Skip to content

Commit

Permalink
Merge pull request #3 from Piturnah/varbool
Browse files Browse the repository at this point in the history
it's better now?
  • Loading branch information
AlexanderNoles committed Jun 6, 2023
2 parents b0b1b74 + 294baf1 commit b47c5fe
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions Scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,15 @@ if (stored_count !== null) {
count = parseInt(stored_count)
}
document.getElementById("2").innerHTML = count

function randTanuki(){
const tanukiImage = document.getElementById('1');
tanuki_index += 1;
tanuki_index = tanuki_index % 3;
switch (tanuki_index) {
case 0:
tanukiImage.src = '/Images/tanuki.jpg';
break;
case 1:
tanukiImage.src = '/Images/tanuki2.jpg';
break;
case 2:
tanukiImage.src = '/Images/tanuki3.jpg';
break;
}
bool = bool? false : bool == false ? null : true;
tanukiImage.src = bool? 'Images/tanuki.jpg' : bool == false ? 'Images/tanuki2.jpg' : 'Images/tanuki3.jpg';
count += 1;
localStorage.setItem("meme", count);
document.getElementById("2").innerHTML = count
}

}
$("#1").on("click", function(){
randTanuki();
});

0 comments on commit b47c5fe

Please sign in to comment.