Conditional animations

This commit is contained in:
Romein van Buren 2022-10-28 15:16:04 +02:00
parent 65065468c4
commit 721d788a5c
Signed by: romein
GPG Key ID: 0EFF8478ADDF6C49
3 changed files with 8 additions and 2 deletions

View File

@ -110,7 +110,7 @@
<div
in:receive={{ key: tile.id }}
out:send={{ key: tile.id }}
animate:flip
animate:flip={{ duration: $settings.animate ? (d => Math.sqrt(d) * 120) : 0 }}
>
<TileRawValue {...tileProps(tile)} />
</div>

View File

@ -8,6 +8,7 @@ function createSettingsStore() {
cols: 4,
rows: 3,
fontSize: 1,
animate: true,
};
const s = writable(defaults);
@ -47,7 +48,7 @@ export const shuffle = crossfade({
const transform = style.transform === 'none' ? '' : style.transform;
return {
duration: 300,
duration: get(settings).animate ? 300 : 0,
easing: quintOut,
css: t => `
transform: ${transform} scale(${t});

View File

@ -42,6 +42,11 @@
</select>
</label>
<label>
Enable animations
<input type="checkbox" bind:checked={$settings.animate} />
</label>
<label>
Columns
<input type="number" bind:value={$settings.cols} width="10" />