Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sk66641 committed May 26, 2024
1 parent 8dbfd21 commit 5834900
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 8 deletions.
10 changes: 5 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ <h1>Random Disco Light Simulator</h1>
</div>
<div class="button">
<button id="submit" onclick="run()">Submit</button>
<a href="https://github.com/sk66641/Random-Disco-Light-Simulator" target="_blank">
<img src="github.jpeg" alt="github">
</a>
<button id="reset" onclick="window.location.reload()">Reset</button>
</div>
<div id="error"></div>
<div style="display: flex; justify-content: center;">
<a href="https://github.com/sk66641/Random-Disco-Light-Simulator">
<img src="github.jpeg" alt="github">
</a>
<div class="screen">
<button id="screen">Enable Fullscreen</button>
</div>

</div>
</div>

Expand Down
12 changes: 12 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
document.body.addEventListener("click", () => {
if (document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement) {
document.exitFullscreen();
document.getElementById("screen").innerHTML = "Enable Fullscreen";
}
else {

document.documentElement.requestFullscreen();
document.getElementById("screen").innerHTML = "Exit Fullscreen";
}
})

function run() {

function getRandomColor() {
Expand Down
22 changes: 19 additions & 3 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,34 @@ h1 {

}

#screen {
border-radius: 10px;
background: linear-gradient(yellow, green);
cursor: pointer;
}

#screen:hover {
background: linear-gradient(green, yellow);

}

.button {
margin-top: 50px;
margin-bottom: 20px;
margin-top: 40px;
margin-bottom: 16px;
display: flex;
justify-content: center;
align-items: center;
gap: 20px;
}

.screen {
display: flex;
justify-content: center;
align-items: center;
}

#error {
display: flex;
/* color: brown; */
align-items: center;
justify-content: center;
}
Expand Down

0 comments on commit 5834900

Please sign in to comment.