Skip to content

Commit 651ece1

Browse files
committed
Added halloween theme, currently always active
1 parent 7f37961 commit 651ece1

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed

fonts/CC Monster Mash Medium.ttf

31 KB
Binary file not shown.
551 KB
Loading

script.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,25 @@ function playAudio(img) {
55
source.src = "../audio/" + img.src.replace(/^.*[\\\/]/, "").replace("jpg", "mp3");
66
audio.load();
77
audio.play();
8-
}
8+
}
9+
10+
function checkSeasonal() {
11+
const d = new Date();
12+
//if (d.getMonth() == 9 && d.getDate() > 24 && d.getDate() < 32) { // check if month is october (getMonth starts at 0) and its the week leading to halloween
13+
document.body.style.setProperty("--bg-image", 'url("images/SteampunkAirshipHalloween.gif")');
14+
document.body.style.color = "#d70000";
15+
document.querySelectorAll('h1, h2').forEach(tag => {
16+
tag.style.fontFamily = "MonsterMash";
17+
tag.style.textShadow = "-1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000";
18+
});
19+
document.querySelectorAll('p, ul').forEach(tag => {
20+
tag.style.color = "#af6034";
21+
});
22+
document.querySelectorAll('main, .textBackground').forEach(tag => {
23+
tag.style.backgroundColor = "#160025";
24+
});
25+
document.querySelector('footer').style.backgroundColor = "#000000";
26+
//}
27+
}
28+
29+
checkSeasonal();

style.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
src: url('fonts/contb.ttf') format('truetype');
1616
}
1717

18+
@font-face {
19+
font-family: 'MonsterMash';
20+
src: url('fonts/CC Monster Mash Medium.ttf') format('truetype');
21+
}
22+
1823
/* ID's */
1924
#mainTitle {
2025
position: absolute;
@@ -156,6 +161,7 @@ body {
156161
margin: 0;
157162
display: grid;
158163
background-color: #e68d50;
164+
--bg-image: url("images/SteampunkAirship.gif"); /* bg image variable for body::after so javascript can change it */
159165
}
160166

161167
body::after{
@@ -166,7 +172,7 @@ body::after{
166172
left: 0;
167173
right: 0;
168174
z-index: -1;
169-
background: url("images/SteampunkAirship.gif") center center;
175+
background: var(--bg-image) center center;
170176
-webkit-background-size: cover;
171177
-moz-background-size: cover;
172178
-o-background-size: cover;

0 commit comments

Comments
 (0)