Full-stack homeschool web app with FastAPI backend, Vue 3 frontend, MySQL database, and Docker Compose orchestration. Includes JWT auth, WebSocket real-time TV dashboard, schedule builder, activity logging, and multi-child support. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
46 lines
986 B
Vue
46 lines
986 B
Vue
<template>
|
|
<div class="child-selector" v-if="childrenStore.children.length > 1">
|
|
<button
|
|
v-for="child in childrenStore.children.filter(c => c.is_active)"
|
|
:key="child.id"
|
|
class="child-btn"
|
|
:class="{ active: childrenStore.activeChild?.id === child.id }"
|
|
:style="{ '--color': child.color }"
|
|
@click="childrenStore.setActiveChild(child)"
|
|
>
|
|
{{ child.name }}
|
|
</button>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { useChildrenStore } from '@/stores/children'
|
|
const childrenStore = useChildrenStore()
|
|
</script>
|
|
|
|
<style scoped>
|
|
.child-selector {
|
|
display: flex;
|
|
gap: 0.5rem;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.child-btn {
|
|
padding: 0.4rem 1rem;
|
|
border: 2px solid var(--color, #4f46e5);
|
|
background: transparent;
|
|
color: #94a3b8;
|
|
border-radius: 999px;
|
|
cursor: pointer;
|
|
font-size: 0.875rem;
|
|
font-weight: 500;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.child-btn:hover,
|
|
.child-btn.active {
|
|
background: var(--color, #4f46e5);
|
|
color: #fff;
|
|
}
|
|
</style>
|