Skip to content

Komans-Hub/launch-countdown-timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Launch Countdown Timer πŸš€

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.

Features ✨

  • 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

Tech Stack πŸ› οΈ

  • 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

Installation

Prerequisites

  • Node.js 16+ and npm or yarn

Setup

  1. Clone or extract the project

    cd launch-countdown-timer-src
  2. Install dependencies

    npm install

Getting Started

Development Server

Start the development server with hot module replacement:

npm run dev

The app will be available at http://localhost:5173 (or the next available port).

Build for Production

Create an optimized production build:

npm run build

The built files will be in the dist/ directory, ready to deploy.

Preview Production Build

Preview the production build locally:

npm run preview

Lint Code

Run ESLint to check code quality:

npm run lint

Project Structure πŸ“

src/
β”œβ”€β”€ 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

Key Components

CountdownTimer Component

The main countdown display component that:

  • Calculates a target date 14 days in the future
  • Uses the useCountdown hook for live updates
  • Renders four FlipCard components
  • Includes accessibility features for screen readers

useCountdown Hook

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

FlipCard Component

Displays individual time units with:

  • Animated flip effect on value changes
  • Label for the time unit (DAYS, HOURS, MINUTES, SECONDS)
  • Responsive sizing

Accessibility β™Ώ

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

Responsive Design πŸ“±

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)

Customization

Change Target Date

Edit the useCountdown hook call in src/components/CountdownTimer.jsx to modify the countdown logic.

Styling

Background

Replace bg-stars.svg in the public/ directory to change the background image.

Deployment

Vercel

npm run build
# Deploy the dist/ folder to Vercel

Netlify

npm run build
# Deploy the dist/ folder to Netlify

Traditional Hosting

  1. Run npm run build to create the production build
  2. Upload the contents of the dist/ folder to your web server
  3. Configure your server to serve index.html for all routes (SPA routing)

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

Performance Considerations

  • Efficient countdown updates using setInterval
  • CSS animations for smooth flip card transitions
  • Optimized bundle size with Vite
  • Static background generation for minimal repaints

License

[Add your license information here]

Contributing

[Add contribution guidelines here]


Happy Countdown! πŸŽ‰

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors