Add animation on load

This commit is contained in:
Maciej Gomola 2024-10-24 08:23:15 +02:00
parent d7dfc5309d
commit 7256c53f45
3 changed files with 27 additions and 1 deletions

View File

@ -20,6 +20,16 @@ body {
overflow: hidden; overflow: hidden;
} }
.loader {
background-color: var(--theme-bg);
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
.material-symbols-outlined { .material-symbols-outlined {
font-variation-settings: font-variation-settings:
'FILL' 1, 'FILL' 1,

View File

@ -17,3 +17,18 @@ function applyUIColors() {
setUIColors(background, text, buttonPrimary, buttonSecondary); setUIColors(background, text, buttonPrimary, buttonSecondary);
} }
window.addEventListener('load', () => {
$('.loader').hide();
anime({
targets: '.calculator button.button',
opacity: [0, 1],
scale: [0, 1],
easing: 'easeOutBack',
duration: 500,
delay: anime.stagger(35),
complete: () => {
$('.calculator button.button').removeAttr('style');
}
});
});

View File

@ -21,6 +21,7 @@
<link rel="stylesheet" href="./assets/css/keyboard.css"> <link rel="stylesheet" href="./assets/css/keyboard.css">
</head> </head>
<body> <body>
<div class="loader"></div>
<div class="history-container" id="history"> <div class="history-container" id="history">
<span>5+10<strong> = 15</strong></span> <span>5+10<strong> = 15</strong></span>
<span>7*8<strong> = 56</strong></span> <span>7*8<strong> = 56</strong></span>