Initial commit - LoreMind project

This commit is contained in:
2026-04-19 12:08:16 +02:00
parent 95928b7165
commit 094c759f2c
213 changed files with 25358 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
<aside class="sidebar">
<div class="sidebar-header">
<div class="logo">
<span class="logo-icon"></span>
<span class="logo-text">LoreMind</span>
</div>
<p class="logo-subtitle">THE DIGITAL CODEX</p>
</div>
<div class="nav-toggle">
<button class="toggle-btn" [class.active]="currentRoute.startsWith('/lore')" (click)="navigateTo('/lore')">
Lore
</button>
<button class="toggle-btn" [class.active]="currentRoute.startsWith('/campaigns')" (click)="navigateTo('/campaigns')">
Campagne
</button>
</div>
<!-- Mode contextuel : liste des lores ou campagnes -->
<ng-container *ngIf="layoutConfig$ | async as config">
<div class="context-list">
<button
class="context-item"
*ngFor="let item of config.globalItems"
[class.active]="isActive(item.route)"
(click)="navigateTo(item.route)">
{{ item.name }}
</button>
</div>
<div class="spacer"></div>
<button class="btn-back-all" (click)="navigateTo(config.globalBackRoute)">
<lucide-icon [img]="ArrowLeft" [size]="14"></lucide-icon>
<span>{{ config.globalBackLabel }}</span>
</button>
</ng-container>
<!-- Mode normal : spacer + outils -->
<ng-container *ngIf="!(layoutConfig$ | async)">
<div class="spacer"></div>
</ng-container>
<div class="tools-section">
<p class="tools-label">OUTILS</p>
<button class="tool-btn" (click)="openSearch()">
<lucide-icon [img]="Search" [size]="16"></lucide-icon>
<span>Recherche globale</span>
<span class="tool-kbd">Ctrl+K</span>
</button>
<button class="tool-btn">
<lucide-icon [img]="Download" [size]="16"></lucide-icon>
<span>Export VTT</span>
</button>
<button class="tool-btn">
<lucide-icon [img]="Settings" [size]="16"></lucide-icon>
<span>Paramètres</span>
</button>
</div>
<div class="sidebar-footer">
<span class="version">Version 1.0.0</span>
</div>
</aside>

View File

@@ -0,0 +1,186 @@
.sidebar {
width: 190px;
height: 100vh;
background: #0f0f1a;
color: #e0e0e0;
display: flex;
flex-direction: column;
padding: 1.5rem 1rem;
border-right: 1px solid #1e1e3a;
}
.sidebar-header { margin-bottom: 2rem; }
.logo {
display: flex;
align-items: center;
gap: 0.5rem;
}
.logo-icon { font-size: 1.2rem; color: #6c63ff; }
.logo-text { font-size: 1.25rem; font-weight: 700; color: white; }
.logo-subtitle {
font-size: 0.65rem;
color: #6b7280;
letter-spacing: 0.15em;
margin-top: 0.25rem;
}
.nav-toggle {
display: flex;
background: #1a1a2e;
border-radius: 0.5rem;
padding: 0.25rem;
gap: 0;
}
.toggle-btn {
flex: 1;
padding: 0.5rem 0.75rem;
background: transparent;
color: #9ca3af;
border: none;
border-radius: 0.4rem;
cursor: pointer;
font-size: 0.9rem;
font-weight: 500;
transition: all 0.2s;
&:hover { color: white; }
&.active { background: #6c63ff; color: white; }
}
.spacer { flex: 1; }
.context-list {
display: flex;
flex-direction: column;
gap: 0.15rem;
margin-top: 0.75rem;
flex: 1;
overflow-y: auto;
}
.context-item {
width: 100%;
background: transparent;
border: none;
color: #9ca3af;
font-size: 0.82rem;
padding: 0.45rem 0.75rem;
border-radius: 6px;
cursor: pointer;
text-align: left;
transition: all 0.15s;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
&:hover { background: #1f2937; color: white; }
&.active { background: #1e1b4b; color: #a5b4fc; font-weight: 600; }
}
// Bouton de retour vers la liste globale (ex: "Tous les lores" / "Toutes les campagnes").
// Volontairement distinct des context-items pour signaler que c'est une action
// de navigation hors-contexte (retour au niveau supérieur).
.btn-back-all {
display: flex;
align-items: center;
justify-content: center;
gap: 0.5rem;
width: 100%;
background: #1f2937;
border: 1px solid #374151;
color: #d1d5db;
font-size: 0.82rem;
font-weight: 500;
padding: 0.6rem 0.85rem;
border-radius: 8px;
cursor: pointer;
margin-bottom: 0.75rem;
// Séparateur visuel au-dessus pour détacher du bloc globalItems.
margin-top: 0.75rem;
position: relative;
transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
// Fine ligne de séparation au-dessus.
&::before {
content: '';
position: absolute;
top: -0.5rem;
left: 0.5rem;
right: 0.5rem;
height: 1px;
background: #1f2937;
}
// Petit déplacement de la flèche au hover pour suggérer l'action "retour".
lucide-icon {
color: #9ca3af;
transition: transform 0.15s, color 0.15s;
}
&:hover {
background: #374151;
border-color: #6c63ff;
color: white;
lucide-icon {
color: #a5b4fc;
transform: translateX(-2px);
}
}
}
.tools-section {
display: flex;
flex-direction: column;
gap: 0.25rem;
margin-bottom: 1rem;
}
.tools-label {
font-size: 0.7rem;
color: #6b7280;
letter-spacing: 0.1em;
text-transform: uppercase;
margin-bottom: 0.5rem;
}
.tool-btn {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.6rem 0.75rem;
background: transparent;
color: #9ca3af;
border: none;
border-radius: 0.4rem;
cursor: pointer;
font-size: 0.875rem;
text-align: left;
width: 100%;
transition: color 0.2s;
&:hover { color: white; }
}
.tool-icon { font-size: 1rem; }
.tool-kbd {
margin-left: auto;
font-size: 0.7rem;
background: #2d3145;
color: #9ca3af;
padding: 0.1rem 0.35rem;
border-radius: 3px;
border: 1px solid #3a3f55;
}
.sidebar-footer {
padding-top: 1rem;
border-top: 1px solid #1e1e3a;
}
.version { font-size: 0.7rem; color: #4b5563; }

View File

@@ -0,0 +1,46 @@
import { Component } from '@angular/core';
import { AsyncPipe, NgIf, NgFor } from '@angular/common';
import { Router } from '@angular/router';
import { LucideAngularModule, Search, Download, Settings, ArrowLeft } from 'lucide-angular';
import { LayoutService } from '../services/layout.service';
import { GlobalSearchService } from '../services/global-search.service';
@Component({
selector: 'app-sidebar',
standalone: true,
imports: [AsyncPipe, NgIf, NgFor, LucideAngularModule],
templateUrl: './sidebar.component.html',
styleUrls: ['./sidebar.component.scss']
})
export class SidebarComponent {
currentRoute = '';
readonly Search = Search;
readonly Download = Download;
readonly Settings = Settings;
readonly ArrowLeft = ArrowLeft;
readonly layoutConfig$ = this.layoutService.secondarySidebar$;
constructor(
private router: Router,
private layoutService: LayoutService,
private globalSearch: GlobalSearchService
) {
this.router.events.subscribe(() => {
this.currentRoute = this.router.url;
});
}
navigateTo(route: string): void {
this.router.navigate([route]);
}
isActive(itemRoute: string): boolean {
return this.currentRoute === itemRoute;
}
openSearch(): void {
this.globalSearch.open();
}
}