fix: Slider-Intervall 15s für Video-Slide, 8s für andere
Slide 0 bleibt jetzt so lange sichtbar wie das Video dauert (15s). Alle anderen Slides wechseln weiterhin nach 8s. Umstellung von setInterval auf verkettete setTimeout für dynamisches Timing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dieser Commit ist enthalten in:
@@ -47,8 +47,13 @@
|
|||||||
var heroCurrentSlide = 0;
|
var heroCurrentSlide = 0;
|
||||||
var heroTimer = null;
|
var heroTimer = null;
|
||||||
var HERO_INTERVAL = 8000;
|
var HERO_INTERVAL = 8000;
|
||||||
|
var HERO_INTERVAL_VIDEO = 15000;
|
||||||
var heroIsTransitioning = false;
|
var heroIsTransitioning = false;
|
||||||
|
|
||||||
|
function heroGetInterval() {
|
||||||
|
return heroCurrentSlide === 0 ? HERO_INTERVAL_VIDEO : HERO_INTERVAL;
|
||||||
|
}
|
||||||
|
|
||||||
function heroGoTo(index) {
|
function heroGoTo(index) {
|
||||||
if (heroIsTransitioning || index === heroCurrentSlide || !heroSlides.length) return;
|
if (heroIsTransitioning || index === heroCurrentSlide || !heroSlides.length) return;
|
||||||
heroIsTransitioning = true;
|
heroIsTransitioning = true;
|
||||||
@@ -80,7 +85,10 @@
|
|||||||
|
|
||||||
function heroStartAutoplay() {
|
function heroStartAutoplay() {
|
||||||
heroStopAutoplay();
|
heroStopAutoplay();
|
||||||
heroTimer = setInterval(heroNext, HERO_INTERVAL);
|
heroTimer = setTimeout(function tick() {
|
||||||
|
heroNext();
|
||||||
|
heroTimer = setTimeout(tick, heroGetInterval());
|
||||||
|
}, heroGetInterval());
|
||||||
}
|
}
|
||||||
|
|
||||||
function heroStopAutoplay() {
|
function heroStopAutoplay() {
|
||||||
|
|||||||
In neuem Issue referenzieren
Einen Benutzer sperren