sanajitjana/react-greetings-website
Simple greetings website in React Js. It wishes greetings according to your time.
๐ React Greetings Website
A beautiful, modern React application featuring time-based greetings with an outstanding white and black theme system. This enhanced version transforms the classic greeting app into a premium user experience with sophisticated animations, glassmorphism design, and seamless theme switching.
โจ Features
๐จ Outstanding UI Design
- Modern Glassmorphism: Semi-transparent cards with backdrop blur effects
- Dynamic Gradients: Beautiful gradient backgrounds that change with theme
- Floating Animations: Smooth particle effects and micro-interactions
- Responsive Design: Optimized for desktop, tablet, and mobile devices
๐ Advanced Theme System
- White & Black Themes: Elegant light and dark mode options
- Smart Toggle: Beautiful animated theme switcher
- Theme Persistence: Remembers user preference with localStorage
- Smooth Transitions: Seamless theme switching with elegant animations
โฐ Time-Based Greetings
- Smart Greetings: Automatically changes based on time of day
- Good Morning (12 AM - 12 PM)
- Good Afternoon (12 PM - 6 PM)
- Good Evening (6 PM - 8 PM)
- Good Night (8 PM - 12 AM)
- Live Clock: Real-time time display with smooth updates
- Dynamic Styling: Greeting colors change with time periods
๐ง Technical Excellence
- Clean Architecture: Modular component structure
- Performance Optimized: Efficient CSS animations and React hooks
- Accessibility Ready: Reduced motion support and ARIA labels
- Error-Free: TypeScript-compatible and lint-free code
๐ Quick Start
Prerequisites
- Node.js (v14.0.0 or later)
- npm (v6.0.0 or later)
Installation
-
Clone the repository
git clone <repository-url> cd react-greetings-website
-
Install dependencies
npm install
-
Start the development server
npm start
-
Open in browser
Navigate tohttp://localhost:3000
๐ฎ Usage
Theme Toggle
- Click the theme toggle button in the top-right corner
- Switch between elegant light and dark themes
- Your preference is automatically saved
Time Display
- View the current time with live updates every second
- Time display includes a rotating clock icon
- Greeting text animates with time updates
Greeting System
- The greeting automatically updates based on the current time
- Text styling and colors change throughout the day
- Smooth animations enhance the user experience
๐๏ธ Project Structure
react-greetings-website/
โโโ public/
โ โโโ index.html
โ โโโ favicon.ico
โ โโโ manifest.json
โโโ src/
โ โโโ components/
โ โ โโโ ThemeContext.js # Theme management system
โ โ โโโ ThemeToggle.js # Theme toggle component
โ โ โโโ ThemeToggle.css # Theme toggle styling
โ โโโ App.js # Main application component
โ โโโ App.css # Original styles (legacy)
โ โโโ EnhancedApp.css # Enhanced UI styling
โ โโโ index.js # Application entry point
โ โโโ index.css # Global styles
โโโ package.json
โโโ README.md
๐ Key Files
src/ThemeContext.js: React Context for theme managementsrc/ThemeToggle.js: Beautiful theme toggle componentsrc/EnhancedApp.css: Main styling with theme supportsrc/App.js: Core application logic and component structure
๐จ Design System
Color Palette
Light Theme
- Primary Background: Gradient (Purple to Blue)
- Card Background: rgba(255, 255, 255, 0.95)
- Text Color: #2d3748
- Accent Colors: #667eea, #764ba2
Dark Theme
- Primary Background: Gradient (Dark Gray to Darker Gray)
- Card Background: rgba(0, 0, 0, 0.8)
- Text Color: #f7fafc
- Accent Colors: #f093fb, #f5576c
Typography
- Font Family: Inter, system fonts
- Heading Size: clamp(2rem, 5vw, 3.5rem)
- Body Size: clamp(1.2rem, 3vw, 1.8rem)
- Weight: 700 (headings), 500 (body)
๐ ๏ธ Available Scripts
npm start
Runs the app in development mode.
npm startOpen http://localhost:3000 to view it in your browser.
npm test
Launches the test runner in interactive watch mode.
npm testnpm run build
Builds the app for production to the build folder.
npm run buildnpm run eject
Note: this is a one-way operation. Once you eject, you can't go back!
npm run eject๐ Browser Support
- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
โฟ Accessibility
- Reduced Motion: Respects
prefers-reduced-motionsetting - Keyboard Navigation: Full keyboard accessibility
- Screen Readers: Proper ARIA labels and semantic HTML
- High Contrast: Excellent color contrast ratios
๐ง Customization
Adding New Themes
- Update
ThemeContext.jsto include new theme options - Add corresponding CSS variables in
EnhancedApp.css - Update the theme toggle component
Modifying Greetings
Edit the greeting logic in src/App.js:
if (currDate >= 0 && currDate < 12) {
greeting = "Good Morning";
} else if (currDate >= 12 && currDate < 18) {
greeting = "Good Afternoon";
} // ... add more conditions๐ค Contributing
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- React Team - For the amazing framework
- Create React App - For the excellent development environment
- Inter Font - For beautiful typography
- CSS Gradient - For inspiration on gradient effects
๐ Support
If you encounter any issues or have questions, please feel free to open an issue in the repository.
Enjoy your enhanced greetings experience! ๐