✨ Modification Style Front
This commit is contained in:
1 parent
9b4b8651d7
commit
e16677748f
6 files changed
+223
-28
No files matched your search
+20
-12
@@ -1,11 +1,12 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { BrowserRouter as Router, Routes, Route, Navigate, Link } from 'react-router-dom';
|
||||
import { BrowserRouter as Router, Routes, Route, Navigate, Link, useLocation } from 'react-router-dom';
|
||||
import HomeView from './views/HomeView';
|
||||
import ServiceView from './views/ServiceView';
|
||||
import LoginView from './views/LoginView';
|
||||
import SignupView from './views/SignupView';
|
||||
import SettingsModal from './components/SettingsModal';
|
||||
import AIChatSidebar from './components/AIChatSidebar';
|
||||
import DecorativeBackground from './components/DecorativeBackground';
|
||||
import { AuthProvider, useAuth } from './context/AuthContext';
|
||||
import ProtectedRoute from './components/ProtectedRoute';
|
||||
import { LogOut, Settings, Bot, Moon, Sun } from 'lucide-react';
|
||||
@@ -16,6 +17,7 @@ function AppContent() {
|
||||
const [isSettingsOpen, setIsSettingsOpen] = useState(false);
|
||||
const [isChatOpen, setIsChatOpen] = useState(false);
|
||||
const { user, logout } = useAuth();
|
||||
const location = useLocation();
|
||||
|
||||
// Gestion du thème
|
||||
const [theme, setTheme] = useState<'dark' | 'light'>(
|
||||
@@ -42,7 +44,9 @@ function AppContent() {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-background text-foreground flex flex-col font-sans transition-colors duration-300">
|
||||
<div className="relative min-h-screen bg-background text-foreground flex flex-col font-sans transition-colors duration-300">
|
||||
{/* Fond décoratif fixe (blobs + grille), sous le contenu */}
|
||||
<DecorativeBackground />
|
||||
<header className="sticky top-0 z-40 w-full border-b bg-background/80 backdrop-blur-md">
|
||||
<div className="max-w-7xl mx-auto px-4 h-16 flex items-center justify-between">
|
||||
<Link to="/" className="text-2xl font-bold tracking-tighter hover:opacity-80 transition-opacity">
|
||||
@@ -100,18 +104,22 @@ function AppContent() {
|
||||
</header>
|
||||
|
||||
<main className={cn(
|
||||
"flex-1 transition-all duration-300",
|
||||
"relative z-10 flex-1 transition-all duration-300",
|
||||
isChatOpen ? "lg:mr-[var(--sidebar-width)]" : ""
|
||||
)}>
|
||||
<Routes>
|
||||
<Route path="/login" element={<LoginView />} />
|
||||
<Route path="/signup" element={<SignupView />} />
|
||||
<Route element={<ProtectedRoute />}>
|
||||
<Route path="/" element={<HomeView />} />
|
||||
<Route path="/service/:id" element={<ServiceView />} />
|
||||
</Route>
|
||||
<Route path="*" element={<Navigate to="/" replace />} />
|
||||
</Routes>
|
||||
{/* La clé force un remont à chaque changement de route :
|
||||
la classe page-enter rejoue l'animation d'entrée */}
|
||||
<div key={location.pathname} className="page-enter">
|
||||
<Routes location={location}>
|
||||
<Route path="/login" element={<LoginView />} />
|
||||
<Route path="/signup" element={<SignupView />} />
|
||||
<Route element={<ProtectedRoute />}>
|
||||
<Route path="/" element={<HomeView />} />
|
||||
<Route path="/service/:id" element={<ServiceView />} />
|
||||
</Route>
|
||||
<Route path="*" element={<Navigate to="/" replace />} />
|
||||
</Routes>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{isSettingsOpen && <SettingsModal onClose={() => setIsSettingsOpen(false)} />}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
/**
|
||||
* Fond décoratif global : blobs dégradés aux couleurs de la marque
|
||||
* (bleu → violet → orange) qui dérivent lentement, sur une grille
|
||||
* discrète qui s'estompe vers le bas.
|
||||
*
|
||||
* - Fixe, derrière le contenu (z-0), invisible au pointeur.
|
||||
* - Uniquement des animations transform/opacity : fluide sur GPU.
|
||||
* - Opacité réduite en mode clair pour ne pas gêner la lecture.
|
||||
* - `prefers-reduced-motion` coupe les mouvements (voir index.css).
|
||||
*/
|
||||
|
||||
export default function DecorativeBackground() {
|
||||
return (
|
||||
<div aria-hidden className="fixed inset-0 z-0 overflow-hidden pointer-events-none">
|
||||
{/* Grille */}
|
||||
<div className="bg-grid absolute inset-0 opacity-40 dark:opacity-60" />
|
||||
|
||||
{/* Blobs dégradés */}
|
||||
<div className="absolute inset-0 opacity-60 dark:opacity-75">
|
||||
{/* Bleu — haut gauche */}
|
||||
<div
|
||||
className="bg-blob"
|
||||
style={{
|
||||
width: '52vw',
|
||||
height: '52vw',
|
||||
minWidth: '420px',
|
||||
minHeight: '420px',
|
||||
left: '-14%',
|
||||
top: '-22%',
|
||||
background:
|
||||
'radial-gradient(circle at 35% 35%, rgba(59, 130, 246, 0.55), rgba(59, 130, 246, 0) 70%)',
|
||||
animation: 'blobDrift1 46s ease-in-out infinite',
|
||||
}}
|
||||
/>
|
||||
{/* Violet — droite */}
|
||||
<div
|
||||
className="bg-blob"
|
||||
style={{
|
||||
width: '46vw',
|
||||
height: '46vw',
|
||||
minWidth: '360px',
|
||||
minHeight: '360px',
|
||||
right: '-16%',
|
||||
top: '-8%',
|
||||
background:
|
||||
'radial-gradient(circle at 60% 40%, rgba(168, 85, 247, 0.45), rgba(168, 85, 247, 0) 70%)',
|
||||
animation: 'blobDrift2 58s ease-in-out infinite',
|
||||
}}
|
||||
/>
|
||||
{/* Orange — bas gauche */}
|
||||
<div
|
||||
className="bg-blob"
|
||||
style={{
|
||||
width: '42vw',
|
||||
height: '42vw',
|
||||
minWidth: '320px',
|
||||
minHeight: '320px',
|
||||
left: '18%',
|
||||
bottom: '-28%',
|
||||
background:
|
||||
'radial-gradient(circle at 40% 60%, rgba(249, 115, 22, 0.3), rgba(249, 115, 22, 0) 70%)',
|
||||
animation: 'blobDrift3 52s ease-in-out infinite',
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
+115
@@ -172,6 +172,121 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Animations UX : apparitions fluides */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
/* Apparition douce avec léger mouvement vers le haut.
|
||||
`both` : le délai (stagger) s'applique aussi avant le départ. */
|
||||
@keyframes fadeUp {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(16px);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.anim-fade-up {
|
||||
animation: fadeUp 0.55s cubic-bezier(0.21, 0.6, 0.35, 1) both;
|
||||
}
|
||||
|
||||
/* Transition lors d'un changement de route */
|
||||
@keyframes pageEnter {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(10px);
|
||||
}
|
||||
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.page-enter {
|
||||
animation: pageEnter 0.45s ease-out both;
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Fond décoratif : blobs dégradés + grille */
|
||||
/* ------------------------------------------------------------------ */
|
||||
|
||||
.bg-blob {
|
||||
position: absolute;
|
||||
border-radius: 9999px;
|
||||
filter: blur(90px);
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
@keyframes blobDrift1 {
|
||||
0%,
|
||||
100% {
|
||||
transform: translate(0, 0) scale(1);
|
||||
}
|
||||
|
||||
33% {
|
||||
transform: translate(4vw, -5vh) scale(1.08);
|
||||
}
|
||||
|
||||
66% {
|
||||
transform: translate(-3vw, 3vh) scale(0.94);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes blobDrift2 {
|
||||
0%,
|
||||
100% {
|
||||
transform: translate(0, 0) scale(1);
|
||||
}
|
||||
|
||||
40% {
|
||||
transform: translate(-5vw, 6vh) scale(0.92);
|
||||
}
|
||||
|
||||
70% {
|
||||
transform: translate(3vw, -4vh) scale(1.06);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes blobDrift3 {
|
||||
0%,
|
||||
100% {
|
||||
transform: translate(0, 0) scale(1);
|
||||
}
|
||||
|
||||
45% {
|
||||
transform: translate(6vw, -3vh) scale(1.1);
|
||||
}
|
||||
|
||||
75% {
|
||||
transform: translate(-4vw, 5vh) scale(0.9);
|
||||
}
|
||||
}
|
||||
|
||||
/* Grille discrète qui s'estompe en s'éloignant du haut */
|
||||
.bg-grid {
|
||||
background-image:
|
||||
linear-gradient(to right, hsl(var(--border) / 0.35) 1px, transparent 1px),
|
||||
linear-gradient(to bottom, hsl(var(--border) / 0.35) 1px, transparent 1px);
|
||||
background-size: 44px 44px;
|
||||
-webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 25%, transparent 100%);
|
||||
mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, black 25%, transparent 100%);
|
||||
}
|
||||
|
||||
/* Accessibilité : pas d'animation quand l'utilisateur le demande */
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
|
||||
.bg-blob,
|
||||
.anim-fade-up,
|
||||
.page-enter {
|
||||
animation: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.ai-gradient-text {
|
||||
background: linear-gradient(74deg, #3b82f6 0%, #a855f7 46%, #f97316 100%);
|
||||
-webkit-background-clip: text;
|
||||
|
||||
+18
-14
@@ -127,7 +127,7 @@ export default function HomeView() {
|
||||
return (
|
||||
<div className="max-w-7xl mx-auto px-4 py-8 space-y-12 fade-in">
|
||||
{/* Welcome Banner */}
|
||||
<div className="relative overflow-hidden rounded-3xl bg-card border shadow-sm">
|
||||
<div className="anim-fade-up relative overflow-hidden rounded-3xl bg-card border shadow-sm">
|
||||
<div className="absolute inset-0 bg-gradient-to-r from-primary/10 via-transparent to-secondary/5" />
|
||||
<CardContent className="relative flex flex-col md:flex-row items-center justify-between p-6 sm:p-10 gap-8">
|
||||
<div className="space-y-3 text-center md:text-left">
|
||||
@@ -143,7 +143,7 @@ export default function HomeView() {
|
||||
|
||||
{/* Barre de Recherche et Filtres */}
|
||||
<section className="space-y-8">
|
||||
<div className="relative max-w-3xl mx-auto">
|
||||
<div className="anim-fade-up relative max-w-3xl mx-auto" style={{ animationDelay: '90ms' }}>
|
||||
<div className="relative group">
|
||||
<Search size={22} className="absolute left-4 top-1/2 -translate-y-1/2 text-muted-foreground transition-colors group-focus-within:text-primary" />
|
||||
<Input
|
||||
@@ -167,7 +167,7 @@ export default function HomeView() {
|
||||
|
||||
<Tabs defaultValue="all" className="w-full" onValueChange={setActiveTab}>
|
||||
<div className="flex flex-col items-center gap-6 overflow-x-auto pb-2 scrollbar-none">
|
||||
<TabsList className="bg-muted/30 p-1 rounded-xl border border-muted/50 w-full sm:w-auto h-auto sm:h-12 flex-wrap sm:flex-nowrap">
|
||||
<TabsList className="anim-fade-up bg-muted/30 p-1 rounded-xl border border-muted/50 w-full sm:w-auto h-auto sm:h-12 flex-wrap sm:flex-nowrap" style={{ animationDelay: '150ms' }}>
|
||||
<TabsTrigger value="all" className="rounded-lg flex-1 sm:flex-none px-4 sm:px-8 py-2 data-[state=active]:bg-card data-[state=active]:shadow-sm">Tous</TabsTrigger>
|
||||
<TabsTrigger value="docker" className="rounded-lg flex-1 sm:flex-none px-4 sm:px-8 py-2 data-[state=active]:bg-card data-[state=active]:shadow-sm">Docker</TabsTrigger>
|
||||
<TabsTrigger value="os" className="rounded-lg flex-1 sm:flex-none px-4 sm:px-8 py-2 data-[state=active]:bg-card data-[state=active]:shadow-sm">Système</TabsTrigger>
|
||||
@@ -184,10 +184,11 @@ export default function HomeView() {
|
||||
</div>
|
||||
|
||||
<div className="grid gap-4">
|
||||
{filteredRegistered.map(s => (
|
||||
<Card
|
||||
key={`reg-${s.id}`}
|
||||
className="hover:bg-muted/20 border-transparent hover:border-primary/20 transition-all cursor-pointer group shadow-none hover:shadow-md"
|
||||
{filteredRegistered.map((s, idx) => (
|
||||
<Card
|
||||
key={`reg-${s.id}`}
|
||||
className="anim-fade-up hover:bg-muted/20 border-transparent hover:border-primary/20 transition-all cursor-pointer group shadow-none hover:shadow-md"
|
||||
style={{ animationDelay: `${idx * 60}ms` }}
|
||||
onClick={() => navigate(`/service/${s.id}`)}
|
||||
>
|
||||
<CardContent className="flex items-center p-5 gap-5">
|
||||
@@ -204,9 +205,10 @@ export default function HomeView() {
|
||||
))}
|
||||
|
||||
{filteredSystem.map((s, idx) => (
|
||||
<Card
|
||||
key={`sys-${idx}`}
|
||||
className="hover:bg-muted/20 border-dashed border-2 hover:border-solid hover:border-secondary/30 transition-all cursor-pointer group shadow-none"
|
||||
<Card
|
||||
key={`sys-${idx}`}
|
||||
className="anim-fade-up hover:bg-muted/20 border-dashed border-2 hover:border-solid hover:border-secondary/30 transition-all cursor-pointer group shadow-none"
|
||||
style={{ animationDelay: `${(filteredRegistered.length + idx) * 60}ms` }}
|
||||
onClick={() => navigate(`/service/ephemeral?type=${s.type}&target=${s.id || s.name}&name=${s.name}`)}
|
||||
>
|
||||
<CardContent className="flex items-center p-5 gap-5">
|
||||
@@ -244,10 +246,11 @@ export default function HomeView() {
|
||||
<Separator className="flex-1" />
|
||||
</div>
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4">
|
||||
{recentServices.map(s => (
|
||||
{recentServices.map((s, idx) => (
|
||||
<Card
|
||||
key={s.id}
|
||||
className="hover:border-primary/30 transition-all cursor-pointer group shadow-none relative overflow-hidden h-24"
|
||||
className="anim-fade-up hover:border-primary/30 transition-all cursor-pointer group shadow-none relative overflow-hidden h-24"
|
||||
style={{ animationDelay: `${idx * 70}ms` }}
|
||||
onClick={() => navigate(`/service/${s.id}`)}
|
||||
>
|
||||
<CardContent className="flex items-center h-full p-4 gap-4">
|
||||
@@ -272,10 +275,11 @@ export default function HomeView() {
|
||||
<Separator className="flex-1" />
|
||||
</div>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
{filteredRegistered.map(s => (
|
||||
{filteredRegistered.map((s, idx) => (
|
||||
<Card
|
||||
key={s.id}
|
||||
className="hover:border-primary/50 hover:bg-muted/10 transition-all cursor-pointer shadow-none group"
|
||||
className="anim-fade-up hover:border-primary/50 hover:bg-muted/10 transition-all cursor-pointer shadow-none group"
|
||||
style={{ animationDelay: `${idx * 60}ms` }}
|
||||
onClick={() => navigate(`/service/${s.id}`)}
|
||||
>
|
||||
<CardHeader className="p-4 sm:p-5 pb-3">
|
||||
|
||||
@@ -45,7 +45,7 @@ export default function LoginView() {
|
||||
|
||||
return (
|
||||
<div className="flex items-center justify-center min-h-[80vh] fade-in">
|
||||
<Card className="w-full max-w-md">
|
||||
<Card className="anim-fade-up w-full max-w-md hover:shadow-xl transition-shadow duration-500">
|
||||
<CardHeader className="space-y-1">
|
||||
<CardTitle className="text-2xl text-center">Connexion</CardTitle>
|
||||
</CardHeader>
|
||||
|
||||
@@ -46,7 +46,7 @@ export default function SignupView() {
|
||||
|
||||
return (
|
||||
<div className="flex items-center justify-center min-h-[80vh] fade-in">
|
||||
<Card className="w-full max-w-md">
|
||||
<Card className="anim-fade-up w-full max-w-md hover:shadow-xl transition-shadow duration-500">
|
||||
<CardHeader className="space-y-1">
|
||||
<CardTitle className="text-2xl text-center">Créer un compte</CardTitle>
|
||||
</CardHeader>
|
||||
|
||||
Reference in new issue
Block a user