diff --git a/index.html b/index.html index 1500e07..94d4be2 100644 --- a/index.html +++ b/index.html @@ -328,24 +328,22 @@

- - -
-

- BibTeX +

+ BibTex

+
@@ -354,35 +352,4 @@

- - \ No newline at end of file diff --git a/js/main.js b/js/main.js index cda4948..f9446b0 100644 --- a/js/main.js +++ b/js/main.js @@ -57,4 +57,64 @@ function showVideo(beforePath, stylePath, afterPath) { content.src = beforePath; style.src = stylePath; after.src = afterPath; -} \ No newline at end of file +} + +document.addEventListener('DOMContentLoaded', function() { + + const videoPairs = [ + [document.getElementById('before-vid'), document.getElementById('after-vid')], + [document.getElementById('before-nerf'), document.getElementById('after-nerf')], + // Add more pairs if needed + ]; + + videoPairs.forEach(pair => { + const [videoA, videoB] = pair; + + videoA.addEventListener('timeupdate', function() { + if (Math.abs(videoA.currentTime - videoB.currentTime) > 0.1) { + videoB.currentTime = videoA.currentTime; + } + }); + + videoB.addEventListener('timeupdate', function() { + if (Math.abs(videoB.currentTime - videoA.currentTime) > 0.1) { + videoA.currentTime = videoB.currentTime; + } + }); + + videoA.addEventListener('play', function() { + if (videoB.paused && !videoB.ended) { + videoB.play(); + } + }); + + videoA.addEventListener('pause', function() { + if (!videoB.paused && !videoB.ended) { + videoB.pause(); + } + }); + + videoB.addEventListener('play', function() { + if (videoA.paused && !videoA.ended) { + videoA.play(); + } + }); + + videoB.addEventListener('pause', function() { + if (!videoA.paused && !videoA.ended) { + videoA.pause(); + } + }); + }); +}); + +$(document).ready(function() { + var editor = CodeMirror.fromTextArea(document.getElementById("bibtex"), { + lineNumbers: false, + lineWrapping: true, + readOnly:true + }); + $(function () { + $('[data-toggle="tooltip"]').tooltip() + }); +}); \ No newline at end of file