diff --git a/Bulb/sivangbagri/bulb.html b/Bulb/sivangbagri/bulb.html new file mode 100644 index 000000000..366f68ac8 --- /dev/null +++ b/Bulb/sivangbagri/bulb.html @@ -0,0 +1,35 @@ + + + + + + + + Image Carousel + + + + + + + + + +
+
+ +
+
+
+ +
+
+
+ + + + \ No newline at end of file diff --git a/Bulb/sivangbagri/bulb.js b/Bulb/sivangbagri/bulb.js new file mode 100644 index 000000000..271a34b2b --- /dev/null +++ b/Bulb/sivangbagri/bulb.js @@ -0,0 +1,21 @@ +const BULB_ON_URL = "https://i.postimg.cc/6QyTynzr/bulb-on.png"; +const BULB_OFF_URL = "https://i.postimg.cc/KjK1wL3c/bulb-off.png"; + +function lightSwitch() { + const checkbox = document.getElementById("flexSwitchCheckChecked"); + if (checkbox.checked) { + bulb_on(); + } else { + bulb_off(); + } +} + +function bulb_on() { + const bulb = document.getElementById("bulb"); + bulb.src = BULB_ON_URL; +} + +function bulb_off() { + const bulb = document.getElementById("bulb"); + bulb.src = BULB_OFF_URL; +} diff --git a/Bulb/sivangbagri/readme.md b/Bulb/sivangbagri/readme.md new file mode 100644 index 000000000..bb3d84a66 --- /dev/null +++ b/Bulb/sivangbagri/readme.md @@ -0,0 +1,39 @@ +# Bulb Toggle Project + +This is a simple project that demonstrates how to create a toggle button to switch a bulb on and off using HTML, CSS, JavaScript, and Bootstrap. + +## Table of Contents + +- [Project Overview](#project-overview) +- [Tech Stack](#tech-stack) +- [Getting Started](#getting-started) +- [Usage](#usage) +- [License](#license) + +## Project Overview + +This project provides a basic example of how to create a toggle button to turn a virtual bulb on and off. The toggle button changes the color of the bulb and updates its state accordingly. + +## Tech Stack + +- HTML +- CSS +- JavaScript +- Bootstrap + +## Getting Started + +1. Clone the repository or download the source code. + +2. Open `index.html` in a web browser to see the project in action. + +## Usage + +1. Open the `index.html` file in a web browser. + +2. Click the toggle button to switch the bulb on and off. The bulb's color will change based on its state. + +## License + +This project is licensed under the [MIT License](LICENSE). +Feel free to modify and distribute the code as needed. \ No newline at end of file