Skip to content

Commit

Permalink
Add JS worker
Browse files Browse the repository at this point in the history
  • Loading branch information
bydzen committed Apr 5, 2024
1 parent 32bad9a commit f199389
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions public/arc/asset/js/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
function headerPath() {
var path = document.getElementById("path");
path.innerText = window.location.host + window.location.pathname;
}
window.onload = headerPath();
function footerYear() {
var year = document.getElementById("year");
var date = new Date();
var dateYear = date.getFullYear();
year.innerText = dateYear;
}
window.onload = footerYear();
function playSong() {
var audio = new Audio("/arc/asset/audio/blue-salvia.mp3");
audio.play();
audio.volume = 0.35;
audio.loop = true;
}
function openPopup() {
var popupSong = document.getElementById("popup-song");
var popupOverlay = document.getElementById("popup-overlay");
var gifAnimated = document.querySelectorAll(".gif.animated");
for (let i = 0; i < gifAnimated.length; i++) {
gifAnimated[i].style.transform = 'translateY(-125%)';
}
popupSong.style.display = "flex";
popupOverlay.style.display = "block";
document.body.style.overflow = "hidden";
}
window.onload = openPopup();
function closePopup() {
var popupSong = document.getElementById("popup-song");
var popupOverlay = document.getElementById("popup-overlay");
var gifAnimated = document.querySelectorAll(".gif.animated");
for (let i = 0; i < gifAnimated.length; i++) {
gifAnimated[i].style.transform = 'translateY(0%)';
}
popupSong.style.display = "none";
popupOverlay.style.display = "none";
document.body.style.overflow = "visible";
}

0 comments on commit f199389

Please sign in to comment.