A modern, interactive web application for controlling smart lights in a home environment. This project simulates a smart home lighting system, allowing users to toggle lights, adjust brightness, automate schedules, and manage Wi-Fi connectivity—all from a beautiful, responsive interface.
-
Room-based Light Control:
- Toggle lights on/off for individual rooms (Hall, Bedroom, Bathroom, Kitchen, Guest Room, Outdoor Lights, Walkway & Corridor).
- Adjust light intensity in real-time using sliders.
- Visual feedback with light bulb icons and background brightness.
-
General Controls:
- Master switch to turn all lights on or off at once.
- Wi-Fi toggle to simulate connectivity; all controls depend on Wi-Fi status.
-
Advanced Settings:
- Set automatic on/off times for each room.
- Modal interface for advanced scheduling and customization.
- Usage analytics chart (Chart.js integration ready).
-
Wi-Fi Management:
- Simulated Wi-Fi network list with signal strength and protection status.
- Notification system for Wi-Fi and light actions.
-
Responsive UI:
- Works on desktop and mobile screens.
- Smooth transitions and modern design.
-
Clone the repository:
git clone https://github.com/yourusername/smart-light.git cd smart-light -
Install dependencies:
npm install # or yarn install -
Build the project:
npm run build # or yarn build -
Start a local server: You can use any static server. For example:
npx serve . # or npm install -g live-server live-server
Then open http://localhost:8080 in your browser.
- Click "Click to begin" to enter the main dashboard.
- Use the sliders to adjust light intensity for each room.
- Click the light bulb icon to toggle lights on/off.
- Use the Wi-Fi toggle in the navigation bar to simulate connectivity.
- Click the enlarge icon for advanced settings (automation, analytics).
- View and select Wi-Fi networks from the Wi-Fi notification area.
smart-light/
├── assets/ # SVGs and images
├── dist/ # Compiled JavaScript files
├── src/ # TypeScript source files
│ ├── main.ts # Main entry point
│ ├── basicSettings.ts
│ ├── advanceSettings.ts
│ ├── general.ts
│ └── types.ts
├── style.css # Main stylesheet
├── index.html # Main HTML file
├── jest.config.js # Jest test configuration
├── Bugs.md # Bug documentation and fixes
└── ...
- Add new rooms:
- Update
componentsDatainsrc/general.tsand add corresponding HTML inindex.html.
- Update
- Change default automation times:
- Edit the
autoOnandautoOfffields incomponentsData.
- Edit the
- Update Wi-Fi networks:
- Modify the
wifiNetworksarray insrc/main.ts.
- Modify the
Contributions are welcome! Please open issues or submit pull requests for improvements, bug fixes, or new features.
- Fork the repository
- Create your feature branch (
git checkout -b feature/YourFeature) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/YourFeature) - Open a pull request
This project is licensed under the MIT License.
