Develop #2

Open
w-vandal wants to merge 48 commits from develop into main
12 changed files with 1017 additions and 183 deletions
Showing only changes of commit d46a1ca69f - Show all commits
+20
View File
@@ -11,6 +11,8 @@
"dependencies": { "dependencies": {
"@electron-toolkit/preload": "^3.0.2", "@electron-toolkit/preload": "^3.0.2",
"@electron-toolkit/utils": "^4.0.0", "@electron-toolkit/utils": "^4.0.0",
"@fontsource/inter": "^5.3.0",
"@fontsource/jetbrains-mono": "^5.3.0",
"dotenv": "^18.0.8", "dotenv": "^18.0.8",
"electron-updater": "^6.8.11", "electron-updater": "^6.8.11",
"pdf-lib": "^1.17.1", "pdf-lib": "^1.17.1",
@@ -1240,6 +1242,24 @@
} }
} }
}, },
"node_modules/@fontsource/inter": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/@fontsource/inter/-/inter-5.3.0.tgz",
"integrity": "sha512-RofMylZmjlJEfELXeNHFWBRcSs75rGU/6bV2S2jfnvv/3rPXPGe0LgUJTklcHZ9lM4OZmAVFhcJPnACfb91A3g==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
"node_modules/@fontsource/jetbrains-mono": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/@fontsource/jetbrains-mono/-/jetbrains-mono-5.3.0.tgz",
"integrity": "sha512-fqDfB5I9f1p1TV486aUgB9t8zP84P0O1FtQR5Ol9vjwPy+S+EIGlVYm1cvj2W5shcZMTg2nZFdVMoH5wFu8a1A==",
"license": "OFL-1.1",
"funding": {
"url": "https://github.com/sponsors/ayuhito"
}
},
"node_modules/@humanfs/core": { "node_modules/@humanfs/core": {
"version": "0.19.2", "version": "0.19.2",
"resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz",
+2
View File
@@ -44,6 +44,8 @@
"dependencies": { "dependencies": {
"@electron-toolkit/preload": "^3.0.2", "@electron-toolkit/preload": "^3.0.2",
"@electron-toolkit/utils": "^4.0.0", "@electron-toolkit/utils": "^4.0.0",
"@fontsource/inter": "^5.3.0",
"@fontsource/jetbrains-mono": "^5.3.0",
"dotenv": "^18.0.8", "dotenv": "^18.0.8",
"electron-updater": "^6.8.11", "electron-updater": "^6.8.11",
"pdf-lib": "^1.17.1", "pdf-lib": "^1.17.1",
+6 -48
View File
@@ -1,35 +1,5 @@
:root { /* Les tokens de couleur/typographie/espace vivent dans ../styles/tokens.css (design system,
--ev-c-white: #ffffff; docs/Max_Design_System.md) : ce fichier ne garde que le reset de base. */
--ev-c-white-soft: #f8f8f8;
--ev-c-white-mute: #f2f2f2;
--ev-c-black: #1b1b1f;
--ev-c-black-soft: #222222;
--ev-c-black-mute: #282828;
--ev-c-gray-1: #515c67;
--ev-c-gray-2: #414853;
--ev-c-gray-3: #32363f;
--ev-c-text-1: rgba(255, 255, 245, 0.86);
--ev-c-text-2: rgba(235, 235, 245, 0.6);
--ev-c-text-3: rgba(235, 235, 245, 0.38);
--ev-button-alt-border: transparent;
--ev-button-alt-text: var(--ev-c-text-1);
--ev-button-alt-bg: var(--ev-c-gray-3);
--ev-button-alt-hover-border: transparent;
--ev-button-alt-hover-text: var(--ev-c-text-1);
--ev-button-alt-hover-bg: var(--ev-c-gray-2);
}
:root {
--color-background: var(--ev-c-black);
--color-background-soft: var(--ev-c-black-soft);
--color-background-mute: var(--ev-c-black-mute);
--color-text: var(--ev-c-text-1);
}
*, *,
*::before, *::before,
@@ -45,22 +15,10 @@ ul {
body { body {
min-height: 100vh; min-height: 100vh;
color: var(--color-text); color: var(--text-1);
background: var(--color-background); background: var(--bg);
line-height: 1.6; line-height: var(--leading-body);
font-family: font-family: var(--font-sans);
Inter,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
Oxygen,
Ubuntu,
Cantarell,
'Fira Sans',
'Droid Sans',
'Helvetica Neue',
sans-serif;
text-rendering: optimizeLegibility; text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
@@ -28,85 +28,43 @@ export default function LoginView(): React.JSX.Element {
} }
return ( return (
<div <div className="auth-panel">
style={{ <h1 className="auth-panel__title">Connexion a Max</h1>
background: '#1e1e1e',
color: '#eee',
minHeight: '100vh',
padding: 24,
fontFamily: 'sans-serif',
boxSizing: 'border-box'
}}
>
<h1 style={{ fontSize: 18, marginBottom: 20 }}>Connexion a Max</h1>
{success ? ( {success ? (
<p style={{ color: '#8bc34a' }}> <p className="auth-panel__success">
Connexion reussie. Cette fenetre se ferme automatiquement... Connexion reussie. Cette fenetre se ferme automatiquement...
</p> </p>
) : ( ) : (
<form onSubmit={submit}> <form onSubmit={submit}>
<label style={{ display: 'block', marginBottom: 12 }}> <label className="auth-field">
<span style={{ display: 'block', marginBottom: 4, fontSize: 13, color: '#aaa' }}> <span className="auth-field__label">Email</span>
Email
</span>
<input <input
type="email" type="email"
value={email} value={email}
onChange={(e) => setEmail(e.target.value)} onChange={(e) => setEmail(e.target.value)}
autoFocus autoFocus
style={{ className="auth-field__input"
width: '100%',
boxSizing: 'border-box',
padding: 10,
background: '#111',
color: '#eee',
border: '1px solid #444',
borderRadius: 4
}}
/> />
</label> </label>
<label style={{ display: 'block', marginBottom: 16 }}> <label className="auth-field">
<span style={{ display: 'block', marginBottom: 4, fontSize: 13, color: '#aaa' }}> <span className="auth-field__label">Mot de passe</span>
Mot de passe
</span>
<input <input
type="password" type="password"
value={password} value={password}
onChange={(e) => setPassword(e.target.value)} onChange={(e) => setPassword(e.target.value)}
style={{ className="auth-field__input"
width: '100%',
boxSizing: 'border-box',
padding: 10,
background: '#111',
color: '#eee',
border: '1px solid #444',
borderRadius: 4
}}
/> />
</label> </label>
{error && ( {error && (
<p style={{ color: '#e57373', fontSize: 13, marginBottom: 16 }} role="alert"> <p className="auth-panel__error" role="alert">
{error} {error}
</p> </p>
)} )}
<button <button type="submit" disabled={!canSubmit} className="auth-panel__submit">
type="submit"
disabled={!canSubmit}
style={{
width: '100%',
padding: '10px 24px',
fontSize: 14,
background: canSubmit ? '#3f6fd1' : '#444',
color: '#fff',
border: 'none',
borderRadius: 4,
cursor: canSubmit ? 'pointer' : 'not-allowed'
}}
>
{submitting ? 'Connexion...' : 'Se connecter'} {submitting ? 'Connexion...' : 'Se connecter'}
</button> </button>
</form> </form>
@@ -1,12 +1,3 @@
const dotStyle = (delay: string): React.CSSProperties => ({
width: 10,
height: 10,
borderRadius: '50%',
backgroundColor: '#ffffff',
animation: 'forge-avatar-think-bounce 1s infinite ease-in-out',
animationDelay: delay
})
/** /**
* Doit rester visible meme sur une tache tres longue (pipeline Coach : plusieurs dizaines de * Doit rester visible meme sur une tache tres longue (pipeline Coach : plusieurs dizaines de
* secondes, constate en test reel) pour que l'utilisateur sache que Max travaille encore, pas * secondes, constate en test reel) pour que l'utilisateur sache que Max travaille encore, pas
@@ -15,35 +6,12 @@ const dotStyle = (delay: string): React.CSSProperties => ({
*/ */
function ThinkingIndicator(): React.JSX.Element { function ThinkingIndicator(): React.JSX.Element {
return ( return (
<div <div className="thinking">
style={{ <span className="thinking__label">Max reflechit...</span>
position: 'absolute', <span className="thinking__dots">
top: '4%', <span className="thinking__dot" style={{ animationDelay: '0s' }} />
left: '50%', <span className="thinking__dot" style={{ animationDelay: '0.15s' }} />
transform: 'translateX(-50%)', <span className="thinking__dot" style={{ animationDelay: '0.3s' }} />
display: 'flex',
alignItems: 'center',
gap: 10,
padding: '10px 18px',
borderRadius: 999,
backgroundColor: 'rgba(0, 0, 0, 0.75)',
boxShadow: '0 0 0 2px rgba(255, 255, 255, 0.25)',
pointerEvents: 'none'
}}
>
<style>{`
@keyframes forge-avatar-think-bounce {
0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
40% { transform: scale(1); opacity: 1; }
}
`}</style>
<span style={{ color: '#ffffff', fontSize: 13, fontFamily: 'sans-serif' }}>
Max reflechit...
</span>
<span style={{ display: 'flex', gap: 6 }}>
<span style={dotStyle('0s')} />
<span style={dotStyle('0.15s')} />
<span style={dotStyle('0.3s')} />
</span> </span>
</div> </div>
) )
@@ -9,28 +9,7 @@ function UpdateBanner({ status }: { status: 'available' | 'ready' }): React.JSX.
? 'Mise a jour prete : elle sera installee a la prochaine fermeture de Max.' ? 'Mise a jour prete : elle sera installee a la prochaine fermeture de Max.'
: 'Mise a jour disponible, telechargement en cours...' : 'Mise a jour disponible, telechargement en cours...'
return ( return <div className="banner banner--info">{message}</div>
<div
style={{
position: 'absolute',
bottom: '4%',
left: '50%',
transform: 'translateX(-50%)',
maxWidth: '90%',
padding: '10px 18px',
borderRadius: 12,
backgroundColor: 'rgba(30, 90, 150, 0.9)',
boxShadow: '0 0 0 2px rgba(255, 255, 255, 0.25)',
color: '#ffffff',
fontSize: 13,
fontFamily: 'sans-serif',
textAlign: 'center',
pointerEvents: 'none'
}}
>
{message}
</div>
)
} }
export default UpdateBanner export default UpdateBanner
@@ -4,28 +4,7 @@
* alors qu'une erreur reseau transitoire avait simplement coupe la transcription. * alors qu'une erreur reseau transitoire avait simplement coupe la transcription.
*/ */
function VoiceErrorBanner({ message }: { message: string }): React.JSX.Element { function VoiceErrorBanner({ message }: { message: string }): React.JSX.Element {
return ( return <div className="banner banner--error">Erreur : {message}</div>
<div
style={{
position: 'absolute',
top: '4%',
left: '50%',
transform: 'translateX(-50%)',
maxWidth: '90%',
padding: '10px 18px',
borderRadius: 12,
backgroundColor: 'rgba(150, 30, 30, 0.9)',
boxShadow: '0 0 0 2px rgba(255, 255, 255, 0.25)',
color: '#ffffff',
fontSize: 13,
fontFamily: 'sans-serif',
textAlign: 'center',
pointerEvents: 'none'
}}
>
Erreur : {message}
</div>
)
} }
export default VoiceErrorBanner export default VoiceErrorBanner
+7
View File
@@ -1,3 +1,10 @@
import '@fontsource/inter/400.css'
import '@fontsource/inter/500.css'
import '@fontsource/inter/600.css'
import '@fontsource/jetbrains-mono/400.css'
import './styles/tokens.css'
import './styles/components.css'
import './styles/app.css'
import './assets/main.css' import './assets/main.css'
import { StrictMode } from 'react' import { StrictMode } from 'react'
+170
View File
@@ -0,0 +1,170 @@
/* Composants propres a Max Avatar qui n'ont pas d'equivalent direct dans la bibliotheque du
design system (docs/Max_Design_System.md) mais doivent en respecter les tokens, rayons, ombres
et regles visuelles (section "ce que l'IA codeuse ne doit pas faire"). */
/* ── Indicateur de reflexion ── */
.thinking {
position: absolute;
top: 4%;
left: 50%;
transform: translateX(-50%);
display: flex;
align-items: center;
gap: var(--space-3);
padding: var(--space-2) var(--space-4);
border-radius: var(--radius-full);
background: var(--surface);
border: 1px solid var(--border);
box-shadow: var(--shadow-panel);
pointer-events: none;
}
.thinking__label {
font-family: var(--font-sans);
font-size: var(--text-sm);
color: var(--text-1);
}
.thinking__dots {
display: flex;
gap: var(--space-1);
}
.thinking__dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--accent);
animation: thinking-bounce 1s infinite ease-in-out;
}
@keyframes thinking-bounce {
0%,
80%,
100% {
transform: scale(0.6);
opacity: 0.5;
}
40% {
transform: scale(1);
opacity: 1;
}
}
/* ── Bannieres flottantes (erreur, mise a jour) ── */
.banner {
position: absolute;
left: 50%;
transform: translateX(-50%);
max-width: min(90%, 420px);
padding: var(--space-2) var(--space-4);
border-radius: var(--radius-md);
background: var(--surface);
box-shadow: var(--shadow-panel);
font-family: var(--font-sans);
font-size: var(--text-sm);
line-height: var(--leading-tight);
text-align: center;
color: var(--text-1);
pointer-events: none;
}
.banner--error {
top: 4%;
border: 1px solid rgba(248, 113, 113, 0.3);
}
.banner--info {
bottom: 4%;
border: 1px solid var(--border-active);
}
/* ── Fenetre de connexion ── */
.auth-panel {
width: 100%;
height: 100%;
box-sizing: border-box;
padding: var(--space-5);
background: var(--bg);
font-family: var(--font-sans);
display: flex;
flex-direction: column;
}
.auth-panel__title {
font-size: var(--text-md);
font-weight: var(--weight-semi);
color: var(--text-1);
margin-bottom: var(--space-5);
}
.auth-panel__success {
font-size: var(--text-base);
color: var(--green);
}
.auth-field {
display: block;
margin-bottom: var(--space-4);
}
.auth-field__label {
display: block;
margin-bottom: var(--space-1);
font-size: var(--text-sm);
color: var(--text-2);
}
.auth-field__input {
width: 100%;
box-sizing: border-box;
padding: var(--space-3);
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-md);
color: var(--text-1);
font-family: var(--font-sans);
font-size: var(--text-base);
outline: none;
caret-color: var(--accent);
transition: border-color var(--ease);
}
.auth-field__input:focus {
border-color: var(--border-active);
}
.auth-panel__error {
margin-bottom: var(--space-4);
font-size: var(--text-sm);
color: var(--red);
}
.auth-panel__submit {
width: 100%;
padding: var(--space-3) var(--space-4);
border: none;
border-radius: var(--radius-md);
background: var(--accent);
color: white;
font-family: var(--font-sans);
font-size: var(--text-base);
font-weight: var(--weight-medium);
cursor: pointer;
opacity: 0.9;
transition: opacity var(--ease);
}
.auth-panel__submit:hover:not(:disabled) {
opacity: 1;
}
.auth-panel__submit:disabled {
background: var(--surface-2);
color: var(--text-3);
cursor: not-allowed;
opacity: 1;
}
@@ -0,0 +1,333 @@
/* Bibliotheque de composants du design system (docs/Max_Design_System.md). A reutiliser tel quel
pour toute nouvelle surface du pipeline coach (bulle de chat, panneau de module, carte
d'exercice, stepper, barre de saisie, badge) plutot que d'ecrire de nouvelles classes. */
/* ── Chat bubble — bulle de message ── */
.chat-bubble {
max-width: 280px;
padding: var(--space-3) var(--space-4);
border-radius: var(--radius-lg);
font-family: var(--font-sans);
font-size: var(--text-base);
line-height: var(--leading-body);
box-shadow: var(--shadow-panel);
}
.chat-bubble--max {
background: var(--surface);
border: 1px solid var(--border);
color: var(--text-1);
border-bottom-left-radius: var(--radius-sm);
}
.chat-bubble--user {
background: var(--accent-dim);
border: 1px solid var(--border-active);
color: var(--text-1);
border-bottom-right-radius: var(--radius-sm);
align-self: flex-end;
}
/* ── Module panel — panneau de cours ── */
.module-panel {
width: 420px;
max-height: 520px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-panel);
display: flex;
flex-direction: column;
overflow: hidden;
}
.module-panel__header {
padding: var(--space-4) var(--space-5);
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
.module-panel__tag {
font-size: var(--text-xs);
font-weight: var(--weight-medium);
color: var(--accent);
margin-bottom: var(--space-1);
}
.module-panel__title {
font-size: var(--text-md);
font-weight: var(--weight-semi);
letter-spacing: -0.3px;
color: var(--text-1);
}
.module-panel__body {
flex: 1;
overflow-y: auto;
padding: var(--space-5);
font-size: var(--text-base);
line-height: var(--leading-body);
color: #9097b0;
scrollbar-width: thin;
scrollbar-color: var(--surface-2) transparent;
}
/* ── Exercise card — carte d'exercice ── */
.ex-card {
padding: var(--space-4);
background: var(--bg);
border: 1px solid var(--border);
border-radius: var(--radius-md);
cursor: pointer;
transition: border-color var(--ease);
}
.ex-card:hover {
border-color: var(--border-active);
}
.ex-card__level {
font-size: var(--text-xs);
font-weight: var(--weight-medium);
margin-bottom: var(--space-2);
}
.ex-card__level--easy {
color: var(--green);
}
.ex-card__level--medium {
color: var(--amber);
}
.ex-card__level--hard {
color: var(--red);
}
.ex-card__text {
font-size: var(--text-sm);
color: var(--text-2);
line-height: var(--leading-tight);
}
/* ── Pipeline stepper — progression session ── */
.step {
display: flex;
align-items: center;
gap: var(--space-2);
padding: var(--space-2) var(--space-2);
border-radius: var(--radius-sm);
border: 1px solid transparent;
}
.step--done {
opacity: 0.45;
}
.step--pending {
opacity: 0.25;
}
.step--active {
background: var(--accent-dim);
border-color: var(--border-active);
}
.step__num {
width: 18px;
height: 18px;
border-radius: 5px;
display: flex;
align-items: center;
justify-content: center;
font-size: 9px;
font-weight: var(--weight-semi);
flex-shrink: 0;
}
.step--done .step__num {
background: var(--green-dim);
color: var(--green);
}
.step--active .step__num {
background: var(--accent);
color: white;
}
.step--pending .step__num {
background: var(--surface-2);
color: var(--text-3);
border: 1px solid var(--border);
}
.step__label {
font-size: var(--text-sm);
font-weight: var(--weight-medium);
color: var(--text-2);
}
.step--active .step__label {
color: var(--text-1);
}
/* ── Input bar — barre de saisie ── */
.input-bar {
display: flex;
align-items: center;
gap: var(--space-2);
padding: var(--space-2) var(--space-3);
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-md);
transition: border-color var(--ease);
width: 320px;
}
.input-bar:focus-within {
border-color: var(--border-active);
}
.input-bar input {
flex: 1;
border: none;
background: none;
outline: none;
font-family: var(--font-sans);
font-size: var(--text-base);
color: var(--text-1);
caret-color: var(--accent);
}
.input-bar input::placeholder {
color: var(--text-3);
}
.input-bar__btn {
width: 28px;
height: 28px;
border-radius: var(--radius-sm);
border: 1px solid var(--border);
background: none;
color: var(--text-2);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all var(--ease);
flex-shrink: 0;
}
.input-bar__btn:hover {
background: var(--surface-2);
color: var(--text-1);
}
.input-bar__send {
width: 28px;
height: 28px;
border-radius: var(--radius-sm);
border: none;
background: var(--accent);
color: white;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
opacity: 0.9;
transition: opacity var(--ease);
flex-shrink: 0;
}
.input-bar__send:hover {
opacity: 1;
}
/* ── Badge — statut et labels ── */
.badge {
display: inline-flex;
align-items: center;
gap: var(--space-1);
padding: 3px var(--space-2);
border-radius: var(--radius-full);
font-size: var(--text-xs);
font-weight: var(--weight-medium);
white-space: nowrap;
}
.badge--active {
background: var(--accent-dim);
color: #a5b4fc;
border: 1px solid var(--border-active);
}
.badge--success {
background: var(--green-dim);
color: var(--green);
}
.badge--neutral {
background: var(--surface-2);
color: var(--text-2);
border: 1px solid var(--border);
}
.live-dot {
width: 5px;
height: 5px;
border-radius: 50%;
background: var(--green);
animation: blink 2.5s ease-in-out infinite;
}
@keyframes blink {
0%,
100% {
opacity: 1;
}
60% {
opacity: 0.3;
}
}
/* ── Code block — affichage de code ── */
.code-block {
background: #0a0b0f;
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: var(--space-4) var(--space-5);
font-family: var(--font-mono);
font-size: 12px;
line-height: 1.65;
color: #8892b0;
overflow-x: auto;
tab-size: 2;
}
.token-kw {
color: #8b8bdb;
}
.token-fn {
color: #88c0d0;
}
.token-str {
color: #a3be8c;
}
.token-num {
color: #d08770;
}
.token-cm {
color: #3b4261;
font-style: italic;
}
@@ -0,0 +1,65 @@
:root {
/* ── Couleurs de base ── */
--bg: #0c0d12; /* fond principal de la fenetre */
--surface: #111318; /* surface des panneaux */
--surface-2: #16181f; /* surface secondaire, hover */
/* ── Bordures ── */
--border: rgba(255, 255, 255, 0.06);
--border-active: rgba(99, 102, 241, 0.3);
--border-hover: rgba(255, 255, 255, 0.1);
/* ── Accent ── */
--accent: #6366f1; /* indigo — couleur principale */
--accent-dim: rgba(99, 102, 241, 0.12); /* fond des elements actifs */
--accent-glow: rgba(99, 102, 241, 0.08); /* halo tres subtil avatar uniquement */
/* ── Texte ── */
--text-1: #e4e6ee; /* texte principal */
--text-2: #6b7280; /* texte secondaire, labels */
--text-3: #2d3148; /* texte desactive, placeholders */
/* ── Semantique ── */
--green: #34d399;
--green-dim: rgba(52, 211, 153, 0.1);
--amber: #fbbf24;
--red: #f87171;
/* ── Typographie ── */
--font-sans: 'Inter', system-ui, sans-serif;
--font-mono: 'JetBrains Mono', 'Fira Code', monospace;
--text-xs: 11px;
--text-sm: 12px;
--text-base: 13.5px;
--text-md: 15px;
--text-lg: 18px;
--weight-normal: 400;
--weight-medium: 500;
--weight-semi: 600;
--leading-tight: 1.4;
--leading-body: 1.75;
/* ── Espace ── */
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
--space-5: 20px;
--space-6: 24px;
/* ── Rayons ── */
--radius-sm: 6px;
--radius-md: 9px;
--radius-lg: 14px;
--radius-full: 9999px;
/* ── Ombres ── */
--shadow-panel: 0 8px 32px rgba(0, 0, 0, 0.45);
--shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
/* ── Transitions ── */
--ease: 0.15s ease;
}
+395
View File
@@ -0,0 +1,395 @@
# Max — Design System & CSS Template
> Ce document définit les tokens CSS et les règles visuelles à respecter pour tous les composants de Max. Max est un **avatar 3D de bureau** — les composants sont des **panneaux flottants**, des **bulles**, des **cartes** qui apparaissent autour de l'avatar. Pas des pages entières.
---
## Contexte d'utilisation
Max s'affiche comme une fenêtre Electron transparente, always-on-top. Les composants UI sont de petites surfaces qui apparaissent autour ou à côté de l'avatar 3D selon le contexte :
- Une **bulle de chat** pour les messages
- Un **panneau de module** pour afficher le contenu de cours
- Des **cartes d'exercice** pour les exercices
- Un **stepper** pour la progression dans le pipeline
- Une **barre de saisie** pour l'input utilisateur
- Des **badges de statut** pour indiquer l'état de Max
Tous ces composants sont compacts, semi-transparents, et ne doivent jamais cacher l'avatar.
---
## Tokens CSS
À placer dans un fichier `src/renderer/styles/tokens.css` importé globalement.
```css
:root {
/* ── Couleurs de base ── */
--bg: #0C0D12; /* fond principal de la fenêtre */
--surface: #111318; /* surface des panneaux */
--surface-2: #16181F; /* surface secondaire, hover */
/* ── Bordures ── */
--border: rgba(255, 255, 255, 0.06);
--border-active: rgba(99, 102, 241, 0.30);
--border-hover: rgba(255, 255, 255, 0.10);
/* ── Accent ── */
--accent: #6366F1; /* indigo — couleur principale */
--accent-dim: rgba(99, 102, 241, 0.12); /* fond des éléments actifs */
--accent-glow: rgba(99, 102, 241, 0.08); /* halo très subtil avatar uniquement */
/* ── Texte ── */
--text-1: #E4E6EE; /* texte principal */
--text-2: #6B7280; /* texte secondaire, labels */
--text-3: #2D3148; /* texte désactivé, placeholders */
/* ── Sémantique ── */
--green: #34D399;
--green-dim: rgba(52, 211, 153, 0.10);
--amber: #FBBF24;
--red: #F87171;
/* ── Typographie ── */
--font-sans: 'Inter', system-ui, sans-serif;
--font-mono: 'JetBrains Mono', 'Fira Code', monospace;
--text-xs: 11px;
--text-sm: 12px;
--text-base: 13.5px;
--text-md: 15px;
--text-lg: 18px;
--weight-normal: 400;
--weight-medium: 500;
--weight-semi: 600;
--leading-tight: 1.4;
--leading-body: 1.75;
/* ── Espace ── */
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
--space-5: 20px;
--space-6: 24px;
/* ── Rayons ── */
--radius-sm: 6px;
--radius-md: 9px;
--radius-lg: 14px;
--radius-full: 9999px;
/* ── Ombres ── */
--shadow-panel: 0 8px 32px rgba(0, 0, 0, 0.45);
--shadow-card: 0 2px 8px rgba(0, 0, 0, 0.30);
/* ── Transitions ── */
--ease: 0.15s ease;
}
```
---
## Composants
### Chat bubble — bulle de message
```css
/* Conteneur de conversation */
.chat-bubble {
max-width: 280px;
padding: var(--space-3) var(--space-4);
border-radius: var(--radius-lg);
font-family: var(--font-sans);
font-size: var(--text-base);
line-height: var(--leading-body);
box-shadow: var(--shadow-panel);
}
/* Message de Max */
.chat-bubble--max {
background: var(--surface);
border: 1px solid var(--border);
color: var(--text-1);
border-bottom-left-radius: var(--radius-sm);
}
/* Message de l'utilisateur */
.chat-bubble--user {
background: var(--accent-dim);
border: 1px solid var(--border-active);
color: var(--text-1);
border-bottom-right-radius: var(--radius-sm);
align-self: flex-end;
}
```
### Module panel — panneau de cours
```css
.module-panel {
width: 420px;
max-height: 520px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-panel);
display: flex;
flex-direction: column;
overflow: hidden;
}
.module-panel__header {
padding: var(--space-4) var(--space-5);
border-bottom: 1px solid var(--border);
flex-shrink: 0;
}
.module-panel__tag {
font-size: var(--text-xs);
font-weight: var(--weight-medium);
color: var(--accent);
margin-bottom: var(--space-1);
}
.module-panel__title {
font-size: var(--text-md);
font-weight: var(--weight-semi);
letter-spacing: -0.3px;
color: var(--text-1);
}
.module-panel__body {
flex: 1;
overflow-y: auto;
padding: var(--space-5);
font-size: var(--text-base);
line-height: var(--leading-body);
color: #9097B0;
scrollbar-width: thin;
scrollbar-color: var(--surface-2) transparent;
}
```
### Exercise card — carte d'exercice
```css
.ex-card {
padding: var(--space-4);
background: var(--bg);
border: 1px solid var(--border);
border-radius: var(--radius-md);
cursor: pointer;
transition: border-color var(--ease);
}
.ex-card:hover {
border-color: var(--border-active);
}
.ex-card__level {
font-size: var(--text-xs);
font-weight: var(--weight-medium);
margin-bottom: var(--space-2);
}
.ex-card__level--easy { color: var(--green); }
.ex-card__level--medium { color: var(--amber); }
.ex-card__level--hard { color: var(--red); }
.ex-card__text {
font-size: var(--text-sm);
color: var(--text-2);
line-height: var(--leading-tight);
}
```
### Pipeline stepper — progression session
```css
.step {
display: flex;
align-items: center;
gap: var(--space-2);
padding: var(--space-2) var(--space-2);
border-radius: var(--radius-sm);
border: 1px solid transparent;
}
.step--done { opacity: 0.45; }
.step--pending { opacity: 0.25; }
.step--active {
background: var(--accent-dim);
border-color: var(--border-active);
}
.step__num {
width: 18px;
height: 18px;
border-radius: 5px;
display: flex;
align-items: center;
justify-content: center;
font-size: 9px;
font-weight: var(--weight-semi);
flex-shrink: 0;
}
.step--done .step__num { background: var(--green-dim); color: var(--green); }
.step--active .step__num { background: var(--accent); color: white; }
.step--pending .step__num { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.step__label {
font-size: var(--text-sm);
font-weight: var(--weight-medium);
color: var(--text-2);
}
.step--active .step__label { color: var(--text-1); }
```
### Input bar — barre de saisie
```css
.input-bar {
display: flex;
align-items: center;
gap: var(--space-2);
padding: var(--space-2) var(--space-3);
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-md);
transition: border-color var(--ease);
width: 320px;
}
.input-bar:focus-within {
border-color: var(--border-active);
}
.input-bar input {
flex: 1;
border: none;
background: none;
outline: none;
font-family: var(--font-sans);
font-size: var(--text-base);
color: var(--text-1);
caret-color: var(--accent);
}
.input-bar input::placeholder { color: var(--text-3); }
.input-bar__btn {
width: 28px;
height: 28px;
border-radius: var(--radius-sm);
border: 1px solid var(--border);
background: none;
color: var(--text-2);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all var(--ease);
flex-shrink: 0;
}
.input-bar__btn:hover { background: var(--surface-2); color: var(--text-1); }
.input-bar__send {
width: 28px;
height: 28px;
border-radius: var(--radius-sm);
border: none;
background: var(--accent);
color: white;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
opacity: 0.9;
transition: opacity var(--ease);
flex-shrink: 0;
}
.input-bar__send:hover { opacity: 1; }
```
### Badge — statut et labels
```css
.badge {
display: inline-flex;
align-items: center;
gap: var(--space-1);
padding: 3px var(--space-2);
border-radius: var(--radius-full);
font-size: var(--text-xs);
font-weight: var(--weight-medium);
white-space: nowrap;
}
.badge--active { background: var(--accent-dim); color: #A5B4FC; border: 1px solid var(--border-active); }
.badge--success { background: var(--green-dim); color: var(--green); }
.badge--neutral { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
/* Point de statut live */
.live-dot {
width: 5px;
height: 5px;
border-radius: 50%;
background: var(--green);
animation: blink 2.5s ease-in-out infinite;
}
@keyframes blink {
0%, 100% { opacity: 1; }
60% { opacity: 0.3; }
}
```
### Code block — affichage de code
```css
.code-block {
background: #0A0B0F;
border: 1px solid var(--border);
border-radius: var(--radius-md);
padding: var(--space-4) var(--space-5);
font-family: var(--font-mono);
font-size: 12px;
line-height: 1.65;
color: #8892B0;
overflow-x: auto;
tab-size: 2;
}
/* Syntax highlighting */
.token-kw { color: #8B8BDB; } /* keywords */
.token-fn { color: #88C0D0; } /* functions */
.token-str { color: #A3BE8C; } /* strings */
.token-num { color: #D08770; } /* numbers */
.token-cm { color: #3B4261; font-style: italic; } /* comments */
```
---
## Règles visuelles — ce que l'IA codeuse ne doit pas faire
| Interdit | Pourquoi |
| --- | --- |
| Utiliser une couleur hors des tokens | Crée de l'incohérence visuelle |
| Ajouter des ombres colorées (box-shadow coloré) | Réservé au halo de l'avatar uniquement |
| Utiliser `border-radius` hors des variables | Les rayons doivent être cohérents |
| Animer autre chose que les dots et le live-dot | Les animations doivent être discrètes |
| Dépasser 420px de largeur pour un panneau | Max est un composant de bureau, pas une page |
| Utiliser du blanc pur (#FFF) ou du noir pur (#000) | Toujours utiliser les tokens |
| Mettre du texte en all-caps | Jamais dans cette interface |
| Utiliser un dégradé visible sur du texte | Réservé au logo "Max." uniquement |
| Ajouter des icônes emoji dans les composants | Utiliser une lib d'icônes (Lucide) |
| Importer une nouvelle police | Inter et JetBrains Mono uniquement |