File size: 2,981 Bytes
e83d3d6 42805da e83d3d6 2c1e150 e83d3d6 2c1e150 e83d3d6 2c1e150 e83d3d6 2c1e150 e83d3d6 8db3924 2c1e150 e83d3d6 dedcda8 8db3924 e83d3d6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
window.HELP_IMPROVE_VIDEOJS = false;
var INTERP_BASE = "./static/images/adaptive";
var NUM_INTERP_FRAMES = 7;
var c10_images = [];
var c100_images = [];
var imgnet_images = [];
function preloadInterpolationImages() {
for (var i = 0; i < NUM_INTERP_FRAMES; i++) {
var c10_path = INTERP_BASE + '/c10_' + String(i) + '.png';
// var c100_path = INTERP_BASE + '/c100_' + String(i) + '.png';
var imgnet_path = INTERP_BASE + '/imgnet_' + String(i) + '.png';
c10_images[i] = new Image();
c10_images[i].src = c10_path;
// c100_images[i] = new Image();
// c100_images[i].src = c100_path;
imgnet_images[i] = new Image();
imgnet_images[i].src = imgnet_path;
}
}
function setInterpolationImage(name, value) {
if (name == "c10"){
var image = c10_images[value]
}
else if (name == "c100"){
var image = c100_images[value]
}
else if (name == "imgnet"){
var image = imgnet_images[value]
}
else {
var image = c10_images[value]
}
image.ondragstart = function() { return false; };
image.oncontextmenu = function() { return false; };
$('#'+name+'-image-wrapper').empty().append(image);
}
$(document).ready(function() {
// Check for click events on the navbar burger icon
$(".navbar-burger").click(function() {
// Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu"
$(".navbar-burger").toggleClass("is-active");
$(".navbar-menu").toggleClass("is-active");
});
var options = {
slidesToScroll: 1,
slidesToShow: 3,
loop: true,
infinite: true,
autoplay: false,
autoplaySpeed: 3000,
}
// Initialize all div with carousel class
var carousels = bulmaCarousel.attach('.carousel', options);
// Loop on each carousel initialized
for(var i = 0; i < carousels.length; i++) {
// Add listener to event
carousels[i].on('before:show', state => {
console.log(state);
});
}
// Access to bulmaCarousel instance of an element
var element = document.querySelector('#my-element');
if (element && element.bulmaCarousel) {
// bulmaCarousel instance is available as element.bulmaCarousel
element.bulmaCarousel.on('before-show', function(state) {
console.log(state);
});
}
/*var player = document.getElementById('interpolation-video');
player.addEventListener('loadedmetadata', function() {
$('#interpolation-slider').on('input', function(event) {
console.log(this.value, player.duration);
player.currentTime = player.duration / 100 * this.value;
})
}, false);*/
preloadInterpolationImages();
$('.interpolation-slider').on('input', function(event) {
setInterpolationImage(this.name, this.value);
});
setInterpolationImage('c10', 0);
// setInterpolationImage('c100', 0);
setInterpolationImage('imgnet', 0);
$('.interpolation-slider').prop('max', NUM_INTERP_FRAMES - 1);
bulmaSlider.attach();
})
|