Skip to content

Commit

Permalink
web/layout: preload meowbalt assets
Browse files Browse the repository at this point in the history
no more flickering i hope

is this rational? maybe not so much, but it makes cobalt feel like a native app
  • Loading branch information
wukko committed Mar 11, 2025
1 parent 429591c commit e6e2fea
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions web/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
data-theme={browser ? $currentTheme : undefined}
lang={$locale}
>
<div id="preload-meowbalt" aria-hidden="true"></div>
<div
id="cobalt"
class:loaded={browser}
Expand Down Expand Up @@ -644,4 +645,17 @@
transform: rotate(360deg);
}
}
/* preload meowbalt assets to prevent flickering in dialogs */
#preload-meowbalt {
width: 0;
height: 0;
position: absolute;
z-index: -10;
content:
url(/meowbalt/smile.png)
url(/meowbalt/error.png)
url(/meowbalt/question.png)
url(/meowbalt/think.png);
}
</style>

0 comments on commit e6e2fea

Please sign in to comment.