diff --git a/gorge.css b/gorge.css index 62859cb..76744d9 100644 --- a/gorge.css +++ b/gorge.css @@ -339,6 +339,17 @@ button { --target: -200px; } +.click-popup-info { + pointer-events: none; + transform-origin: -50% 50%; + text-align: center; + position: fixed; + animation: click-popup-upgrade 2s linear; + animation-fill-mode: both; + font-size: 36px; + --target: -200px; +} + @keyframes click-popup-food { 0% { transform: translate(0px, 0px) scale(1, 1); @@ -372,6 +383,17 @@ button { } } +@keyframes click-popup-info { + 0% { + transform: translate(0px, 0px) scale(1, 1); + opacity: 1; + } + 100% { + transform: translate(var(--target), 200px) scale(0.5, 0.5); + opacity: 0; + } +} + div::-webkit-scrollbar { diff --git a/gorge.js b/gorge.js index feefee8..a39f8d8 100644 --- a/gorge.js +++ b/gorge.js @@ -569,6 +569,8 @@ function clickPopup(text, type, location) { direction = -150; } else if (type == "upgrade") { direction = -50; + } else if (type == "info") { + direction = 50; } direction *= Math.random() * 0.5 + 1; @@ -684,7 +686,7 @@ window.onload = function() { setTimeout(updateDisplay, 1000/updateRate); } -function save() { +function save(e) { let storage = window.localStorage; storage.setItem("save-version", "0.0.1"); @@ -694,6 +696,8 @@ function save() { storage.setItem("resources", JSON.stringify(resources)); storage.setItem("belongings", JSON.stringify(belongings)); + + clickPopup("Saved!", "upgrade", [e.clientX, e.clientY]); } function load() {