INIT: initial commit
This commit is contained in:
parent
bdcf50ca0b
commit
78e0ff6ac9
10 changed files with 217 additions and 8 deletions
28
app/components/MoodDropdown.vue
Normal file
28
app/components/MoodDropdown.vue
Normal file
|
@ -0,0 +1,28 @@
|
|||
<template>
|
||||
<aside class="MoodDropdown">
|
||||
<button
|
||||
v-for="[moodName, mood] in availableMoods"
|
||||
:key="mood.label"
|
||||
:style="{
|
||||
'--background': `var(--clr-${mood.color}-light)`,
|
||||
'--color': `var(--clr-${mood.color}-dark)`,
|
||||
}"
|
||||
@click="changeMood(moodName)"
|
||||
>
|
||||
<Icon class="icon" :name="`mingcute:${mood.icon}`" mode="svg" />
|
||||
<span>{{ mood.label }}</span>
|
||||
</button>
|
||||
</aside>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { type Mood, moods, type PossibleMood } from '../../shared/moods'
|
||||
|
||||
const availableMoods = computed<[PossibleMood, Mood][]>(() => Object.entries(moods))
|
||||
|
||||
const emit = defineEmits(['changeMood'])
|
||||
|
||||
const changeMood = (newMood : PossibleMood) => {
|
||||
emit('changeMood', newMood)
|
||||
}
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue