React Clock Project - Live demo
This project is a clock application built with React, featuring both analog and digital clocks, dark/light mode support, and timezone adjustments. It uses Vite as the development environment and has been deployed on Vercel.
Analog Clock: A functional analog clock that displays real-time hours, minutes, and seconds. Digital Clock: Displays the current time in a digital format. Dark/Light Mode: Toggle between light and dark themes with a mode switch. Time Zones: Ability to select different time zones and display the current time accordingly. Timezone API Integration: Fetches time zone data using the TimeZoneDB API.
- src/components: Contains reusable components such as
AnalogClock
,DigitalClock
,DarkModeSwitch
, and more. - src/context: Context providers like
ModeContext
,LoadingContext
, andTimeZoneOffsetContext
. - src/hooks: Custom hooks like
useTime
for handling the time logic.
- React: Frontend library
- Vite: Development environment
- Tailwind CSS: Styling framework
- Vercel: Deployment platform
-
Clone the repository:
git clone https://github.com/your-username/react-clock.git
-
Navigate into the project directory:
cd react-clock
-
Install dependencies using
npm
oryarn
:npm install
or
yarn install
-
Start the development server:
npm run dev
or
yarn dev
-
Open the application in your browser at:
http://localhost:3000
npm run dev
oryarn dev
– Start the development servernpm run build
oryarn build
– Build the application for productionnpm run preview
oryarn preview
– Preview the production build
This project is licensed under the MIT License. See the LICENSE
file for more information.