From d81c494ba2a5845afc255c2c7c348d5b954b8dcf Mon Sep 17 00:00:00 2001 From: Yule Date: Fri, 10 Apr 2026 04:49:12 +0800 Subject: [PATCH] =?UTF-8?q?style(webui):=20Web=20UI=20=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webui/src/App.vue | 38 ++++++++++++++++++++---------- webui/src/components.css | 1 + webui/src/components/BottomNav.vue | 8 +++---- webui/src/log.css | 4 +--- webui/src/style.css | 38 ++++++++++++++++++++++++++++-- webui/src/views/ConfigView.vue | 2 +- webui/src/views/StatusView.vue | 4 ++-- 7 files changed, 70 insertions(+), 25 deletions(-) diff --git a/webui/src/App.vue b/webui/src/App.vue index 03f954a..78415bc 100644 --- a/webui/src/App.vue +++ b/webui/src/App.vue @@ -1,5 +1,5 @@ @@ -138,12 +148,16 @@ function handleViewChange(view) { - - - - - - + +
+
+
+
+
+
+
+
+
diff --git a/webui/src/components.css b/webui/src/components.css index ab3a9ad..232dcbb 100644 --- a/webui/src/components.css +++ b/webui/src/components.css @@ -383,6 +383,7 @@ input:checked + .slider:before { appearance: none; cursor: grab; transition: + background 0.35s ease, height 0.2s, box-shadow 0.2s; border: 1px solid rgba(255, 255, 255, 0.03); diff --git a/webui/src/components/BottomNav.vue b/webui/src/components/BottomNav.vue index e683607..102dbc6 100644 --- a/webui/src/components/BottomNav.vue +++ b/webui/src/components/BottomNav.vue @@ -23,18 +23,16 @@ const navbarEl = ref(null) const sliderEl = ref(null) const btnRefs = ref([]) +const TRANSITION_ON = 'transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), width 0.3s ease' + function updateSlider(key, animate = true) { const idx = navItems.findIndex((n) => n.key === key) if (idx < 0) return const btn = btnRefs.value[idx] if (!btn || !sliderEl.value) return - if (!animate) sliderEl.value.style.transition = 'none' + sliderEl.value.style.transition = animate ? TRANSITION_ON : 'none' sliderEl.value.style.width = btn.offsetWidth + 'px' sliderEl.value.style.transform = `translateX(${btn.offsetLeft}px)` - if (!animate) - requestAnimationFrame(() => { - if (sliderEl.value) sliderEl.value.style.transition = '' - }) } function select(key) { diff --git a/webui/src/log.css b/webui/src/log.css index 6b15b4d..dbeab64 100644 --- a/webui/src/log.css +++ b/webui/src/log.css @@ -152,9 +152,7 @@ height: auto; background: var(--md-sys-color-primary-container); border-radius: 20px; - transition: - transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), - width 0.3s ease; + will-change: transform, width; pointer-events: none; z-index: 0; } diff --git a/webui/src/style.css b/webui/src/style.css index 41ebb5c..79b2f40 100644 --- a/webui/src/style.css +++ b/webui/src/style.css @@ -78,11 +78,45 @@ body::-webkit-scrollbar { } #app { - padding: 12px; - padding-bottom: calc(12px + 80px); + padding: 0; max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; + height: 100dvh; + overflow: hidden; +} + +/* 滑动页面轨道 */ +.page-viewport { + flex: 1; + min-height: 0; + overflow: hidden; + position: relative; +} + +.page-track { + display: flex; + height: 100%; + transition: transform 0.38s cubic-bezier(0.25, 1, 0.5, 1); + will-change: transform; +} + +.page-slide { + width: 100%; + flex-shrink: 0; + height: 100%; + overflow-y: auto; + overflow-x: hidden; + padding: 12px; + padding-bottom: calc(16px + 80px + var(--safe-area-inset-bottom, 0px)); + scrollbar-width: none; + -ms-overflow-style: none; + display: flex; + flex-direction: column; gap: var(--spacing-m); } + +.page-slide::-webkit-scrollbar { + display: none; +} diff --git a/webui/src/views/ConfigView.vue b/webui/src/views/ConfigView.vue index a5547a0..f01193a 100644 --- a/webui/src/views/ConfigView.vue +++ b/webui/src/views/ConfigView.vue @@ -42,7 +42,7 @@ function setTheme(v) { } async function viewInotifyHelp() { - const msg = `支持的事件字母 (toybox inotifyd 兼容): + const msg = `支持的事件字母 (toybox/busybox inotifyd 兼容): a = accessed 读取 c = modified 内容修改 (亮度节点推荐用此) e = metadata change 属性变更 diff --git a/webui/src/views/StatusView.vue b/webui/src/views/StatusView.vue index 37b0525..5a8d877 100644 --- a/webui/src/views/StatusView.vue +++ b/webui/src/views/StatusView.vue @@ -64,8 +64,8 @@ async function onSliderChange(e) { const statusItems = computed(() => [ { label: '当前亮度', value: status.currentBri.value || '—', icon: SunMedium }, { label: '系统最大亮度', value: status.sysMaxBri.value || '—', icon: Smartphone }, - { label: 'inotifyd PID', value: status.inotifydPid.value, icon: Activity }, - { label: 'inotifyd 状态', value: status.inotifydState.value, icon: Clock }, + { label: 'lumipro PID', value: status.inotifydPid.value, icon: Activity }, + { label: 'lumipro 状态', value: status.inotifydState.value, icon: Clock }, { label: '休眠状态', value: status.sleepStatus.value, icon: Moon }, { label: 'HDR/SDR 比率', value: status.hdrRatio.value, icon: Layers }, ])