diff --git a/index.html b/index.html index 733e885..73559b8 100644 --- a/index.html +++ b/index.html @@ -18,7 +18,13 @@

This website requires JavaScript to be enabled

- +
+ + Custom Obstacle Mode +
@@ -34,8 +40,9 @@

This website requires JavaScript to be enabled

Instructions:

1. Click on the "Generate Empty Maze" button to generate an empty maze.

-

2. Click on the "Generate Randomized Maze" button to generate a maze with random obstacles based on the density.

-

3. Click on the "Toggle Custom Obstacle Mode" button to toggle the custom obstacle mode. In this mode, you can click on the cells to add or remove obstacles.

+

2. (a)Click on the "Generate Randomized Maze" button to generate a maze with random obstacles based on the density. or + (b) Click on the "Custom Obstacle Mode" button to toggle the custom obstacle mode. In this mode, you can click on the cells to add or remove obstacles.

+

3. If the "Custom Obstacle Mode" button is on switch it off . After that you can set the start and end

4. Click on the "Simulate Micromouse" button to simulate the micromouse in the maze.

5. Click on the "Clear Maze" button to clear the maze.

diff --git a/script.js b/script.js index 7012c13..40bb958 100644 --- a/script.js +++ b/script.js @@ -159,8 +159,8 @@ function toggleObstacleMode() { document.getElementById("setStart").disabled = customObstacleMode; document.getElementById("setEnd").disabled = customObstacleMode; - alert(customObstacleMode ? "Custom Obstacle Mode Enabled. Click on cells to toggle obstacles. Click again to disable. Then set start and end points." - : "Custom Obstacle Mode Disabled. You can set Start and End points."); + // alert(customObstacleMode ? "Custom Obstacle Mode Enabled. Click on cells to toggle obstacles. Click again to disable. Then set start and end points." + // : "Custom Obstacle Mode Disabled. You can set Start and End points."); } function setStart() { diff --git a/style.css b/style.css index fad500b..2bac365 100644 --- a/style.css +++ b/style.css @@ -83,4 +83,50 @@ body { button:disabled { background-color: #ccc; cursor: not-allowed; - } \ No newline at end of file + } + + /* Toggle Switch Style */ +.switch { + position: relative; + display: inline-block; + width: 60px; + height: 34px; +} + +.switch input { + opacity: 0; + width: 0; + height: 0; +} + +.slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #ccc; + transition: 0.4s; + border-radius: 34px; +} + +.slider:before { + position: absolute; + content: ""; + height: 26px; + width: 26px; + left: 4px; + bottom: 4px; + background-color: white; + transition: 0.4s; + border-radius: 50%; +} + +input:checked + .slider { + background-color: #4caf50; +} + +input:checked + .slider:before { + transform: translateX(26px); +}