mega-commit: migrations, controllers, models, etc.
This commit is contained in:
parent
9732135e90
commit
2c6745e812
70 changed files with 2124 additions and 400 deletions
27
public/js/jumbotron.js
Normal file
27
public/js/jumbotron.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
let jumbotron = document.querySelector('.jumbotron');
|
||||
let topImageHolder = document.querySelector('.jumbotron-image[data-order="1"]');
|
||||
let bottomImageHolder = document.querySelector('.jumbotron-image[data-order="2"]');
|
||||
let images = jumbotron.getAttribute('data-images').split(',');
|
||||
let delay = jumbotron.getAttribute('data-delay');
|
||||
let imageIndex = 0;
|
||||
|
||||
// init
|
||||
bottomImageHolder.src = images[imageIndex];
|
||||
imageIndex++;
|
||||
|
||||
function loop() {
|
||||
bottomImageHolder.classList.add('op0');
|
||||
bottomImageHolder.src = images[imageIndex];
|
||||
imageIndex++;
|
||||
|
||||
topImageHolder.classList.add('op0');
|
||||
topImageHolder.src = images[imageIndex];
|
||||
imageIndex++;
|
||||
|
||||
bottomImageHolder.classList.remove('op0');
|
||||
if (imageIndex >= images.length) {
|
||||
imageIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
setInterval(loop, delay);
|
Loading…
Add table
Add a link
Reference in a new issue