Turn audio into a shareable video. forked from nypublicradio/audiogram

index.html 4.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>Audiogram</title>
  5. <meta charset="utf-8" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
  8. <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,300,600" rel="stylesheet" type="text/css">
  9. <link href="/css/base.css" rel="stylesheet" type="text/css">
  10. <link href="/css/editor.css" rel="stylesheet" type="text/css">
  11. <link href="/fonts/fonts.css" rel="stylesheet" type="text/css">
  12. </head>
  13. <body class="loading">
  14. <div class="container">
  15. <h1>Audiogram</h1>
  16. <div id="loading">
  17. <div id="loading-bars">
  18. <div class="r1"></div><div class="r2"></div><div class="r3"></div><div class="r4"></div><div class="r5"></div>
  19. </div>
  20. <div id="loading-message">Loading...</div>
  21. </div><!-- #loading -->
  22. <div id="loaded">
  23. <div id="error"></div>
  24. <div class="row form-row" id="row-audio">
  25. <label for="input-audio">Audio</label>
  26. <input id="input-audio" name="audio" type="file" />
  27. </div>
  28. <div class="row form-row" id="row-theme">
  29. <label for="input-theme">Theme</label>
  30. <select id="input-theme" name="theme"></select>
  31. </div>
  32. <div class="row form-row" id="row-caption">
  33. <label for="input-caption">
  34. Caption
  35. <div class="note">Add two spaces in a row to force a line break.</div>
  36. </label>
  37. <input id="input-caption" name="caption" type="text" autocomplete="off" placeholder="Add a caption" />
  38. </div>
  39. <div id="preview">
  40. <div style="background-color: black;">
  41. <div id="canvas">
  42. <canvas width="640" height="360"></canvas>
  43. <div id="preview-label">Preview</div>
  44. </div>
  45. </div>
  46. <div id="minimap" class="hidden">
  47. <svg width="640" height="80" xmlns="http://www.w3.org/2000/svg">
  48. <defs>
  49. <clipPath id="clip">
  50. <rect height="80" width="640" x="0" y="0"></rect>
  51. </clipPath>
  52. </defs>
  53. <g class="waveform background">
  54. <line x1="0" x2="640" y1="40" y2="40"></line>
  55. <path></path>
  56. </g>
  57. <g class="waveform foreground" clip-path="url(#clip)">
  58. <line x1="0" x2="640" y1="40" y2="40"></line>
  59. <path></path>
  60. </g>
  61. <g class="brush"></g>
  62. <g class="time">
  63. <line x1="0" x2="0" y1="0" y2="80"></line>
  64. </g>
  65. </svg>
  66. <div id="controls">
  67. <span id="tip">Click and drag over the waveform to clip audio<br />Use space bar to play/pause</span>
  68. <span id="duration"><strong></strong> seconds selected</span>
  69. <button id="play"><i class="fa fa-play"></i>Play</button>
  70. <button id="pause" class="hidden"><i class="fa fa-pause"></i>Pause</button>
  71. <button id="restart"><i class="fa fa-step-backward"></i>Restart</button>
  72. </div>
  73. </div>
  74. </div>
  75. <div id="audio">
  76. <audio controls>
  77. <source />
  78. </audio>
  79. </div>
  80. <div id="video">
  81. <video width="640" height="360" controls>
  82. <source type="video/mp4" />
  83. </video>
  84. </div>
  85. <div class="row" id="row-submit">
  86. <button type="button" id="return" class="left"><i class="fa fa-edit"></i>Return to editor</button>
  87. <button type="button" id="submit" class="right hidden"><i class="fa fa-cloud-upload"></i>Generate</button>
  88. <a id="download" class="button right" href="#" target="_blank"><i class="fa fa-download"></i>Download</a>
  89. <div class="clear"></div>
  90. </div>
  91. </div><!-- #loaded -->
  92. </div><!-- .container -->
  93. <script src="/js/bundle.js"></script>
  94. <!-- Force load custom fonts -->
  95. <script src="/fonts/fonts.js"></script>
  96. </body>
  97. </html>