Design moderne + seed reel engagements forgeron avec votes
- CSS: couleurs saturees sans pastels, border-radius 4-6px, inputs mood-aware - Header: allege (3.25rem), logo typographique, bouton connexion fin - Login: redesign complet avec steps dots et input natif style - Dashboard: entry cards epurees, tags toolbox compacts - Seed: 34 vraies clauses forgeron v2.0.0 (forum topic 33165) - Seed: 9 clauses certification (licence G1) - Seed: 11 votants simules + 3 sessions de vote (10 pour / 1 contre) - MoodSwitcher: dots colores au lieu d'icones Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@ const { initMood } = useMood()
|
||||
|
||||
const navigationItems = [
|
||||
{
|
||||
label: 'Documents de reference',
|
||||
label: 'Documents',
|
||||
icon: 'i-lucide-book-open',
|
||||
to: '/documents',
|
||||
},
|
||||
@@ -44,10 +44,7 @@ const ws = useWebSocket()
|
||||
const { setupWsNotifications } = useNotifications()
|
||||
|
||||
onMounted(async () => {
|
||||
// Apply saved mood / ambiance
|
||||
initMood()
|
||||
|
||||
// Hydrate auth from localStorage
|
||||
auth.hydrateFromStorage()
|
||||
if (auth.token) {
|
||||
try {
|
||||
@@ -56,8 +53,6 @@ onMounted(async () => {
|
||||
auth.logout()
|
||||
}
|
||||
}
|
||||
|
||||
// Connect WebSocket and setup notifications
|
||||
ws.connect()
|
||||
setupWsNotifications(ws)
|
||||
})
|
||||
@@ -65,88 +60,81 @@ onMounted(async () => {
|
||||
onUnmounted(() => {
|
||||
ws.disconnect()
|
||||
})
|
||||
|
||||
function isActive(to: string) {
|
||||
return route.path === to || route.path.startsWith(to + '/')
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UApp>
|
||||
<!-- Offline detection banner -->
|
||||
<OfflineBanner />
|
||||
|
||||
<div
|
||||
class="min-h-screen flex flex-col"
|
||||
class="app-shell"
|
||||
:style="{
|
||||
backgroundColor: 'var(--mood-bg)',
|
||||
color: 'var(--mood-text)',
|
||||
}"
|
||||
>
|
||||
<!-- Header -->
|
||||
<header class="sticky top-0 z-30 border-b border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900">
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||
<div class="flex items-center justify-between h-16">
|
||||
<!-- Left: Hamburger (mobile) + Logo -->
|
||||
<div class="flex items-center gap-3">
|
||||
<!-- Hamburger menu button for mobile -->
|
||||
<UButton
|
||||
class="md:hidden"
|
||||
icon="i-lucide-menu"
|
||||
variant="ghost"
|
||||
color="neutral"
|
||||
size="sm"
|
||||
aria-label="Ouvrir le menu"
|
||||
@click="mobileMenuOpen = true"
|
||||
/>
|
||||
<header class="app-header">
|
||||
<div class="app-header__inner">
|
||||
<!-- Left: Hamburger (mobile) + Logo -->
|
||||
<div class="app-header__left">
|
||||
<button
|
||||
class="app-header__menu-btn md:hidden"
|
||||
aria-label="Ouvrir le menu"
|
||||
@click="mobileMenuOpen = true"
|
||||
>
|
||||
<UIcon name="i-lucide-menu" class="text-lg" />
|
||||
</button>
|
||||
<NuxtLink to="/" class="app-header__logo">
|
||||
<span class="app-header__logo-mark">G</span>
|
||||
<span class="app-header__logo-text">libredecision</span>
|
||||
</NuxtLink>
|
||||
</div>
|
||||
|
||||
<NuxtLink to="/" class="flex items-center gap-2">
|
||||
<UIcon name="i-lucide-vote" class="text-primary text-2xl" />
|
||||
<span class="text-xl font-bold text-gray-900 dark:text-white">Glibredecision</span>
|
||||
<!-- Center: Mood switcher -->
|
||||
<MoodSwitcher class="hidden sm:flex" />
|
||||
|
||||
<!-- Right: Auth -->
|
||||
<div class="app-header__right">
|
||||
<template v-if="auth.isAuthenticated">
|
||||
<span class="app-header__identity">
|
||||
{{ auth.identity?.display_name || auth.identity?.address?.slice(0, 10) + '...' }}
|
||||
</span>
|
||||
<span
|
||||
v-if="auth.identity?.is_smith"
|
||||
class="app-header__role app-header__role--smith"
|
||||
>
|
||||
Forgeron
|
||||
</span>
|
||||
<span
|
||||
v-if="auth.identity?.is_techcomm"
|
||||
class="app-header__role app-header__role--tech"
|
||||
>
|
||||
CoTec
|
||||
</span>
|
||||
<button
|
||||
class="app-header__icon-btn"
|
||||
aria-label="Se deconnecter"
|
||||
@click="auth.logout()"
|
||||
>
|
||||
<UIcon name="i-lucide-log-out" />
|
||||
</button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<NuxtLink to="/login" class="app-header__connect-btn">
|
||||
<UIcon name="i-lucide-log-in" class="text-sm" />
|
||||
<span>Connexion</span>
|
||||
</NuxtLink>
|
||||
</div>
|
||||
|
||||
<!-- Center: Mood switcher -->
|
||||
<MoodSwitcher class="hidden sm:flex" />
|
||||
|
||||
<!-- Right: Auth controls -->
|
||||
<div class="flex items-center gap-2 sm:gap-4">
|
||||
<template v-if="auth.isAuthenticated">
|
||||
<UBadge
|
||||
:color="auth.identity?.is_smith ? 'success' : 'neutral'"
|
||||
variant="subtle"
|
||||
class="hidden sm:inline-flex"
|
||||
>
|
||||
{{ auth.identity?.display_name || auth.identity?.address?.slice(0, 12) + '...' }}
|
||||
</UBadge>
|
||||
<UBadge
|
||||
v-if="auth.identity?.is_techcomm"
|
||||
color="info"
|
||||
variant="subtle"
|
||||
class="hidden sm:inline-flex"
|
||||
>
|
||||
Comite Tech
|
||||
</UBadge>
|
||||
<UButton
|
||||
icon="i-lucide-log-out"
|
||||
variant="ghost"
|
||||
color="neutral"
|
||||
size="sm"
|
||||
aria-label="Se deconnecter"
|
||||
@click="auth.logout()"
|
||||
/>
|
||||
</template>
|
||||
<template v-else>
|
||||
<UButton
|
||||
to="/login"
|
||||
icon="i-lucide-log-in"
|
||||
label="Se connecter"
|
||||
variant="soft"
|
||||
color="primary"
|
||||
/>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Mobile navigation drawer (USlideover) -->
|
||||
<!-- Mobile navigation drawer -->
|
||||
<USlideover
|
||||
v-model:open="mobileMenuOpen"
|
||||
side="left"
|
||||
@@ -154,70 +142,48 @@ onUnmounted(() => {
|
||||
:ui="{ width: 'max-w-xs' }"
|
||||
>
|
||||
<template #body>
|
||||
<nav class="py-2">
|
||||
<nav class="app-mobile-nav">
|
||||
<NuxtLink
|
||||
v-for="item in navigationItems"
|
||||
:key="item.to"
|
||||
:to="item.to"
|
||||
class="flex items-center gap-3 px-4 py-3 text-sm font-medium rounded-lg transition-colors"
|
||||
:class="
|
||||
route.path.startsWith(item.to)
|
||||
? 'bg-primary-50 dark:bg-primary-900/20 text-primary'
|
||||
: 'text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800'
|
||||
"
|
||||
class="app-mobile-nav__link"
|
||||
:class="{ 'app-mobile-nav__link--active': isActive(item.to) }"
|
||||
@click="mobileMenuOpen = false"
|
||||
>
|
||||
<UIcon :name="item.icon" class="text-lg" />
|
||||
<UIcon :name="item.icon" class="text-base" />
|
||||
<span>{{ item.label }}</span>
|
||||
</NuxtLink>
|
||||
</nav>
|
||||
|
||||
<!-- Mobile user info -->
|
||||
<div
|
||||
v-if="auth.isAuthenticated"
|
||||
class="mt-4 pt-4 border-t border-gray-200 dark:border-gray-700 px-4"
|
||||
class="app-mobile-nav__user"
|
||||
>
|
||||
<div class="flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400">
|
||||
<UIcon name="i-lucide-user" class="text-lg" />
|
||||
<span>{{ auth.identity?.display_name || auth.identity?.address?.slice(0, 16) + '...' }}</span>
|
||||
</div>
|
||||
<div class="flex gap-2 mt-2">
|
||||
<UBadge
|
||||
v-if="auth.identity?.is_smith"
|
||||
color="success"
|
||||
variant="subtle"
|
||||
size="xs"
|
||||
>
|
||||
Forgeron
|
||||
</UBadge>
|
||||
<UBadge
|
||||
v-if="auth.identity?.is_techcomm"
|
||||
color="info"
|
||||
variant="subtle"
|
||||
size="xs"
|
||||
>
|
||||
Comite Tech
|
||||
</UBadge>
|
||||
</div>
|
||||
<span>{{ auth.identity?.display_name || auth.identity?.address?.slice(0, 16) + '...' }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</USlideover>
|
||||
|
||||
<!-- Main content with sidebar -->
|
||||
<div class="flex flex-1">
|
||||
<!-- Desktop sidebar navigation -->
|
||||
<aside class="w-64 border-r border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/50 hidden md:block flex-shrink-0">
|
||||
<nav class="p-4 sticky top-16">
|
||||
<UNavigationMenu
|
||||
:items="navigationItems"
|
||||
orientation="vertical"
|
||||
class="w-full"
|
||||
/>
|
||||
<div class="app-body">
|
||||
<!-- Desktop sidebar -->
|
||||
<aside class="app-sidebar">
|
||||
<nav class="app-sidebar__nav">
|
||||
<NuxtLink
|
||||
v-for="item in navigationItems"
|
||||
:key="item.to"
|
||||
:to="item.to"
|
||||
class="app-sidebar__link"
|
||||
:class="{ 'app-sidebar__link--active': isActive(item.to) }"
|
||||
>
|
||||
<UIcon :name="item.icon" class="text-base" />
|
||||
<span>{{ item.label }}</span>
|
||||
</NuxtLink>
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
<!-- Page content with error boundary -->
|
||||
<main class="flex-1 min-w-0 p-4 sm:p-6 lg:p-8">
|
||||
<!-- Page content -->
|
||||
<main class="app-main">
|
||||
<ErrorBoundary>
|
||||
<NuxtPage />
|
||||
</ErrorBoundary>
|
||||
@@ -228,52 +194,337 @@ onUnmounted(() => {
|
||||
<Transition name="slide-up">
|
||||
<div
|
||||
v-if="ws.error.value"
|
||||
class="fixed bottom-0 left-0 right-0 z-40 bg-error-100 dark:bg-error-900/50 border-t border-error-300 dark:border-error-700 px-4 py-3 text-center"
|
||||
class="app-ws-banner"
|
||||
role="alert"
|
||||
>
|
||||
<div class="flex items-center justify-center gap-2 text-sm text-error-800 dark:text-error-200">
|
||||
<UIcon name="i-lucide-plug-zap" class="text-lg flex-shrink-0" />
|
||||
<span>{{ ws.error.value }}</span>
|
||||
<UButton
|
||||
size="xs"
|
||||
variant="soft"
|
||||
color="error"
|
||||
label="Reconnecter"
|
||||
icon="i-lucide-refresh-cw"
|
||||
@click="ws.disconnect(); ws.connect()"
|
||||
/>
|
||||
</div>
|
||||
<UIcon name="i-lucide-plug-zap" class="text-base" />
|
||||
<span>{{ ws.error.value }}</span>
|
||||
<button class="app-ws-banner__btn" @click="ws.disconnect(); ws.connect()">
|
||||
Reconnecter
|
||||
</button>
|
||||
</div>
|
||||
</Transition>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="border-t border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/50">
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4">
|
||||
<div class="flex flex-col sm:flex-row items-center justify-between gap-2 text-sm text-gray-500">
|
||||
<span>Glibredecision v0.1.0 - Decisions collectives pour Duniter/G1</span>
|
||||
<span>Licence libre</span>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="app-footer">
|
||||
<span>Glibredecision v0.1.0</span>
|
||||
<span class="app-footer__sep">·</span>
|
||||
<span>Licence libre</span>
|
||||
</footer>
|
||||
</div>
|
||||
</UApp>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* === Shell === */
|
||||
.app-shell {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
/* === Header === */
|
||||
.app-header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 30;
|
||||
background: var(--mood-surface);
|
||||
border-bottom: 1px solid var(--mood-border);
|
||||
}
|
||||
|
||||
.app-header__inner {
|
||||
max-width: 80rem;
|
||||
margin: 0 auto;
|
||||
padding: 0 1rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 3.25rem;
|
||||
}
|
||||
|
||||
.app-header__left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.app-header__menu-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
border: none;
|
||||
background: none;
|
||||
color: var(--mood-text-muted);
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.app-header__menu-btn:hover {
|
||||
color: var(--mood-text);
|
||||
background: var(--mood-accent-soft);
|
||||
}
|
||||
|
||||
.app-header__logo {
|
||||
text-decoration: none;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
.app-header__logo-mark {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 800;
|
||||
color: var(--mood-accent);
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.app-header__logo-text {
|
||||
font-size: 0.9375rem;
|
||||
font-weight: 600;
|
||||
color: var(--mood-text);
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.app-header__right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.app-header__identity {
|
||||
font-size: 0.75rem;
|
||||
font-weight: 500;
|
||||
color: var(--mood-text);
|
||||
max-width: 10rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.app-header__role {
|
||||
font-size: 0.625rem;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
padding: 2px 6px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.app-header__role--smith {
|
||||
background: rgba(24, 132, 59, 0.12);
|
||||
color: var(--mood-success);
|
||||
}
|
||||
|
||||
.app-header__role--tech {
|
||||
background: rgba(24, 86, 168, 0.12);
|
||||
color: var(--mood-status-vote, #1856a8);
|
||||
}
|
||||
|
||||
.app-header__icon-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 1.75rem;
|
||||
height: 1.75rem;
|
||||
border: none;
|
||||
background: none;
|
||||
color: var(--mood-text-muted);
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
.app-header__icon-btn:hover {
|
||||
color: var(--mood-text);
|
||||
background: var(--mood-accent-soft);
|
||||
}
|
||||
|
||||
.app-header__connect-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
padding: 0.375rem 0.875rem;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
color: var(--mood-accent-text);
|
||||
background: var(--mood-accent);
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
transition: opacity 0.15s ease;
|
||||
letter-spacing: 0.01em;
|
||||
}
|
||||
.app-header__connect-btn:hover {
|
||||
opacity: 0.88;
|
||||
}
|
||||
|
||||
/* === Sidebar === */
|
||||
.app-body {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.app-sidebar {
|
||||
width: 13rem;
|
||||
flex-shrink: 0;
|
||||
border-right: 1px solid var(--mood-border);
|
||||
background: var(--mood-surface);
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.app-sidebar {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.app-sidebar__nav {
|
||||
position: sticky;
|
||||
top: 3.25rem;
|
||||
padding: 0.75rem 0.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.app-sidebar__link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.5rem 0.75rem;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 500;
|
||||
color: var(--mood-text-muted);
|
||||
text-decoration: none;
|
||||
border-radius: 4px;
|
||||
transition: all 0.12s ease;
|
||||
}
|
||||
|
||||
.app-sidebar__link:hover {
|
||||
color: var(--mood-text);
|
||||
background: var(--mood-accent-soft);
|
||||
}
|
||||
|
||||
.app-sidebar__link--active {
|
||||
color: var(--mood-accent);
|
||||
background: var(--mood-accent-soft);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* === Mobile nav === */
|
||||
.app-mobile-nav {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
padding: 0.5rem;
|
||||
}
|
||||
|
||||
.app-mobile-nav__link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.625rem;
|
||||
padding: 0.625rem 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: var(--mood-text-muted);
|
||||
text-decoration: none;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.app-mobile-nav__link:hover {
|
||||
background: var(--mood-accent-soft);
|
||||
color: var(--mood-text);
|
||||
}
|
||||
.app-mobile-nav__link--active {
|
||||
color: var(--mood-accent);
|
||||
background: var(--mood-accent-soft);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.app-mobile-nav__user {
|
||||
margin-top: 1rem;
|
||||
padding: 0.75rem;
|
||||
border-top: 1px solid var(--mood-border);
|
||||
font-size: 0.75rem;
|
||||
color: var(--mood-text-muted);
|
||||
}
|
||||
|
||||
/* === Main === */
|
||||
.app-main {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
padding: 1.5rem 1rem;
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.app-main {
|
||||
padding: 1.5rem 1.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.app-main {
|
||||
padding: 2rem 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* === WS Banner === */
|
||||
.app-ws-banner {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 40;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.5rem 1rem;
|
||||
background: var(--mood-error);
|
||||
color: white;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.app-ws-banner__btn {
|
||||
margin-left: 0.5rem;
|
||||
padding: 0.25rem 0.5rem;
|
||||
background: rgba(255,255,255,0.2);
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
color: white;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
}
|
||||
.app-ws-banner__btn:hover {
|
||||
background: rgba(255,255,255,0.3);
|
||||
}
|
||||
|
||||
/* === Footer === */
|
||||
.app-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.75rem 1rem;
|
||||
font-size: 0.6875rem;
|
||||
color: var(--mood-text-muted);
|
||||
border-top: 1px solid var(--mood-border);
|
||||
}
|
||||
|
||||
.app-footer__sep {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
/* === Transitions === */
|
||||
.slide-up-enter-active,
|
||||
.slide-up-leave-active {
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.slide-up-enter-from,
|
||||
.slide-up-leave-to {
|
||||
transform: translateY(100%);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.slide-up-enter-to,
|
||||
.slide-up-leave-from {
|
||||
transform: translateY(0);
|
||||
opacity: 1;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,167 +1,207 @@
|
||||
/* ==========================================================================
|
||||
Glibredecision — Mood / Ambiance System
|
||||
4 moods: Peps (light), Zen (light), Chagrine (dark), Grave (dark)
|
||||
|
||||
Design: saturated, modern, zero pastels.
|
||||
========================================================================== */
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
Peps — Energique et chaleureux (Light)
|
||||
Peps — Energique, vif, franc (Light)
|
||||
-------------------------------------------------------------------------- */
|
||||
.mood-peps {
|
||||
--mood-bg: #ffffff;
|
||||
--mood-surface: #fffbf5;
|
||||
--mood-surface-hover: #fff5ea;
|
||||
--mood-text: #1a1a1a;
|
||||
--mood-text-muted: #6b6b6b;
|
||||
--mood-accent: #e85d26;
|
||||
--mood-accent-soft: #fff3ed;
|
||||
--mood-bg: #fafafa;
|
||||
--mood-surface: #ffffff;
|
||||
--mood-surface-hover: #f5f0ec;
|
||||
--mood-text: #18120e;
|
||||
--mood-text-muted: #6e5f52;
|
||||
--mood-accent: #d44a10;
|
||||
--mood-accent-soft: rgba(212, 74, 16, 0.08);
|
||||
--mood-accent-text: #ffffff;
|
||||
--mood-border: #fde8d8;
|
||||
--mood-success: #22c55e;
|
||||
--mood-warning: #f59e0b;
|
||||
--mood-error: #ef4444;
|
||||
--mood-gradient: linear-gradient(135deg, #fff8f0 0%, #ffffff 100%);
|
||||
--mood-shadow: rgba(232, 93, 38, 0.08);
|
||||
--mood-border: #e0d5cb;
|
||||
--mood-success: #18843b;
|
||||
--mood-warning: #c27e07;
|
||||
--mood-error: #c42b2b;
|
||||
--mood-gradient: linear-gradient(160deg, #faf8f5 0%, #ffffff 50%, #faf7f4 100%);
|
||||
--mood-shadow: rgba(120, 60, 10, 0.06);
|
||||
--mood-input-bg: #ffffff;
|
||||
--mood-input-border: #c9bdb0;
|
||||
--mood-input-focus: #d44a10;
|
||||
|
||||
--mood-status-prepa: #fed7aa;
|
||||
--mood-status-prepa-text: #9a3412;
|
||||
--mood-status-vote: #bfdbfe;
|
||||
--mood-status-vote-text: #1e40af;
|
||||
--mood-status-vigueur: #bbf7d0;
|
||||
--mood-status-vigueur-text: #166534;
|
||||
--mood-status-clos: #e5e7eb;
|
||||
--mood-status-clos-text: #374151;
|
||||
--mood-status-prepa: #b35c0a;
|
||||
--mood-status-prepa-bg: rgba(179, 92, 10, 0.12);
|
||||
--mood-status-vote: #1856a8;
|
||||
--mood-status-vote-bg: rgba(24, 86, 168, 0.10);
|
||||
--mood-status-vigueur: #18843b;
|
||||
--mood-status-vigueur-bg: rgba(24, 132, 59, 0.10);
|
||||
--mood-status-clos: #5c5c5c;
|
||||
--mood-status-clos-bg: rgba(92, 92, 92, 0.08);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
Zen — Calme et serein (Light)
|
||||
Zen — Ancre, equilibre, sobre (Light)
|
||||
-------------------------------------------------------------------------- */
|
||||
.mood-zen {
|
||||
--mood-bg: #f8faf8;
|
||||
--mood-bg: #f7f9f7;
|
||||
--mood-surface: #ffffff;
|
||||
--mood-surface-hover: #f0f7f2;
|
||||
--mood-text: #1a2e1a;
|
||||
--mood-text-muted: #5f7a5f;
|
||||
--mood-accent: #4a9e6f;
|
||||
--mood-accent-soft: #ecf5ef;
|
||||
--mood-surface-hover: #edf3ee;
|
||||
--mood-text: #141e14;
|
||||
--mood-text-muted: #4a6650;
|
||||
--mood-accent: #2d7a4a;
|
||||
--mood-accent-soft: rgba(45, 122, 74, 0.07);
|
||||
--mood-accent-text: #ffffff;
|
||||
--mood-border: #d4e7d9;
|
||||
--mood-success: #34d399;
|
||||
--mood-warning: #fbbf24;
|
||||
--mood-error: #f87171;
|
||||
--mood-gradient: linear-gradient(135deg, #f0f7f2 0%, #f8faf8 100%);
|
||||
--mood-shadow: rgba(74, 158, 111, 0.08);
|
||||
--mood-border: #c2d4c6;
|
||||
--mood-success: #1d8a42;
|
||||
--mood-warning: #b07309;
|
||||
--mood-error: #be3232;
|
||||
--mood-gradient: linear-gradient(160deg, #f4f8f4 0%, #ffffff 50%, #f5f8f5 100%);
|
||||
--mood-shadow: rgba(30, 80, 50, 0.05);
|
||||
--mood-input-bg: #ffffff;
|
||||
--mood-input-border: #a8c0ad;
|
||||
--mood-input-focus: #2d7a4a;
|
||||
|
||||
--mood-status-prepa: #fde68a;
|
||||
--mood-status-prepa-text: #78350f;
|
||||
--mood-status-vote: #a7f3d0;
|
||||
--mood-status-vote-text: #065f46;
|
||||
--mood-status-vigueur: #bbf7d0;
|
||||
--mood-status-vigueur-text: #166534;
|
||||
--mood-status-clos: #d1d5db;
|
||||
--mood-status-clos-text: #374151;
|
||||
--mood-status-prepa: #9e6b0a;
|
||||
--mood-status-prepa-bg: rgba(158, 107, 10, 0.10);
|
||||
--mood-status-vote: #1565a5;
|
||||
--mood-status-vote-bg: rgba(21, 101, 165, 0.10);
|
||||
--mood-status-vigueur: #1d8a42;
|
||||
--mood-status-vigueur-bg: rgba(29, 138, 66, 0.10);
|
||||
--mood-status-clos: #606060;
|
||||
--mood-status-clos-bg: rgba(96, 96, 96, 0.08);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
Chagrine — Profond et subtil (Dark)
|
||||
Chagrine — Dense, veloute, introspectif (Dark)
|
||||
-------------------------------------------------------------------------- */
|
||||
.mood-chagrine {
|
||||
--mood-bg: #1a1625;
|
||||
--mood-surface: #231e30;
|
||||
--mood-surface-hover: #2d2640;
|
||||
--mood-text: #e8e0f0;
|
||||
--mood-text-muted: #9b8fb5;
|
||||
--mood-accent: #9b7fd4;
|
||||
--mood-accent-soft: #2d2640;
|
||||
--mood-bg: #16121e;
|
||||
--mood-surface: #1e1828;
|
||||
--mood-surface-hover: #281f36;
|
||||
--mood-text: #e0d8ec;
|
||||
--mood-text-muted: #8e80a8;
|
||||
--mood-accent: #8b6cc4;
|
||||
--mood-accent-soft: rgba(139, 108, 196, 0.12);
|
||||
--mood-accent-text: #ffffff;
|
||||
--mood-border: #342d45;
|
||||
--mood-success: #6ee7b7;
|
||||
--mood-warning: #fcd34d;
|
||||
--mood-error: #fca5a5;
|
||||
--mood-gradient: linear-gradient(135deg, #1a1625 0%, #231e30 100%);
|
||||
--mood-shadow: rgba(155, 127, 212, 0.12);
|
||||
--mood-border: #2e2540;
|
||||
--mood-success: #48c278;
|
||||
--mood-warning: #d4a030;
|
||||
--mood-error: #e06060;
|
||||
--mood-gradient: linear-gradient(160deg, #16121e 0%, #1e1828 50%, #1a1524 100%);
|
||||
--mood-shadow: rgba(100, 60, 180, 0.10);
|
||||
--mood-input-bg: #1e1828;
|
||||
--mood-input-border: #3a2e52;
|
||||
--mood-input-focus: #8b6cc4;
|
||||
|
||||
--mood-status-prepa: #4c1d95;
|
||||
--mood-status-prepa-text: #ddd6fe;
|
||||
--mood-status-vote: #312e81;
|
||||
--mood-status-vote-text: #c7d2fe;
|
||||
--mood-status-vigueur: #064e3b;
|
||||
--mood-status-vigueur-text: #a7f3d0;
|
||||
--mood-status-clos: #2d2640;
|
||||
--mood-status-clos-text: #9b8fb5;
|
||||
--mood-status-prepa: #c4a050;
|
||||
--mood-status-prepa-bg: rgba(196, 160, 80, 0.14);
|
||||
--mood-status-vote: #7090d0;
|
||||
--mood-status-vote-bg: rgba(112, 144, 208, 0.14);
|
||||
--mood-status-vigueur: #48c278;
|
||||
--mood-status-vigueur-bg: rgba(72, 194, 120, 0.14);
|
||||
--mood-status-clos: #706080;
|
||||
--mood-status-clos-bg: rgba(112, 96, 128, 0.12);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
Grave — Serieux et solennel (Dark)
|
||||
Grave — Mineral, solennel, net (Dark)
|
||||
-------------------------------------------------------------------------- */
|
||||
.mood-grave {
|
||||
--mood-bg: #141518;
|
||||
--mood-surface: #1c1d21;
|
||||
--mood-surface-hover: #262420;
|
||||
--mood-text: #e5e5e0;
|
||||
--mood-text-muted: #8a8a85;
|
||||
--mood-accent: #d4a545;
|
||||
--mood-accent-soft: #262420;
|
||||
--mood-accent-text: #141518;
|
||||
--mood-border: #2a2b30;
|
||||
--mood-success: #86efac;
|
||||
--mood-warning: #fde68a;
|
||||
--mood-error: #fca5a5;
|
||||
--mood-gradient: linear-gradient(135deg, #141518 0%, #1c1d21 100%);
|
||||
--mood-shadow: rgba(212, 165, 69, 0.10);
|
||||
--mood-bg: #111214;
|
||||
--mood-surface: #191a1e;
|
||||
--mood-surface-hover: #22201c;
|
||||
--mood-text: #e2e0d8;
|
||||
--mood-text-muted: #8a877e;
|
||||
--mood-accent: #c49530;
|
||||
--mood-accent-soft: rgba(196, 149, 48, 0.10);
|
||||
--mood-accent-text: #111214;
|
||||
--mood-border: #2a2a2e;
|
||||
--mood-success: #4ac070;
|
||||
--mood-warning: #d4a530;
|
||||
--mood-error: #d85050;
|
||||
--mood-gradient: linear-gradient(160deg, #111214 0%, #191a1e 50%, #141518 100%);
|
||||
--mood-shadow: rgba(160, 120, 30, 0.08);
|
||||
--mood-input-bg: #191a1e;
|
||||
--mood-input-border: #38362e;
|
||||
--mood-input-focus: #c49530;
|
||||
|
||||
--mood-status-prepa: #78350f;
|
||||
--mood-status-prepa-text: #fde68a;
|
||||
--mood-status-vote: #1e3a5f;
|
||||
--mood-status-vote-text: #93c5fd;
|
||||
--mood-status-vigueur: #14532d;
|
||||
--mood-status-vigueur-text: #86efac;
|
||||
--mood-status-clos: #27272a;
|
||||
--mood-status-clos-text: #a1a1aa;
|
||||
--mood-status-prepa: #c49530;
|
||||
--mood-status-prepa-bg: rgba(196, 149, 48, 0.14);
|
||||
--mood-status-vote: #5a90c8;
|
||||
--mood-status-vote-bg: rgba(90, 144, 200, 0.14);
|
||||
--mood-status-vigueur: #4ac070;
|
||||
--mood-status-vigueur-bg: rgba(74, 192, 112, 0.14);
|
||||
--mood-status-clos: #686860;
|
||||
--mood-status-clos-bg: rgba(104, 104, 96, 0.12);
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Base Utilities
|
||||
Global design tokens — modern, refined, thin
|
||||
========================================================================== */
|
||||
|
||||
/* Transition all mood changes smoothly */
|
||||
body {
|
||||
transition: background-color 0.3s ease, color 0.3s ease;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
/* Status labels — clickable pill style */
|
||||
/* --- Status pills — compact, saturated, NO pastels --- */
|
||||
.status-pill {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 0.25rem 0.75rem;
|
||||
border-radius: 9999px;
|
||||
font-size: 0.75rem;
|
||||
padding: 3px 10px;
|
||||
border-radius: 4px;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.02em;
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
transition: all 0.15s ease;
|
||||
user-select: none;
|
||||
border: none;
|
||||
}
|
||||
.status-pill:hover {
|
||||
filter: brightness(0.92);
|
||||
transform: scale(1.05);
|
||||
filter: brightness(1.1);
|
||||
}
|
||||
.status-pill.active {
|
||||
ring: 2px;
|
||||
ring-offset: 2px;
|
||||
box-shadow: 0 0 0 2px var(--mood-accent);
|
||||
}
|
||||
|
||||
.status-prepa {
|
||||
background: var(--mood-status-prepa);
|
||||
color: var(--mood-status-prepa-text);
|
||||
background: var(--mood-status-prepa-bg);
|
||||
color: var(--mood-status-prepa);
|
||||
}
|
||||
.status-vote {
|
||||
background: var(--mood-status-vote);
|
||||
color: var(--mood-status-vote-text);
|
||||
background: var(--mood-status-vote-bg);
|
||||
color: var(--mood-status-vote);
|
||||
}
|
||||
.status-vigueur {
|
||||
background: var(--mood-status-vigueur);
|
||||
color: var(--mood-status-vigueur-text);
|
||||
background: var(--mood-status-vigueur-bg);
|
||||
color: var(--mood-status-vigueur);
|
||||
}
|
||||
.status-clos {
|
||||
background: var(--mood-status-clos);
|
||||
color: var(--mood-status-clos-text);
|
||||
background: var(--mood-status-clos-bg);
|
||||
color: var(--mood-status-clos);
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Global overrides — Nuxt UI refinements
|
||||
========================================================================== */
|
||||
|
||||
/* Inputs: thin, clean, mood-aware */
|
||||
:root .mood-peps,
|
||||
:root .mood-zen,
|
||||
:root .mood-chagrine,
|
||||
:root .mood-grave {
|
||||
/* UInput / UTextarea */
|
||||
--ui-border: var(--mood-input-border);
|
||||
--ui-bg: var(--mood-input-bg);
|
||||
--ui-text-highlighted: var(--mood-accent);
|
||||
}
|
||||
|
||||
/* UButton refinements */
|
||||
:root .mood-peps button[class*="UButton"],
|
||||
:root .mood-zen button[class*="UButton"],
|
||||
:root .mood-chagrine button[class*="UButton"],
|
||||
:root .mood-grave button[class*="UButton"] {
|
||||
font-weight: 500;
|
||||
letter-spacing: 0.01em;
|
||||
}
|
||||
|
||||
@@ -3,52 +3,51 @@ const { currentMood, moods, setMood } = useMood()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="flex items-center gap-1" role="radiogroup" aria-label="Ambiance visuelle">
|
||||
<div class="mood-switcher" role="radiogroup" aria-label="Ambiance visuelle">
|
||||
<UTooltip
|
||||
v-for="mood in moods"
|
||||
:key="mood.id"
|
||||
:text="`${mood.label} — ${mood.description}`"
|
||||
:text="mood.label"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
role="radio"
|
||||
:aria-checked="currentMood === mood.id"
|
||||
:aria-label="`Ambiance ${mood.label}`"
|
||||
class="mood-btn"
|
||||
:class="{ 'mood-btn--active': currentMood === mood.id }"
|
||||
class="mood-dot"
|
||||
:class="{ 'mood-dot--active': currentMood === mood.id }"
|
||||
:style="{ '--dot-color': mood.color }"
|
||||
@click="setMood(mood.id)"
|
||||
>
|
||||
<UIcon :name="mood.icon" class="text-base" />
|
||||
</button>
|
||||
/>
|
||||
</UTooltip>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.mood-btn {
|
||||
.mood-switcher {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
border-radius: 9999px;
|
||||
gap: 0.375rem;
|
||||
}
|
||||
|
||||
.mood-dot {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
border-radius: 50%;
|
||||
border: 2px solid transparent;
|
||||
background: var(--mood-surface, #f3f4f6);
|
||||
color: var(--mood-text-muted, #6b7280);
|
||||
background: var(--dot-color, var(--mood-text-muted));
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
transition: all 0.15s ease;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.mood-btn:hover {
|
||||
background: var(--mood-surface-hover, #e5e7eb);
|
||||
color: var(--mood-accent, #4b5563);
|
||||
transform: scale(1.1);
|
||||
.mood-dot:hover {
|
||||
transform: scale(1.25);
|
||||
}
|
||||
|
||||
.mood-btn--active {
|
||||
border-color: var(--mood-accent, #3b82f6);
|
||||
color: var(--mood-accent, #3b82f6);
|
||||
background: var(--mood-accent-soft, #eff6ff);
|
||||
box-shadow: 0 0 0 2px var(--mood-shadow, rgba(59, 130, 246, 0.15));
|
||||
.mood-dot--active {
|
||||
border-color: var(--mood-text);
|
||||
box-shadow: 0 0 0 2px var(--mood-bg), 0 0 0 3px var(--mood-text-muted);
|
||||
transform: scale(1.15);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* SectionLayout — Mise en page reutilisable pour les sections (documents, decisions, mandats).
|
||||
* SectionLayout — Mise en page pour sections (documents, decisions, mandats).
|
||||
*
|
||||
* Structure : titre + status filter pills en haut,
|
||||
* puis une grille principale (contenu) + barre laterale "Boite a outils".
|
||||
* Responsive : sur mobile la boite a outils passe sous le contenu principal.
|
||||
* Structure : titre + status pills + grille (contenu + toolbox).
|
||||
* Responsive : toolbox passe sous le contenu sur mobile.
|
||||
*/
|
||||
|
||||
export interface StatusFilter {
|
||||
@@ -43,7 +42,6 @@ const emit = defineEmits<{
|
||||
'update:activeStatus': [status: string | null]
|
||||
}>()
|
||||
|
||||
/** Map status id to CSS class for status pills. */
|
||||
const statusCssMap: Record<string, string> = {
|
||||
draft: 'status-prepa',
|
||||
qualification: 'status-prepa',
|
||||
@@ -74,19 +72,15 @@ function toggleStatus(statusId: string) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="section-layout">
|
||||
<!-- Header: title + status pills -->
|
||||
<div class="section-layout__header">
|
||||
<div class="section-layout__title-block">
|
||||
<h1 class="section-layout__title">
|
||||
{{ title }}
|
||||
</h1>
|
||||
<p v-if="subtitle" class="section-layout__subtitle">
|
||||
{{ subtitle }}
|
||||
</p>
|
||||
<div class="section">
|
||||
<!-- Header -->
|
||||
<div class="section__header">
|
||||
<div class="section__title-block">
|
||||
<h1 class="section__title">{{ title }}</h1>
|
||||
<p v-if="subtitle" class="section__subtitle">{{ subtitle }}</p>
|
||||
</div>
|
||||
|
||||
<div v-if="statuses.length > 0" class="section-layout__status-pills">
|
||||
<div v-if="statuses.length > 0" class="section__pills">
|
||||
<button
|
||||
v-for="status in statuses"
|
||||
:key="status.id"
|
||||
@@ -96,45 +90,34 @@ function toggleStatus(statusId: string) {
|
||||
@click="toggleStatus(status.id)"
|
||||
>
|
||||
{{ status.label }}
|
||||
<span v-if="status.count > 0" class="status-pill__count">
|
||||
{{ status.count }}
|
||||
</span>
|
||||
<span v-if="status.count > 0" class="section__pill-count">{{ status.count }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Main content area: list + toolbox sidebar -->
|
||||
<div class="section-layout__body">
|
||||
<!-- Left: search + list -->
|
||||
<div class="section-layout__main">
|
||||
<!-- Search / sort bar slot -->
|
||||
<div v-if="$slots.search" class="section-layout__search">
|
||||
<!-- Body: content + toolbox -->
|
||||
<div class="section__body">
|
||||
<div class="section__main">
|
||||
<div v-if="$slots.search" class="section__search">
|
||||
<slot name="search" />
|
||||
</div>
|
||||
|
||||
<!-- Main list content -->
|
||||
<div class="section-layout__content">
|
||||
<div class="section__content">
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
<!-- Empty state slot -->
|
||||
<div v-if="$slots.empty" class="section-layout__empty">
|
||||
<div v-if="$slots.empty" class="section__empty">
|
||||
<slot name="empty" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Right: toolbox sidebar -->
|
||||
<aside class="section-layout__toolbox">
|
||||
<div class="section-layout__toolbox-header">
|
||||
<UIcon name="i-lucide-wrench" class="text-sm" />
|
||||
<aside class="section__toolbox">
|
||||
<div class="section__toolbox-head">
|
||||
<UIcon name="i-lucide-wrench" class="text-xs" />
|
||||
<span>Boite a outils</span>
|
||||
</div>
|
||||
|
||||
<!-- Custom toolbox slot or default vignettes -->
|
||||
<div v-if="$slots.toolbox" class="section-layout__toolbox-content">
|
||||
<div v-if="$slots.toolbox" class="section__toolbox-body">
|
||||
<slot name="toolbox" />
|
||||
</div>
|
||||
<div v-else-if="toolboxItems && toolboxItems.length > 0" class="section-layout__toolbox-content">
|
||||
<div v-else-if="toolboxItems && toolboxItems.length > 0" class="section__toolbox-body">
|
||||
<ToolboxVignette
|
||||
v-for="(item, idx) in toolboxItems"
|
||||
:key="idx"
|
||||
@@ -142,8 +125,8 @@ function toggleStatus(statusId: string) {
|
||||
:description="item.description"
|
||||
/>
|
||||
</div>
|
||||
<div v-else class="section-layout__toolbox-empty">
|
||||
<p>Aucun outil disponible</p>
|
||||
<div v-else class="section__toolbox-empty">
|
||||
Aucun outil disponible
|
||||
</div>
|
||||
</aside>
|
||||
</div>
|
||||
@@ -151,126 +134,118 @@ function toggleStatus(statusId: string) {
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.section-layout {
|
||||
.section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
gap: 1.25rem;
|
||||
}
|
||||
|
||||
.section-layout__header {
|
||||
.section__header {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.section-layout__title-block {
|
||||
.section__title-block {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.section-layout__title {
|
||||
font-size: 1.5rem;
|
||||
.section__title {
|
||||
font-size: 1.375rem;
|
||||
font-weight: 700;
|
||||
color: var(--mood-text);
|
||||
line-height: 1.2;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.section-layout__subtitle {
|
||||
margin-top: 0.25rem;
|
||||
font-size: 0.875rem;
|
||||
.section__subtitle {
|
||||
margin-top: 0.125rem;
|
||||
font-size: 0.8125rem;
|
||||
color: var(--mood-text-muted);
|
||||
}
|
||||
|
||||
.section-layout__status-pills {
|
||||
.section__pills {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.375rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.section__pill-count {
|
||||
margin-left: 0.25rem;
|
||||
font-size: 0.5625rem;
|
||||
font-weight: 700;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.section__body {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 16rem;
|
||||
gap: 1.25rem;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.section__main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.section__search {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* Active state ring for pills */
|
||||
.status-pill.active {
|
||||
outline: 2px solid var(--mood-accent);
|
||||
outline-offset: 2px;
|
||||
.section__content {
|
||||
min-height: 12rem;
|
||||
}
|
||||
|
||||
.status-pill__count {
|
||||
margin-left: 0.375rem;
|
||||
font-size: 0.625rem;
|
||||
font-weight: 700;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.section-layout__body {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 280px;
|
||||
gap: 1.5rem;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.section-layout__main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.section-layout__search {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.75rem;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.section-layout__content {
|
||||
min-height: 200px;
|
||||
}
|
||||
|
||||
.section-layout__toolbox {
|
||||
.section__toolbox {
|
||||
position: sticky;
|
||||
top: 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
background: var(--mood-surface);
|
||||
border: 1px solid var(--mood-border);
|
||||
border-radius: 0.75rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.section-layout__toolbox-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 700;
|
||||
color: var(--mood-accent);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
.section-layout__toolbox-content {
|
||||
top: 4rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.625rem;
|
||||
background: var(--mood-surface);
|
||||
border: 1px solid var(--mood-border);
|
||||
border-radius: 6px;
|
||||
padding: 0.875rem;
|
||||
}
|
||||
|
||||
.section-layout__toolbox-empty {
|
||||
font-size: 0.75rem;
|
||||
.section__toolbox-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 700;
|
||||
color: var(--mood-accent);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.section__toolbox-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.section__toolbox-empty {
|
||||
font-size: 0.6875rem;
|
||||
color: var(--mood-text-muted);
|
||||
text-align: center;
|
||||
padding: 1rem 0;
|
||||
padding: 0.75rem 0;
|
||||
}
|
||||
|
||||
/* Responsive: on mobile, toolbox goes below */
|
||||
@media (max-width: 1023px) {
|
||||
.section-layout__body {
|
||||
.section__body {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.section-layout__toolbox {
|
||||
.section__toolbox {
|
||||
position: static;
|
||||
order: 2;
|
||||
}
|
||||
|
||||
@@ -34,9 +34,12 @@ const STATUS_MAP: Record<string, { label: string; cssClass: string }> = {
|
||||
// Mandate specific
|
||||
formulation: { label: 'En prepa', cssClass: 'status-prepa' },
|
||||
candidature: { label: 'En prepa', cssClass: 'status-prepa' },
|
||||
candidacy: { label: 'En prepa', cssClass: 'status-prepa' },
|
||||
investiture: { label: 'En vote', cssClass: 'status-vote' },
|
||||
revoked: { label: 'Clos', cssClass: 'status-clos' },
|
||||
completed: { label: 'Clos', cssClass: 'status-clos' },
|
||||
archived: { label: 'Clos', cssClass: 'status-clos' },
|
||||
reporting: { label: 'En vote', cssClass: 'status-vote' },
|
||||
}
|
||||
|
||||
const resolved = computed(() => {
|
||||
@@ -55,7 +58,7 @@ function handleClick() {
|
||||
v-if="clickable"
|
||||
type="button"
|
||||
class="status-pill"
|
||||
:class="[resolved.cssClass, { 'status-pill--active': active }]"
|
||||
:class="[resolved.cssClass, { active: active }]"
|
||||
@click="handleClick"
|
||||
>
|
||||
{{ resolved.label }}
|
||||
@@ -68,83 +71,3 @@ function handleClick() {
|
||||
{{ resolved.label }}
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.status-pill {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 2px 10px;
|
||||
border-radius: 9999px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.5;
|
||||
border: 1px solid transparent;
|
||||
cursor: default;
|
||||
transition: box-shadow 0.15s ease, border-color 0.15s ease;
|
||||
}
|
||||
|
||||
button.status-pill {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button.status-pill:hover {
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.status-pill--active {
|
||||
box-shadow: 0 0 0 2px currentColor;
|
||||
}
|
||||
|
||||
/* --- En prepa (amber/warning) --- */
|
||||
.status-prepa {
|
||||
background-color: var(--ui-color-amber-50, #fffbeb);
|
||||
color: var(--ui-color-amber-700, #b45309);
|
||||
border-color: var(--ui-color-amber-200, #fde68a);
|
||||
}
|
||||
|
||||
/* --- En vigueur (green/success) --- */
|
||||
.status-vigueur {
|
||||
background-color: var(--ui-color-green-50, #f0fdf4);
|
||||
color: var(--ui-color-green-700, #15803d);
|
||||
border-color: var(--ui-color-green-200, #bbf7d0);
|
||||
}
|
||||
|
||||
/* --- En vote (blue/primary) --- */
|
||||
.status-vote {
|
||||
background-color: var(--ui-color-blue-50, #eff6ff);
|
||||
color: var(--ui-color-blue-700, #1d4ed8);
|
||||
border-color: var(--ui-color-blue-200, #bfdbfe);
|
||||
}
|
||||
|
||||
/* --- Clos (gray/neutral) --- */
|
||||
.status-clos {
|
||||
background-color: var(--ui-color-gray-50, #f9fafb);
|
||||
color: var(--ui-color-gray-500, #6b7280);
|
||||
border-color: var(--ui-color-gray-200, #e5e7eb);
|
||||
}
|
||||
|
||||
/* Dark mode overrides */
|
||||
.dark .status-prepa {
|
||||
background-color: var(--ui-color-amber-950, #451a03);
|
||||
color: var(--ui-color-amber-300, #fcd34d);
|
||||
border-color: var(--ui-color-amber-800, #92400e);
|
||||
}
|
||||
|
||||
.dark .status-vigueur {
|
||||
background-color: var(--ui-color-green-950, #052e16);
|
||||
color: var(--ui-color-green-300, #86efac);
|
||||
border-color: var(--ui-color-green-800, #166534);
|
||||
}
|
||||
|
||||
.dark .status-vote {
|
||||
background-color: var(--ui-color-blue-950, #172554);
|
||||
color: var(--ui-color-blue-300, #93c5fd);
|
||||
border-color: var(--ui-color-blue-800, #1e40af);
|
||||
}
|
||||
|
||||
.dark .status-clos {
|
||||
background-color: var(--ui-color-gray-900, #111827);
|
||||
color: var(--ui-color-gray-400, #9ca3af);
|
||||
border-color: var(--ui-color-gray-700, #374151);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
/**
|
||||
* ToolboxVignette — Carte compacte pour la barre laterale "Boite a outils".
|
||||
*
|
||||
* Affiche un protocole ou outil avec titre, description, contexte et actions.
|
||||
* Utilise les variables mood pour le theming.
|
||||
* ToolboxVignette — Carte compacte pour la boite a outils.
|
||||
*/
|
||||
|
||||
export interface ToolboxAction {
|
||||
@@ -51,82 +48,87 @@ function handleAction(action: ToolboxAction) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="toolbox-vignette">
|
||||
<h4 class="toolbox-vignette__title">
|
||||
{{ title }}
|
||||
</h4>
|
||||
|
||||
<p v-if="description" class="toolbox-vignette__description">
|
||||
{{ description }}
|
||||
</p>
|
||||
|
||||
<div v-if="contextLabel" class="toolbox-vignette__context">
|
||||
<div class="vignette">
|
||||
<h4 class="vignette__title">{{ title }}</h4>
|
||||
<p v-if="description" class="vignette__desc">{{ description }}</p>
|
||||
<div v-if="contextLabel" class="vignette__ctx">
|
||||
<UIcon name="i-lucide-tag" class="text-xs" />
|
||||
<span>Contexte : {{ contextLabel }}</span>
|
||||
<span>{{ contextLabel }}</span>
|
||||
</div>
|
||||
|
||||
<div class="toolbox-vignette__actions">
|
||||
<UButton
|
||||
<div class="vignette__actions">
|
||||
<button
|
||||
v-for="action in resolvedActions"
|
||||
:key="action.label"
|
||||
:icon="action.icon"
|
||||
:label="action.label"
|
||||
size="xs"
|
||||
variant="soft"
|
||||
class="toolbox-vignette__action-btn"
|
||||
class="vignette__btn"
|
||||
@click="handleAction(action)"
|
||||
/>
|
||||
>
|
||||
<UIcon v-if="action.icon" :name="action.icon" class="text-xs" />
|
||||
<span>{{ action.label }}</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.toolbox-vignette {
|
||||
.vignette {
|
||||
background: var(--mood-surface);
|
||||
border: 1px solid var(--mood-border);
|
||||
border-radius: 0.5rem;
|
||||
padding: 0.75rem;
|
||||
border-radius: 4px;
|
||||
padding: 0.625rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
||||
gap: 0.375rem;
|
||||
transition: border-color 0.15s ease;
|
||||
}
|
||||
|
||||
.toolbox-vignette:hover {
|
||||
.vignette:hover {
|
||||
border-color: var(--mood-accent);
|
||||
box-shadow: 0 1px 4px var(--mood-shadow);
|
||||
}
|
||||
|
||||
.toolbox-vignette__title {
|
||||
font-size: 0.8125rem;
|
||||
.vignette__title {
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
color: var(--mood-text);
|
||||
line-height: 1.3;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.toolbox-vignette__description {
|
||||
font-size: 0.75rem;
|
||||
.vignette__desc {
|
||||
font-size: 0.6875rem;
|
||||
color: var(--mood-text-muted);
|
||||
line-height: 1.4;
|
||||
line-height: 1.35;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.toolbox-vignette__context {
|
||||
.vignette__ctx {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
font-size: 0.6875rem;
|
||||
font-size: 0.625rem;
|
||||
color: var(--mood-text-muted);
|
||||
}
|
||||
|
||||
.toolbox-vignette__actions {
|
||||
.vignette__actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.25rem;
|
||||
margin-top: 0.25rem;
|
||||
margin-top: 0.125rem;
|
||||
}
|
||||
|
||||
.toolbox-vignette__action-btn {
|
||||
--btn-bg: var(--mood-accent-soft);
|
||||
--btn-color: var(--mood-accent);
|
||||
.vignette__btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
padding: 0.1875rem 0.5rem;
|
||||
font-size: 0.625rem;
|
||||
font-weight: 600;
|
||||
color: var(--mood-accent);
|
||||
background: var(--mood-accent-soft);
|
||||
border: none;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
transition: opacity 0.12s ease;
|
||||
letter-spacing: 0.01em;
|
||||
}
|
||||
.vignette__btn:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -5,16 +5,17 @@ export interface Mood {
|
||||
label: string
|
||||
description: string
|
||||
icon: string
|
||||
color: string
|
||||
isDark: boolean
|
||||
}
|
||||
|
||||
const STORAGE_KEY = 'glibredecision_mood'
|
||||
|
||||
const moods: Mood[] = [
|
||||
{ id: 'peps', label: 'Peps', description: 'Energique et chaleureux', icon: 'i-lucide-sun', isDark: false },
|
||||
{ id: 'zen', label: 'Zen', description: 'Calme et serein', icon: 'i-lucide-leaf', isDark: false },
|
||||
{ id: 'chagrine', label: 'Chagrine', description: 'Profond et subtil', icon: 'i-lucide-moon', isDark: true },
|
||||
{ id: 'grave', label: 'Grave', description: 'Serieux et solennel', icon: 'i-lucide-shield', isDark: true },
|
||||
{ id: 'peps', label: 'Peps', description: 'Energique et franc', icon: 'i-lucide-sun', color: '#d44a10', isDark: false },
|
||||
{ id: 'zen', label: 'Zen', description: 'Ancre et sobre', icon: 'i-lucide-leaf', color: '#2d7a4a', isDark: false },
|
||||
{ id: 'chagrine', label: 'Chagrine', description: 'Dense et veloute', icon: 'i-lucide-moon', color: '#8b6cc4', isDark: true },
|
||||
{ id: 'grave', label: 'Grave', description: 'Mineral et solennel', icon: 'i-lucide-shield', color: '#c49530', isDark: true },
|
||||
]
|
||||
|
||||
const currentMood: Ref<string> = ref('peps')
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
/**
|
||||
* Dashboard / Page d'accueil — Glibredecision.
|
||||
*
|
||||
* Accueil chaleureux avec onboarding : cartes d'entree vers les sections,
|
||||
* banniere de connexion, apercu de la boite a outils et activite recente.
|
||||
* Accueil sobre et lisible : cartes d'entree, banniere connexion,
|
||||
* apercu boite a outils et activite recente.
|
||||
*/
|
||||
const documents = useDocumentsStore()
|
||||
const decisions = useDecisionsStore()
|
||||
@@ -67,7 +67,6 @@ const recentDecisions = computed(() => {
|
||||
.slice(0, 5)
|
||||
})
|
||||
|
||||
/** Format a date string to a localized relative or absolute string. */
|
||||
function formatDate(dateStr: string): string {
|
||||
const date = new Date(dateStr)
|
||||
const now = new Date()
|
||||
@@ -76,7 +75,7 @@ function formatDate(dateStr: string): string {
|
||||
|
||||
if (diffHours < 1) {
|
||||
const diffMinutes = Math.floor(diffMs / (1000 * 60))
|
||||
return diffMinutes <= 1 ? 'Il y a un instant' : `Il y a ${diffMinutes} min`
|
||||
return diffMinutes <= 1 ? 'A l\'instant' : `Il y a ${diffMinutes} min`
|
||||
}
|
||||
if (diffHours < 24) {
|
||||
return `Il y a ${Math.floor(diffHours)}h`
|
||||
@@ -89,191 +88,147 @@ function formatDate(dateStr: string): string {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="dashboard" :style="{ background: 'var(--mood-gradient)' }">
|
||||
<!-- Welcome banner -->
|
||||
<div class="dashboard__welcome">
|
||||
<h1 class="dashboard__welcome-title">
|
||||
Bienvenue sur Glibredecision
|
||||
</h1>
|
||||
<p class="dashboard__welcome-subtitle">
|
||||
Plateforme de decisions collectives pour la communaute Duniter / G1.
|
||||
Explorez les documents de reference, participez aux decisions, suivez les mandats.
|
||||
<div class="dash">
|
||||
<!-- Welcome -->
|
||||
<div class="dash__welcome">
|
||||
<h1 class="dash__title">Glibredecision</h1>
|
||||
<p class="dash__subtitle">
|
||||
Decisions collectives pour la communaute Duniter / G1
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Entry cards grid -->
|
||||
<div class="dashboard__entries">
|
||||
<!-- Entry cards -->
|
||||
<div class="dash__entries">
|
||||
<template v-if="loading">
|
||||
<LoadingSkeleton
|
||||
v-for="i in 3"
|
||||
:key="i"
|
||||
:lines="3"
|
||||
card
|
||||
/>
|
||||
<LoadingSkeleton v-for="i in 3" :key="i" :lines="3" card />
|
||||
</template>
|
||||
<template v-else>
|
||||
<NuxtLink
|
||||
v-for="card in entryCards"
|
||||
:key="card.key"
|
||||
:to="card.to"
|
||||
class="dashboard__entry-card"
|
||||
class="entry-card"
|
||||
>
|
||||
<div class="dashboard__entry-icon">
|
||||
<UIcon :name="card.icon" class="text-2xl" />
|
||||
<div class="entry-card__icon">
|
||||
<UIcon :name="card.icon" class="text-xl" />
|
||||
</div>
|
||||
<h2 class="dashboard__entry-title">
|
||||
{{ card.title }}
|
||||
</h2>
|
||||
|
||||
<!-- Count badge for documents and decisions -->
|
||||
<h2 class="entry-card__title">{{ card.title }}</h2>
|
||||
<template v-if="card.count !== null">
|
||||
<p class="dashboard__entry-count">
|
||||
{{ card.countLabel }}
|
||||
</p>
|
||||
<p class="dashboard__entry-total">
|
||||
{{ card.totalLabel }}
|
||||
</p>
|
||||
<span class="entry-card__count">{{ card.countLabel }}</span>
|
||||
<span class="entry-card__total">{{ card.totalLabel }}</span>
|
||||
</template>
|
||||
|
||||
<!-- Special onboarding text for mandats -->
|
||||
<template v-else>
|
||||
<p class="dashboard__entry-onboard">
|
||||
{{ card.description }}
|
||||
</p>
|
||||
<span class="entry-card__desc">{{ card.description }}</span>
|
||||
</template>
|
||||
|
||||
<UButton
|
||||
label="Entrer"
|
||||
variant="soft"
|
||||
size="xs"
|
||||
trailing-icon="i-lucide-arrow-right"
|
||||
class="dashboard__entry-btn"
|
||||
/>
|
||||
<span class="entry-card__arrow">
|
||||
<UIcon name="i-lucide-arrow-right" class="text-sm" />
|
||||
</span>
|
||||
</NuxtLink>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<!-- Onboarding banner for unauthenticated users -->
|
||||
<div v-if="!auth.isAuthenticated" class="dashboard__onboarding">
|
||||
<div class="dashboard__onboarding-content">
|
||||
<UIcon name="i-lucide-key-round" class="text-xl" />
|
||||
<!-- Connect banner -->
|
||||
<div v-if="!auth.isAuthenticated" class="dash__connect">
|
||||
<div class="dash__connect-left">
|
||||
<UIcon name="i-lucide-key-round" class="text-base" />
|
||||
<div>
|
||||
<p class="dashboard__onboarding-text">
|
||||
Connectez-vous avec votre identite Duniter pour participer aux decisions collectives.
|
||||
</p>
|
||||
<p class="dashboard__onboarding-hint">
|
||||
Authentification par signature Ed25519 — aucun mot de passe.
|
||||
</p>
|
||||
<p class="dash__connect-text">Connectez-vous avec votre identite Duniter pour participer.</p>
|
||||
<p class="dash__connect-hint">Signature Ed25519 · aucun mot de passe</p>
|
||||
</div>
|
||||
</div>
|
||||
<UButton
|
||||
to="/login"
|
||||
label="Se connecter"
|
||||
icon="i-lucide-log-in"
|
||||
variant="soft"
|
||||
size="sm"
|
||||
/>
|
||||
<NuxtLink to="/login" class="dash__connect-btn">
|
||||
<UIcon name="i-lucide-log-in" class="text-sm" />
|
||||
<span>Connexion</span>
|
||||
</NuxtLink>
|
||||
</div>
|
||||
|
||||
<!-- Boite a outils teaser -->
|
||||
<div class="dashboard__toolbox-teaser">
|
||||
<div class="dashboard__toolbox-teaser-header">
|
||||
<UIcon name="i-lucide-wrench" class="text-lg" />
|
||||
<div class="dash__toolbox">
|
||||
<div class="dash__toolbox-head">
|
||||
<UIcon name="i-lucide-wrench" class="text-base" />
|
||||
<h3>Boite a outils</h3>
|
||||
<UBadge variant="subtle" size="xs">
|
||||
{{ protocols.protocols.length }} modalite{{ protocols.protocols.length > 1 ? 's' : '' }}
|
||||
</UBadge>
|
||||
<span class="dash__toolbox-count">{{ protocols.protocols.length }}</span>
|
||||
</div>
|
||||
<p class="dashboard__toolbox-teaser-description">
|
||||
Protocoles de vote configurables avec formule de seuil WoT adaptative.
|
||||
<p class="dash__toolbox-desc">
|
||||
Protocoles de vote avec formule de seuil WoT adaptative.
|
||||
</p>
|
||||
<div class="dashboard__toolbox-teaser-tags">
|
||||
<div class="dash__toolbox-tags">
|
||||
<template v-if="protocols.protocols.length > 0">
|
||||
<NuxtLink
|
||||
v-for="protocol in protocols.protocols"
|
||||
:key="protocol.id"
|
||||
:to="`/protocols/${protocol.id}`"
|
||||
class="dashboard__toolbox-tag"
|
||||
class="dash__tag"
|
||||
>
|
||||
{{ protocol.name }}
|
||||
</NuxtLink>
|
||||
</template>
|
||||
<template v-else>
|
||||
<span class="dashboard__toolbox-tag">Vote majoritaire</span>
|
||||
<span class="dashboard__toolbox-tag">Vote nuance</span>
|
||||
<span class="dashboard__toolbox-tag">Vote permanent</span>
|
||||
<span class="dash__tag">Vote majoritaire</span>
|
||||
<span class="dash__tag">Vote nuance</span>
|
||||
<span class="dash__tag">Vote permanent</span>
|
||||
</template>
|
||||
</div>
|
||||
<UButton
|
||||
to="/protocols"
|
||||
label="Voir la boite a outils"
|
||||
variant="ghost"
|
||||
size="xs"
|
||||
trailing-icon="i-lucide-chevron-right"
|
||||
class="mt-1"
|
||||
/>
|
||||
<NuxtLink to="/protocols" class="dash__toolbox-link">
|
||||
Voir la boite a outils
|
||||
<UIcon name="i-lucide-chevron-right" class="text-xs" />
|
||||
</NuxtLink>
|
||||
</div>
|
||||
|
||||
<!-- Recent activity -->
|
||||
<div v-if="recentDecisions.length > 0" class="dashboard__activity">
|
||||
<div class="dashboard__activity-header">
|
||||
<UIcon name="i-lucide-activity" class="text-lg" />
|
||||
<div v-if="recentDecisions.length > 0" class="dash__activity">
|
||||
<div class="dash__activity-head">
|
||||
<UIcon name="i-lucide-activity" class="text-base" />
|
||||
<h3>Activite recente</h3>
|
||||
</div>
|
||||
<div class="dashboard__activity-list">
|
||||
<div class="dash__activity-list">
|
||||
<NuxtLink
|
||||
v-for="decision in recentDecisions"
|
||||
:key="decision.id"
|
||||
:to="`/decisions/${decision.id}`"
|
||||
class="dashboard__activity-item"
|
||||
class="dash__activity-item"
|
||||
>
|
||||
<div class="dashboard__activity-item-main">
|
||||
<span class="dashboard__activity-item-title">{{ decision.title }}</span>
|
||||
<span class="dashboard__activity-item-date">{{ formatDate(decision.updated_at) }}</span>
|
||||
<div class="dash__activity-main">
|
||||
<span class="dash__activity-title">{{ decision.title }}</span>
|
||||
<span class="dash__activity-date">{{ formatDate(decision.updated_at) }}</span>
|
||||
</div>
|
||||
<StatusBadge :status="decision.status" type="decision" />
|
||||
<StatusBadge :status="decision.status" type="decision" :clickable="false" />
|
||||
</NuxtLink>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Formula explainer — collapsible -->
|
||||
<!-- Formula explainer -->
|
||||
<UCollapsible v-model:open="formulaOpen">
|
||||
<UButton
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
:icon="formulaOpen ? 'i-lucide-chevron-up' : 'i-lucide-chevron-down'"
|
||||
class="dashboard__formula-trigger"
|
||||
>
|
||||
<div class="flex items-center gap-2">
|
||||
<UIcon name="i-lucide-calculator" />
|
||||
<button class="dash__formula-trigger" @click="formulaOpen = !formulaOpen">
|
||||
<div class="dash__formula-trigger-left">
|
||||
<UIcon name="i-lucide-calculator" class="text-sm" />
|
||||
<span>Formule de seuil WoT</span>
|
||||
</div>
|
||||
</UButton>
|
||||
<UIcon
|
||||
:name="formulaOpen ? 'i-lucide-chevron-up' : 'i-lucide-chevron-down'"
|
||||
class="text-xs"
|
||||
/>
|
||||
</button>
|
||||
<template #content>
|
||||
<div class="dashboard__formula-content">
|
||||
<p class="dashboard__formula-description">
|
||||
Le seuil d'adoption s'adapte dynamiquement a la participation :
|
||||
faible participation = quasi-unanimite requise ; forte participation = majorite simple suffisante.
|
||||
<div class="dash__formula-body">
|
||||
<p class="dash__formula-desc">
|
||||
Le seuil s'adapte a la participation : faible = quasi-unanimite ; forte = majorite simple.
|
||||
</p>
|
||||
<code class="dashboard__formula-code">
|
||||
<code class="dash__formula-code">
|
||||
Seuil = C + B^W + (M + (1-M) * (1 - (T/W)^G)) * max(0, T-C)
|
||||
</code>
|
||||
<div class="dashboard__formula-params">
|
||||
<span>C = constante de base</span>
|
||||
<span>B = exposant de base</span>
|
||||
<div class="dash__formula-params">
|
||||
<span>C = constante</span>
|
||||
<span>B = base</span>
|
||||
<span>W = taille WoT</span>
|
||||
<span>T = votes totaux</span>
|
||||
<span>T = votes</span>
|
||||
<span>M = majorite</span>
|
||||
<span>G = gradient</span>
|
||||
</div>
|
||||
<UButton
|
||||
to="/protocols/formulas"
|
||||
label="Ouvrir le simulateur"
|
||||
variant="outline"
|
||||
size="xs"
|
||||
icon="i-lucide-calculator"
|
||||
class="mt-2"
|
||||
/>
|
||||
<NuxtLink to="/protocols/formulas" class="dash__formula-link">
|
||||
Ouvrir le simulateur
|
||||
<UIcon name="i-lucide-chevron-right" class="text-xs" />
|
||||
</NuxtLink>
|
||||
</div>
|
||||
</template>
|
||||
</UCollapsible>
|
||||
@@ -281,254 +236,275 @@ function formatDate(dateStr: string): string {
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.dashboard {
|
||||
.dash {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2rem;
|
||||
min-height: 100%;
|
||||
padding-bottom: 2rem;
|
||||
gap: 1.5rem;
|
||||
max-width: 52rem;
|
||||
}
|
||||
|
||||
/* --- Welcome --- */
|
||||
.dashboard__welcome {
|
||||
text-align: center;
|
||||
padding: 1rem 0;
|
||||
.dash__welcome {
|
||||
padding: 0.5rem 0;
|
||||
}
|
||||
|
||||
.dashboard__welcome-title {
|
||||
font-size: 1.75rem;
|
||||
.dash__title {
|
||||
font-size: 1.625rem;
|
||||
font-weight: 800;
|
||||
color: var(--mood-accent);
|
||||
line-height: 1.2;
|
||||
letter-spacing: -0.02em;
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.dashboard__welcome-title {
|
||||
font-size: 2.25rem;
|
||||
}
|
||||
}
|
||||
|
||||
.dashboard__welcome-subtitle {
|
||||
margin-top: 0.5rem;
|
||||
font-size: 1rem;
|
||||
.dash__subtitle {
|
||||
margin-top: 0.25rem;
|
||||
font-size: 0.875rem;
|
||||
color: var(--mood-text-muted);
|
||||
max-width: 42rem;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* --- Entry cards --- */
|
||||
.dashboard__entries {
|
||||
.dash__entries {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
|
||||
gap: 1rem;
|
||||
grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.dashboard__entry-card {
|
||||
.entry-card {
|
||||
position: relative;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 1.5rem 1rem;
|
||||
gap: 0.375rem;
|
||||
padding: 1.25rem 1rem;
|
||||
background: var(--mood-surface);
|
||||
border: 1px solid var(--mood-border);
|
||||
border-radius: 0.75rem;
|
||||
text-align: center;
|
||||
border-radius: 6px;
|
||||
text-decoration: none;
|
||||
transition: all 0.2s ease;
|
||||
cursor: pointer;
|
||||
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
||||
}
|
||||
|
||||
.dashboard__entry-card:hover {
|
||||
.entry-card:hover {
|
||||
border-color: var(--mood-accent);
|
||||
box-shadow: 0 4px 12px var(--mood-shadow);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 2px 8px var(--mood-shadow);
|
||||
}
|
||||
|
||||
.dashboard__entry-icon {
|
||||
.entry-card__icon {
|
||||
width: 2.25rem;
|
||||
height: 2.25rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 3rem;
|
||||
height: 3rem;
|
||||
border-radius: 0.75rem;
|
||||
border-radius: 6px;
|
||||
background: var(--mood-accent-soft);
|
||||
color: var(--mood-accent);
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
.dashboard__entry-title {
|
||||
font-size: 1.125rem;
|
||||
.entry-card__title {
|
||||
font-size: 1rem;
|
||||
font-weight: 700;
|
||||
color: var(--mood-text);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.dashboard__entry-count {
|
||||
font-size: 1.5rem;
|
||||
.entry-card__count {
|
||||
font-size: 1.25rem;
|
||||
font-weight: 800;
|
||||
color: var(--mood-accent);
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.dashboard__entry-total {
|
||||
font-size: 0.75rem;
|
||||
.entry-card__total {
|
||||
font-size: 0.6875rem;
|
||||
color: var(--mood-text-muted);
|
||||
}
|
||||
|
||||
.dashboard__entry-onboard {
|
||||
.entry-card__desc {
|
||||
font-size: 0.75rem;
|
||||
color: var(--mood-text-muted);
|
||||
line-height: 1.4;
|
||||
max-width: 18rem;
|
||||
}
|
||||
|
||||
.dashboard__entry-btn {
|
||||
margin-top: 0.5rem;
|
||||
.entry-card__arrow {
|
||||
position: absolute;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
color: var(--mood-text-muted);
|
||||
opacity: 0.4;
|
||||
transition: opacity 0.15s;
|
||||
}
|
||||
.entry-card:hover .entry-card__arrow {
|
||||
opacity: 1;
|
||||
color: var(--mood-accent);
|
||||
}
|
||||
|
||||
/* --- Onboarding banner --- */
|
||||
.dashboard__onboarding {
|
||||
/* --- Connect banner --- */
|
||||
.dash__connect {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding: 1rem 1.25rem;
|
||||
gap: 0.75rem;
|
||||
padding: 0.875rem 1rem;
|
||||
background: var(--mood-accent-soft);
|
||||
border: 1px solid var(--mood-border);
|
||||
border-radius: 0.75rem;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.dashboard__onboarding-content {
|
||||
.dash__connect-left {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 0.75rem;
|
||||
gap: 0.625rem;
|
||||
color: var(--mood-accent);
|
||||
}
|
||||
|
||||
.dashboard__onboarding-text {
|
||||
font-size: 0.875rem;
|
||||
color: var(--mood-text);
|
||||
.dash__connect-text {
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 500;
|
||||
color: var(--mood-text);
|
||||
}
|
||||
|
||||
.dashboard__onboarding-hint {
|
||||
font-size: 0.75rem;
|
||||
.dash__connect-hint {
|
||||
font-size: 0.6875rem;
|
||||
color: var(--mood-text-muted);
|
||||
margin-top: 0.125rem;
|
||||
}
|
||||
|
||||
.dash__connect-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
padding: 0.375rem 0.875rem;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
color: var(--mood-accent-text);
|
||||
background: var(--mood-accent);
|
||||
border-radius: 4px;
|
||||
text-decoration: none;
|
||||
transition: opacity 0.15s ease;
|
||||
}
|
||||
.dash__connect-btn:hover {
|
||||
opacity: 0.88;
|
||||
}
|
||||
|
||||
/* --- Toolbox teaser --- */
|
||||
.dashboard__toolbox-teaser {
|
||||
.dash__toolbox {
|
||||
background: var(--mood-surface);
|
||||
border: 1px solid var(--mood-border);
|
||||
border-radius: 0.75rem;
|
||||
padding: 1rem 1.25rem;
|
||||
border-radius: 6px;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.dashboard__toolbox-teaser-header {
|
||||
.dash__toolbox-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
gap: 0.375rem;
|
||||
color: var(--mood-accent);
|
||||
font-weight: 700;
|
||||
font-size: 0.9375rem;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
.dash__toolbox-head h3 { margin: 0; }
|
||||
|
||||
.dash__toolbox-count {
|
||||
font-size: 0.625rem;
|
||||
font-weight: 700;
|
||||
background: var(--mood-accent-soft);
|
||||
color: var(--mood-accent);
|
||||
padding: 1px 5px;
|
||||
border-radius: 3px;
|
||||
margin-left: 0.25rem;
|
||||
}
|
||||
|
||||
.dashboard__toolbox-teaser-header h3 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.dashboard__toolbox-teaser-description {
|
||||
margin-top: 0.375rem;
|
||||
font-size: 0.8125rem;
|
||||
.dash__toolbox-desc {
|
||||
margin-top: 0.25rem;
|
||||
font-size: 0.75rem;
|
||||
color: var(--mood-text-muted);
|
||||
}
|
||||
|
||||
.dashboard__toolbox-teaser-tags {
|
||||
.dash__toolbox-tags {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.375rem;
|
||||
margin-top: 0.625rem;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.dashboard__toolbox-tag {
|
||||
.dash__tag {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 0.25rem 0.625rem;
|
||||
font-size: 0.75rem;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 500;
|
||||
color: var(--mood-accent);
|
||||
background: var(--mood-accent-soft);
|
||||
border: 1px solid var(--mood-border);
|
||||
border-radius: 9999px;
|
||||
border-radius: 4px;
|
||||
text-decoration: none;
|
||||
transition: background 0.15s ease;
|
||||
transition: border-color 0.15s ease;
|
||||
}
|
||||
.dash__tag:hover {
|
||||
border-color: var(--mood-accent);
|
||||
}
|
||||
|
||||
.dashboard__toolbox-tag:hover {
|
||||
background: var(--mood-surface-hover);
|
||||
.dash__toolbox-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
margin-top: 0.5rem;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 600;
|
||||
color: var(--mood-accent);
|
||||
text-decoration: none;
|
||||
}
|
||||
.dash__toolbox-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* --- Recent activity --- */
|
||||
.dashboard__activity {
|
||||
/* --- Activity --- */
|
||||
.dash__activity {
|
||||
background: var(--mood-surface);
|
||||
border: 1px solid var(--mood-border);
|
||||
border-radius: 0.75rem;
|
||||
padding: 1rem 1.25rem;
|
||||
border-radius: 6px;
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.dashboard__activity-header {
|
||||
.dash__activity-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
gap: 0.375rem;
|
||||
color: var(--mood-text);
|
||||
font-weight: 700;
|
||||
font-size: 0.9375rem;
|
||||
margin-bottom: 0.75rem;
|
||||
font-size: 0.875rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
.dash__activity-head h3 { margin: 0; }
|
||||
|
||||
.dashboard__activity-header h3 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.dashboard__activity-list {
|
||||
.dash__activity-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.dashboard__activity-item {
|
||||
.dash__activity-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.75rem;
|
||||
gap: 0.5rem;
|
||||
padding: 0.5rem 0;
|
||||
border-bottom: 1px solid var(--mood-border);
|
||||
text-decoration: none;
|
||||
transition: background 0.15s ease;
|
||||
transition: background 0.1s;
|
||||
}
|
||||
|
||||
.dashboard__activity-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.dashboard__activity-item:hover {
|
||||
.dash__activity-item:last-child { border-bottom: none; }
|
||||
.dash__activity-item:hover {
|
||||
background: var(--mood-surface-hover);
|
||||
margin-left: -0.5rem;
|
||||
margin-right: -0.5rem;
|
||||
margin: 0 -0.5rem;
|
||||
padding-left: 0.5rem;
|
||||
padding-right: 0.5rem;
|
||||
border-radius: 0.375rem;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.dashboard__activity-item-main {
|
||||
.dash__activity-main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.dashboard__activity-item-title {
|
||||
.dash__activity-title {
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 500;
|
||||
color: var(--mood-text);
|
||||
@@ -537,53 +513,84 @@ function formatDate(dateStr: string): string {
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.dashboard__activity-item-date {
|
||||
font-size: 0.6875rem;
|
||||
.dash__activity-date {
|
||||
font-size: 0.625rem;
|
||||
color: var(--mood-text-muted);
|
||||
}
|
||||
|
||||
/* --- Formula explainer --- */
|
||||
.dashboard__formula-trigger {
|
||||
width: 100%;
|
||||
/* --- Formula --- */
|
||||
.dash__formula-trigger {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
padding: 0.75rem 1rem;
|
||||
background: var(--mood-surface);
|
||||
border: 1px solid var(--mood-border);
|
||||
border-radius: 0.75rem;
|
||||
border-radius: 6px;
|
||||
color: var(--mood-text-muted);
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: border-color 0.15s;
|
||||
}
|
||||
.dash__formula-trigger:hover {
|
||||
border-color: var(--mood-accent);
|
||||
}
|
||||
|
||||
.dashboard__formula-content {
|
||||
padding: 0 1.25rem 1.25rem;
|
||||
.dash__formula-trigger-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.dash__formula-body {
|
||||
padding: 0 1rem 1rem;
|
||||
background: var(--mood-surface);
|
||||
border: 1px solid var(--mood-border);
|
||||
border-top: none;
|
||||
border-radius: 0 0 0.75rem 0.75rem;
|
||||
border-radius: 0 0 6px 6px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
gap: 0.625rem;
|
||||
}
|
||||
|
||||
.dashboard__formula-description {
|
||||
font-size: 0.8125rem;
|
||||
.dash__formula-desc {
|
||||
font-size: 0.75rem;
|
||||
color: var(--mood-text-muted);
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.dashboard__formula-code {
|
||||
.dash__formula-code {
|
||||
display: block;
|
||||
padding: 0.75rem;
|
||||
padding: 0.625rem;
|
||||
background: var(--mood-accent-soft);
|
||||
border-radius: 0.375rem;
|
||||
font-size: 0.8125rem;
|
||||
border-radius: 4px;
|
||||
font-size: 0.75rem;
|
||||
font-family: ui-monospace, SFMono-Regular, monospace;
|
||||
color: var(--mood-text);
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.dashboard__formula-params {
|
||||
.dash__formula-params {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.75rem;
|
||||
font-size: 0.6875rem;
|
||||
gap: 0.625rem;
|
||||
font-size: 0.625rem;
|
||||
color: var(--mood-text-muted);
|
||||
font-family: ui-monospace, SFMono-Regular, monospace;
|
||||
}
|
||||
|
||||
.dash__formula-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 600;
|
||||
color: var(--mood-accent);
|
||||
text-decoration: none;
|
||||
}
|
||||
.dash__formula-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -19,11 +19,9 @@ async function handleLogin() {
|
||||
step.value = 'signing'
|
||||
await auth.login(address.value.trim())
|
||||
step.value = 'success'
|
||||
|
||||
// Redirect to home after a brief moment
|
||||
setTimeout(() => {
|
||||
router.push('/')
|
||||
}, 1000)
|
||||
}, 800)
|
||||
} catch (err: any) {
|
||||
errorMessage.value = err?.data?.detail || err?.message || 'Erreur lors de la connexion'
|
||||
step.value = 'input'
|
||||
@@ -31,37 +29,22 @@ async function handleLogin() {
|
||||
}
|
||||
|
||||
const steps = computed(() => [
|
||||
{
|
||||
title: 'Adresse Duniter',
|
||||
description: 'Entrez votre adresse SS58 Duniter V2',
|
||||
icon: 'i-lucide-user',
|
||||
active: step.value === 'input',
|
||||
complete: step.value !== 'input',
|
||||
},
|
||||
{
|
||||
title: 'Challenge cryptographique',
|
||||
description: 'Un challenge aleatoire est genere par le serveur',
|
||||
icon: 'i-lucide-shield',
|
||||
active: step.value === 'challenge',
|
||||
complete: step.value === 'signing' || step.value === 'success',
|
||||
},
|
||||
{
|
||||
title: 'Signature Ed25519',
|
||||
description: 'Signez le challenge avec votre cle privee',
|
||||
icon: 'i-lucide-key',
|
||||
active: step.value === 'signing',
|
||||
complete: step.value === 'success',
|
||||
},
|
||||
{
|
||||
title: 'Connexion',
|
||||
description: 'Votre identite est verifiee et la session creee',
|
||||
icon: 'i-lucide-check-circle',
|
||||
active: step.value === 'success',
|
||||
complete: false,
|
||||
},
|
||||
{ label: 'Adresse SS58', icon: 'i-lucide-user', done: step.value !== 'input' },
|
||||
{ label: 'Challenge', icon: 'i-lucide-shield', done: step.value === 'signing' || step.value === 'success' },
|
||||
{ label: 'Signature', icon: 'i-lucide-key', done: step.value === 'success' },
|
||||
{ label: 'Connecte', icon: 'i-lucide-check', done: false },
|
||||
])
|
||||
|
||||
// Redirect if already authenticated
|
||||
const activeStepIndex = computed(() => {
|
||||
switch (step.value) {
|
||||
case 'input': return 0
|
||||
case 'challenge': return 1
|
||||
case 'signing': return 2
|
||||
case 'success': return 3
|
||||
default: return 0
|
||||
}
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
if (auth.isAuthenticated) {
|
||||
router.push('/')
|
||||
@@ -70,108 +53,289 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="max-w-lg mx-auto space-y-8 py-8">
|
||||
<div class="text-center">
|
||||
<UIcon name="i-lucide-vote" class="text-5xl text-primary mb-4" />
|
||||
<h1 class="text-2xl font-bold text-gray-900 dark:text-white">
|
||||
Connexion a Glibredecision
|
||||
</h1>
|
||||
<p class="mt-2 text-gray-600 dark:text-gray-400">
|
||||
Authentification via votre identite Duniter V2
|
||||
</p>
|
||||
</div>
|
||||
<div class="login-page">
|
||||
<div class="login-card">
|
||||
<!-- Logo -->
|
||||
<div class="login-card__header">
|
||||
<span class="login-card__logo">G</span>
|
||||
<h1 class="login-card__title">Connexion</h1>
|
||||
<p class="login-card__subtitle">Identite Duniter V2 · Ed25519</p>
|
||||
</div>
|
||||
|
||||
<!-- Login form -->
|
||||
<UCard>
|
||||
<div class="space-y-6">
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
|
||||
Adresse Duniter (SS58)
|
||||
</label>
|
||||
<UInput
|
||||
v-model="address"
|
||||
placeholder="5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"
|
||||
size="lg"
|
||||
icon="i-lucide-wallet"
|
||||
:disabled="auth.loading || step !== 'input'"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- Error message -->
|
||||
<div v-if="errorMessage || auth.error" class="p-3 bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 rounded-lg">
|
||||
<div class="flex items-center gap-2">
|
||||
<UIcon name="i-lucide-alert-circle" class="text-red-500" />
|
||||
<p class="text-sm text-red-700 dark:text-red-400">
|
||||
{{ errorMessage || auth.error }}
|
||||
</p>
|
||||
<!-- Steps indicator -->
|
||||
<div class="login-steps">
|
||||
<div
|
||||
v-for="(s, i) in steps"
|
||||
:key="i"
|
||||
class="login-step"
|
||||
:class="{
|
||||
'login-step--done': s.done,
|
||||
'login-step--active': i === activeStepIndex,
|
||||
}"
|
||||
>
|
||||
<div class="login-step__dot">
|
||||
<UIcon v-if="s.done" name="i-lucide-check" class="text-xs" />
|
||||
<span v-else class="login-step__num">{{ i + 1 }}</span>
|
||||
</div>
|
||||
<span class="login-step__label">{{ s.label }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Success message -->
|
||||
<div v-if="step === 'success'" class="p-3 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-lg">
|
||||
<div class="flex items-center gap-2">
|
||||
<UIcon name="i-lucide-check-circle" class="text-green-500" />
|
||||
<p class="text-sm text-green-700 dark:text-green-400">
|
||||
Connexion reussie ! Redirection en cours...
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<UButton
|
||||
:label="auth.loading ? 'Connexion en cours...' : 'Se connecter avec Duniter'"
|
||||
icon="i-lucide-log-in"
|
||||
size="lg"
|
||||
block
|
||||
:loading="auth.loading"
|
||||
:disabled="!address.trim() || step === 'success'"
|
||||
@click="handleLogin"
|
||||
<!-- Input -->
|
||||
<div class="login-card__field">
|
||||
<label class="login-card__label">Adresse Duniter (SS58)</label>
|
||||
<input
|
||||
v-model="address"
|
||||
type="text"
|
||||
class="login-card__input"
|
||||
placeholder="5GrwvaEF5zXb26Fz9rcQpDWS57Ct..."
|
||||
:disabled="auth.loading || step !== 'input'"
|
||||
@keydown.enter="handleLogin"
|
||||
/>
|
||||
</div>
|
||||
</UCard>
|
||||
|
||||
<!-- Challenge flow steps -->
|
||||
<UCard>
|
||||
<div class="space-y-4">
|
||||
<h3 class="text-sm font-semibold text-gray-700 dark:text-gray-300 uppercase tracking-wide">
|
||||
Processus d'authentification
|
||||
</h3>
|
||||
<div class="space-y-3">
|
||||
<div
|
||||
v-for="(s, index) in steps"
|
||||
:key="index"
|
||||
class="flex items-start gap-3"
|
||||
:class="{ 'opacity-40': !s.active && !s.complete }"
|
||||
>
|
||||
<div
|
||||
class="w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0"
|
||||
:class="{
|
||||
'bg-primary text-white': s.active,
|
||||
'bg-green-500 text-white': s.complete,
|
||||
'bg-gray-200 dark:bg-gray-700 text-gray-500': !s.active && !s.complete,
|
||||
}"
|
||||
>
|
||||
<UIcon v-if="s.complete" name="i-lucide-check" class="text-sm" />
|
||||
<span v-else class="text-xs font-bold">{{ index + 1 }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<p class="text-sm font-medium text-gray-900 dark:text-white">
|
||||
{{ s.title }}
|
||||
</p>
|
||||
<p class="text-xs text-gray-500 dark:text-gray-400">
|
||||
{{ s.description }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Error -->
|
||||
<div v-if="errorMessage || auth.error" class="login-card__error">
|
||||
<UIcon name="i-lucide-alert-circle" class="text-sm flex-shrink-0" />
|
||||
<span>{{ errorMessage || auth.error }}</span>
|
||||
</div>
|
||||
</UCard>
|
||||
|
||||
<!-- Info note -->
|
||||
<div class="text-center">
|
||||
<p class="text-xs text-gray-400">
|
||||
L'authentification utilise la cryptographie Ed25519 de Duniter V2.
|
||||
Aucun mot de passe n'est transmis au serveur.
|
||||
<!-- Success -->
|
||||
<div v-if="step === 'success'" class="login-card__success">
|
||||
<UIcon name="i-lucide-check-circle" class="text-sm flex-shrink-0" />
|
||||
<span>Connecte. Redirection...</span>
|
||||
</div>
|
||||
|
||||
<!-- Button -->
|
||||
<button
|
||||
class="login-card__btn"
|
||||
:disabled="!address.trim() || step === 'success' || auth.loading"
|
||||
@click="handleLogin"
|
||||
>
|
||||
<UIcon v-if="auth.loading" name="i-lucide-loader-2" class="animate-spin text-sm" />
|
||||
<UIcon v-else name="i-lucide-log-in" class="text-sm" />
|
||||
<span>{{ auth.loading ? 'Verification...' : 'Se connecter' }}</span>
|
||||
</button>
|
||||
|
||||
<!-- Note -->
|
||||
<p class="login-card__note">
|
||||
Aucun mot de passe. Authentification par signature cryptographique.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.login-page {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 70vh;
|
||||
padding: 2rem 1rem;
|
||||
}
|
||||
|
||||
.login-card {
|
||||
width: 100%;
|
||||
max-width: 24rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.25rem;
|
||||
}
|
||||
|
||||
.login-card__header {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.login-card__logo {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 3rem;
|
||||
height: 3rem;
|
||||
font-size: 1.5rem;
|
||||
font-weight: 800;
|
||||
color: var(--mood-accent-text);
|
||||
background: var(--mood-accent);
|
||||
border-radius: 8px;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.login-card__title {
|
||||
font-size: 1.375rem;
|
||||
font-weight: 700;
|
||||
color: var(--mood-text);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.login-card__subtitle {
|
||||
font-size: 0.75rem;
|
||||
color: var(--mood-text-muted);
|
||||
margin-top: 0.25rem;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
/* Steps */
|
||||
.login-steps {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 0.25rem;
|
||||
padding: 0.75rem 0;
|
||||
}
|
||||
|
||||
.login-step {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.login-step__dot {
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 0.625rem;
|
||||
font-weight: 700;
|
||||
border: 1.5px solid var(--mood-border);
|
||||
color: var(--mood-text-muted);
|
||||
background: var(--mood-surface);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.login-step--active .login-step__dot {
|
||||
border-color: var(--mood-accent);
|
||||
color: var(--mood-accent);
|
||||
box-shadow: 0 0 0 3px var(--mood-accent-soft);
|
||||
}
|
||||
|
||||
.login-step--done .login-step__dot {
|
||||
border-color: var(--mood-success);
|
||||
background: var(--mood-success);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.login-step__num {
|
||||
font-size: 0.5625rem;
|
||||
}
|
||||
|
||||
.login-step__label {
|
||||
font-size: 0.5625rem;
|
||||
font-weight: 500;
|
||||
color: var(--mood-text-muted);
|
||||
text-align: center;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.login-step--active .login-step__label {
|
||||
color: var(--mood-accent);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Field */
|
||||
.login-card__field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.375rem;
|
||||
}
|
||||
|
||||
.login-card__label {
|
||||
font-size: 0.6875rem;
|
||||
font-weight: 600;
|
||||
color: var(--mood-text-muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
.login-card__input {
|
||||
width: 100%;
|
||||
padding: 0.625rem 0.75rem;
|
||||
font-size: 0.8125rem;
|
||||
font-family: ui-monospace, SFMono-Regular, 'Cascadia Code', monospace;
|
||||
color: var(--mood-text);
|
||||
background: var(--mood-input-bg, var(--mood-surface));
|
||||
border: 1px solid var(--mood-input-border, var(--mood-border));
|
||||
border-radius: 4px;
|
||||
outline: none;
|
||||
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
||||
}
|
||||
|
||||
.login-card__input:focus {
|
||||
border-color: var(--mood-input-focus, var(--mood-accent));
|
||||
box-shadow: 0 0 0 2px var(--mood-accent-soft);
|
||||
}
|
||||
|
||||
.login-card__input:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.login-card__input::placeholder {
|
||||
color: var(--mood-text-muted);
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
/* Messages */
|
||||
.login-card__error {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.5rem 0.75rem;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 500;
|
||||
color: var(--mood-error);
|
||||
background: rgba(196, 43, 43, 0.08);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.login-card__success {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
padding: 0.5rem 0.75rem;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 500;
|
||||
color: var(--mood-success);
|
||||
background: rgba(24, 132, 59, 0.08);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
/* Button */
|
||||
.login-card__btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.5rem;
|
||||
width: 100%;
|
||||
padding: 0.625rem 1rem;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
color: var(--mood-accent-text);
|
||||
background: var(--mood-accent);
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
transition: opacity 0.15s ease;
|
||||
letter-spacing: 0.01em;
|
||||
}
|
||||
|
||||
.login-card__btn:hover:not(:disabled) {
|
||||
opacity: 0.88;
|
||||
}
|
||||
|
||||
.login-card__btn:disabled {
|
||||
opacity: 0.4;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/* Note */
|
||||
.login-card__note {
|
||||
text-align: center;
|
||||
font-size: 0.6875rem;
|
||||
color: var(--mood-text-muted);
|
||||
opacity: 0.7;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user