diff --git a/frontend/src/assets/main.css b/frontend/src/assets/main.css index 5b965be..272a060 100644 --- a/frontend/src/assets/main.css +++ b/frontend/src/assets/main.css @@ -924,8 +924,7 @@ button { box-shadow: inset 0 0 0 3px #000; } .photos-app, -.store-app, -.settings-app { +.store-app { background: #000; } .photo-grid { @@ -1041,43 +1040,6 @@ button { color: #0a84ff; font-weight: 700; } -.settings-app { - overflow: auto; - padding-bottom: 48px; -} -.settings-section-title { - margin: 24px 18px 8px; - color: #8e8e93; - text-transform: uppercase; - font-size: 12px; -} -.settings-app .settings-list { - margin: 14px 17px; -} -.settings-symbol { - width: 28px; - height: 28px; - border-radius: 7px; - display: grid; - place-items: center; - color: white; -} -.wallpaper-picker { - margin: 0 17px; - display: grid; - grid-template-columns: repeat(3, 1fr); - gap: 12px; -} -.wallpaper-picker button { - height: 128px; - border: 3px solid transparent; - border-radius: 14px; - background-size: cover; -} -.wallpaper-picker button.active { - border-color: #0a84ff; -} - /* Reference-accurate app surfaces. These remain scoped to the phone resource. */ .calculator-app { padding: 54px 16px 27px; @@ -1654,224 +1616,6 @@ button { padding: 0; } -.reference-settings { - padding: 0; - background: #0e0e0e; -} -.settings-scroll { - height: 100%; - padding: 69px 16px 38px; - overflow-y: auto; -} -.settings-scroll > h1 { - margin: 0 0 17px; - font-size: 35px; - line-height: 1; -} -.settings-search { - height: 36px; - display: flex; - align-items: center; - gap: 7px; - padding: 0 9px; - border-radius: 9px; - background: #1c1c1e; - color: #777; -} -.settings-search input { - width: 100%; - border: 0; - outline: 0; - background: transparent; - color: white; - font-size: 16px; -} -.settings-account { - margin: 17px 0; - padding: 10px; - display: flex; - align-items: center; - gap: 12px; - border-radius: 12px; - background: #1c1c1e; -} -.settings-account > span { - width: 58px; - height: 58px; - display: grid; - place-items: center; - border-radius: 50%; - background: linear-gradient(145deg, #596172, #22252c); -} -.settings-account > div { - flex: 1; - display: flex; - flex-direction: column; -} -.settings-account strong { - font-size: 17px; -} -.settings-account small { - color: #ccc; - font-size: 11px; -} -.reference-settings-group { - margin-bottom: 17px; - padding: 0 11px; - overflow: hidden; - border-radius: 12px; - background: #1c1c1e; -} -.reference-settings-group article { - min-height: 44px; - display: flex; - align-items: center; - gap: 12px; -} -.reference-settings-group article:not(:last-child) > div { - border-bottom: 1px solid #ffffff18; -} -.reference-settings-group article > div { - min-width: 0; - flex: 1; - align-self: stretch; - display: flex; - align-items: center; - justify-content: space-between; -} -.reference-settings-group article > div strong { - font-size: 14px; - font-weight: 400; -} -.reference-settings-group article > div small { - max-width: 100px; - overflow: hidden; - color: #999; - font-size: 12px; - text-overflow: ellipsis; - white-space: nowrap; -} -.reference-settings-group .settings-symbol { - width: 27px; - height: 27px; - flex: none; - border-radius: 6px; -} -.settings-chevron { - color: #555; -} -.reference-settings .wallpaper-picker button { - height: 105px; -} -.konsta-settings { - padding: 0; - overflow: hidden; - background: #000; - color: #fff; -} -.settings-konsta-list { - margin-top: 17px !important; - margin-bottom: 17px !important; -} -.settings-konsta-navbar { - z-index: 8; - margin-top: 44px; - flex: none; -} -.settings-subpage-scroll { - height: calc(100% - 88px); - padding: 1px 0 48px; - overflow-y: auto; -} -.settings-app-icon { - width: 32px; - height: 32px; - display: block; - object-fit: contain; -} -.settings-notification-app { - padding: 20px 20px 3px; - display: flex; - flex-direction: column; - align-items: center; - gap: 9px; -} -.settings-notification-app img { - width: 66px; - height: 66px; - object-fit: contain; -} -.settings-notification-app strong { - font-size: 17px; -} -.settings-range-row, -.settings-scale-row { - width: 100%; - display: flex; - align-items: center; - gap: 11px; -} -.settings-range-row > div, -.settings-scale-row > div { - flex: 1; -} -.settings-scale-row > span { - font-size: 13px; -} -.settings-scale-row > strong { - font-size: 21px; -} -.settings-check { - color: #0a84ff; -} -.settings-frame-picker { - margin: 0 16px 22px; - display: grid; - grid-template-columns: repeat(3, 1fr); - gap: 11px; -} -.settings-frame-picker button { - min-width: 0; - padding: 9px 6px 7px; - display: flex; - flex-direction: column; - align-items: center; - gap: 6px; - border: 2px solid transparent; - border-radius: 13px; - background: #1c1c1e; - color: inherit; - font-size: 10px; -} -.settings-frame-picker button.active { - border-color: #0a84ff; -} -.settings-frame-picker img { - width: 40px; - height: 82px; - object-fit: fill; -} -.settings-wallpaper-picker { - margin-top: 10px; -} -.phone-app--light .konsta-settings { - background: #f2f2f7; - color: #000; -} -.phone-app--light .settings-search, -.phone-app--light .settings-account, -.phone-app--light .settings-frame-picker button { - background: #fff; -} -.phone-app--light .settings-search { - color: #8e8e93; -} -.phone-app--light .settings-search input { - color: #000; -} -.phone-app--light .settings-account small { - color: #666; -} .phone-screen--app .phone-app--light .phone-status-bar { color: #000; } diff --git a/frontend/src/views/apps/SettingsApp.vue b/frontend/src/views/apps/SettingsApp.vue index ad47a78..82f96d1 100644 --- a/frontend/src/views/apps/SettingsApp.vue +++ b/frontend/src/views/apps/SettingsApp.vue @@ -7,23 +7,11 @@ import { kNavbarBackLink, kPage, kRange, + kSearchbar, kToggle, } from 'konsta/vue' -import { - BellRing, - Check, - ChevronRight, - EyeOff, - Monitor, - Plane, - Search, - Settings, - Sun, - UserRound, - Volume1, - Volume2, -} from 'lucide-vue-next' -import { computed, ref } from 'vue' +import { Check, UserRound } from 'lucide-vue-next' +import { computed, nextTick, ref, type ComponentPublicInstance } from 'vue' import { PHONE_FRAME_IMAGES } from '@/config/appearance' import { PHONE_APPS } from '@/config/apps' @@ -56,44 +44,20 @@ const phone = usePhoneStore() const query = ref('') const activeView = ref('root') const selectedNotificationAppId = ref('calculator') +const settingsPage = ref(null) const toggleRows = [ - { key: 'airplaneMode' as const, icon: Plane, color: '#ff9500' }, - { key: 'streamerMode' as const, icon: EyeOff, color: '#af52de' }, + { key: 'airplaneMode' as const }, + { key: 'streamerMode' as const }, ] const serviceRows = [ - { - key: 'notifications', - view: 'notifications' as const, - icon: BellRing, - color: '#ff453a', - }, - { - key: 'sounds', - view: 'sounds' as const, - icon: Volume2, - color: '#ff2d55', - }, + { key: 'notifications', view: 'notifications' as const }, + { key: 'sounds', view: 'sounds' as const }, ] const preferenceRows = [ - { - key: 'general', - view: 'general' as const, - icon: Settings, - color: '#8e8e93', - }, - { - key: 'appearance', - view: 'appearance' as const, - icon: Sun, - color: '#0a84ff', - }, - { - key: 'wallpaper', - view: 'wallpaper' as const, - icon: Monitor, - color: '#64d2ff', - }, + { key: 'general', view: 'general' as const }, + { key: 'appearance', view: 'appearance' as const }, + { key: 'wallpaper', view: 'wallpaper' as const }, ] const normalizedQuery = computed(() => query.value.trim().toLowerCase()) @@ -133,25 +97,39 @@ function matchesSearch(key: string): boolean { ) } +function updateSearch(event: Event): void { + query.value = (event.target as HTMLInputElement).value +} + function openView(view: SubmenuView): void { activeView.value = view + scrollPageToTop() } function openNotificationApp(app: PhoneAppDefinition): void { selectedNotificationAppId.value = app.id activeView.value = 'notification-detail' + scrollPageToTop() } function goBack(): void { activeView.value = activeView.value === 'notification-detail' ? 'notifications' : 'root' + scrollPageToTop() +} + +function scrollPageToTop(): void { + void nextTick(() => { + const pageElement = settingsPage.value?.$el as HTMLElement | undefined + pageElement?.scrollTo({ top: 0 }) + }) } function toggleRootSetting(key: RootToggleKey): void { phone.setPreference(key, !phone.preferences.settings[key]) } -function updateVolume( +function updateNumberPreference( key: 'notificationVolume' | 'phoneScale' | 'ringtoneVolume', event: Event, ): void { @@ -179,43 +157,41 @@ function selectNotificationSound(sound: NotificationSoundId): void {