Initial theme commit
This commit is contained in:
BIN
assets/images/50ct_wike_210722.ico
Executable file
BIN
assets/images/50ct_wike_210722.ico
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 422 KiB |
BIN
assets/images/footer-skyline.png
Executable file
BIN
assets/images/footer-skyline.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 92 KiB |
BIN
assets/images/skyline.webp
Executable file
BIN
assets/images/skyline.webp
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
BIN
assets/images/slide-1.png
Executable file
BIN
assets/images/slide-1.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 9.9 MiB |
BIN
assets/images/slide-2.png
Executable file
BIN
assets/images/slide-2.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 1.9 MiB |
BIN
assets/images/slide-3.png
Executable file
BIN
assets/images/slide-3.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 MiB |
19
assets/js/slider.js
Executable file
19
assets/js/slider.js
Executable file
@@ -0,0 +1,19 @@
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const slider = document.querySelector('.hero-slider');
|
||||
if (!slider) return;
|
||||
const slides = Array.from(slider.querySelectorAll('.slide'));
|
||||
const dots = Array.from(slider.querySelectorAll('.slider-dot'));
|
||||
if (slides.length < 2) return;
|
||||
let current = 0;
|
||||
function showSlide(index) {
|
||||
slides.forEach((slide, i) => slide.classList.toggle('is-active', i === index));
|
||||
dots.forEach((dot, i) => dot.classList.toggle('is-active', i === index));
|
||||
current = index;
|
||||
}
|
||||
dots.forEach((dot) => dot.addEventListener('click', function () {
|
||||
showSlide(Number(this.getAttribute('data-slide')));
|
||||
}));
|
||||
setInterval(function () {
|
||||
showSlide((current + 1) % slides.length);
|
||||
}, 5000);
|
||||
});
|
||||
Reference in New Issue
Block a user