Skip to content

betterthanwell/wisdom-timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

38 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧘 Wisdom Timer

A beautiful, modern meditation timer with ambient sounds, interval bells, and a stunning gradient UI.

🌐 Live Demo: https://wisdomtimer.app/

Meditation Timer Vite Tailwind

✨ Features

βœ… Custom timer - Specify any duration with minute/second inputs (default: 45 minutes) βœ… Preset buttons - Quick access to 30, 45, 60, 90 minute sessions βœ… Singing bowl start bell - Beautiful Tibetan singing bowl when meditation begins βœ… Woodblock interval bell - Gentle knock-on-wood for periodic reminders βœ… Gling end bell - Pure resonant tone (35.5s sustain) when meditation completes βœ… Enlightenment burst - Stunning 9-second sunburst animation on completion with three pulsing waves βœ… Ambient sounds - Rain, ocean, forest (seamless looping) βœ… Volume controls - Separate controls for bells and ambient sounds βœ… Keyboard shortcuts - Space to play/pause, R to reset βœ… Settings persistence - Automatically saves your preferences βœ… Responsive design - Beautiful on mobile, tablet, and desktop βœ… Modern UI - Warm gradient background with glass-morphism effects βœ… Smart audio loading - Bells preload before ambient sounds for instant playback

πŸš€ Getting Started

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn

Installation

# Install dependencies
npm install

# Start development server
npm run dev

Open http://localhost:5173 in your browser.

Build for Production

npm run build
npm run preview

πŸ”Š Audio Files

The app includes the following audio files in the public/audio directory:

Audio Files Structure

public/
└── audio/
    β”œβ”€β”€ bells/
    β”‚   β”œβ”€β”€ bell-start.mp3       # Plays when meditation starts
    β”‚   β”œβ”€β”€ bell-interval.mp3    # Plays at intervals (if enabled)
    β”‚   └── bell-end.mp3         # Plays when meditation completes
    └── ambient/
        β”œβ”€β”€ rain.mp3             # Rain ambience
        β”œβ”€β”€ ocean.mp3            # Ocean waves
        └── forest.mp3           # Forest sounds

⌨️ Keyboard Shortcuts

  • Space - Play/Pause timer
  • R - Reset timer

πŸ› οΈ Tech Stack

  • React 19 - UI library with latest features
  • Vite 7 - Lightning-fast build tool
  • Tailwind CSS v4 - Utility-first CSS with custom theme
  • Lucide React - Beautiful, consistent icons
  • Context API + Reducer - State management
  • LocalStorage - Settings persistence

πŸ“ Project Structure

src/
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ Timer/              # Timer display and controls
β”‚   β”‚   β”œβ”€β”€ TimerDisplay.jsx
β”‚   β”‚   β”œβ”€β”€ TimerControls.jsx
β”‚   β”‚   └── CircularProgress.jsx
β”‚   β”œβ”€β”€ Settings/           # Configuration components
β”‚   β”‚   β”œβ”€β”€ PresetButtons.jsx
β”‚   β”‚   β”œβ”€β”€ DurationSelector.jsx
β”‚   β”‚   β”œβ”€β”€ IntervalSettings.jsx
β”‚   β”‚   └── AmbientSoundSelector.jsx
β”‚   └── UI/                 # Reusable UI components
β”‚       β”œβ”€β”€ GlassCard.jsx
β”‚       └── Button.jsx
β”œβ”€β”€ hooks/                  # Custom React hooks
β”‚   β”œβ”€β”€ useTimer.js         # Timer logic with accuracy
β”‚   β”œβ”€β”€ useAudio.js         # Audio playback wrapper
β”‚   └── useLocalStorage.js  # Persistent settings
β”œβ”€β”€ context/                # State management
β”‚   └── TimerContext.jsx    # Central state with reducer
β”œβ”€β”€ utils/                  # Utility functions
β”‚   β”œβ”€β”€ audioManager.js     # Audio system with fade effects
β”‚   └── timeFormatter.js    # Time formatting utilities
β”œβ”€β”€ constants/              # App constants
β”‚   └── audioSources.js     # Audio file paths
β”œβ”€β”€ App.jsx                 # Main application
β”œβ”€β”€ main.jsx               # App entry point
└── index.css              # Global styles + Tailwind

🎨 Customization

Change Gradient Colors

Edit src/index.css:

@theme {
  --color-gradient-start: #FDE68A;  /* Light Yellow */
  --color-gradient-end: #F97316;    /* Vivid Orange */
}

Modify Preset Durations

Edit src/context/TimerContext.jsx:

const initialState = {
  duration: 2700, // 45 minutes default
  presetDurations: [1800, 2700, 3600, 5400], // 30, 45, 60, 90 min
  // Change to your preferred durations (in seconds)
};

Add More Ambient Sounds

  1. Add audio file to public/audio/ambient/
  2. Update src/constants/audioSources.js:
export const AMBIENT_SOUNDS = [
  // ... existing sounds
  { id: 'newSound', name: 'New Sound', path: '/audio/ambient/new-sound.mp3', icon: 'Music' },
];

πŸ› Troubleshooting

Audio not playing

  • Browser autoplay policy: Click the play button to initialize audio
  • Missing files: Check that audio files exist in public/audio/ directories
  • Check console: Open browser DevTools (F12) to see audio loading errors

Styling issues

  • Tailwind not loading: Ensure @tailwindcss/postcss is installed
  • Clear cache: Try npm run dev -- --force

Timer drift

  • The timer uses Date.now() calculations to prevent drift from CPU throttling
  • Should remain accurate even on slower devices or backgrounded tabs

πŸ“ License

MIT License - feel free to use this project for personal or commercial purposes.

πŸ™ Audio Attribution

All audio files used in this project are licensed under CC0 1.0 Universal (Public Domain). While attribution is not legally required, we credit the following creators:

Bell Sounds

  • Start Bell - "Singing Bell Hit 2" by ryancacophony Source: Freesound.org License: CC0 1.0 Universal (Public Domain)

  • Interval Bell (Woodblock) - "Wood Block Hit" by thomasjaunism Source: Freesound.org License: CC0 1.0 Universal (Public Domain)

  • End Bell - "Gling" by manuelsound Source: Freesound.org License: CC0 1.0 Universal (Public Domain)

Ambient Sounds

  • Rain - "Light Gentle Rain" by Naturthusiast Source: Internet Archive License: CC0 1.0 Universal (Public Domain)

  • Ocean Waves - "Birds With Ocean Waves on the Beach" by Naturthusiast Source: Internet Archive License: CC0 1.0 Universal (Public Domain)

  • Forest - "Relaxing Nature Sounds - Birdsong Sound" by Naturthusiast Source: Internet Archive License: CC0 1.0 Universal (Public Domain)

🀝 Contributing

Contributions welcome! Feel free to:

  • Report bugs
  • Suggest new features
  • Submit pull requests
  • Share your audio recommendations

🌟 Future Enhancements

  • Session history and statistics
  • Multiple timer profiles
  • Dark/light theme toggle
  • Additional ambient sounds
  • Guided meditation audio
  • Progressive Web App (PWA) support
  • Social sharing of meditation sessions
  • Integration with meditation apps

Built with ❀️ for mindful moments

Enjoy your meditation! πŸ§˜β€β™€οΈβœ¨

About

Simple beautiful meditation timer.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors