Skip to content

Commit

Permalink
only roll title once
Browse files Browse the repository at this point in the history
  • Loading branch information
zaibon committed Mar 14, 2024
1 parent de6f93f commit 12e6e5d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,17 @@
let index = 0;
let rol: NodeJS.Timeout;
let titleClass = 'italic';
onMount(() => {
rol = setInterval(() => {
if (index === greetings.length - 1) index = 0;
else index++;
if (index === greetings.length - 1) {
index = 0;
// only show all the options onces, then stop sliding
clearInterval(rol);
titleClass = '';
} else {
index++;
}
}, 1250);
});
Expand Down Expand Up @@ -167,8 +174,8 @@

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

0 comments on commit 12e6e5d

Please sign in to comment.