UPD: UI Animations

This commit is contained in:
Robert Kossessa
2024-02-07 00:23:36 +01:00
parent 58f0509d87
commit e01541d06d
7 changed files with 37 additions and 20 deletions

View File

@@ -1,16 +1,19 @@
<template>
<div class="p-2 border-solid border-0 border-b">
<div class="flex rounded-lg overflow-hidden border border-zinc-800">
<TabSelectButton
v-for="(option, key) in options" :key="key"
:ref="(el) => buttons[key] = el"
:title="$t(option.titleKey)"
:icon="option.icon" :selected="model===key"
@select="model=key">
<template v-if="$slots[key]" #replace>
<slot :name="key" />
</template>
</TabSelectButton>
<TransitionGroup name="flex">
<TabSelectButton
v-for="(option, key) in options" :key="key"
:ref="(el) => buttons[key] = el"
:title="$t(option.titleKey)"
:icon="option.icon" :selected="model===key"
class="min-w-0 overflow-hidden"
@select="model=key">
<template v-if="$slots[key]" #replace>
<slot :name="key" />
</template>
</TabSelectButton>
</TransitionGroup>
</div>
</div>
</template>
@@ -73,4 +76,15 @@ defineProps({
}),
},
})
</script>
</script>
<style scoped>
.flex-enter-active,
.flex-leave-active {
transition: flex-grow 75ms;
}
.flex-enter-from,
.flex-leave-to {
flex-grow: 0.000001;
}
</style>

View File

@@ -1,10 +1,10 @@
<template>
<ConfigSection title="Key Light" :icon-component="Lightbulb">
<ConfigSection title="Key Colors" :icon-component="Palette">
<PaletteInput v-model="keyColors" />
</ConfigSection>
</template>
<script setup>
import { Lightbulb } from 'lucide-vue-next'
import { Palette } from 'lucide-vue-next'
import ConfigSection from '@/components/common/ConfigSection.vue'
import PaletteInput from '@/components/common/PaletteInput.vue'
import Color from 'color'

View File

@@ -1,10 +1,10 @@
<template>
<ConfigSection title="Key Mapping" :icon-component="Keyboard">
<ConfigSection title="Key Mapping" :icon-component="PlusSquare">
<WIP />
</ConfigSection>
</template>
<script setup>
import { Keyboard } from 'lucide-vue-next'
import { PlusSquare } from 'lucide-vue-next'
import ConfigSection from '@/components/common/ConfigSection.vue'
import WIP from '@/components/WIP.vue'
</script>

View File

@@ -1,10 +1,10 @@
<template>
<ConfigSection title="Ring Light" :icon-component="Lightbulb">
<ConfigSection title="Ring Colors" :icon-component="Palette">
<PaletteInput v-model="ringColors" />
</ConfigSection>
</template>
<script setup>
import { Lightbulb } from 'lucide-vue-next'
import { Palette } from 'lucide-vue-next'
import ConfigSection from '@/components/common/ConfigSection.vue'
import PaletteInput from '@/components/common/PaletteInput.vue'
import Color from 'color'

View File

@@ -1,10 +1,10 @@
<template>
<ConfigSection title="Knob Mapping" :icon-component="GaugeCircle">
<ConfigSection title="Knob Mapping" :icon-component="PlusCircle">
<WIP />
</ConfigSection>
</template>
<script setup>
import { GaugeCircle } from 'lucide-vue-next'
import { PlusCircle } from 'lucide-vue-next'
import ConfigSection from '@/components/common/ConfigSection.vue'
import WIP from '@/components/WIP.vue'
</script>

View File

@@ -53,7 +53,7 @@
<DeviceKeys
v-if="store.connected"
class="absolute w-[72.7%] top-[77.2%] gap-[2.8%] left-0 right-0 mx-auto"
:selected="store.selectedFeature === 'key' && store.selectedKey"
:selected="store.selectedFeature === 'key' ? store.selectedKey : ''"
@select="store.selectKey" />
</Transition>
</div>

View File

@@ -57,6 +57,9 @@
v-bind="dragOptions"
@change="(event)=>onProfileDrop(event, categoryIndex)"
>
<div v-if="category.profiles.length === 0">
HELLO THERE!
</div>
<template #item="{ element }">
<ProfileButton
:key="element.id"