style: remove animations

This commit is contained in:
MAZE 2024-06-16 22:14:47 +03:30
parent 787a9b60b5
commit 28abc16b9c
3 changed files with 27 additions and 52 deletions

View file

@ -1,5 +1,4 @@
import { FaPlay, FaRegTrashAlt } from 'react-icons/fa/index';
import { motion, AnimatePresence } from 'framer-motion';
import styles from './list.module.css';
@ -27,37 +26,29 @@ export function List({ close }: ListProps) {
<p className={styles.empty}>You don&apos;t have any presets yet.</p>
)}
<AnimatePresence>
{presets.map(preset => (
<motion.div
animate={{ opacity: 1 }}
className={styles.preset}
exit={{ opacity: 0 }}
initial={{ opacity: 0 }}
key={preset.id}
{presets.map(preset => (
<div className={styles.preset} key={preset.id}>
<input
placeholder="Untitled"
type="text"
value={preset.label}
onChange={e => changeName(preset.id, e.target.value)}
/>
<button onClick={() => deletePreset(preset.id)}>
<FaRegTrashAlt />
</button>
<button
className={styles.primary}
onClick={() => {
override(preset.sounds);
play();
close();
}}
>
<input
placeholder="Untitled"
type="text"
value={preset.label}
onChange={e => changeName(preset.id, e.target.value)}
/>
<button onClick={() => deletePreset(preset.id)}>
<FaRegTrashAlt />
</button>
<button
className={styles.primary}
onClick={() => {
override(preset.sounds);
play();
close();
}}
>
<FaPlay />
</button>
</motion.div>
))}
</AnimatePresence>
<FaPlay />
</button>
</div>
))}
</div>
);
}

View file

@ -5,7 +5,6 @@ import {
IoRefresh,
IoTrashOutline,
} from 'react-icons/io5/index';
import { motion } from 'framer-motion';
import { ReverseTimer } from './reverse-timer';
@ -139,20 +138,8 @@ export function Timer({ id }: TimerProps) {
};
}, [isRunning, tick, id, spent, total, left]);
const variants = {
enter: { opacity: 1 },
exit: { opacity: 0 },
initial: { opacity: 0 },
};
return (
<motion.div
animate="enter"
className={styles.timer}
exit="exit"
initial="initial"
variants={variants}
>
<div className={styles.timer}>
<header className={styles.header}>
<div className={styles.bar}>
<div
@ -211,6 +198,6 @@ export function Timer({ id }: TimerProps) {
<IoTrashOutline />
</button>
</footer>
</motion.div>
</div>
);
}

View file

@ -1,5 +1,4 @@
import { useMemo } from 'react';
import { AnimatePresence } from 'framer-motion';
import { Timer } from './timer';
import { Notice } from './notice';
@ -31,11 +30,9 @@ export function Timers() {
)}
</header>
<AnimatePresence>
{timers.map(timer => (
<Timer id={timer.id} key={timer.id} />
))}
</AnimatePresence>
{timers.map(timer => (
<Timer id={timer.id} key={timer.id} />
))}
<Notice />
</div>