Skip to content

Commit

Permalink
Added template
Browse files Browse the repository at this point in the history
  • Loading branch information
vevenom committed Apr 16, 2024
1 parent ad84a1a commit bf60fbb
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,26 @@ function setExample5Image(i) {
$('#example5-image-wrapper').empty().append(image);
}

// Example 6
var EXAMPLE6_BASE = "./static/interpolation/example6";
var NUM_EXAMPLE6_FRAMES = 21;

var example6_images = [];
function preloadExample6Images() {
for (var i = 0; i <= NUM_EXAMPLE6_FRAMES; i++) {
var path = EXAMPLE6_BASE + '/visualization (' + String(i) + ').jpg';
example6_images[i] = new Image();
example6_images[i].src = path;
}
}

function setExample6Image(i) {
var image = example6_images[i];
image.ondragstart = function() { return false; };
image.oncontextmenu = function() { return false; };
$('#example6-image-wrapper').empty().append(image);
}

$(document).ready(function() {
// Check for click events on the navbar burger icon
$(".navbar-burger").click(function() {
Expand All @@ -130,8 +150,8 @@ $(document).ready(function() {
});

var options = {
slidesToScroll: 5,
slidesToShow: 5,
slidesToScroll: 6,
slidesToShow: 6,
loop: true,
infinite: true,
autoplay: false,
Expand Down Expand Up @@ -209,6 +229,13 @@ $(document).ready(function() {
setExample5Image(0);
$('#example5-slider').prop('max', NUM_EXAMPLE5_FRAMES);

preloadExample6Images();
$('#example6-slider').on('input', function(event) {
setExample6Image(this.value);
});
setExample6Image(0);
$('#example6-slider').prop('max', NUM_EXAMPLE6_FRAMES);

bulmaSlider.attach();

})

0 comments on commit bf60fbb

Please sign in to comment.