opt menu touch effect

This commit is contained in:
KOWX712
2025-01-01 22:36:31 +08:00
parent f7aee9dc34
commit f641f388ad
4 changed files with 56 additions and 20 deletions

View File

@@ -93,8 +93,10 @@ export function setupLanguageMenu() {
} }
}); });
function openLanguageMenu() { function openLanguageMenu() {
languageMenu.classList.add("show");
languageOverlay.style.display = 'flex'; languageOverlay.style.display = 'flex';
setTimeout(() => {
languageMenu.classList.add("show");
}, 10);
} }
function closeLanguageMenu() { function closeLanguageMenu() {
languageMenu.classList.remove("show"); languageMenu.classList.remove("show");

View File

@@ -60,8 +60,8 @@ function setupUpdateMenu() {
.filter(line => line.trim() !== '') .filter(line => line.trim() !== '')
.map(line => line.startsWith('- ') ? line.slice(2) : line); .map(line => line.startsWith('- ') ? line.slice(2) : line);
const formattedChangelog = ` const formattedChangelog = `
<li class="changelog-title">${lines[0]}</li> <li class="changelog-title">${lines[0]}</li>
${lines.slice(1).map(line => `<li>${line}</li>`).join('')} ${lines.slice(1).map(line => `<li>${line}</li>`).join('')}
`; `;
releaseNotes.innerHTML = formattedChangelog; releaseNotes.innerHTML = formattedChangelog;
openUpdateMenu(); openUpdateMenu();

View File

@@ -61,7 +61,6 @@
.language-menu { .language-menu {
display: flex; display: flex;
padding: 3px 10px;
flex-direction: column; flex-direction: column;
position: absolute; position: absolute;
right: 0; right: 0;
@@ -70,23 +69,22 @@
z-index: 1800; z-index: 1800;
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 8px; border-radius: 8px;
box-sizing: border-box;
opacity: 0; opacity: 0;
visibility: hidden;
max-height: calc(100vh - 50px); max-height: calc(100vh - 50px);
overflow-y: auto; overflow-y: auto;
transform: translateY(-10px); transform: translateY(-30px) scale(0);
transform-origin: top right;
transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1); transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
} }
.language-menu.show { .language-menu.show {
display: block;
opacity: 1; opacity: 1;
visibility: visible; transform: translateY(0) scale(1);
transform: translateY(0);
} }
.language-option { .language-option {
padding: 8px 5px; padding: 8px 10px;
text-align: left; text-align: left;
color: #333; color: #333;
background-color: white; background-color: white;
@@ -94,14 +92,31 @@
font-size: 16px; font-size: 16px;
width: 100%; width: 100%;
white-space: nowrap; white-space: nowrap;
border-bottom: 1px solid #ccc;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
user-select: none; user-select: none;
} }
.language-option::after {
content: "";
position: absolute;
bottom: 0;
left: 10px;
width: calc(100% - 20px);
height: 1px;
background-color: #ccc;
}
.language-option:last-child::after {
content: none;
}
.language-option:first-child {
padding-top: 10px;
}
.language-option:last-child { .language-option:last-child {
border-bottom: none; padding-bottom: 10px;
} }
.language-overlay { .language-overlay {
@@ -228,7 +243,7 @@
border: 1px solid #6E6E6E; border: 1px solid #6E6E6E;
} }
.language-option { .language-option::after {
border-bottom: 1px solid #6E6E6E; background-color: #6E6E6E;
} }
} }

View File

@@ -98,9 +98,9 @@
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 8px; border-radius: 8px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
box-sizing: border-box;
display: flex; display: flex;
position: absolute; position: absolute;
padding: 5px 12px;
top: 110%; top: 110%;
right: 0; right: 0;
z-index: 1200; z-index: 1200;
@@ -131,17 +131,33 @@
} }
.menu-options li { .menu-options li {
cursor: default; padding: 12px 15px;
padding: 12px 4px;
text-align: left; text-align: left;
background-color: white; background-color: white;
border-bottom: 1px solid #ccc;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
.menu-options li::after {
content: "";
position: absolute;
bottom: 0;
left: 15px;
width: calc(100% - 30px);
height: 1px;
background-color: #ccc;
}
.menu-options li:last-child::after {
content: none;
}
.menu-options li:first-child {
padding-top: 16px;
}
.menu-options li:last-child { .menu-options li:last-child {
border-bottom: none; padding-bottom: 16px;
} }
.menu-overlay { .menu-overlay {
@@ -181,6 +197,9 @@
.menu-options li { .menu-options li {
background-color: #343434; background-color: #343434;
border-bottom: 1px solid #6E6E6E; }
.menu-options li::after {
background-color: #6E6E6E
} }
} }