This project showcases a 3D toggle switch created using HTML and CSS. The toggle switch is designed with a unique 3D appearance, and it features interactive animations that respond to user interactions.
-
Interactive Toggle: The toggle switch provides visual feedback when interacted with. It smoothly transitions between the on and off states.
-
3D Appearance: The switch components are designed to create a 3D effect using gradient backgrounds, shadows, and animations.
-
Customizable Colors: The hue of the toggle switch and its accent color can be easily adjusted by modifying the CSS variables.
To use the 3D toggle switch in your project, follow these steps:
- Include the provided
style.css
stylesheet in your HTML file's<head>
section:
<link rel="stylesheet" href="style.css">
- Place the following HTML code in the
<body>
of your HTML file:
<label class="switch">
<input type="checkbox" checked />
<div class="indicator left"></div>
<div class="indicator right"></div>
<div class="button"></div>
</label>
- Customize the switch appearance by adjusting the CSS variables defined in the
style.css
file. You can modify colors, dimensions, and other properties according to your preferences.
/* Example: Change the hue of the switch */
:root {
--hue: 140deg;
}
- Save both the HTML and CSS files in the same directory and open the HTML file in a web browser to see the 3D toggle switch in action.
This project is licensed under the MIT License.
Feel free to use, modify, and distribute this code as needed while adhering to the terms of the MIT License.
![Screenshot 2023-08-21 103810](https://private-user-images.githubusercontent.com/59678435/261924650-3a633c52-d368-4d7e-bd78-258478f47962.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM2NDkzOTUsIm5iZiI6MTcyMzY0OTA5NSwicGF0aCI6Ii81OTY3ODQzNS8yNjE5MjQ2NTAtM2E2MzNjNTItZDM2OC00ZDdlLWJkNzgtMjU4NDc4ZjQ3OTYyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODE0VDE1MjQ1NVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU3MmQyZGE1ZDA2M2M3YjgzNzEwOGUyNDkyYjQ0OTE2YmFiMjI2NjY1ZjdmMTIwZTI1ODgxM2U0NzliMWJiZmYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Qj48R3DiQA-Xscp5XpMmk2qVv0Kb94u-HpzlHEnVP18)
Designed and implemented by Aarzoo. Inspired by various creative designs on the web.
For more details, enhancements, and contributions, visit the GitHub repository.
If you find this project helpful, consider giving it a โญ on GitHub!