-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
69 lines (57 loc) · 3.05 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Warehouse INC</title>
<link rel="manifest" href="src/manifest.json">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css"> <!-- Font Awesome CSS -->
<link rel="icon" type="image/x-icon" href="src/images/favicon.ico">
<link rel="stylesheet" href="index.css">
</head>
<body>
<div id="autoplayPopup" style="display: none;">Autoplay is disabled for this site. Click <a onclick="bgMusic.play();document.getElementById('autoplayPopup').classList.add('autoplayPopupLeave')">here</a> to play background music.</div>
<div id="bgscroll" class="fadeout"></div>
<div id="container">
<h1>Welcome to Warehouse INC</h1>
<p>Embark on an epic adventure in the world of warehousing!</p>
<button onclick="switchTo('./src/index.html')">
<i class="fas fa-play icon"><span class="buttonText">Play</span></i>
</button>
<button onclick="switchTo('./credits.html')">
<i class="fas fa-info-circle icon"><span class="buttonText">Credits</span></i>
</button>
</div>
<div id="crapOfTheDay">
<span style="font-size: 4vmin;color: #a6a7cf;">Quote of the minute:</span><br>
<span id="crapContents" style="font-size: 3vmin;"></span>
</div>
<script src="./src/data/crapmessages.js"></script>
<script>
const firstCrapDate = new Date(2024, 2, 28);
let daysSinceCrapCreation = Math.floor((new Date() - firstCrapDate) / (1000 * 60)); // et daysSinceCrapCreation = Math.floor((new Date() - firstCrapDate) / (1000 * 3600 * 24));
const crapContents = document.getElementById("crapContents");
crapContents.innerHTML = crapMessages[daysSinceCrapCreation % crapMessages.length];
function switchTo(site) {
const bgscroll = document.getElementById("bgscroll");
const container = document.getElementById("container")
container.style.transform = "translateY(100vh)";
bgscroll.style.backgroundPositionX = getComputedStyle(bgscroll).backgroundPositionX;
bgscroll.style.animation = "fadeout 1s";
container.style.transform = "translateY(100vh)";
setTimeout(()=>{
window.location.href = site;
},1100)
}
const bgMusic = new Audio('./src/sfx/music/FastMenuLiteHeavy.mp3');
document.addEventListener("DOMContentLoaded", async function() {
try {
bgMusic.loop = true;
await bgMusic.play();
} catch {
document.getElementById("autoplayPopup").style.display = "unset";
}
});
</script>
</body>
</html>