From 239c69ee40052ff80294ae79492161cae1ccd54c Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sat, 11 Jul 2026 23:21:34 +0200 Subject: [PATCH] feat: mobile UX overhaul, theme flash prevention and build cleanup (#474) * feat: mobile UX overhaul, theme flash prevention and build cleanup UI/UX (mostly mobile): - Prevent white flash on load: pre-paint inline style + script in index.html applies the persisted theme before first paint. - Match browser chrome to the app background: theme-color meta kept in sync for Android/older iOS, and body background pinned to the Layout color for Safari 26+, which ignores theme-color and samples the page. - Make the document the app's scroller instead of n-layout's nested container: single scrollbar, native iOS tap-status-bar-to-scroll-top, natural toolbar collapsing; desktop sider becomes sticky and router scrollBehavior restores/resets scroll on navigation. - Full-width mobile menu that fades in under an always-visible sticky top bar, seamless app background without the hero gradient, closes on navigation (including About while already on /about), scroll-locked behind, symmetric spacing around the title block and icon row. - Language selector and theme toggle become icon dropdowns; theme supports System/Light/Dark via useColorMode (same storage as before). - Route-change loading spinner scoped to the page area so the nav bar stays visible; spinner remains cosmetic-only (350ms delay). - Halve content padding on small screens; reduce home top padding. - Full-width expand/collapse tools button so its width doesn't jump. - No sticky hover styles on touch devices (hover gated behind @media (hover: hover)). Build: - Rename deprecated rolldown output.advancedChunks to codeSplitting. - Fix unocss 'unmatched utility' warnings in the pretty-scrollbar shortcut; override js-sha256 to 0.11.x (drops eval); bump javascript-obfuscator to 5.4.6. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01TNayL5ianBBucVapfkM8CC * Remove unnecessary comment * Refresh lockfile, remove releaseage ignore Signed-off-by: Sebastian Danielsson * chore: remove unused LocaleSelector component Language selection moved into the NavbarButtons dropdown; nothing references this component anymore. Its i18n keys are left in place. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01TNayL5ianBBucVapfkM8CC --------- Signed-off-by: Sebastian Danielsson Co-authored-by: Claude --- index.html | 20 +++- locales/en.yml | 4 + package.json | 4 +- pnpm-lock.yaml | 27 +++-- pnpm-workspace.yaml | 3 + src/App.vue | 23 +++- src/components/CollapsibleToolMenu.vue | 27 +++-- src/components/ColoredCard.vue | 6 +- src/components/MenuLayout.vue | 111 ++++++++++++++++-- src/components/NavbarButtons.vue | 91 ++++++++++++-- src/layouts/base.layout.vue | 73 ++++++++++-- .../i18n/components/locale-selector.vue | 43 ------- src/pages/Home.page.vue | 10 +- src/router.ts | 14 +++ src/stores/style.store.ts | 24 +++- src/themes.ts | 8 ++ src/ui/c-button/c-button.vue | 8 +- src/ui/c-link/c-link.vue | 6 +- unocss.config.ts | 6 +- vite.config.ts | 2 +- 20 files changed, 394 insertions(+), 116 deletions(-) delete mode 100644 src/modules/i18n/components/locale-selector.vue diff --git a/index.html b/index.html index d9893fed..7e024614 100644 --- a/index.html +++ b/index.html @@ -2,6 +2,25 @@ + + + IT Tools - Handy online tools for developers @@ -14,7 +33,6 @@ - diff --git a/locales/en.yml b/locales/en.yml index 817f69bd..cd66cf1e 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -114,6 +114,10 @@ home: lightMode: Light mode mode: Toggle dark/light mode aboutLabel: About + language: Language + themeSystem: System + themeLight: Light + themeDark: Dark page: text: collection-of-handy-online-tools-for-developers-with-great-ux-it-tools-is-a-free-and-open-source-collection-of-handy-online-tools-for-developers-and-people-working-in-it: >- diff --git a/package.json b/package.json index d99bc41c..42f2f1a7 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "it-tools", "type": "module", "version": "2026.1.4", - "packageManager": "pnpm@11.10.0+sha512.0b7f8b98060031904c017e3a41eb187a16d40eeb829b95c4f8cb03681761fc4ab53dd219115b9b447f4dce1a05a214764461e7d3703392a9f32f9511ce8c86c8", + "packageManager": "pnpm@11.11.0+sha512.4463f65fd80ed80d69bc1d4bf163ee94f605c7380fc318bb5b2ebe15f8cd12d49c51a4d59e951b401e764d3b6ca751cbf51bc50ed7001a6bcb4935e684c34882", "description": "Collection of handy online tools for developers, with great UX. ", "author": "Corentin Th (https://corentin.tech)", "license": "GNU GPLv3", @@ -238,7 +238,7 @@ "isbn3": "^2.0.2", "iso-639-1": "^3.1.5", "jasypt": "^1.0.7", - "javascript-obfuscator": "^5.1.0", + "javascript-obfuscator": "^5.4.6", "javastack.js": "^1.0.3", "jks-js": "^1.1.4", "jose": "5.10.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b641b907..71c2efe2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,6 +9,7 @@ overrides: isolated-vm: file:./stubs/empty-stub onnxruntime-node: file:./stubs/empty-stub elliptic: ^6.6.1 + js-sha256: ^0.11.1 xlsx: https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz patchedDependencies: @@ -600,8 +601,8 @@ importers: specifier: ^1.0.7 version: 1.0.7 javascript-obfuscator: - specifier: ^5.1.0 - version: 5.4.3 + specifier: ^5.4.6 + version: 5.4.6 javastack.js: specifier: ^1.0.3 version: 1.0.3 @@ -2664,8 +2665,8 @@ packages: '@it-tools/oggen@1.3.0': resolution: {integrity: sha512-hvPn0mDkbJvA6jDxV3Xw+MIermq+QyrQpUq86KkZXaWLfCIDnLVp3hBmdxpxU4NIckXj5/7eeVg5CvW0kpQBTw==} - '@javascript-obfuscator/escodegen@2.4.1': - resolution: {integrity: sha512-YrEJJDr4cb+pIQKWzHFoDlDkQzatcrNB6OhAD6iTSwiKwzZUMVdobwbOuLpF4EiLxUj0qP28Xl1saTHYzIPCLg==} + '@javascript-obfuscator/escodegen@2.4.2': + resolution: {integrity: sha512-3N7EUdYxuldwvtOtZIlAxNwPW1qTUFwWt3PxNkik6hB1uSSXLXj9JMlSyUbTCXK3Osjn0Nu0s/aa4mbvkGouXQ==} engines: {node: '>=6.0'} '@javascript-obfuscator/estraverse@5.4.0': @@ -7900,8 +7901,8 @@ packages: javascript-natural-sort@0.7.1: resolution: {integrity: sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==} - javascript-obfuscator@5.4.3: - resolution: {integrity: sha512-G5WUgh84tJa5jtk49w+nQCxQpXIvp65xhLyaFeTAdQeYqWji+SXo89k96UvYIDqojyWZEWSDKRmaWKK6bBn/2A==} + javascript-obfuscator@5.4.6: + resolution: {integrity: sha512-AkcObe46EfyF3nMUB9tSNgf612IN00gA+RhD7T5JL4vIdCfMtK+gZznl2niI5dwiwYUUfdBVjfctjHbePnz3rQ==} engines: {node: '>=18.0.0'} hasBin: true @@ -7956,8 +7957,8 @@ packages: js-cookie@3.0.8: resolution: {integrity: sha512-yeJd4aNAdYZQjaon2bpD/Gb0B/omw7HQOsynXXcOiWVCacbBcPlgn8S/d1X6blFSaHao7ozqtW7NZW19xpCtIw==} - js-sha256@0.9.0: - resolution: {integrity: sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==} + js-sha256@0.11.1: + resolution: {integrity: sha512-o6WSo/LUvY2uC4j7mO50a2ms7E/EAdbP0swigLV+nzHKTTaYnaLIWJ02VdXrsJX0vGedDESQnLsOekr94ryfjg==} js-string-escape@1.0.1: resolution: {integrity: sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==} @@ -13036,12 +13037,12 @@ snapshots: '@it-tools/bip39@0.0.4': dependencies: - js-sha256: 0.9.0 + js-sha256: 0.11.1 nanoid: 3.3.15 '@it-tools/oggen@1.3.0': {} - '@javascript-obfuscator/escodegen@2.4.1': + '@javascript-obfuscator/escodegen@2.4.2': dependencies: '@javascript-obfuscator/estraverse': 5.4.0 esprima: 4.0.1 @@ -18546,9 +18547,9 @@ snapshots: javascript-natural-sort@0.7.1: {} - javascript-obfuscator@5.4.3: + javascript-obfuscator@5.4.6: dependencies: - '@javascript-obfuscator/escodegen': 2.4.1 + '@javascript-obfuscator/escodegen': 2.4.2 '@javascript-obfuscator/estraverse': 5.4.0 '@vercel/blob': 2.5.0 acorn: 8.15.0 @@ -18632,7 +18633,7 @@ snapshots: js-cookie@3.0.8: {} - js-sha256@0.9.0: {} + js-sha256@0.11.1: {} js-string-escape@1.0.1: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 18ab3dea..8765fc0c 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -13,6 +13,9 @@ overrides: isolated-vm: file:./stubs/empty-stub onnxruntime-node: file:./stubs/empty-stub elliptic: ^6.6.1 + # @it-tools/bip39 pins ^0.9.0, whose Node fallback uses eval("require('crypto')") + # and triggers rolldown EVAL build warnings; 0.11.x dropped the eval. + js-sha256: ^0.11.1 xlsx: https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz patchedDependencies: diff --git a/src/App.vue b/src/App.vue index 251f6b73..f9c4c263 100644 --- a/src/App.vue +++ b/src/App.vue @@ -78,6 +78,8 @@ body { min-height: 100%; margin: 0; padding: 0; + /* The document scrolls vertically (see MenuLayout.vue); never horizontally */ + overflow-x: hidden; -webkit-overflow-scrolling: touch; } @@ -85,10 +87,10 @@ body { box-sizing: border-box; } +/* No transform/contain here: they would make .app-root the containing block + for position:fixed descendants (the mobile menu), and the old inner-scroll + perf rationale no longer applies now that the document is the scroller. */ .app-root { - contain: layout style paint; - -webkit-transform: translateZ(0); - transform: translateZ(0); -webkit-overflow-scrolling: touch; } @@ -97,13 +99,24 @@ body .vld-container { left: 0; top: 0; width: 100%; - height: 100vh; background-color: var(--loading-background-color); - z-index: 9999; text-align: center; pointer-events: none; } +/* Fullscreen fallback: overlay mounted on (first navigation) */ +body > .vld-container { + height: 100vh; + z-index: 9999; +} + +/* Route-change overlay scoped to the page area (see router.ts) */ +.page-content > .vld-container { + height: 100%; + min-height: 350px; + z-index: 100; +} + body .vld-container.vl-active { pointer-events: auto; } diff --git a/src/components/CollapsibleToolMenu.vue b/src/components/CollapsibleToolMenu.vue index dfae5482..7e67fbd7 100644 --- a/src/components/CollapsibleToolMenu.vue +++ b/src/components/CollapsibleToolMenu.vue @@ -139,8 +139,10 @@ const themeVars = useThemeVars();