2012-10-21 02:40:52 +02:00
<!doctype html>
< html lang = "en" >
< head >
< meta charset = "utf-8" >
< title > reveal.js - Slide Notes< / title >
< style >
body {
font-family: Helvetica;
}
#notes {
font-size: 24px;
width: 640px;
margin-top: 5px;
2013-05-02 02:02:46 +02:00
clear: left;
2012-10-21 02:40:52 +02:00
}
#wrap-current-slide {
width: 640px;
height: 512px;
float: left;
overflow: hidden;
}
#current-slide {
width: 1280px;
height: 1024px;
border: none;
-webkit-transform-origin: 0 0;
2013-02-07 01:15:30 +01:00
-moz-transform-origin: 0 0;
-ms-transform-origin: 0 0;
-o-transform-origin: 0 0;
transform-origin: 0 0;
2012-10-21 02:40:52 +02:00
-webkit-transform: scale(0.5);
2013-02-07 01:15:30 +01:00
-moz-transform: scale(0.5);
-ms-transform: scale(0.5);
-o-transform: scale(0.5);
transform: scale(0.5);
2012-10-21 02:40:52 +02:00
}
#wrap-next-slide {
width: 448px;
height: 358px;
float: left;
margin: 0 0 0 10px;
overflow: hidden;
}
#next-slide {
width: 1280px;
height: 1024px;
border: none;
-webkit-transform-origin: 0 0;
2013-02-07 01:15:30 +01:00
-moz-transform-origin: 0 0;
-ms-transform-origin: 0 0;
-o-transform-origin: 0 0;
transform-origin: 0 0;
2012-10-21 02:40:52 +02:00
-webkit-transform: scale(0.35);
2013-02-07 01:15:30 +01:00
-moz-transform: scale(0.35);
-ms-transform: scale(0.35);
-o-transform: scale(0.35);
transform: scale(0.35);
2012-10-21 02:40:52 +02:00
}
.slides {
position: relative;
margin-bottom: 10px;
border: 1px solid black;
border-radius: 2px;
background: rgb(28, 30, 32);
}
.slides span {
position: absolute;
top: 3px;
left: 3px;
font-weight: bold;
font-size: 14px;
color: rgba( 255, 255, 255, 0.9 );
}
2013-01-23 17:04:04 +01:00
.error {
font-weight: bold;
color: red;
font-size: 1.5em;
text-align: center;
margin-top: 10%;
}
.error code {
font-family: monospace;
}
2013-01-26 19:32:07 +01:00
2013-01-26 17:49:19 +01:00
.time {
2013-01-26 19:32:07 +01:00
width: 448px;
margin: 30px 0 0 10px;
float: left;
2013-01-26 17:49:19 +01:00
text-align: center;
2013-01-26 19:32:07 +01:00
opacity: 0;
-webkit-transition: opacity 0.4s;
-moz-transition: opacity 0.4s;
-o-transition: opacity 0.4s;
transition: opacity 0.4s;
2013-01-26 17:49:19 +01:00
}
2013-01-26 19:32:07 +01:00
.elapsed,
.clock {
2013-01-26 17:49:19 +01:00
color: #333;
font-size: 2em;
text-align: center;
display: inline-block;
padding: 0.5em;
background-color: #eee;
border-radius: 10px;
}
2013-01-26 19:32:07 +01:00
.elapsed h2,
.clock h2 {
2013-01-26 17:49:19 +01:00
font-size: 0.8em;
line-height: 100%;
margin: 0;
color: #aaa;
}
2013-01-26 19:32:07 +01:00
2013-01-26 17:49:19 +01:00
.elapsed .mute {
color: #ddd;
}
2012-10-21 02:40:52 +02:00
< / style >
< / head >
< body >
< div id = "wrap-current-slide" class = "slides" >
2013-01-23 17:04:04 +01:00
< script > document . write ( '<iframe width="1280" height="1024" id="current-slide" src="' + window . opener . location . href + '"></iframe>' ) ; < / script >
2012-10-21 02:40:52 +02:00
< / div >
< div id = "wrap-next-slide" class = "slides" >
2013-01-23 17:04:04 +01:00
< script > document . write ( '<iframe width="640" height="512" id="next-slide" src="' + window . opener . location . href + '"></iframe>' ) ; < / script >
2012-10-21 02:40:52 +02:00
< span > UPCOMING:< / span >
< / div >
2013-01-26 19:32:07 +01:00
< div class = "time" >
< div class = "clock" >
2013-01-26 17:49:19 +01:00
< h2 > Time< / h2 >
2013-01-26 19:32:07 +01:00
< span id = "clock" > 0:00:00 AM< / span >
2013-01-26 17:49:19 +01:00
< / div >
2013-01-26 19:32:07 +01:00
< div class = "elapsed" >
2013-01-26 17:49:19 +01:00
< h2 > Elapsed< / h2 >
2013-01-26 19:32:07 +01:00
< span id = "hours" > 00< / span > < span id = "minutes" > :00< / span > < span id = "seconds" > :00< / span >
2013-01-26 17:49:19 +01:00
< / div >
< / div >
2013-01-26 19:32:07 +01:00
2012-10-21 02:40:52 +02:00
< div id = "notes" > < / div >
2013-05-01 22:10:31 +02:00
< script src = "../../plugin/markdown/marked.js" > < / script >
2012-10-21 02:40:52 +02:00
< script >
2013-01-26 19:32:07 +01:00
2012-10-21 02:40:52 +02:00
window.addEventListener( 'load', function() {
2013-01-23 17:04:04 +01:00
if( window.opener & & window.opener.location & & window.opener.location.href ) {
2013-01-26 19:32:07 +01:00
var notes = document.getElementById( 'notes' ),
currentSlide = document.getElementById( 'current-slide' ),
2013-07-26 16:03:59 +02:00
nextSlide = document.getElementById( 'next-slide' ),
silenced = false;
2013-01-23 17:04:04 +01:00
2013-01-26 19:32:07 +01:00
window.addEventListener( 'message', function( event ) {
var data = JSON.parse( event.data );
2013-07-26 15:48:21 +02:00
2013-01-26 19:32:07 +01:00
// No need for updating the notes in case of fragment changes
if ( data.notes !== undefined) {
if( data.markdown ) {
2013-05-01 22:10:31 +02:00
notes.innerHTML = marked( data.notes );
2012-10-24 14:33:16 +02:00
}
else {
2013-01-26 19:32:07 +01:00
notes.innerHTML = data.notes;
2012-10-24 14:33:16 +02:00
}
2013-01-26 19:32:07 +01:00
}
2013-07-26 16:03:59 +02:00
silenced = true;
2013-07-26 15:48:21 +02:00
// Update the note slides
currentSlide.contentWindow.Reveal.slide( data.indexh, data.indexv, data.indexf );
nextSlide.contentWindow.Reveal.slide( data.nextindexh, data.nextindexv );
2013-01-26 19:32:07 +01:00
2013-07-26 16:03:59 +02:00
silenced = false;
2013-01-26 19:32:07 +01:00
}, false );
var start = new Date(),
timeEl = document.querySelector( '.time' ),
clockEl = document.getElementById( 'clock' ),
hoursEl = document.getElementById( 'hours' ),
minutesEl = document.getElementById( 'minutes' ),
secondsEl = document.getElementById( 'seconds' );
setInterval( function() {
timeEl.style.opacity = 1;
var diff, hours, minutes, seconds,
now = new Date();
diff = now.getTime() - start.getTime();
2013-06-02 11:02:53 +02:00
hours = Math.floor( diff / ( 1000 * 60 * 60 ) );
minutes = Math.floor( ( diff / ( 1000 * 60 ) ) % 60 );
seconds = Math.floor( ( diff / 1000 ) % 60 );
2013-01-26 19:32:07 +01:00
clockEl.innerHTML = now.toLocaleTimeString();
hoursEl.innerHTML = zeroPadInteger( hours );
hoursEl.className = hours > 0 ? "" : "mute";
minutesEl.innerHTML = ":" + zeroPadInteger( minutes );
minutesEl.className = minutes > 0 ? "" : "mute";
secondsEl.innerHTML = ":" + zeroPadInteger( seconds );
}, 1000 );
2013-01-23 17:04:04 +01:00
2013-07-26 16:03:59 +02:00
// Broadcasts the state of the notes window to synchronize
// the main window
function synchronizeMainWindow() {
2013-02-27 22:55:42 +01:00
2013-07-26 16:03:59 +02:00
if( !silenced ) {
var indices = currentSlide.contentWindow.Reveal.getIndices();
window.opener.Reveal.slide( indices.h, indices.v, indices.f );
}
}
2013-02-27 22:55:42 +01:00
2013-07-26 16:03:59 +02:00
// Navigate the main window when the notes slide changes
currentSlide.contentWindow.Reveal.addEventListener( 'slidechanged', synchronizeMainWindow );
currentSlide.contentWindow.Reveal.addEventListener( 'fragmentshown', synchronizeMainWindow );
currentSlide.contentWindow.Reveal.addEventListener( 'fragmenthidden', synchronizeMainWindow );
2013-02-27 22:55:42 +01:00
2013-08-29 15:28:16 +02:00
// Reconfigure the notes window to remove needless UI
currentSlide.contentWindow.Reveal.configure({ controls: false, progress: false, overview: false });
nextSlide.contentWindow.Reveal.configure({ controls: false, progress: false, overview: false });
2013-01-23 17:04:04 +01:00
}
else {
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 > ';
}
2012-10-21 02:40:52 +02:00
2013-01-26 17:49:19 +01:00
2012-10-21 02:40:52 +02:00
}, false );
2013-01-26 19:32:07 +01:00
function zeroPadInteger( num ) {
var str = "00" + parseInt( num );
return str.substring( str.length - 2 );
}
2012-10-21 02:40:52 +02:00
< / script >
< / body >
< / html >