From 884192418010d6d1d9d45253826e7e4447dc7bf5 Mon Sep 17 00:00:00 2001 From: Spoiled Unknown Date: Thu, 6 Jun 2024 18:50:58 +0530 Subject: [PATCH 1/8] Improvement related to the Game Menu. 1. Increased the username limit to 20 2. added close menu button to game 3. menu with hover animation 4. added closing animation to game menu 5. added typing affect to the tittle of game menu 6. Remove button Now also closes the game menu when a game is removed --- src/App.vue | 75 +++++++++++++++++++++++++++++++++++ src/components/LeftBar.vue | 2 +- src/components/find-games.vue | 27 +++++++++++-- 3 files changed, 99 insertions(+), 5 deletions(-) diff --git a/src/App.vue b/src/App.vue index fb5c2e3d..2424198f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -142,6 +142,7 @@ placeholder="Launch Flags..." /> --> + @@ -341,6 +342,18 @@ export default { document .getElementById("removeGame") .addEventListener("click", async function () { + + const gamemenu = document.getElementById("gameMenu"); + gamemenu.classList.add("active"); + let isGameMenuAlreadyActive = false + gamemenu.addEventListener("animationend", function () { + if (gamemenu.style.display === "flex" && isGameMenuAlreadyActive === false) { + gamemenu.classList.remove("active"); + gamemenu.style.display = "none"; + isGameMenuAlreadyActive = true; + } + }) + let data = JSON.parse( await invoke("read_file", { filePath: (await path.appDir()) + "cache/games/data.json", @@ -372,6 +385,22 @@ export default { ); }); })(); + + document + .getElementById("closeMenu") + .addEventListener("click", async function () { + const gamemenu = document.getElementById("gameMenu"); + gamemenu.classList.add("active"); + let isGameMenuAlreadyActive = false + gamemenu.addEventListener("animationend", function () { + if (gamemenu.style.display === "flex" && isGameMenuAlreadyActive === false) { + gamemenu.classList.remove("active"); + gamemenu.style.display = "none"; + isGameMenuAlreadyActive = true; + } + }) + }); + function checkForUpdate() { window.__TAURI__.updater .checkUpdate() @@ -962,6 +991,10 @@ img, align-items: center; } +.gameMenu.active { + animation: gameMenuAnimationReverse 0.2s both ease-out; +} + .gameMenu .gameMenuBtn { font-family: Nunito; color: rgb(201, 201, 201); @@ -981,6 +1014,26 @@ img, align-items: center; } +.gameMenu .gameMenuCloseBtn { + font-family: Nunito; + color: rgb(201, 201, 201); + border: 4px solid rgba(var(--accent-color), 1); + border-radius: 12px; + font-size: 18px; + background-color: rgba(var(--all-color-primary), 0.7); + opacity: 0.9; + width: 13.78rem; + height: 50px; + text-decoration: none; + text-shadow: none; + padding: 10; + margin-top: 1rem; + display: flex; + justify-content: center; + align-items: center; + transition: background-color 0.3s ease-out; +} + .gameMenu .gameMenuBody { margin: 40px; display: flex; @@ -1012,6 +1065,11 @@ img, margin-top: 100px; } +.gameMenu .gameMenuBody .gameMenuCloseBtn:first-child { + margin-top: 100px; +} + + .gameMenu .gameMenuTitle { font-size: 20px; color: #cacaca; @@ -1021,6 +1079,11 @@ img, margin-bottom: 50px; } +.gameMenu .gameMenuCloseBtn:hover { + scale: 1.05; + background-color: rgba(var(--accent-color), 0.5); +} + .gameMenu .gameMenuBtn:hover { scale: 1.05; } @@ -1329,6 +1392,18 @@ img, } } +@keyframes gameMenuAnimationReverse { + 0% { + width: 30rem; + opacity: 1; + } + 100% { + width: 0px; + opacity: 0.5; + } +} + + @keyframes closeOverlay { 0% { height: 100%; diff --git a/src/components/LeftBar.vue b/src/components/LeftBar.vue index 3ae6a5e8..83d96139 100644 --- a/src/components/LeftBar.vue +++ b/src/components/LeftBar.vue @@ -23,7 +23,7 @@ type="text" value="Lazap" spellcheck="false" - maxlength="12" + maxlength="20" /> diff --git a/src/components/find-games.vue b/src/components/find-games.vue index 2c07237a..d2a465d3 100644 --- a/src/components/find-games.vue +++ b/src/components/find-games.vue @@ -1,6 +1,13 @@