diff --git a/src/App.vue b/src/App.vue
index 5ac70cf..7abd66b 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -4,12 +4,9 @@ import DevicePreview from '@/components/device/DevicePreview.vue'
import ConfigPane from '@/components/config/ConfigPane.vue'
import Navbar from '@/components/Navbar.vue'
import { useStore } from '@/store'
-import { ref } from 'vue'
const store = useStore()
-const currentConfigPage = ref(0)
-
store.fetchProfiles()
@@ -20,10 +17,8 @@ store.fetchProfiles()
+ class="basis-1/3 flex-col flex-1 flex border-solid border-0 border-r" />
diff --git a/src/components/config/ConfigPane.vue b/src/components/config/ConfigPane.vue
index 04d2c19..b02aebd 100644
--- a/src/components/config/ConfigPane.vue
+++ b/src/components/config/ConfigPane.vue
@@ -1,61 +1,12 @@
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/src/components/config/PaletteInput.vue b/src/components/config/PaletteInput.vue
index 51c51b3..157ab5a 100644
--- a/src/components/config/PaletteInput.vue
+++ b/src/components/config/PaletteInput.vue
@@ -5,7 +5,7 @@
class="flex-1 pt-2 items-center text-center"
:class="currentOption!==key ? 'hover:bg-zinc-800 text-zinc-200' : 'text-black bg-zinc-200 hover:bg-zinc-100'"
@click="currentOption = key">
- {{ $t(option.key) }}
+ {{ $t(option.titleKey) }}
@@ -15,6 +15,7 @@
import HSVInput from '@/components/config/HSVInput.vue'
import Color from 'color'
import { onBeforeMount, reactive, ref } from 'vue'
+import TabSelect from '@/components/config/TabSelect.vue'
const currentOption = ref(null)
@@ -22,15 +23,15 @@ const model = defineModel({
type: Object,
default: () => ({
one: {
- key: 'One',
+ titleKey: 'One',
color: Color('#ff0000'),
},
two: {
- key: 'Two',
+ titleKey: 'Two',
color: Color('#00ff00'),
},
three: {
- key: 'Three',
+ titleKey: 'Three',
color: Color('#0000ff'),
},
}),
diff --git a/src/components/config/pages/KeyConfig.vue b/src/components/config/pages/KeyConfig.vue
new file mode 100644
index 0000000..334faf2
--- /dev/null
+++ b/src/components/config/pages/KeyConfig.vue
@@ -0,0 +1,23 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/config/pages/KnobConfig.vue b/src/components/config/pages/KnobConfig.vue
new file mode 100644
index 0000000..b13c8dd
--- /dev/null
+++ b/src/components/config/pages/KnobConfig.vue
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/device/DevicePreview.vue b/src/components/device/DevicePreview.vue
index 9097e9f..c7b3dc7 100644
--- a/src/components/device/DevicePreview.vue
+++ b/src/components/device/DevicePreview.vue
@@ -28,12 +28,13 @@
+ :class="{'outline outline-white': store.currentConfigPage==='knob',
+ 'hover:outline outline-zinc-400': store.currentConfigPage!=='knob'}"
+ @click="store.setCurrentConfigPage('knob')" />
{selected=args; $emit('select', selected)}" />
+ class="absolute w-[72.7%] top-[77.2%] gap-[2.8%] left-0 right-0 mx-auto"
+ :selected="store.currentConfigPage"
+ @select="store.setCurrentConfigPage" />
@@ -48,10 +49,6 @@ import DeviceLEDRing from '@/components/device/DeviceLEDRing.vue'
import gsap from 'gsap'
import DeviceKeys from '@/components/device/DeviceKeys.vue'
-defineEmits(['select'])
-
-const selected = ref('a')
-
const value = ref(69)
const barValue = computed(() => value.value / 127 * 100)
diff --git a/src/components/profile/ProfileManager.vue b/src/components/profile/ProfileManager.vue
index 7262da5..42a3ccd 100644
--- a/src/components/profile/ProfileManager.vue
+++ b/src/components/profile/ProfileManager.vue
@@ -10,8 +10,8 @@
diff --git a/src/store.js b/src/store.js
index 3b11526..11bf066 100644
--- a/src/store.js
+++ b/src/store.js
@@ -19,6 +19,8 @@ import { createPinia, defineStore } from 'pinia'
import Axios from 'axios'
import schema from '@/data/profileSchema.json'
import Ajv from 'ajv'
+import KnobConfig from '@/components/config/pages/KnobConfig.vue'
+import KeyConfig from '@/components/config/pages/KeyConfig.vue'
const ajv = new Ajv()
@@ -29,11 +31,28 @@ export const useStore = defineStore('main', {
profiles: [],
selectedProfileId: null,
connected: false,
+ currentConfigPage: 'knob',
}
},
getters: {
profileIds: (state) => state.profiles.map(p => p.id),
selectedProfile: (state) => state.profiles.find(p => p.id === state.selectedProfileId),
+ currentConfigComponent: (state) => {
+ switch (state.currentConfigPage) {
+ case 'knob':
+ return KnobConfig
+ case 'a':
+ return KeyConfig
+ case 'b':
+ return KeyConfig
+ case 'c':
+ return KeyConfig
+ case 'd':
+ return KeyConfig
+ default:
+ return KnobConfig
+ }
+ },
},
actions: {
selectProfile(id) {
@@ -110,6 +129,9 @@ export const useStore = defineStore('main', {
}
return id
},
+ setCurrentConfigPage(page) {
+ this.currentConfigPage = page
+ },
},
})