Skip to content

Commit

Permalink
news: fancy spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
vdawg-git committed Jan 30, 2024
1 parent 429e010 commit 658a62f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions src/lib/Helper.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ export function animateIn(node, options = {}) {

function callback() {
timeoutId = setTimeout(
effects.forEach(([effect]) => {
if (effect === 'slide') node.style.removeProperty('translate')
else if (effect === 'fade') node.style.removeProperty('opacity')
else if (effect === 'zoom') node.style.removeProperty('scale')
}),
() =>
effects.forEach(([effect]) => {
if (effect === 'slide') node.style.removeProperty('translate')
else if (effect === 'fade') node.style.removeProperty('opacity')
else if (effect === 'zoom') node.style.removeProperty('scale')
}),
options.delay ?? 0
)
}
Expand Down
6 changes: 3 additions & 3 deletions src/lib/components/news-thumb.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</script>

<li class="flex gap-14" use:animateIn={{ fade: 0, slide: 24 }}>
<div class="flex flex-col gap-4 rounded">
<article class="flex flex-col gap-4 rounded">
<div class="flex flex-col gap-4 text-sm font-medium text-slate-400">
<p class="font-bold text-slate-400">{formatDate(entry.date)}</p>
</div>
Expand All @@ -18,7 +18,7 @@
<a
href={link}
class="group flex max-w-max items-center gap-4 font-medium text-slate-300 transition-all hover:text-white"
>Read up<ArrowRight class="transition-transform group-hover:translate-x-0.5" /></a
>Read up <ArrowRight class="transition-transform group-hover:translate-x-0.5" /></a
>
</div>
</article>
</li>
2 changes: 1 addition & 1 deletion src/routes/news/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
}
.spinner-wrapper {
@apply flex items-center justify-center bg-gradient-to-tr from-blue-500/0 to-cyan-500 bg-clip-text text-transparent animate-in fade-in-0;
@apply mb-4 flex items-center justify-center bg-gradient-to-tr from-blue-500/0 to-cyan-500 bg-clip-text text-transparent animate-in fade-in-0;
animation-duration: 2000ms;
font-size: min(1vh, 1rem);
/* There are 36 rows */
Expand Down

0 comments on commit 658a62f

Please sign in to comment.