mirror of
https://github.com/smartyellow/status.git
synced 2025-01-18 13:37:59 +00:00
Conditional animations
This commit is contained in:
parent
65065468c4
commit
721d788a5c
@ -110,7 +110,7 @@
|
|||||||
<div
|
<div
|
||||||
in:receive={{ key: tile.id }}
|
in:receive={{ key: tile.id }}
|
||||||
out:send={{ key: tile.id }}
|
out:send={{ key: tile.id }}
|
||||||
animate:flip
|
animate:flip={{ duration: $settings.animate ? (d => Math.sqrt(d) * 120) : 0 }}
|
||||||
>
|
>
|
||||||
<TileRawValue {...tileProps(tile)} />
|
<TileRawValue {...tileProps(tile)} />
|
||||||
</div>
|
</div>
|
||||||
|
@ -8,6 +8,7 @@ function createSettingsStore() {
|
|||||||
cols: 4,
|
cols: 4,
|
||||||
rows: 3,
|
rows: 3,
|
||||||
fontSize: 1,
|
fontSize: 1,
|
||||||
|
animate: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
const s = writable(defaults);
|
const s = writable(defaults);
|
||||||
@ -47,7 +48,7 @@ export const shuffle = crossfade({
|
|||||||
const transform = style.transform === 'none' ? '' : style.transform;
|
const transform = style.transform === 'none' ? '' : style.transform;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
duration: 300,
|
duration: get(settings).animate ? 300 : 0,
|
||||||
easing: quintOut,
|
easing: quintOut,
|
||||||
css: t => `
|
css: t => `
|
||||||
transform: ${transform} scale(${t});
|
transform: ${transform} scale(${t});
|
||||||
|
@ -42,6 +42,11 @@
|
|||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
<label>
|
||||||
|
Enable animations
|
||||||
|
<input type="checkbox" bind:checked={$settings.animate} />
|
||||||
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
Columns
|
Columns
|
||||||
<input type="number" bind:value={$settings.cols} width="10" />
|
<input type="number" bind:value={$settings.cols} width="10" />
|
||||||
|
Loading…
Reference in New Issue
Block a user