Skip to content

Commit

Permalink
delete old files, rename existing, add main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Megaemce committed Apr 4, 2024
1 parent 2009ce2 commit c0f5143
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 61 deletions.
File renamed without changes
Binary file removed bonfire_black-min.png
Binary file not shown.
Binary file removed bonfire_black.jpeg
Binary file not shown.
Binary file removed bonfire_black.png
Binary file not shown.
14 changes: 8 additions & 6 deletions fire.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
width: 100%;
height: 100%;
background-position: 51% bottom;
background-image: url(bonfire_black_min.png);
background-image: url(bonfire.png);
background-repeat: no-repeat;
background-size: 30%;
filter: drop-shadow(0px 10px 15px black);
Expand Down Expand Up @@ -55,12 +55,14 @@
transparent 88% /* ignore the fire */
)
/* linear gradient for the smog */,
url(noise2.svg), url(noise2.svg), url(noise.svg), url(noise1.svg);
url(noiseMedium.svg), url(noiseMedium.svg), url(noiseSmall.svg),
url(noiseBig.svg);

filter: sepia(1);
background-blend-mode: color-burn /* smog gradient and noise2 */,
color-burn /* noise2 and noise2 */, color-burn /* noise2 and noise */,
difference /* noise and noise1 */;
background-blend-mode: color-burn /* smog gradient and noiseMedium */,
color-burn /* noiseMedium and noiseMedium */,
color-burn /* noiseMedium and noiseSmall */,
difference /* noiseSmall and noiseBig */;
mix-blend-mode: hard-light;
animation: firing 100s linear infinite;
}
Expand Down Expand Up @@ -97,7 +99,7 @@
height: 100%;
filter: drop-shadow(0px 11px 14px black);
background-position: 51% bottom;
background-image: url(bonfire_black_min.png);
background-image: url(bonfire.png);
background-repeat: no-repeat;
background-size: 30%;
mix-blend-mode: overlay;
Expand Down
File renamed without changes.
57 changes: 2 additions & 55 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,61 +15,8 @@
</div>

<audio id="fireSound" loop>
<source src="fire_min.mp3" type="audio/mpeg" />
<source src="fire.mp3" type="audio/mpeg" />
</audio>
<script>
function startSound() {
const fireSound = document.getElementById("fireSound");
const start = document.getElementById("start");
const fire = document.getElementById("fire");

fire.classList.add("on");
start.style.display = "none";

fireSound.play();
}

let lastClickTime = 0;
document.addEventListener("click", function (event) {
const currentTime = new Date().getTime();
const tapLength = currentTime - lastClickTime;
if (tapLength < 500 && tapLength > 0) {
toggleFullScreen();
event.preventDefault();
}
lastClickTime = currentTime;
});

// Toggle fullscreen mode
function toggleFullScreen() {
const element = document.documentElement;
const isFullScreen =
document.fullscreenElement ||
document.mozFullScreenElement ||
document.webkitFullscreenElement ||
document.msFullscreenElement;
if (!isFullScreen) {
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen();
}
} else {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
}
}
</script>
<script src="main.js"></script>
</body>
</html>
52 changes: 52 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
function startSound() {
const fireSound = document.getElementById("fireSound");
const start = document.getElementById("start");
const fire = document.getElementById("fire");

fire.classList.add("on");
start.style.display = "none";

fireSound.play();
}

let lastClickTime = 0;
document.addEventListener("click", function (event) {
const currentTime = new Date().getTime();
const tapLength = currentTime - lastClickTime;
if (tapLength < 500 && tapLength > 0) {
toggleFullScreen();
event.preventDefault();
}
lastClickTime = currentTime;
});

// Toggle fullscreen mode
function toggleFullScreen() {
const element = document.documentElement;
const isFullScreen =
document.fullscreenElement ||
document.mozFullScreenElement ||
document.webkitFullscreenElement ||
document.msFullscreenElement;
if (!isFullScreen) {
if (element.requestFullscreen) {
element.requestFullscreen();
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen();
}
} else {
if (document.exitFullscreen) {
document.exitFullscreen();
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen();
} else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen();
} else if (document.msExitFullscreen) {
document.msExitFullscreen();
}
}
}
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit c0f5143

Please sign in to comment.