diff --git a/index.html b/index.html index e4b78ea..21aad81 100644 --- a/index.html +++ b/index.html @@ -2,9 +2,15 @@ - + + - Vite + React + TS + + + XClicker - Wood Processing Game
diff --git a/public/favicon.png b/public/favicon.png new file mode 100644 index 0000000..0519ecb --- /dev/null +++ b/public/favicon.png @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 0000000..67e7583 --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/public/vite.svg b/public/vite.svg deleted file mode 100644 index e7b8dfb..0000000 --- a/public/vite.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/App.css b/src/App.css index 2527e48..e9f2feb 100644 --- a/src/App.css +++ b/src/App.css @@ -96,6 +96,11 @@ body { .resource-count { font-size: 1.2rem; font-weight: bold; + position: relative; +} + +.resource-count.animate { + animation: popIn 0.3s ease-out; } .resource-label { @@ -438,6 +443,7 @@ button { transition: transform 0.1s ease, background-color 0.2s ease; + transform-origin: center; } .click-button { @@ -515,3 +521,84 @@ button:active { max-width: 600px; } } + +/* Resource creation animations */ +@keyframes popIn { + 0% { + transform: scale(0.5); + opacity: 0; + } + 50% { + transform: scale(1.2); + } + 100% { + transform: scale(1); + opacity: 1; + } +} + +@keyframes floatUp { + 0% { + transform: translateY(0) scale(1); + opacity: 1; + } + 100% { + transform: translateY(-20px) scale(0.8); + opacity: 0; + } +} + +@keyframes shake { + 0%, + 100% { + transform: rotate(0deg); + } + 25% { + transform: rotate(-5deg); + } + 75% { + transform: rotate(5deg); + } +} + +@keyframes sparkle { + 0%, + 100% { + filter: brightness(100%); + transform: scale(1); + } + 50% { + filter: brightness(150%); + transform: scale(1.1); + } +} + +/* Apply animations to elements */ +.resource-count.animate { + animation: popIn 0.3s ease-out; +} + +.resource-popup { + position: absolute; + top: -20px; + left: 50%; + transform: translateX(-50%); + color: #4caf50; + font-weight: bold; + pointer-events: none; + animation: floatUp 0.8s ease-out forwards; +} + +.upgrade-button:active { + animation: shake 0.3s ease-in-out; +} + +.upgrade-item.upgraded { + animation: sparkle 0.5s ease-in-out; +} + +.wood-piece.new { + animation: + stackGrow 0.3s ease-out, + sparkle 0.5s ease-in-out; +} diff --git a/src/components/AdminPanel.tsx b/src/components/AdminPanel.tsx index 80f5854..f185d71 100644 --- a/src/components/AdminPanel.tsx +++ b/src/components/AdminPanel.tsx @@ -34,7 +34,7 @@ export const AdminPanel: React.FC = ({ onClick={() => setIsOpen(!isOpen)} style={{ position: "fixed", - top: "10px", + bottom: "10px", right: "10px", zIndex: 1000, background: "#ff4444", @@ -52,7 +52,7 @@ export const AdminPanel: React.FC = ({
= ({ getLogSplittingButtonText, getRoundSplittingButtonText, }) => { + const [clickedButton, setClickedButton] = useState(null); + + const handleButtonClick = (action: () => void, buttonType: string) => { + action(); + setClickedButton(buttonType); + setTimeout(() => setClickedButton(null), 300); + }; + return (
@@ -49,8 +57,8 @@ export const ProcessingSection: React.FC = ({