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

index.html 4.2KB

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