diff --git a/index.html b/index.html
index 0835500..b75697a 100644
--- a/index.html
+++ b/index.html
@@ -38,7 +38,7 @@
-
+
@@ -88,7 +88,7 @@
diff --git a/main.js b/main.js
index 7a749cc..e3c7e27 100644
--- a/main.js
+++ b/main.js
@@ -11,6 +11,9 @@
//image placeholder
// gameover movie name
getReady()
+
+
+
function getReady() {
window.addEventListener ("load", function() {
@@ -25,6 +28,13 @@ guess='Skipped';
localStorage.setItem('playedBefore',"true");
}
+ if(localStorage.getItem('archiveButtonPressed')){
+
+ document.getElementsByClassName("gif")[0].style.display="none";
+ }
+
+
+
var buttonNo = 0;
@@ -85,8 +95,8 @@ var movies = [
["The Invisible Man",2,"Cecilia Kass"],
["Triangle",0,"Jess"],
["10 Cloverfield Lane",1,"Michelle"],
- ["The Ruins",2,"Amy"],
["28 Days Later",1,"Jim"],
+ ["The Ruins",2,"Amy"],
["Halloween",2,"Laurie Strode"],
["Escape Room"],
["The Shining"],
@@ -1071,6 +1081,9 @@ var movies = [
// gameBeginning = new Date(gameBeginning.getTime() + 0 * 60 * 1000);
// console.log(gameBeginning.getTimezoneOffset());
dayCounter();
+ if(dayCount>30){
+ document.getElementsByClassName("gif")[0].style.display="block";
+ }
// console.log("gameBeginning: ",gameBeginning);
// console.log("now: ",present_date);
// console.log("Current dayCount: ", dayCount)
@@ -1080,12 +1093,14 @@ var movies = [
function dayCounter(){
dayCount = Math.floor((present_date - gameBeginning) / (1000 * 60 * 60 * 24));
console.log("dayCount: " + dayCount);
+
return dayCount;
}
markCalendar();
function markCalendar() {
+ calendarResult=" "
winCount = 0;
loseCount = 0;
dates = document.getElementsByClassName('calendar__number');
@@ -1101,9 +1116,13 @@ loseCount = 0;
if (localStorage.getItem('day'+(i))) {
if (localStorage.getItem('day'+(i))=='true') {
dates[i].classList.add('won');
+ calendarResult+="🟩"
+ if((i+6)%7==0){calendarResult+="\n"}
winCount=winCount + 1;
} else if (localStorage.getItem('day'+(i))=='false') {
dates[i].classList.add('lost');
+ calendarResult+="🟥"
+ if((i+6)%7==0){calendarResult+="\n"}
loseCount=loseCount + 1;
}
@@ -1112,6 +1131,8 @@ loseCount = 0;
dates[i].classList.add('past');
dates[i] = document.createElement('a');
+ calendarResult+="🟧"
+ if((i+6)%7==0){calendarResult+="\n"}
//dates[j].setAttribute('href','#');
// if(localStorage.getItem("playedToday")){
dates[i].setAttribute('onclick','getArchive(' + (i+1) +')');
@@ -1127,6 +1148,8 @@ loseCount = 0;
// console.log(dates[i]);
}
+ // calendarResult = calendarResult.replace(/(.{8})/g, "$1|");
+ console.log("calo reso"+ calendarResult);
console.log("win:"+ winCount)
console.log("lose:"+ loseCount)
winPerc.textContent = Math.ceil(winCount/(winCount+loseCount)*100)+"%";
@@ -1166,7 +1189,7 @@ function clearGuess() {
document.getElementById("shareResult").style.display = "none";
document.getElementById("guessForm").style.display = "block";
document.getElementById("countDown").style.display = "none";
- document.getElementById("footer").style.display = "none";
+ // document.getElementById("footer").style.display = "none";
// document.getElementById("resultText").innerHTML =textResult;
document.getElementById("movieFrame").style.display = "block";
document.getElementsByClassName("resultContainer")[0].style.display="none";
@@ -1246,8 +1269,8 @@ window.onload = deathOftheDay();
document.getElementById("movieFrame").style.display = "none";
document.getElementById("guessForm").style.display = "none";
document.getElementsByClassName("picButtons")[0].style.display="none";
- document.getElementById("movieName").innerHTML = "Thanks for playing Horrordle!";
- document.getElementById("feedback").innerHTML = "Thanks for playing Horrordle!";
+ document.getElementById("movieName").innerHTML = "
Thanks for playing!";
+ document.getElementById("feedback").innerHTML = "Horrordle will be back next October!
follow me on twitter for updates
In the meantime you can go back and play
the days you've missed by visiting the
archive page on the top right and
clicking on the orange dates.";
}
// picButton = document.getElementsByClassName('picButton');
@@ -1305,7 +1328,7 @@ window.onload = deathOftheDay();
document.getElementsByClassName("picButtons")[0].style.display="none";
showPic(movieOfTheDay[1])
// console.log(buttonNo);
- addData();
+ // addData();
}
setResult();
function setResult(){
@@ -1465,6 +1488,16 @@ function copyToClipboard() {
});
}
+ function copyToClipboardCalendar() {
+
+ navigator.clipboard.writeText("Horrordle 2022: \n" + calendarResult + "").then(() => {
+ shareResultCalender.value = "copied!";
+
+ // Alert the user that the action took place.
+ // Nobody likes hidden stuff being done under the hood!
+
+ });
+ }
function getArchive(j,d = dayCount){
for (var i = 0; i < dates.length; i++) {
@@ -1568,16 +1601,16 @@ const config = {
// // window.location.reload();
// }
// }, 1000);
-function addData(){
- myChart.data.datasets[0].data[0] = localStorage.getItem('firstGuessStat');
- myChart.data.datasets[0].data[1] = localStorage.getItem('secondGuessStat');
- myChart.data.datasets[0].data[2] = localStorage.getItem('thirdGuessStat');
- myChart.update();
-}
-const myChart = new Chart(
- document.getElementById('myChart'),
- config
-);
+// function addData(){
+// myChart.data.datasets[0].data[0] = localStorage.getItem('firstGuessStat');
+// myChart.data.datasets[0].data[1] = localStorage.getItem('secondGuessStat');
+// myChart.data.datasets[0].data[2] = localStorage.getItem('thirdGuessStat');
+// myChart.update();
+// }
+// const myChart = new Chart(
+// document.getElementById('myChart'),
+// config
+// );
function preloadImage(url)
{
var img=new Image();
@@ -1591,4 +1624,9 @@ function resetFunction() {
}
}
+function remember(){
+ localStorage.setItem('archiveButtonPressed','true');
+ document.getElementsByClassName("gif")[0].style.display="none";
+}
+
//window.localStorage.clear();
\ No newline at end of file
diff --git a/new.gif b/new.gif
new file mode 100644
index 0000000..a08d8f2
Binary files /dev/null and b/new.gif differ
diff --git a/new.png b/new.png
new file mode 100644
index 0000000..0d63713
Binary files /dev/null and b/new.png differ
diff --git a/new2.gif b/new2.gif
new file mode 100644
index 0000000..c4c7b38
Binary files /dev/null and b/new2.gif differ
diff --git a/style.css b/style.css
index e1d2e5b..98a4e25 100644
--- a/style.css
+++ b/style.css
@@ -26,6 +26,16 @@
font-size: 1.5em;
}
+.gif{
+ transform:rotate(60deg);
+ width: 35px;
+ margin-left: 5px;
+ top:2px;
+ padding-right: 5px;
+ position:absolute;
+ display:none;
+}
+
.resultImage{
/* padding-right: 8px; */
display: flex;
@@ -413,6 +423,14 @@ i{
margin-right: auto;
}
+#shareResultCalender{
+ background-color: green;
+ margin-top: 20px;
+ bottom: 5px;
+ display:block;
+ margin-left: auto;
+ margin-right: auto;
+}
#countDown{
display: none;
}