Skip to content

Instantly share code, notes, and snippets.

@clarkhacks
Last active May 17, 2024 07:17
Show Gist options
  • Save clarkhacks/72d53ffdcdec2d43f9130a718acaf68b to your computer and use it in GitHub Desktop.
Save clarkhacks/72d53ffdcdec2d43f9130a718acaf68b to your computer and use it in GitHub Desktop.
Reveal.initialize({
controls: false,
progress: true,
history: true,
center: true,
transition: 'convex',
touch: true,
hideAddressBar: true,
dependencies: [ {
src: '//cdnjs.cloudflare.com/ajax/libs/reveal.js/3.2.0/plugin/zoom-js/zoom.min.js',
async: true
}, {
src: '//cdnjs.cloudflare.com/ajax/libs/reveal.js/3.2.0/plugin/notes/notes.min.js',
async: true
}, {
src: '//cdnjs.cloudflare.com/ajax/libs/reveal.js/3.2.0/plugin/highlight/highlight.min.js',
async: true,
callback: function() {
return hljs.initHighlightingOnLoad();
}
}
]
});
var config = {
apiKey: "AIzaSyBdf7B8CGVoaos7-Q4W4lPMi0A4N0LRp7E",
authDomain: "clarkhacks-db.firebaseapp.com",
databaseURL: "https://clarkhacks-db.firebaseio.com",
};
firebase.initializeApp(config);
var ref = firebase.database().ref("/slides");
if(window.location.href.indexOf("?remote") > -1) {
Reveal.configure({ controls: true, touch: true });
Reveal.addEventListener( 'slidechanged', function( event ) {
ref.set({currentslideX : Reveal.getState().indexh,
currentslideY : Reveal.getState().indexv
});
});
};
ref.on("value", function(snapshot) {
Reveal.slide(snapshot.val().currentslideX,snapshot.val().currentslideY);
});
var minutesLabel = document.getElementById("minutes");
var secondsLabel = document.getElementById("seconds");
var totalSeconds = 0;
setInterval(setTime, 1000);
function setTime()
{
++totalSeconds;
secondsLabel.innerHTML = pad(totalSeconds%60);
minutesLabel.innerHTML = pad(parseInt(totalSeconds/60));
}
function pad(val)
{
var valString = val + "";
if(valString.length < 2)
{
return "0" + valString;
}
else
{
return valString;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment