Skip to content

Commit

Permalink
Merge pull request #82 from bnidevs/frontend
Browse files Browse the repository at this point in the history
Further Theme Updates
  • Loading branch information
bnidevs authored Nov 21, 2020
2 parents c957fb0 + f7a0865 commit 61e31d5
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@
# Dependency directories (remove the comment below to include it)
# vendor/
.DS_Store

*.tmp.html
Binary file added frontend/assets/easter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ <h1>The Hotbox</h1>
<option value="4">Thanksgiving</option>
<option value="5">Christmas</option>
<option value="6">New Years</option>
<option value="7">Easter</option>
</select>
</p>
</footer>
Expand Down
18 changes: 15 additions & 3 deletions frontend/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,13 @@ function toggleTheme(){
document.documentElement.className="light-mode";
document.getElementsByTagName("h1")[0].style.color = "black";
document.getElementsByTagName("footer")[0].style.color = "black";
document.cookie = themeID.toString() + ";path=/";
}
else if(themeID == 2){
document.documentElement.className="dark-mode";
document.getElementsByTagName("h1")[0].style.color = "white";
document.getElementsByTagName("footer")[0].style.color = "white";
document.cookie = themeID.toString() + ";path=/";
}
else if(themeID == 3){
document.documentElement.className="halloween";
Expand All @@ -168,6 +170,11 @@ function toggleTheme(){
document.documentElement.className="newyears";
document.getElementsByTagName("h1")[0].style.color = "hotpink";
document.getElementsByTagName("footer")[0].style.color = "white";
}
else if(themeID == 7){
document.documentElement.className="easter";
document.getElementsByTagName("h1")[0].style.color = "darkmagenta";
document.getElementsByTagName("footer")[0].style.color = "darkmagenta";
}
}

Expand All @@ -180,14 +187,19 @@ function checkDate(){
else if(month == 11){
document.getElementById("themeSwitch").value=4;
}
else if(month == 12){
else if(month == 12 && day <= 25){
document.getElementById("themeSwitch").value=5;
}
else if(month == 1){
else if((month == 12 && day > 25) || (month == 1 && day < 8)){
document.getElementById("themeSwitch").value=6;
}
else if((month == 3 && day > 21) || (month == 4 && day < 26)){
document.getElementById("themeSwitch").value=7;
}
else{
return;
var decoded_cookie = decodeURIComponent(document.cookie);
var theme_value = decoded_cookie.substring(0,1);
document.getElementById("themeSwitch").value = Number(theme_value);
}
toggleTheme();
}
Expand Down
14 changes: 12 additions & 2 deletions frontend/style/progress.css
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ div:last-child{
max-width: 300px;
}


#preview-wrapper {
margin-left: 60px;
text-align: center;
Expand Down Expand Up @@ -97,7 +96,7 @@ div:last-child{
.halloween{
background-color: black;
color: #FF7000;
--secondary-color: #FF7000;
--secondary-color: "#FF7000";
background-image: url("../assets/pumpkin.png");
background-repeat: no-repeat;
background-position: absolute;
Expand Down Expand Up @@ -135,4 +134,15 @@ div:last-child{
background-position: absolute;
background-position: right bottom;
background-size: 24vw;
}

.easter{
background-color: #9DCFDF;
color: orangered;
--secondary-color: darkmagenta;
background-image: url("../assets/easter.png");
background-repeat: no-repeat;
background-position: absolute;
background-position: right bottom;
background-size: 24vw;
}

0 comments on commit 61e31d5

Please sign in to comment.