Skip to content

Commit 12e6e5d

Browse files
committed
only roll title once
1 parent de6f93f commit 12e6e5d

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/routes/+page.svelte

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,17 @@
2929
let index = 0;
3030
let rol: NodeJS.Timeout;
3131
32+
let titleClass = 'italic';
3233
onMount(() => {
3334
rol = setInterval(() => {
34-
if (index === greetings.length - 1) index = 0;
35-
else index++;
35+
if (index === greetings.length - 1) {
36+
index = 0;
37+
// only show all the options onces, then stop sliding
38+
clearInterval(rol);
39+
titleClass = '';
40+
} else {
41+
index++;
42+
}
3643
}, 1250);
3744
});
3845
@@ -167,8 +174,8 @@
167174

168175
<div class="container h-full mx-auto flex justify-center items-center">
169176
<div class="space-y-10 text-center flex flex-col items-center">
170-
<h2 style="display: inline">
171-
<bold transition:slide>{greetings[index]}</bold> your top contributors
177+
<h2 class="h2">
178+
<span class={titleClass} transition:slide>{greetings[index]}</span> your top contributors
172179
</h2>
173180
<form class="w-full">
174181
<div class="input-group input-group-divider grid-cols-[auto_1fr_auto]">

0 commit comments

Comments
 (0)