2024-06-26 22:08:53 +02:00
|
|
|
import Nav from './NavControl.js';
|
|
|
|
import Audio from './AudioControl.js';
|
|
|
|
|
2024-04-25 21:17:24 +02:00
|
|
|
export default class Base {
|
|
|
|
//--------------------------
|
|
|
|
// constructor
|
|
|
|
//--------------------------
|
|
|
|
constructor() {
|
|
|
|
this.currentSlide = 0;
|
|
|
|
this.slides = document.querySelectorAll('.slide');
|
2024-06-26 22:08:53 +02:00
|
|
|
this.nav = new Nav();
|
|
|
|
if (document.querySelector('[role="page-meta"]')) {
|
|
|
|
let audio = new Audio();
|
|
|
|
}
|
2024-04-25 21:17:24 +02:00
|
|
|
this.start();
|
|
|
|
}
|
|
|
|
start() {
|
|
|
|
if (this.slides.length > 1) {
|
|
|
|
this.slideInterval = setInterval(() => {
|
2024-06-26 22:08:53 +02:00
|
|
|
this.slides[this.currentSlide].className = 'hide';
|
2024-04-25 21:17:24 +02:00
|
|
|
this.currentSlide = (this.currentSlide + 1) % this.slides.length;
|
2024-06-26 22:08:53 +02:00
|
|
|
this.slides[this.currentSlide].className = 'show';
|
2024-04-25 21:17:24 +02:00
|
|
|
}, 3000);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//--------------------------
|
|
|
|
// methods
|
|
|
|
//--------------------------
|
|
|
|
|
|
|
|
//--------------------------
|
|
|
|
// event handlers
|
|
|
|
//--------------------------
|
|
|
|
}
|