From dc317d53e57824fdf32d0de9053f193dd419b411 Mon Sep 17 00:00:00 2001 From: Pihkaal Date: Sat, 27 Dec 2025 16:48:10 +0100 Subject: [PATCH] feat(settings/user/color): implement basic color picker without animations --- .../Settings/BottomScreen/Menus/Menus.vue | 5 + .../BottomScreen/Menus/User/Color.vue | 100 ++++++++++++++++++ app/stores/app.ts | 15 +++ app/utils/app.ts | 6 ++ .../bottom-screen/user/color-palette.webp | Bin 0 -> 304 bytes .../bottom-screen/user/color-selector.webp | Bin 0 -> 62 bytes 6 files changed, 126 insertions(+) create mode 100644 app/components/Settings/BottomScreen/Menus/User/Color.vue create mode 100644 app/utils/app.ts create mode 100644 public/images/settings/bottom-screen/user/color-palette.webp create mode 100644 public/images/settings/bottom-screen/user/color-selector.webp diff --git a/app/components/Settings/BottomScreen/Menus/Menus.vue b/app/components/Settings/BottomScreen/Menus/Menus.vue index f3c33a6..2c98be4 100644 --- a/app/components/Settings/BottomScreen/Menus/Menus.vue +++ b/app/components/Settings/BottomScreen/Menus/Menus.vue @@ -4,6 +4,8 @@ import OptionsStartUp from "./Options/StartUp.vue"; import OptionsLanguage from "./Options/Language.vue"; import OptionsGbaMode from "./Options/GbaMode.vue"; +import UserColor from "./User/Color.vue"; + import ClockMenu from "./Clock/Menu.vue"; import UserMenu from "./User/Menu.vue"; import TouchScreenMenu from "./TouchScreen/Menu.vue"; @@ -113,6 +115,7 @@ const { selectedButton: selected, selectorPosition } = useButtonNavigation({ left: "user", }, }, + disabled: computed(() => settingsStore.currentSubMenu !== null), }); const isSubmenu = (buttonName: string) => { @@ -170,6 +173,8 @@ const viewComponents: Record = { optionsStartUp: OptionsStartUp, optionsLanguage: OptionsLanguage, optionsGbaMode: OptionsGbaMode, + + userColor: UserColor, }; diff --git a/app/components/Settings/BottomScreen/Menus/User/Color.vue b/app/components/Settings/BottomScreen/Menus/User/Color.vue new file mode 100644 index 0000000..133f759 --- /dev/null +++ b/app/components/Settings/BottomScreen/Menus/User/Color.vue @@ -0,0 +1,100 @@ + diff --git a/app/stores/app.ts b/app/stores/app.ts index a92e724..d223abe 100644 --- a/app/stores/app.ts +++ b/app/stores/app.ts @@ -1,5 +1,20 @@ export const useAppStore = defineStore("app", { state: () => ({ booted: false, + _color: { col: 0, row: 0 }, }), + + actions: { + setColor(col: number, row: number) { + this._color = { col, row }; + }, + }, + + getters: { + color: (state) => ({ + col: state._color.col, + row: state._color.row, + hex: APP_COLORS[state._color.row]![state._color.col]!, + }), + }, }); diff --git a/app/utils/app.ts b/app/utils/app.ts new file mode 100644 index 0000000..fc46bc7 --- /dev/null +++ b/app/utils/app.ts @@ -0,0 +1,6 @@ +export const APP_COLORS = [ + ["#61829a", "#ba4900", "#fb0018", "#fb8afb"], + ["#fb9200", "#f3e300", "#aafb00", "#00fb00"], + ["#00a238", "#49db8a", "#30baf3", "#0059f3"], + ["#000092", "#8a00d3", "#d300eb", "#fb0092"], +]; diff --git a/public/images/settings/bottom-screen/user/color-palette.webp b/public/images/settings/bottom-screen/user/color-palette.webp new file mode 100644 index 0000000000000000000000000000000000000000..fc1fc5641da1b208d4559fdc16c743174a73f87c GIT binary patch literal 304 zcmV-00nh$YNk&E}0RRA3MM6+kP&iB+0RR9m-~b>HHMp&{Jxj74Be;&GB_mKWf~_N1 zS~3D<+HjtuZ+PQh0CTtr?arBc0^Y4B|cn z5kz}B$s^S|7Lz>E_8HJW_iB**2=8x{ffMa|Q~3X literal 0 HcmV?d00001