forked from Backwards/backwards.dev
Fixed Tracker
This commit is contained in:
parent
a7d1cf28ba
commit
56545bc3a3
@ -7,8 +7,6 @@
|
|||||||
slides,
|
slides,
|
||||||
includeFirst = true;
|
includeFirst = true;
|
||||||
|
|
||||||
console.log(page, slides, includeFirst);
|
|
||||||
|
|
||||||
let newSlides = includeFirst ? slides : slides.slice(1);
|
let newSlides = includeFirst ? slides : slides.slice(1);
|
||||||
|
|
||||||
let pageSection = sectionStore[page];
|
let pageSection = sectionStore[page];
|
||||||
@ -17,12 +15,9 @@
|
|||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
pageSection.subscribe((cs) => {
|
pageSection.subscribe((cs) => {
|
||||||
console.log(cs);
|
|
||||||
currentSection = cs;
|
currentSection = cs;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// let currentSection = 0
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if includeFirst ? currentSection >= 0 : currentSection > 0}
|
{#if includeFirst ? currentSection >= 0 : currentSection > 0}
|
||||||
@ -31,7 +26,7 @@
|
|||||||
out:fly={{ x: 50, duration: 300 }}
|
out:fly={{ x: 50, duration: 300 }}
|
||||||
class="tracker"
|
class="tracker"
|
||||||
>
|
>
|
||||||
{#each slides as _, i}
|
{#each newSlides as _, i}
|
||||||
<div
|
<div
|
||||||
class="tracker-dot {(includeFirst ? i : i + 1) ===
|
class="tracker-dot {(includeFirst ? i : i + 1) ===
|
||||||
currentSection
|
currentSection
|
||||||
|
Loading…
x
Reference in New Issue
Block a user