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

index.html 4.5KB

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