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

index.html 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. <button id="theme-edit" title="Edit Theme"><i class="fa fa-pencil-square-o"></i></button>
  32. <button id="new-theme" title="New Theme"><i class="fa fa-plus"></i></button>
  33. </div>
  34. <div class="row form-row" id="row-caption">
  35. <label for="input-caption">
  36. Caption
  37. <div class="note">Add two spaces in a row to force a line break.</div>
  38. </label>
  39. <input id="input-caption" name="caption" type="text" autocomplete="off" placeholder="Add a caption" />
  40. </div>
  41. <div id="preview">
  42. <div style="background-color: black;">
  43. <div id="canvas">
  44. <canvas width="640" height="360"></canvas>
  45. <div id="preview-label">Preview</div>
  46. </div>
  47. </div>
  48. <div id="minimap" class="hidden">
  49. <svg width="640" height="80" xmlns="http://www.w3.org/2000/svg">
  50. <defs>
  51. <clipPath id="clip">
  52. <rect height="80" width="640" x="0" y="0"></rect>
  53. </clipPath>
  54. </defs>
  55. <g class="waveform background">
  56. <line x1="0" x2="640" y1="40" y2="40"></line>
  57. <path></path>
  58. </g>
  59. <g class="waveform foreground" clip-path="url(#clip)">
  60. <line x1="0" x2="640" y1="40" y2="40"></line>
  61. <path></path>
  62. </g>
  63. <g class="brush"></g>
  64. <g class="time">
  65. <line x1="0" x2="0" y1="0" y2="80"></line>
  66. </g>
  67. </svg>
  68. <div id="controls">
  69. <span id="tip">Click and drag over the waveform to clip audio<br />Use space bar to play/pause</span>
  70. <span id="duration"><strong></strong> seconds selected</span>
  71. <button id="play"><i class="fa fa-play"></i>Play</button>
  72. <button id="pause" class="hidden"><i class="fa fa-pause"></i>Pause</button>
  73. <button id="restart"><i class="fa fa-step-backward"></i>Restart</button>
  74. </div>
  75. </div>
  76. </div>
  77. <div id="audio">
  78. <audio controls>
  79. <source />
  80. </audio>
  81. </div>
  82. <div id="video">
  83. <video width="640" height="360" controls>
  84. <source type="video/mp4" />
  85. </video>
  86. </div>
  87. <div class="row" id="row-submit">
  88. <button type="button" id="return" class="left"><i class="fa fa-edit"></i>Return to editor</button>
  89. <button type="button" id="submit" class="right hidden"><i class="fa fa-cloud-upload"></i>Generate</button>
  90. <a id="download" class="button right" href="#" target="_blank"><i class="fa fa-download"></i>Download</a>
  91. <div class="clear"></div>
  92. </div>
  93. </div><!-- #loaded -->
  94. </div><!-- .container -->
  95. <script src="/js/bundle.js"></script>
  96. <!-- Force load custom fonts -->
  97. <script src="/fonts/fonts.js"></script>
  98. </body>
  99. </html>