renames vars
This commit is contained in:
parent
245b7de609
commit
eb996bf112
1 changed files with 5 additions and 5 deletions
|
|
@ -10,24 +10,24 @@
|
||||||
|
|
||||||
let { index, steps, preload = 1, stackBackground = true }: Props = $props();
|
let { index, steps, preload = 1, stackBackground = true }: Props = $props();
|
||||||
|
|
||||||
function shouldShowStep(i: number) {
|
function showStep(i: number) {
|
||||||
if (preload === 0) return true;
|
if (preload === 0) return true;
|
||||||
if (stackBackground) return i <= index;
|
if (stackBackground) return i <= index;
|
||||||
return i >= index - preload && i <= index + preload;
|
return i >= index - preload && i <= index + preload;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isStepVisible(i: number) {
|
function isVisible(i: number) {
|
||||||
if (stackBackground) return i <= index;
|
if (stackBackground) return i <= index;
|
||||||
return i === index;
|
return i === index;
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#each steps as step, i}
|
{#each steps as step, i}
|
||||||
{#if shouldShowStep(i)}
|
{#if showStep(i)}
|
||||||
<div
|
<div
|
||||||
class={`step step-${i + 1} w-full absolute`}
|
class={`step step-${i + 1} w-full absolute`}
|
||||||
class:visible={isStepVisible(i)}
|
class:visible={isVisible(i)}
|
||||||
class:invisible={!isStepVisible(i)}
|
class:invisible={!isVisible(i)}
|
||||||
>
|
>
|
||||||
<step.background {...step.backgroundProps || {}}></step.background>
|
<step.background {...step.backgroundProps || {}}></step.background>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue