Skip to content

Commit 57b6a29

Browse files
committed
rendering and animation improvements
1 parent c69a7b3 commit 57b6a29

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

src/components/TheCycleEdit.vue

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,22 @@ watch(
5555
);
5656
</script>
5757
<template>
58-
<dialog ref="dialog" class="m-auto bg-transparent" @close="close">
58+
<dialog
59+
ref="dialog"
60+
class="m-auto translate-y-2 bg-transparent opacity-0 transition-all transition-discrete duration-500 backdrop:opacity-0 backdrop:transition-all backdrop:transition-discrete backdrop:duration-500 open:translate-0 open:opacity-100 open:backdrop:opacity-100 starting:open:translate-y-2 starting:open:opacity-0 starting:open:backdrop:opacity-0"
61+
@close="close"
62+
>
5963
<LayoutStack
60-
v-show="open"
6164
tag="form"
65+
method="dialog"
6266
space="1"
6367
class="w-full rounded-lg border border-blue-200 bg-white px-4 py-2 dark:border-sky-400 dark:bg-stone-800"
64-
@submit.prevent="submit"
68+
@submit="submit"
6569
>
66-
<h2 class="self-center text-lg">
70+
<h1 class="self-center text-lg">
6771
<BaseIcon name="wrench" class="align-middle" />
6872
Settings
69-
</h2>
73+
</h1>
7074
<div class="space-y-1 px-4 py-2">
7175
<IntervalEditBox
7276
v-for="interval in intervalsRef"

src/components/TheTimerList.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<script setup lang="ts">
22
import BaseTimer from '@/components/BaseTimer.vue';
33
import { useCycle } from '@/stores/cycle';
4+
import { computed } from 'vue';
45
56
const cycle = useCycle();
7+
const currentCycle = computed(() => cycle.intervals[cycle.current]);
8+
const countdown = computed(() => cycle.countdowns[cycle.current]);
69
</script>
710
<template>
811
<TransitionGroup
@@ -16,11 +19,10 @@ const cycle = useCycle();
1619
class="grid-overlap grid"
1720
>
1821
<BaseTimer
19-
v-for="(interval, i) in cycle.intervals"
20-
v-show="i === cycle.current"
21-
:key="interval.id"
22-
:duration="cycle.countdowns[i]"
23-
:type="interval.type"
22+
v-if="currentCycle"
23+
:key="currentCycle.id"
24+
:duration="countdown"
25+
:type="currentCycle.type"
2426
class="will-change-transform"
2527
/>
2628
</TransitionGroup>

0 commit comments

Comments
 (0)