From 2bbdc7e09e053bd6e8bb052abb7aff723cb14eaa Mon Sep 17 00:00:00 2001 From: MAZE Date: Sat, 31 Aug 2024 00:10:58 +0330 Subject: [PATCH] feat: remove all tools --- .../store-consumer/store-consumer.tsx | 2 - src/components/tools/about.astro | 54 ----- .../tools/breathing/breathing.module.css | 1 - src/components/tools/breathing/breathing.tsx | 10 - .../breathing/exercise/exercise.module.css | 47 ---- .../tools/breathing/exercise/exercise.tsx | 109 --------- .../tools/breathing/exercise/index.ts | 1 - src/components/tools/breathing/index.ts | 1 - .../tools/generics/button/button.module.css | 34 --- .../tools/generics/button/button.tsx | 33 --- src/components/tools/generics/button/index.ts | 1 - src/components/tools/hero.astro | 114 ---------- .../tools/notepad/button/button.module.css | 45 ---- .../tools/notepad/button/button.tsx | 36 --- src/components/tools/notepad/button/index.ts | 1 - src/components/tools/notepad/index.tsx | 11 - .../tools/notepad/notepad.module.css | 44 ---- src/components/tools/notepad/notepad.tsx | 66 ------ src/components/tools/pomodoro/index.ts | 1 - .../tools/pomodoro/pomodoro.module.css | 36 --- src/components/tools/pomodoro/pomodoro.tsx | 168 -------------- .../tools/pomodoro/setting/index.ts | 1 - .../tools/pomodoro/setting/setting.module.css | 76 ------- .../tools/pomodoro/setting/setting.tsx | 110 --------- src/components/tools/pomodoro/tabs/index.ts | 1 - .../tools/pomodoro/tabs/tabs.module.css | 43 ---- src/components/tools/pomodoro/tabs/tabs.tsx | 25 --- .../tools/timer/form/field/field.module.css | 27 --- .../tools/timer/form/field/field.tsx | 51 ----- .../tools/timer/form/field/index.ts | 1 - .../tools/timer/form/form.module.css | 28 --- src/components/tools/timer/form/form.tsx | 97 -------- src/components/tools/timer/form/index.ts | 1 - src/components/tools/timer/index.ts | 1 - src/components/tools/timer/timer.tsx | 15 -- src/components/tools/timer/timers/index.ts | 1 - .../tools/timer/timers/notice/index.ts | 1 - .../timer/timers/notice/notice.module.css | 10 - .../tools/timer/timers/notice/notice.tsx | 10 - .../tools/timer/timers/timer/index.ts | 1 - .../tools/timer/timers/timer/timer.module.css | 126 ----------- .../tools/timer/timers/timer/timer.tsx | 212 ------------------ .../tools/timer/timers/timer/toolbar/index.ts | 1 - .../timers/timer/toolbar/toolbar.module.css | 37 --- .../timer/timers/timer/toolbar/toolbar.tsx | 39 ---- .../tools/timer/timers/timers.module.css | 27 --- src/components/tools/timer/timers/timers.tsx | 46 ---- src/pages/tools/breathing-exercises.astro | 24 -- src/pages/tools/countdown-timer.astro | 21 -- src/pages/tools/notepad.astro | 21 -- src/pages/tools/pomodoro.astro | 21 -- src/stores/alarm.ts | 19 -- src/stores/timers.ts | 155 ------------- 53 files changed, 2064 deletions(-) delete mode 100644 src/components/tools/about.astro delete mode 100644 src/components/tools/breathing/breathing.module.css delete mode 100644 src/components/tools/breathing/breathing.tsx delete mode 100644 src/components/tools/breathing/exercise/exercise.module.css delete mode 100644 src/components/tools/breathing/exercise/exercise.tsx delete mode 100644 src/components/tools/breathing/exercise/index.ts delete mode 100644 src/components/tools/breathing/index.ts delete mode 100644 src/components/tools/generics/button/button.module.css delete mode 100644 src/components/tools/generics/button/button.tsx delete mode 100644 src/components/tools/generics/button/index.ts delete mode 100644 src/components/tools/hero.astro delete mode 100644 src/components/tools/notepad/button/button.module.css delete mode 100644 src/components/tools/notepad/button/button.tsx delete mode 100644 src/components/tools/notepad/button/index.ts delete mode 100644 src/components/tools/notepad/index.tsx delete mode 100644 src/components/tools/notepad/notepad.module.css delete mode 100644 src/components/tools/notepad/notepad.tsx delete mode 100644 src/components/tools/pomodoro/index.ts delete mode 100644 src/components/tools/pomodoro/pomodoro.module.css delete mode 100644 src/components/tools/pomodoro/pomodoro.tsx delete mode 100644 src/components/tools/pomodoro/setting/index.ts delete mode 100644 src/components/tools/pomodoro/setting/setting.module.css delete mode 100644 src/components/tools/pomodoro/setting/setting.tsx delete mode 100644 src/components/tools/pomodoro/tabs/index.ts delete mode 100644 src/components/tools/pomodoro/tabs/tabs.module.css delete mode 100644 src/components/tools/pomodoro/tabs/tabs.tsx delete mode 100644 src/components/tools/timer/form/field/field.module.css delete mode 100644 src/components/tools/timer/form/field/field.tsx delete mode 100644 src/components/tools/timer/form/field/index.ts delete mode 100644 src/components/tools/timer/form/form.module.css delete mode 100644 src/components/tools/timer/form/form.tsx delete mode 100644 src/components/tools/timer/form/index.ts delete mode 100644 src/components/tools/timer/index.ts delete mode 100644 src/components/tools/timer/timer.tsx delete mode 100644 src/components/tools/timer/timers/index.ts delete mode 100644 src/components/tools/timer/timers/notice/index.ts delete mode 100644 src/components/tools/timer/timers/notice/notice.module.css delete mode 100644 src/components/tools/timer/timers/notice/notice.tsx delete mode 100644 src/components/tools/timer/timers/timer/index.ts delete mode 100644 src/components/tools/timer/timers/timer/timer.module.css delete mode 100644 src/components/tools/timer/timers/timer/timer.tsx delete mode 100644 src/components/tools/timer/timers/timer/toolbar/index.ts delete mode 100644 src/components/tools/timer/timers/timer/toolbar/toolbar.module.css delete mode 100644 src/components/tools/timer/timers/timer/toolbar/toolbar.tsx delete mode 100644 src/components/tools/timer/timers/timers.module.css delete mode 100644 src/components/tools/timer/timers/timers.tsx delete mode 100644 src/pages/tools/breathing-exercises.astro delete mode 100644 src/pages/tools/countdown-timer.astro delete mode 100644 src/pages/tools/notepad.astro delete mode 100644 src/pages/tools/pomodoro.astro delete mode 100644 src/stores/alarm.ts delete mode 100644 src/stores/timers.ts diff --git a/src/components/store-consumer/store-consumer.tsx b/src/components/store-consumer/store-consumer.tsx index 77b10cc..101be03 100644 --- a/src/components/store-consumer/store-consumer.tsx +++ b/src/components/store-consumer/store-consumer.tsx @@ -3,7 +3,6 @@ import { useEffect } from 'react'; import { useSoundStore } from '@/stores/sound'; import { useNoteStore } from '@/stores/note'; import { usePresetStore } from '@/stores/preset'; -import { useTimers } from '@/stores/timers'; interface StoreConsumerProps { children: React.ReactNode; @@ -14,7 +13,6 @@ export function StoreConsumer({ children }: StoreConsumerProps) { useSoundStore.persist.rehydrate(); useNoteStore.persist.rehydrate(); usePresetStore.persist.rehydrate(); - useTimers.persist.rehydrate(); }, []); return <>{children}; diff --git a/src/components/tools/about.astro b/src/components/tools/about.astro deleted file mode 100644 index 68eaea3..0000000 --- a/src/components/tools/about.astro +++ /dev/null @@ -1,54 +0,0 @@ ---- -import { Container } from '../container'; -import { SpecialButton } from '../special-button'; - -interface Props { - text: string; -} - -const { text } = Astro.props; ---- - -
- -

About This Tool

-

{text}

- -

About Moodist

-

- Immerse yourself in tranquility with Moodist, a simple ambient sound - generator. Create the perfect atmosphere for relaxation, focus, or sleep - by customizing soothing soundscapes to match your mood. -

- -
- Use Moodist -
-
-
- - diff --git a/src/components/tools/breathing/breathing.module.css b/src/components/tools/breathing/breathing.module.css deleted file mode 100644 index fdbd99d..0000000 --- a/src/components/tools/breathing/breathing.module.css +++ /dev/null @@ -1 +0,0 @@ -/* WIP */ diff --git a/src/components/tools/breathing/breathing.tsx b/src/components/tools/breathing/breathing.tsx deleted file mode 100644 index cc54de4..0000000 --- a/src/components/tools/breathing/breathing.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { Container } from '@/components/container'; -import { Exercise } from './exercise'; - -export function BreathingExercises() { - return ( - - - - ); -} diff --git a/src/components/tools/breathing/exercise/exercise.module.css b/src/components/tools/breathing/exercise/exercise.module.css deleted file mode 100644 index 05b9baa..0000000 --- a/src/components/tools/breathing/exercise/exercise.module.css +++ /dev/null @@ -1,47 +0,0 @@ -.exercise { - position: relative; - z-index: 1; - display: flex; - align-items: center; - justify-content: center; - padding: 75px 0; - margin-top: 12px; - background-color: var(--color-neutral-50); - border: 1px solid var(--color-neutral-200); - border-radius: 8px; - - & .phase { - font-family: var(--font-display); - font-size: var(--font-lg); - font-weight: 600; - } - - & .circle { - position: absolute; - top: 50%; - left: 50%; - z-index: -1; - height: 55%; - aspect-ratio: 1 / 1; - background-image: radial-gradient( - var(--color-neutral-50), - var(--color-neutral-100) - ); - border: 1px solid var(--color-neutral-200); - border-radius: 50%; - transform: translate(-50%, -50%); - } -} - -.selectBox { - width: 100%; - min-width: 0; - height: 45px; - padding: 0 12px; - margin-top: 8px; - font-size: var(--font-sm); - color: var(--color-foreground); - background-color: var(--color-neutral-100); - border: 1px solid var(--color-neutral-200); - border-radius: 8px; -} diff --git a/src/components/tools/breathing/exercise/exercise.tsx b/src/components/tools/breathing/exercise/exercise.tsx deleted file mode 100644 index 14e07fb..0000000 --- a/src/components/tools/breathing/exercise/exercise.tsx +++ /dev/null @@ -1,109 +0,0 @@ -import { useState, useEffect, useMemo, useCallback } from 'react'; -import { motion } from 'framer-motion'; -import styles from './exercise.module.css'; - -type Exercise = 'Box Breathing' | 'Resonant Breathing' | '4-7-8 Breathing'; -type Phase = 'inhale' | 'exhale' | 'holdInhale' | 'holdExhale'; - -const EXERCISE_PHASES: Record = { - '4-7-8 Breathing': ['inhale', 'holdInhale', 'exhale'], - 'Box Breathing': ['inhale', 'holdInhale', 'exhale', 'holdExhale'], - 'Resonant Breathing': ['inhale', 'exhale'], -}; - -const EXERCISE_DURATIONS: Record>> = { - '4-7-8 Breathing': { exhale: 8, holdInhale: 7, inhale: 4 }, - 'Box Breathing': { exhale: 4, holdExhale: 4, holdInhale: 4, inhale: 4 }, - 'Resonant Breathing': { exhale: 5, inhale: 5 }, // No holdExhale -}; - -const PHASE_LABELS: Record = { - exhale: 'Exhale', - holdExhale: 'Hold', - holdInhale: 'Hold', - inhale: 'Inhale', -}; - -export function Exercise() { - const [selectedExercise, setSelectedExercise] = - useState('4-7-8 Breathing'); - const [phaseIndex, setPhaseIndex] = useState(0); - - const phases = useMemo( - () => EXERCISE_PHASES[selectedExercise], - [selectedExercise], - ); - const durations = useMemo( - () => EXERCISE_DURATIONS[selectedExercise], - [selectedExercise], - ); - - const currentPhase = phases[phaseIndex]; - - const animationVariants = useMemo( - () => ({ - exhale: { - transform: 'translate(-50%, -50%) scale(1)', - transition: { duration: durations.exhale }, - }, - holdExhale: { - transform: 'translate(-50%, -50%) scale(1)', - transition: { duration: durations.holdExhale }, - }, - holdInhale: { - transform: 'translate(-50%, -50%) scale(1.5)', - transition: { duration: durations.holdInhale }, - }, - inhale: { - transform: 'translate(-50%, -50%) scale(1.5)', - transition: { duration: durations.inhale }, - }, - }), - [durations], - ); - - const resetExercise = useCallback(() => { - setPhaseIndex(0); - }, []); - - const updatePhase = useCallback(() => { - setPhaseIndex(prevIndex => (prevIndex + 1) % phases.length); - }, [phases.length]); - - useEffect(() => { - resetExercise(); - }, [selectedExercise, resetExercise]); - - useEffect(() => { - const intervalDuration = (durations[currentPhase] || 4) * 1000; - const interval = setInterval(updatePhase, intervalDuration); - - return () => clearInterval(interval); - }, [currentPhase, durations, updatePhase]); - - return ( - <> -
- -

{PHASE_LABELS[currentPhase]}

-
- - - - ); -} diff --git a/src/components/tools/breathing/exercise/index.ts b/src/components/tools/breathing/exercise/index.ts deleted file mode 100644 index 881062d..0000000 --- a/src/components/tools/breathing/exercise/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Exercise } from './exercise'; diff --git a/src/components/tools/breathing/index.ts b/src/components/tools/breathing/index.ts deleted file mode 100644 index dbd185a..0000000 --- a/src/components/tools/breathing/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { BreathingExercises } from './breathing'; diff --git a/src/components/tools/generics/button/button.module.css b/src/components/tools/generics/button/button.module.css deleted file mode 100644 index a96e112..0000000 --- a/src/components/tools/generics/button/button.module.css +++ /dev/null @@ -1,34 +0,0 @@ -.button { - display: flex; - align-items: center; - justify-content: center; - width: 30px; - height: 30px; - font-size: var(--font-sm); - color: var(--color-foreground); - cursor: pointer; - background-color: var(--color-neutral-100); - border: 1px solid var(--color-neutral-200); - border-radius: 4px; - outline: none; - transition: 0.2s; - - &:focus-visible { - outline: 2px solid var(--color-neutral-400); - outline-offset: 2px; - } - - &:hover, - &:focus-visible { - background-color: var(--color-neutral-200); - } - - &.smallIcon { - font-size: var(--font-xsm); - } - - &:disabled { - cursor: not-allowed; - opacity: 0.4; - } -} diff --git a/src/components/tools/generics/button/button.tsx b/src/components/tools/generics/button/button.tsx deleted file mode 100644 index 5828ad6..0000000 --- a/src/components/tools/generics/button/button.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { Tooltip } from '@/components/tooltip'; - -import { cn } from '@/helpers/styles'; - -import styles from './button.module.css'; - -interface ButtonProps { - disabled?: boolean; - icon: React.ReactElement; - onClick: () => void; - smallIcon?: boolean; - tooltip: string; -} - -export function Button({ - disabled = false, - icon, - onClick, - smallIcon, - tooltip, -}: ButtonProps) { - return ( - - - - ); -} diff --git a/src/components/tools/generics/button/index.ts b/src/components/tools/generics/button/index.ts deleted file mode 100644 index a039b75..0000000 --- a/src/components/tools/generics/button/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Button } from './button'; diff --git a/src/components/tools/hero.astro b/src/components/tools/hero.astro deleted file mode 100644 index a502ae4..0000000 --- a/src/components/tools/hero.astro +++ /dev/null @@ -1,114 +0,0 @@ ---- -import { Container } from '../container'; - -interface Props { - desc: string; - title: string; -} - -const { desc, title } = Astro.props; ---- - -
- -
-
- - -

{title}

-

{desc}

- -

Part of Moodist

-
-
-
- - diff --git a/src/components/tools/notepad/button/button.module.css b/src/components/tools/notepad/button/button.module.css deleted file mode 100644 index 4a4e756..0000000 --- a/src/components/tools/notepad/button/button.module.css +++ /dev/null @@ -1,45 +0,0 @@ -.button { - display: flex; - align-items: center; - justify-content: center; - width: 30px; - height: 30px; - font-size: var(--font-sm); - color: var(--color-foreground); - cursor: pointer; - background-color: var(--color-neutral-100); - border: 1px solid var(--color-neutral-200); - border-radius: 4px; - outline: none; - transition: 0.2s; - transition-property: border-color, color, background-color; - - &:focus-visible { - outline: 2px solid var(--color-neutral-400); - outline-offset: 2px; - } - - &.critical { - color: #f43f5e; - border-color: #f43f5e; - - &:hover { - background-color: rgb(244 63 94 / 10%); - } - } - - &.recommended { - font-size: var(--font-xsm); - color: #22c55e; - border-color: #22c55e; - - &:hover { - background-color: rgb(34 197 94 / 10%); - } - } - - &:hover, - &:focus-visible { - background-color: var(--color-neutral-200); - } -} diff --git a/src/components/tools/notepad/button/button.tsx b/src/components/tools/notepad/button/button.tsx deleted file mode 100644 index d3da910..0000000 --- a/src/components/tools/notepad/button/button.tsx +++ /dev/null @@ -1,36 +0,0 @@ -import { Tooltip } from '@/components/tooltip'; - -import { cn } from '@/helpers/styles'; - -import styles from './button.module.css'; - -interface ButtonProps { - critical?: boolean; - icon: React.ReactElement; - onClick: () => void; - recommended?: boolean; - tooltip: string; -} - -export function Button({ - critical, - icon, - onClick, - recommended, - tooltip, -}: ButtonProps) { - return ( - - - - ); -} diff --git a/src/components/tools/notepad/button/index.ts b/src/components/tools/notepad/button/index.ts deleted file mode 100644 index a039b75..0000000 --- a/src/components/tools/notepad/button/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { Button } from './button'; diff --git a/src/components/tools/notepad/index.tsx b/src/components/tools/notepad/index.tsx deleted file mode 100644 index 02c1b24..0000000 --- a/src/components/tools/notepad/index.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import { StoreConsumer } from '@/components/store-consumer'; - -import { Notepad as NotepadComponent } from './notepad'; - -export function Notepad() { - return ( - - - - ); -} diff --git a/src/components/tools/notepad/notepad.module.css b/src/components/tools/notepad/notepad.module.css deleted file mode 100644 index 2dadc40..0000000 --- a/src/components/tools/notepad/notepad.module.css +++ /dev/null @@ -1,44 +0,0 @@ -.header { - display: flex; - align-items: center; - justify-content: space-between; - margin-bottom: 8px; - - & .label { - font-size: var(--font-sm); - font-weight: 500; - color: var(--color-foreground-subtle); - } - - & .buttons { - display: flex; - column-gap: 4px; - align-items: center; - } -} - -.textarea { - width: 100%; - height: 350px; - padding: 12px; - line-height: 1.6; - color: var(--color-foreground-subtle); - resize: none; - background-color: var(--color-neutral-50); - border: 1px solid var(--color-neutral-200); - border-radius: 4px; - outline: none; - scroll-padding-bottom: 12px; - - &:focus-visible { - outline: 2px solid var(--color-neutral-400); - outline-offset: 2px; - } -} - -.counter { - margin-top: 8px; - font-size: var(--font-xsm); - color: var(--color-foreground-subtle); - text-align: center; -} diff --git a/src/components/tools/notepad/notepad.tsx b/src/components/tools/notepad/notepad.tsx deleted file mode 100644 index 9ca334e..0000000 --- a/src/components/tools/notepad/notepad.tsx +++ /dev/null @@ -1,66 +0,0 @@ -import { BiTrash } from 'react-icons/bi/index'; -import { LuCopy, LuDownload } from 'react-icons/lu/index'; -import { FaCheck } from 'react-icons/fa6/index'; -import { FaUndo } from 'react-icons/fa/index'; - -import { Button } from './button'; - -import { useNoteStore } from '@/stores/note'; -import { useCopy } from '@/hooks/use-copy'; -import { download } from '@/helpers/download'; - -import styles from './notepad.module.css'; -import { Container } from '@/components/container'; - -export function Notepad() { - const note = useNoteStore(state => state.note); - const history = useNoteStore(state => state.history); - const write = useNoteStore(state => state.write); - const words = useNoteStore(state => state.words()); - const characters = useNoteStore(state => state.characters()); - const clear = useNoteStore(state => state.clear); - const restore = useNoteStore(state => state.restore); - - const { copy, copying } = useCopy(); - - return ( - -
-

Your Note

-
-
-
- -