A beautiful, responsive countdown timer web application built with React, Vite, and Tailwind CSS. Perfect for announcing product launches, events, or special occasions with an engaging flip-card display.
- Live Countdown Display: Real-time countdown showing days, hours, minutes, and seconds until launch
- Flip Card Animation: Stylish animated flip cards for each time unit
- Fully Responsive: Optimized for mobile, tablet, and desktop screens
- Accessible: Screen reader support with live regions for accessibility
- Starry Background: Beautiful animated starry background effect
- Social Footer: Integrated social media links
- Modern Tech Stack: Built with React 19, Vite, and Tailwind CSS
- Framework: React 19.2.5
- Build Tool: Vite 8.0.10
- Styling: Tailwind CSS 3.4.19 with PostCSS
- Language: JavaScript/JSX
- Development: ESLint for code quality
- Node.js 16+ and npm or yarn
-
Clone or extract the project
cd launch-countdown-timer-src -
Install dependencies
npm install
Start the development server with hot module replacement:
npm run devThe app will be available at http://localhost:5173 (or the next available port).
Create an optimized production build:
npm run buildThe built files will be in the dist/ directory, ready to deploy.
Preview the production build locally:
npm run previewRun ESLint to check code quality:
npm run lintsrc/
βββ App.jsx # Main app component with layout and styling
βββ App.css # App-specific styles
βββ main.jsx # React entry point
βββ index.css # Global styles
βββ components/
β βββ CountdownTimer.jsx # Main countdown timer component
β βββ FlipCard.jsx # Individual flip card component
β βββ PageLayout.jsx # Layout wrapper component
β βββ SocialFooter.jsx # Social media links footer
βββ hooks/
β βββ useCountdown.js # Custom hook for countdown logic
βββ assets/ # Project assets
public/
βββ bg-stars.svg # Starry background image
βββ [other static files]
Configuration Files:
βββ vite.config.js # Vite configuration
βββ tailwind.config.js # Tailwind CSS configuration
βββ postcss.config.js # PostCSS configuration
βββ package.json # Project dependencies and scripts
βββ index.html # HTML entry point
The main countdown display component that:
- Calculates a target date 14 days in the future
- Uses the
useCountdownhook for live updates - Renders four FlipCard components
- Includes accessibility features for screen readers
A custom React hook that:
- Computes time remaining from current time to target date
- Updates every second using
setInterval - Pads values to 2 digits (e.g., "08", "03")
- Returns both formatted strings and raw values
Displays individual time units with:
- Animated flip effect on value changes
- Label for the time unit (DAYS, HOURS, MINUTES, SECONDS)
- Responsive sizing
The application includes several accessibility features:
- Screen Reader Support: Live regions announce countdown changes
- Semantic HTML: Proper semantic markup for better screen reader experience
- ARIA Labels: Descriptive labels for sections and regions
- Responsive Text: Scales appropriately across different screen sizes
The application is optimized for all screen sizes:
- Mobile: Optimized spacing and font sizes for small screens
- Tablet: Medium breakpoint adjustments
- Desktop: Full-featured layout with additional spacing
Tailwind breakpoints used:
sm(640px)md(768px)lg(1024px)
Edit the useCountdown hook call in src/components/CountdownTimer.jsx to modify the countdown logic.
- Global styles: Edit src/index.css
- Tailwind configuration: Modify tailwind.config.js
- Component-specific styles: Use inline Tailwind classes or src/App.css
Replace bg-stars.svg in the public/ directory to change the background image.
npm run build
# Deploy the dist/ folder to Vercelnpm run build
# Deploy the dist/ folder to Netlify- Run
npm run buildto create the production build - Upload the contents of the
dist/folder to your web server - Configure your server to serve
index.htmlfor all routes (SPA routing)
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Efficient countdown updates using
setInterval - CSS animations for smooth flip card transitions
- Optimized bundle size with Vite
- Static background generation for minimal repaints
[Add your license information here]
[Add contribution guidelines here]
Happy Countdown! π