add: new emotions with colors

Added new emotions with respective colors, removed old useless ones
This commit is contained in:
webfussel 2025-07-17 14:32:49 +02:00
parent c423c854fe
commit 3bbcfa529c
6 changed files with 183 additions and 86 deletions

BIN
public/img/nav.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View file

@ -34,29 +34,35 @@ import Navigation from './components/Sections/Navigation.vue'
--clr-error: #851919; --clr-error: #851919;
--clr-error-contrast: #ffffff; --clr-error-contrast: #ffffff;
--clr-happy-dark: #009933; --clr-happy-dark: #007822;
--clr-happy-light: #d1ffe8; --clr-happy-light: #eefff4;
--clr-sad-dark: #252ed5; --clr-relaxed-dark: #0093c1;
--clr-sad-light: #e5ecfc; --clr-relaxed-light: #E5F9FF;
--clr-disappointed-dark: #ab6b0e; --clr-content-dark: #499009;
--clr-disappointed-light: #fffbd8; --clr-content-light: #F1FAEA;
--clr-angry-dark: #851919; --clr-sad-dark: #001f88;
--clr-angry-light: #ffe5e5; --clr-sad-light: #ECEFF7;
--clr-empty-dark: #595959; --clr-angry-dark: #840b15;
--clr-empty-light: #f1f1f1; --clr-angry-light: #FDE7E9;
--clr-dead-dark: #ffffff; --clr-disappointed-dark: #8c0095;
--clr-dead-light: #000000; --clr-disappointed-light: #fce2ff;
--clr-sick-dark: #87ad00; --clr-empty-dark: #262626;
--clr-sick-light: #edffd8; --clr-empty-light: #F2F2F2;
--clr-pissed-dark: #7853ff; --clr-scared-dark: #c35700;
--clr-pissed-light: #f1efff; --clr-scared-light: #FFEAE5;
--clr-nervous-dark: #b6820f;
--clr-nervous-light: #FFF7E5;
--clr-panic-dark: #3F0D10;
--clr-panic-light: #f0e9ea;
--clr-current-dark: var(--clr-happy-dark); --clr-current-dark: var(--clr-happy-dark);
--clr-current-light: var(--clr-happy-light); --clr-current-light: var(--clr-happy-light);
@ -69,6 +75,7 @@ import Navigation from './components/Sections/Navigation.vue'
--font-size-l: calc(var(--font-size-default) * var(--scaling-factor)); --font-size-l: calc(var(--font-size-default) * var(--scaling-factor));
--font-size-xl: calc(var(--font-size-l) * var(--scaling-factor)); --font-size-xl: calc(var(--font-size-l) * var(--scaling-factor));
--font-size-xxl: calc(var(--font-size-xl) * var(--scaling-factor)); --font-size-xxl: calc(var(--font-size-xl) * var(--scaling-factor));
--font-size-xxxl: calc(var(--font-size-xxl) * var(--scaling-factor));
/* Paddings depend on Font-Size */ /* Paddings depend on Font-Size */
--padding-xxs: calc(var(--padding-xs) / var(--scaling-factor)); --padding-xxs: calc(var(--padding-xs) / var(--scaling-factor));

View file

@ -16,12 +16,12 @@
<button <button
v-for="[, mood] in availableMoods" v-for="[, mood] in availableMoods"
:class="{ :class="{
active: currentMood?.color === mood.color, active: currentMood?.id === mood.id,
}" }"
:key="mood.label" :key="mood.label"
:style="{ :style="{
'--color': `var(--clr-${mood.color}-dark)`, '--color': `var(--clr-${mood.id}-dark)`,
'--background-active': `var(--clr-${mood.color}-light)`, '--background-active': `var(--clr-${mood.id}-light)`,
}" }"
@click="changeMood(mood)" @click="changeMood(mood)"
> >

View file

@ -1,7 +1,12 @@
<template> <template>
<section class="Navigation" :class="{ open }"> <section class="Navigation" :class="{ open }">
<nav ref="nav"> <nav ref="nav">
<ul class="points"> <header>
<img src="/img/nav.jpg" alt="" aria-hidden="true" />
<strong>Soul Echo</strong>
</header>
<div class="points">
<ul>
<li v-for="page in pages"> <li v-for="page in pages">
<RouterLink :to="page.route" @click="close()" active-class="active"> <RouterLink :to="page.route" @click="close()" active-class="active">
<FontAwesomeIcon class="icon" :icon="page.icon" /> <FontAwesomeIcon class="icon" :icon="page.icon" />
@ -9,6 +14,15 @@
</RouterLink> </RouterLink>
</li> </li>
</ul> </ul>
<ul>
<li v-for="page in meta">
<RouterLink :to="page.route" @click="close()" active-class="active">
<FontAwesomeIcon class="icon" :icon="page.icon" />
<span>{{ page.label }}</span>
</RouterLink>
</li>
</ul>
</div>
</nav> </nav>
</section> </section>
</template> </template>
@ -21,13 +35,23 @@ import { faClockRotateLeft } from '@fortawesome/pro-duotone-svg-icons/faClockRot
import { faCalendarDays } from '@fortawesome/pro-duotone-svg-icons/faCalendarDays' import { faCalendarDays } from '@fortawesome/pro-duotone-svg-icons/faCalendarDays'
import { onClickOutside } from '@vueuse/core' import { onClickOutside } from '@vueuse/core'
import { useMoodStore } from '../../stores/mood.ts' import { useMoodStore } from '../../stores/mood.ts'
import { IconDefinition } from '@fortawesome/fontawesome-svg-core'
import { faSquareInfo } from '@fortawesome/pro-duotone-svg-icons/faSquareInfo'
import { faGearCode } from '@fortawesome/pro-duotone-svg-icons/faGearCode'
import { faGears } from '@fortawesome/pro-duotone-svg-icons/faGears'
const moodStore = useMoodStore() const moodStore = useMoodStore()
const nav = useNavigation() const nav = useNavigation()
const close = () => nav.hideNavigation() const close = () => nav.hideNavigation()
const open = computed(() => nav.isNavigationVisible.value) const open = computed(() => nav.isNavigationVisible.value)
const pages = reactive([ type Page = {
label: string
icon: IconDefinition
route: string
}
const pages = reactive<Page[]>([
{ {
label: 'Stimmung', label: 'Stimmung',
icon: moodStore.mood.icon, icon: moodStore.mood.icon,
@ -45,6 +69,25 @@ const pages = reactive([
}, },
]) ])
const meta : Page[] = [
{
label: 'Einstellungen',
icon: faGears,
route: '/settings'
},
{
label: 'Updates',
icon: faGearCode,
route: '/updates'
},
{
label: 'Impressum',
icon: faSquareInfo,
route: '/imp'
},
]
const navRef = useTemplateRef<HTMLElement>('nav') const navRef = useTemplateRef<HTMLElement>('nav')
onMounted(() => { onClickOutside(navRef, close) }) onMounted(() => { onClickOutside(navRef, close) })
@ -76,25 +119,44 @@ moodStore.$subscribe((_, state) => {
} }
} }
nav { & header {
position: relative;
& strong {
position: absolute;
left: var(--padding-default);
bottom: var(--padding-default);
font-size: var(--font-size-xxxl);
font-family: "Roboto Condensed", sans-serif;
color: var(--clr-white);
text-shadow: 0 2px 0 #3c3c3c, 1px 13px 15px #cbc8c8;
}
& img {
width: 100%;
}
}
& nav {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: start; align-items: start;
background: var(--clr-white); background: var(--clr-white);
box-shadow: var(--box-shadow-z2); box-shadow: var(--box-shadow-z2);
padding: var(--padding-default);
height: 100dvh; height: 100dvh;
width: 70%; width: 70%;
translate: -100% 0; translate: -100% 0;
transition: 150ms ease-in-out; transition: 150ms ease-in-out;
} }
& .close {
justify-self: flex-end;
font-size: var(--font-size-xl);
}
& .points { & .points {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
& ul {
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -102,6 +164,7 @@ moodStore.$subscribe((_, state) => {
font-size: var(--font-size-default); font-size: var(--font-size-default);
font-family: "Roboto Condensed", sans-serif; font-family: "Roboto Condensed", sans-serif;
gap: var(--padding-default); gap: var(--padding-default);
padding: var(--padding-default);
& li { & li {
list-style: none; list-style: none;
@ -126,5 +189,6 @@ moodStore.$subscribe((_, state) => {
} }
} }
} }
}
} }
</style> </style>

View file

@ -29,8 +29,8 @@ const currentNode = ref<string>('')
const changeMood = (newMood : Mood, note ?: string) => { const changeMood = (newMood : Mood, note ?: string) => {
currentMood.value = newMood currentMood.value = newMood
currentNode.value = note ?? '' currentNode.value = note ?? ''
document.documentElement.style.setProperty('--clr-current-dark', `var(--clr-${newMood.color}-dark)`) document.documentElement.style.setProperty('--clr-current-dark', `var(--clr-${newMood.id}-dark)`)
document.documentElement.style.setProperty('--clr-current-light', `var(--clr-${newMood.color}-light)`) document.documentElement.style.setProperty('--clr-current-light', `var(--clr-${newMood.id}-light)`)
moodStore.changeMood(newMood) moodStore.changeMood(newMood)
moodStore.changeNote(note) moodStore.changeNote(note)

View file

@ -1,76 +1,102 @@
import { IconDefinition } from '@fortawesome/fontawesome-svg-core'
import { faFaceSmile } from '@fortawesome/pro-duotone-svg-icons/faFaceSmile' import { faFaceSmile } from '@fortawesome/pro-duotone-svg-icons/faFaceSmile'
import { faFaceFrown } from '@fortawesome/pro-duotone-svg-icons/faFaceFrown' import { faFaceFrown } from '@fortawesome/pro-duotone-svg-icons/faFaceFrown'
import { faFacePouting } from '@fortawesome/pro-duotone-svg-icons/faFacePouting' import { faFacePouting } from '@fortawesome/pro-duotone-svg-icons/faFacePouting'
import { faFaceDisappointed } from '@fortawesome/pro-duotone-svg-icons/faFaceDisappointed' import { faFaceDisappointed } from '@fortawesome/pro-duotone-svg-icons/faFaceDisappointed'
import { faFaceMeh } from '@fortawesome/pro-duotone-svg-icons/faFaceMeh' import { faFaceMeh } from '@fortawesome/pro-duotone-svg-icons/faFaceMeh'
import { faFaceThermometer } from '@fortawesome/pro-duotone-svg-icons/faFaceThermometer'
import { faFaceDowncastSweat } from '@fortawesome/pro-duotone-svg-icons/faFaceDowncastSweat'
import { faFaceAnxiousSweat } from '@fortawesome/pro-duotone-svg-icons/faFaceAnxiousSweat' import { faFaceAnxiousSweat } from '@fortawesome/pro-duotone-svg-icons/faFaceAnxiousSweat'
import { IconDefinition } from '@fortawesome/fontawesome-svg-core' import { faFaceSmileRelaxed } from '@fortawesome/pro-duotone-svg-icons/faFaceSmileRelaxed'
import { faFaceRelieved } from '@fortawesome/pro-duotone-svg-icons/faFaceRelieved'
import { faFaceScream } from '@fortawesome/pro-duotone-svg-icons/faFaceScream'
import { faFaceConfounded } from '@fortawesome/pro-duotone-svg-icons/faFaceConfounded'
export type PossibleMood =
'happy'
| 'relaxed'
| 'content'
| 'sad'
| 'angry'
| 'disappointed'
| 'empty'
| 'scared'
| 'nervous'
| 'panic'
export type Mood = { export type Mood = {
label: string, label: string,
color: string, id: PossibleMood,
icon: IconDefinition, icon: IconDefinition,
} }
export type PossibleMood = 'happy' | 'sad' | 'angry' | 'disappointed' | 'empty' | 'sick' | 'scared' | 'pissed' const happy : Mood = {
const happy = {
label: 'Glücklich', label: 'Glücklich',
color: 'happy', id: 'happy',
icon: faFaceSmile, icon: faFaceSmile,
} }
const sad = { const relaxed : Mood = {
label: 'Entspannt',
id: 'relaxed',
icon: faFaceRelieved,
}
const content : Mood = {
label: 'Zufrieden',
id: 'content',
icon: faFaceSmileRelaxed,
}
const sad : Mood = {
label: 'Traurig', label: 'Traurig',
color: 'sad', id: 'sad',
icon: faFaceFrown, icon: faFaceFrown,
} }
const angry = { const angry : Mood = {
label: 'Wütend', label: 'Wütend',
color: 'angry', id: 'angry',
icon: faFacePouting, icon: faFacePouting,
} }
const disappointed = { const disappointed : Mood = {
label: 'Enttäuscht', label: 'Enttäuscht',
color: 'disappointed', id: 'disappointed',
icon: faFaceDisappointed, icon: faFaceDisappointed,
} }
const empty = { const empty : Mood = {
label: 'Leer', label: 'Leer',
color: 'empty', id: 'empty',
icon: faFaceMeh, icon: faFaceMeh,
} }
const sick = { const scared : Mood = {
label: 'Krank',
color: 'sick',
icon: faFaceThermometer,
}
const scared = {
label: 'Ängstlich', label: 'Ängstlich',
color: 'scared', id: 'scared',
icon: faFaceAnxiousSweat, icon: faFaceAnxiousSweat,
} }
const pissed = { const nervous : Mood = {
label: 'Genervt', label: 'Nervös',
color: 'pissed', id: 'nervous',
icon: faFaceDowncastSweat, icon: faFaceConfounded,
}
const panic : Mood = {
label: 'Panisch',
id: 'panic',
icon: faFaceScream,
} }
export const moods : Record<PossibleMood, Mood> = { export const moods : Record<PossibleMood, Mood> = {
happy, happy,
relaxed,
content,
sad, sad,
angry, angry,
disappointed, disappointed,
empty, empty,
sick,
scared, scared,
pissed, nervous,
panic,
} }