Files
LoreMind/web/src/app/campaigns/campaign/campaign-detail/campaign-detail.component.scss
IETM_FIXE\ietm6 f670735100 Export/import par campagne + espace de jeu (v2), fix du nombre de joueurs, et ergonomie de jeu
Export / import de contenu (format v2)
- Export SÉLECTIF : on peut exporter une seule campagne (sa clôture : arcs →
  chapitres → scènes, PNJ, ennemis, catalogues, tables, système de jeu lié) au
  lieu de tout exporter. Options par export : inclure le lore, l'espace de jeu,
  les images. L'export global devient « Sauvegarde complète ».
- ESPACE DE JEU désormais exporté/importé : parties (Playthrough), séances,
  journal, flags, progression de quêtes, et feuilles de perso (Character.playthroughId
  préservé au lieu d'être annulé). Remapping complet des références à l'import.
- Format v2 rétro-compatible : un export v1 (sans section jeu) s'importe toujours
  (champs absents → null → traités comme vides).
- Correction d'un bug latent : collectReferencedStorageKeys traitait les références
  d'images comme des clés de stockage alors que ce sont des IDs → les binaires
  d'images n'étaient en réalité pas embarqués dans le zip. Résolution ID → clé.
- Images des Rooms d'une scène (illustration + plan) désormais collectées (elles
  étaient oubliées des deux collecteurs).
- Endpoint : GET /api/admin/data/export?campaignId=&includeLore=&includePlay=&includeImages=
  ; écran « Sauvegarde des données » avec choix campagne + cases à cocher.
- Tests : round-trip étendu au jeu + binaire image réel, export sélectif par
  campagne, import d'archive v1, et DataTransferController.

Correction : nombre de joueurs non persisté
- playerCount était saisi à la création mais jeté par le backend (absent du
  domaine/entité/DTO/mapper) → affichage « 0 joueurs ». Ajouté sur toute la stack
  + migration V7 (défaut 4 pour les campagnes existantes) + intégré à l'export.

Ergonomie de l'espace de jeu et des listes
- Description de campagne repliable (clamp 3 lignes + « Voir plus / moins »).
- Dossiers repliables (chevron + compteur) dans les listes PNJ et Ennemis, sur la
  page campagne ET les pages dédiées.
- Renommage en place des parties (« Mes parties ») via un crayon.
- Panneau de session : onglets sur 2 rangs (« Scènes » n'est plus rogné) ; scènes
  triées par ordre manuel ; arcs repliables (repliés par défaut) ; PJ/PNJ repliables
  et PNJ regroupés par dossier.
2026-06-26 14:38:39 +02:00

567 lines
12 KiB
SCSS

.section-hint {
margin: -0.25rem 0 0.85rem;
font-size: 0.85rem;
color: var(--color-text-muted, #666);
max-width: 70ch;
line-height: 1.4;
}
// ==== Parties (Playthroughs) ====
.playthroughs-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 0.75rem;
}
.playthrough-card {
display: flex;
align-items: center;
gap: 0.7rem;
padding: 0.85rem 1rem;
border: 1px solid var(--color-border, #e2e2e2);
border-radius: 10px;
background: var(--color-surface, #fff);
cursor: pointer;
transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
&:hover {
border-color: var(--color-primary, #2c6cd6);
transform: translateY(-1px);
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}
}
.playthrough-icon { color: var(--color-primary, #2c6cd6); flex: 0 0 auto; }
.playthrough-info {
display: flex;
flex-direction: column;
gap: 0.15rem;
min-width: 0;
flex: 1;
}
.playthrough-rename-input {
width: 100%;
font-weight: 600;
font-size: 0.95rem;
padding: 0.15rem 0.4rem;
border: 1px solid var(--color-primary, #2c6cd6);
border-radius: 6px;
background: var(--color-surface, #fff);
color: inherit;
}
.playthrough-name {
font-weight: 600;
font-size: 0.95rem;
}
.playthrough-meta {
font-size: 0.78rem;
color: var(--color-text-muted, #777);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.campaign-detail {
padding: 2.5rem 2rem;
display: flex;
flex-direction: column;
gap: 1.5rem;
}
/**
* Chaque bloc (resume, PJ, arcs) est encapsule dans une carte distincte
* pour separer visuellement les zones. Le gap au niveau du parent gere
* les espacements — les sections ne portent plus de margin-bottom.
*/
.detail-section {
background: #0d1117;
border: 1px solid #1f2937;
border-radius: 12px;
padding: 1.5rem 1.75rem;
}
.detail-header {
h1 {
font-size: 1.75rem;
font-weight: 700;
color: white;
margin-bottom: 0.5rem;
}
.description {
color: #6b7280;
font-size: 0.95rem;
line-height: 1.6;
margin-bottom: 0.4rem;
white-space: pre-wrap;
// Replié : on borne à 3 lignes avec ellipse ; déplié = texte intégral.
&--clamped {
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
overflow: hidden;
}
}
.desc-toggle {
background: none;
border: none;
padding: 0;
margin-bottom: 1rem;
color: #8a7bc8;
font-size: 0.85rem;
font-weight: 600;
cursor: pointer;
&:hover { text-decoration: underline; }
}
.meta {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
align-items: center;
}
.badge {
display: inline-flex;
align-items: center;
gap: 0.35rem;
background: #1e3a5f;
color: #60a5fa;
font-size: 0.75rem;
font-weight: 600;
padding: 0.25rem 0.75rem;
border-radius: 999px;
text-decoration: none;
}
// Lien cliquable vers le Lore associé (weak cross-context link).
.badge-lore {
background: #2d2450;
color: #a78bfa;
transition: background 0.15s ease;
&:hover {
background: #3d3168;
cursor: pointer;
}
}
// Cas dégradé : loreId renseigné mais Lore introuvable (supprimé).
.badge-lore-missing {
background: #3a1e1e;
color: #f87171;
font-style: italic;
}
}
.detail-header {
// Sticky : Modifier/Supprimer restent accessibles pendant le scroll de la
// campagne (potentiellement très longue avec arcs / chapitres / scènes).
position: sticky;
top: 0;
z-index: 10;
background: #0a0a14;
padding: 1rem 0;
border-bottom: 1px solid #1f2937;
margin-bottom: 1.5rem;
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 1.5rem;
.header-texts { flex: 1; min-width: 0; }
.header-actions {
display: flex;
gap: 0.5rem;
flex-shrink: 0;
}
// Variante mode édition : champs empilés verticalement.
&.edit-mode {
flex-direction: column;
align-items: stretch;
.field {
display: flex;
flex-direction: column;
gap: 0.35rem;
margin-bottom: 1rem;
label { color: #9ca3af; font-size: 0.8rem; font-weight: 500; }
input, textarea, select {
background: #0f172a;
border: 1px solid #1f2937;
border-radius: 8px;
color: white;
padding: 0.6rem 0.85rem;
font-size: 0.9rem;
font-family: inherit;
&:focus { outline: none; border-color: #6c63ff; }
}
textarea { resize: vertical; }
}
.inline-create {
display: flex;
flex-direction: column;
gap: 0.5rem;
padding: 0.875rem;
background: #0f172a;
border: 1px solid #1f2937;
border-left: 3px solid #6c63ff;
border-radius: 8px;
input {
width: 100%;
background: #0a1320;
border: 1px solid #1f2937;
border-radius: 6px;
padding: 0.5rem 0.75rem;
color: white;
font-size: 0.9rem;
outline: none;
&::placeholder { color: #4b5563; }
&:focus { border-color: #6c63ff; }
}
.inline-create-actions { display: flex; gap: 0.5rem; }
.btn-inline-primary {
display: flex;
align-items: center;
gap: 0.375rem;
padding: 0.45rem 0.875rem;
background: #6c63ff;
color: white;
border: none;
border-radius: 6px;
font-size: 0.85rem;
font-weight: 600;
cursor: pointer;
transition: background 0.2s;
&:hover:not(:disabled) { background: #5b52e0; }
&:disabled { opacity: 0.4; cursor: not-allowed; }
}
.btn-inline-secondary {
padding: 0.45rem 0.875rem;
background: transparent;
color: #9ca3af;
border: 1px solid #374151;
border-radius: 6px;
font-size: 0.85rem;
cursor: pointer;
transition: background 0.2s, color 0.2s;
&:hover { background: #1f2937; color: white; }
}
}
.header-actions { justify-content: flex-end; }
}
}
// Boutons partagés.
.btn-primary, .btn-secondary, .btn-danger {
display: inline-flex;
align-items: center;
gap: 0.4rem;
padding: 0.5rem 1rem;
border: none;
border-radius: 8px;
font-size: 0.85rem;
font-weight: 500;
cursor: pointer;
transition: background 0.15s;
&:disabled { opacity: 0.5; cursor: not-allowed; }
}
.btn-primary { background: #6c63ff; color: white; &:hover:not(:disabled) { background: #5b52e0; } }
.btn-secondary { background: #1f2937; color: #d1d5db; &:hover:not(:disabled) { background: #374151; } }
.btn-danger { background: #3a1e1e; color: #f87171; &:hover:not(:disabled) { background: #5a2e2e; } }
.section-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 1.5rem;
h2 { color: #d1d5db; font-size: 1rem; font-weight: 600; }
}
.section-header-actions {
display: flex;
align-items: center;
gap: 0.5rem;
}
.btn-add {
display: flex;
align-items: center;
gap: 0.4rem;
padding: 0.5rem 1rem;
background: #6c63ff;
color: white;
border: none;
border-radius: 8px;
font-size: 0.85rem;
font-weight: 500;
cursor: pointer;
transition: background 0.2s;
&:hover { background: #5b52e0; }
// Variante secondaire (ex: "Importer un PDF") : discrète à côté de l'action primaire.
&--secondary {
background: #1f2937;
color: #e5e7eb;
border: 1px solid #374151;
&:hover { background: #273244; border-color: #6c63ff; }
}
}
.arcs-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
gap: 1rem;
}
.arc-card {
background: #111827;
border: 1px solid #1f2937;
border-radius: 10px;
padding: 1.25rem;
display: flex;
flex-direction: column;
gap: 0.5rem;
cursor: pointer;
transition: border-color 0.2s, transform 0.2s;
&:hover { border-color: #6c63ff; transform: translateY(-2px); }
.arc-icon { color: #6c63ff; }
.arc-name { color: white; font-size: 0.9rem; font-weight: 600; }
.arc-meta { color: #6b7280; font-size: 0.75rem; }
}
// Encart "Personnages" qui regroupe les sous-sections PJ et PNJ.
.personas-section {
.persona-subsection + .persona-subsection {
margin-top: 1.75rem;
padding-top: 1.5rem;
border-top: 1px solid #1f2937;
}
}
.subsection-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 1rem;
h3 {
display: flex;
align-items: center;
gap: 0.5rem;
color: #d1d5db;
font-size: 0.875rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.04em;
margin: 0;
lucide-icon { color: #a78bfa; }
}
.count-badge {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 1.4rem;
height: 1.4rem;
padding: 0 0.45rem;
background: #1f2937;
color: #a78bfa;
border-radius: 999px;
font-size: 0.7rem;
font-weight: 700;
letter-spacing: 0;
text-transform: none;
margin-left: 0.25rem;
}
}
.characters-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
gap: 0.75rem;
}
.character-card {
background: #111827;
border: 1px solid #1f2937;
border-radius: 10px;
padding: 0.9rem 1rem;
display: flex;
align-items: flex-start;
gap: 0.75rem;
cursor: pointer;
transition: border-color 0.2s, transform 0.2s;
&:hover { border-color: #a78bfa; transform: translateY(-2px); }
.character-icon { color: #a78bfa; flex-shrink: 0; margin-top: 2px; }
.character-info {
display: flex;
flex-direction: column;
min-width: 0;
gap: 0.2rem;
}
.character-name { color: white; font-size: 0.95rem; font-weight: 600; }
.character-snippet {
color: #6b7280;
font-size: 0.8rem;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
padding: 4rem 2rem;
color: #6b7280;
.empty-icon { color: #374151; }
p { font-size: 0.95rem; }
// Variante condensée pour les sous-sections PJ/PNJ — pas besoin du
// padding vertical massif quand l'encart parent en porte déjà.
&.empty-state--compact {
padding: 1.5rem 1rem;
gap: 0.75rem;
p {
font-size: 0.85rem;
margin: 0;
}
}
}
// Variante d'icône pour les cartes PNJ (rouge-violet pour différencier des PJ).
.character-icon--npc { color: #c084fc !important; }
.btn-add-first {
display: flex;
align-items: center;
gap: 0.4rem;
padding: 0.6rem 1.25rem;
background: #6c63ff;
color: white;
border: none;
border-radius: 8px;
font-size: 0.875rem;
font-weight: 500;
cursor: pointer;
transition: background 0.2s;
&:hover { background: #5b52e0; }
}
// ─────────────── Sessions de jeu (Play Context) ───────────────
.sessions-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 0.75rem;
}
.session-card {
display: flex;
align-items: center;
gap: 0.75rem;
background: #111827;
border: 1px solid #1f2937;
border-radius: 10px;
padding: 0.9rem 1rem;
cursor: pointer;
transition: border-color 0.2s, transform 0.2s;
&:hover { border-color: #6c63ff; transform: translateY(-1px); }
&--active {
border-color: #10b981;
background: linear-gradient(180deg, #0d1f1a 0%, #111827 100%);
}
.session-icon { color: #6c63ff; flex-shrink: 0; }
.session-info {
display: flex;
flex-direction: column;
gap: 0.2rem;
min-width: 0;
}
.session-name {
color: white;
font-size: 0.9rem;
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.session-meta {
color: #6b7280;
font-size: 0.75rem;
}
.session-status {
color: #10b981;
font-weight: 600;
}
}
// En-tête de dossier dans la grille des PNJ (regroupement par dossier).
.persona-folder {
display: flex;
align-items: center;
gap: 0.4rem;
width: 100%;
font-size: 0.78rem;
font-weight: 600;
letter-spacing: 0.04em;
text-transform: uppercase;
color: #8a7bc8;
margin: 0.9rem 0 0.4rem;
// En-tête de dossier cliquable (repli) : reset du <button>.
background: none; border: none; padding: 0; cursor: pointer; text-align: left;
&:hover { color: #a594e0; }
.persona-folder-count {
font-weight: 400; text-transform: none; letter-spacing: 0;
color: #6b7280;
}
&--none { color: #6b7280; }
}