notes.html 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>reveal.js - Slide Notes</title>
  6. <style>
  7. body {
  8. font-family: Helvetica;
  9. }
  10. #notes {
  11. font-size: 24px;
  12. width: 640px;
  13. margin-top: 5px;
  14. }
  15. #wrap-current-slide {
  16. width: 640px;
  17. height: 512px;
  18. float: left;
  19. overflow: hidden;
  20. }
  21. #current-slide {
  22. width: 1280px;
  23. height: 1024px;
  24. border: none;
  25. -webkit-transform-origin: 0 0;
  26. -moz-transform-origin: 0 0;
  27. -ms-transform-origin: 0 0;
  28. -o-transform-origin: 0 0;
  29. transform-origin: 0 0;
  30. -webkit-transform: scale(0.5);
  31. -moz-transform: scale(0.5);
  32. -ms-transform: scale(0.5);
  33. -o-transform: scale(0.5);
  34. transform: scale(0.5);
  35. }
  36. #wrap-next-slide {
  37. width: 448px;
  38. height: 358px;
  39. float: left;
  40. margin: 0 0 0 10px;
  41. overflow: hidden;
  42. }
  43. #next-slide {
  44. width: 1280px;
  45. height: 1024px;
  46. border: none;
  47. -webkit-transform-origin: 0 0;
  48. -moz-transform-origin: 0 0;
  49. -ms-transform-origin: 0 0;
  50. -o-transform-origin: 0 0;
  51. transform-origin: 0 0;
  52. -webkit-transform: scale(0.35);
  53. -moz-transform: scale(0.35);
  54. -ms-transform: scale(0.35);
  55. -o-transform: scale(0.35);
  56. transform: scale(0.35);
  57. }
  58. .slides {
  59. position: relative;
  60. margin-bottom: 10px;
  61. border: 1px solid black;
  62. border-radius: 2px;
  63. background: rgb(28, 30, 32);
  64. }
  65. .slides span {
  66. position: absolute;
  67. top: 3px;
  68. left: 3px;
  69. font-weight: bold;
  70. font-size: 14px;
  71. color: rgba( 255, 255, 255, 0.9 );
  72. }
  73. .error {
  74. font-weight: bold;
  75. color: red;
  76. font-size: 1.5em;
  77. text-align: center;
  78. margin-top: 10%;
  79. }
  80. .error code {
  81. font-family: monospace;
  82. }
  83. .time {
  84. text-align: center;
  85. }
  86. .elapsed, .clock {
  87. color: #333;
  88. font-size: 2em;
  89. text-align: center;
  90. display: inline-block;
  91. padding: 0.5em;
  92. background-color: #eee;
  93. border-radius: 10px;
  94. }
  95. .elapsed h2, .clock h2 {
  96. font-size: 0.8em;
  97. line-height: 100%;
  98. margin: 0;
  99. color: #aaa;
  100. }
  101. .elapsed .mute {
  102. color: #ddd;
  103. }
  104. </style>
  105. </head>
  106. <body>
  107. <div id="wrap-current-slide" class="slides">
  108. <script>document.write( '<iframe width="1280" height="1024" id="current-slide" src="'+ window.opener.location.href +'"></iframe>' );</script>
  109. </div>
  110. <div id="wrap-next-slide" class="slides">
  111. <script>document.write( '<iframe width="640" height="512" id="next-slide" src="'+ window.opener.location.href +'"></iframe>' );</script>
  112. <span>UPCOMING:</span>
  113. </div>
  114. <div class='time'>
  115. <div class='clock'>
  116. <h2>Time</h2>
  117. <span id='clock'>0:00:00 AM</span>
  118. </div>
  119. <div class='elapsed'>
  120. <h2>Elapsed</h2>
  121. <span id='hours'>00</span><span id='minutes'>:00</span><span id='seconds'>:00</span>
  122. </div>
  123. </div>
  124. <div id="notes"></div>
  125. <script src="../../plugin/markdown/showdown.js"></script>
  126. <script>
  127. function zeroPadInteger(num) {
  128. var str = "00" + parseInt(num);
  129. return str.substring(str.length - 2);
  130. }
  131. window.addEventListener( 'load', function() {
  132. if( window.opener && window.opener.location && window.opener.location.href ) {
  133. (function( window, undefined ) {
  134. var notes = document.getElementById( 'notes' ),
  135. currentSlide = document.getElementById( 'current-slide' ),
  136. nextSlide = document.getElementById( 'next-slide' );
  137. window.addEventListener( 'message', function( event ) {
  138. var data = JSON.parse( event.data );
  139. // No need for updating the notes in case of fragment changes
  140. if ( data.notes !== undefined) {
  141. if( data.markdown ) {
  142. notes.innerHTML = (new Showdown.converter()).makeHtml( data.notes );
  143. }
  144. else {
  145. notes.innerHTML = data.notes;
  146. }
  147. }
  148. // Showing and hiding fragments
  149. if( data.fragment === 'next' ) {
  150. currentSlide.contentWindow.Reveal.nextFragment();
  151. }
  152. else if( data.fragment === 'prev' ) {
  153. currentSlide.contentWindow.Reveal.prevFragment();
  154. }
  155. else {
  156. // Update the note slides
  157. currentSlide.contentWindow.Reveal.slide( data.indexh, data.indexv );
  158. nextSlide.contentWindow.Reveal.slide( data.nextindexh, data.nextindexv );
  159. }
  160. }, false );
  161. })( window );
  162. }
  163. else {
  164. document.body.innerHTML = '<p class="error">Unable to access <code>window.opener.location</code>.<br>Make sure the presentation is running on a web server.</p>';
  165. }
  166. var start = new Date(),
  167. clockEl = document.getElementById('clock'),
  168. hoursEl = document.getElementById('hours'),
  169. minutesEl = document.getElementById('minutes'),
  170. secondsEl = document.getElementById('seconds');
  171. setInterval(function() {
  172. var diff, hours, minutes, seconds,
  173. now = new Date();
  174. diff = now.getTime() - start.getTime();
  175. hours = parseInt(diff / (1000 * 60 * 60));
  176. minutes = parseInt((diff / (1000 * 60)) % 60);
  177. seconds = parseInt((diff / 1000) % 60);
  178. clockEl.innerHTML = now.toLocaleTimeString();
  179. hoursEl.innerHTML = zeroPadInteger(hours);
  180. hoursEl.className = hours > 0 ? "" : "mute";
  181. minutesEl.innerHTML = ":" + zeroPadInteger(minutes);
  182. minutesEl.className = minutes > 0 ? "" : "mute";
  183. secondsEl.innerHTML = ":" + zeroPadInteger(seconds);
  184. }, 1000);
  185. }, false );
  186. </script>
  187. </body>
  188. </html>