rebuild the public site on the Next.js App Router with static export, per-section SEO pages, metadata, sitemap, robots and a generated OG image add full-screen scroll-snap regions, staged scroll reveals, a hash-free tab navigation with a sliding indicator and region-by-region menu scrolling replace the theme text toggle with animated sun/moon icons restructure the CRM API into config, middleware, models, routes, services and utils layers redesign the CRM shell with a single surface, tab rail, full-width blurred DataTable, record dialogs and mask-based icons update Docker/Nginx publishing, Makefile targets, shared UI polish and docs Co-authored-by: Gitea Actions <-[email protected]>
This commit was merged in pull request #1.
This commit is contained in:
+92
-63
@@ -1,19 +1,20 @@
|
||||
# @cohaise/web
|
||||
|
||||
Vitrine institutionnelle de `cohaise.dev`. Première application du monorepo CoHaiSe et premier consommateur réel du design system partagé.
|
||||
Vitrine institutionnelle de `cohaise.dev`, en Next.js 16 (app router, export
|
||||
statique). Ses routes sont servies par nginx : aucun serveur Node en production.
|
||||
|
||||
## Rôle
|
||||
|
||||
| Responsabilité | Localisation |
|
||||
| -------------------------------------------- | ----------------- |
|
||||
| Design system, jetons, composants | `frontend/shared` |
|
||||
| vitrine institutionnelle | `frontend/web` |
|
||||
| Point d'entrée local, publication des builds | `docker/nginx` |
|
||||
| Responsabilité | Localisation |
|
||||
| --- | --- |
|
||||
| Design system, jetons, composants | `frontend/shared` |
|
||||
| Vitrine institutionnelle | `frontend/web` |
|
||||
| Publication des builds | `docker/` |
|
||||
|
||||
```mermaid
|
||||
flowchart LR
|
||||
subgraph navigateur
|
||||
app["frontend/web<br/>React + Vite"]
|
||||
app["frontend/web<br/>Next.js (export statique)"]
|
||||
end
|
||||
subgraph monorepo
|
||||
ui["frontend/shared<br/>@cohaise/ui"]
|
||||
@@ -22,7 +23,7 @@ flowchart LR
|
||||
web["nginx<br/>cohaise.dev"]
|
||||
end
|
||||
app -->|import| ui
|
||||
app -->|build statique| web
|
||||
app -->|out/| web
|
||||
```
|
||||
|
||||
## Prérequis
|
||||
@@ -32,76 +33,104 @@ flowchart LR
|
||||
|
||||
## Commandes
|
||||
|
||||
| Commande | Effet |
|
||||
| ----------------------------------- | ----------------------------------------------------------- |
|
||||
| `npm run dev -w @cohaise/web` | serveur Vite sur `http://localhost:5173` |
|
||||
| `npm run build -w @cohaise/web` | vérification de types puis build de production dans `dist/` |
|
||||
| `npm run preview -w @cohaise/web` | sert le build de production localement |
|
||||
| `npm run typecheck -w @cohaise/web` | vérification de types seule |
|
||||
| `make web` | construit l'image et republie le build dans le volume Nginx |
|
||||
| Commande | Effet |
|
||||
| --- | --- |
|
||||
| `npm run dev -w @cohaise/web` | serveur Next sur `http://localhost:3000` |
|
||||
| `npm run build -w @cohaise/web` | build de production dans `out/` |
|
||||
| `npm run typecheck -w @cohaise/web` | vérification de types seule |
|
||||
| `make web` | construit l'image et republie le build dans le volume nginx |
|
||||
|
||||
## Publication dans l'infrastructure
|
||||
Le premier build de la vitrine exige que `frontend/shared` soit construit :
|
||||
`npm run build` à la racine exécute `tsc --build` avant les workspaces.
|
||||
|
||||
Le `Dockerfile` est un build multi-étapes. Le contexte de construction est la racine du
|
||||
monorepo, car le build a besoin des workspaces, du lockfile et des références
|
||||
TypeScript partagées.
|
||||
## Routes
|
||||
|
||||
```text
|
||||
node:22-alpine deps installation déterministe via npm ci
|
||||
node:22-alpine builder tsc --build puis vite build
|
||||
alpine:3.21 export /app/dist, copié dans le volume web_data
|
||||
```
|
||||
| Route | Contenu |
|
||||
| --- | --- |
|
||||
| `/` | accueil : Hero + toutes les sections, JSON-LD |
|
||||
| `/services` | développement web, mobile, UI/UX, logiciels sur mesure |
|
||||
| `/demos` | CRM, inventaire IT, gamification scolaire |
|
||||
| `/stack` | technologies utilisées |
|
||||
| `/about` | présentation |
|
||||
| `/contact` | formulaire de contact → `POST /api/crm/leads` |
|
||||
| `/sitemap.xml` | généré depuis `app/lib/site.ts` |
|
||||
| `/robots.txt` | généré par `app/robots.ts` |
|
||||
| `/opengraph-image` | image 1200×630 générée par `app/opengraph-image.tsx` |
|
||||
|
||||
Le service `cohaise-web-build` copie le résultat dans le volume `web_data`, que Nginx
|
||||
monte déjà sur `/usr/share/nginx/html/web`. Aucune modification de la configuration
|
||||
Nginx n'est nécessaire, et la publication reste découplée des autres applications.
|
||||
## SEO
|
||||
|
||||
## Consommation du design system
|
||||
- `app/layout.tsx` : métadonnées par défaut, canonical, OpenGraph, Twitter,
|
||||
icônes, `metadataBase`.
|
||||
- Chaque page exporte son propre `metadata` (titre, description, canonical).
|
||||
- L'accueil injecte un JSON-LD `Organization`, `WebSite` et
|
||||
`ProfessionalService`.
|
||||
- Le HTML prérendu est en **français** : le toggle FR/EN est purement client et
|
||||
ne change pas l'URL indexée.
|
||||
|
||||
L'application importe la feuille de style publique du package partagé une seule fois, dans `src/styles/index.css` :
|
||||
## Animations et défilement
|
||||
|
||||
```css
|
||||
@import "tailwindcss";
|
||||
@import "@cohaise/ui/styles";
|
||||
- Chaque section est une région d'un écran (`<Section>`, `min-h-dvh`,
|
||||
`data-region`). Sur l'accueil, Stack et About partagent la même région.
|
||||
- `app/globals.css` : `scroll-snap-type: y mandatory` +
|
||||
`scroll-snap-stop: always` sur `main[data-scroll-snap] > section[data-region]`.
|
||||
On ne peut donc pas s'arrêter entre deux régions, ni en sauter une d'un
|
||||
geste. Le footer s'aligne sur la fin du viewport (`scroll-snap-align: end`)
|
||||
pour rester atteignable. Snap désactivé en `prefers-reduced-motion`, sous
|
||||
620 px de haut, et dès qu'une région dépasse l'écran (`html[data-snap="off"]`,
|
||||
posé par `useScrollReveal`) pour ne jamais bloquer son contenu.
|
||||
- `app/hooks/useScrollReveal.ts` observe chaque région via une bande centrale
|
||||
du viewport. Après 0,25 s d'arrêt sur la région, ses `[data-reveal]`
|
||||
apparaissent en cascade (`data-reveal-delay` pour le décalage, le hero est
|
||||
à 0,2 s). Quitter la région avant la fin annule le minuteur.
|
||||
- `app/globals.css` définit `.reveal-init` / `.is-revealed` (fade-in-up).
|
||||
- Le contenu reste visible sans JavaScript ; `prefers-reduced-motion` désactive
|
||||
les animations et le scroll-snap.
|
||||
|
||||
@source "../../../../frontend/shared/src";
|
||||
```
|
||||
## Thème et langue
|
||||
|
||||
La directive `@source` est indispensable. Sans elle, Tailwind ignore `node_modules` et les classes utilisées par les composants de `frontend/shared` ne sont jamais générées : les composants s'afficheraient sans style.
|
||||
|
||||
## Thème
|
||||
|
||||
Le thème est appliqué par la classe `dark` sur `<html>`. Le script inline de `index.html` applique la préférence enregistrée ou celle du système avant le premier rendu, ce qui évite le flash de thème clair. `src/hooks/useTheme.ts` pilote le changement et persiste le choix dans `localStorage` sous la clé `cohaise-theme`.
|
||||
- Thème : script inline dans `app/layout.tsx` (anti-FOUC), état lu après montage
|
||||
par `ThemeContext`, persisté sous `cohaise-theme`.
|
||||
- Langue : `LanguageContext`, français au premier rendu, préférence persistée
|
||||
sous `cohaise-lang` puis appliquée après hydratation.
|
||||
|
||||
## Structure
|
||||
|
||||
```text
|
||||
frontend/web
|
||||
├── index.html amorce de thème et point de montage
|
||||
├── public/favicon.webp
|
||||
├── src
|
||||
│ ├── App.tsx composition de la page
|
||||
│ ├── main.tsx point d'entrée React
|
||||
│ ├── components
|
||||
│ │ ├── DemoCard.tsx états repos, chargement, chargé
|
||||
│ │ └── ThemeToggle.tsx
|
||||
│ ├── hooks
|
||||
│ │ └── useTheme.ts
|
||||
│ └── styles/index.css import du design system
|
||||
├── tsconfig.json
|
||||
├── tsconfig.node.json
|
||||
└── vite.config.ts
|
||||
├── app
|
||||
│ ├── layout.tsx shell, providers, métadonnées, script thème
|
||||
│ ├── page.tsx accueil + JSON-LD
|
||||
│ ├── globals.css Tailwind, régions (snap), reveal
|
||||
│ ├── providers.tsx
|
||||
│ ├── components/ Section (région), Header, Hero, Services,
|
||||
│ │ Demos, StackAbout, Contact, Footer,
|
||||
│ │ Background, ScrollReveal…
|
||||
│ │ └── background/ Topography (WebGL, client uniquement)
|
||||
│ ├── contexts/ LanguageContext, ThemeContext
|
||||
│ ├── data/ services, demos, stack
|
||||
│ ├── hooks/ useScrollReveal
|
||||
│ ├── lib/ site, api, gsap
|
||||
│ ├── services/ … une page par dossier
|
||||
│ ├── sitemap.ts, robots.ts, opengraph-image.tsx
|
||||
│ └── not-found.tsx
|
||||
├── public/ favicon, images
|
||||
├── next.config.ts export statique, trailingSlash
|
||||
├── postcss.config.mjs
|
||||
└── tsconfig.json
|
||||
```
|
||||
|
||||
## Limites actuelles
|
||||
|
||||
- Aucun appel réseau : toutes les données de démonstration sont locales.
|
||||
- Aucun routage : la page est un point d'entrée unique.
|
||||
- Les URL d'API devront passer par un wrapper dédié, jamais codées en dur dans les composants.
|
||||
|
||||
## Variables d'environnement
|
||||
|
||||
L'application ne déclare aucune variable pour l'instant. Le gabarit `frontend/web/.env.example`
|
||||
prendra une entrée `VITE_API_BASE_URL` au moment où le premier appel réseau existera, afin
|
||||
que l'URL reste définie à un seul endroit. Seules les variables préfixées par `VITE_` sont
|
||||
exposées au bundle ; aucun secret ne doit jamais être lu par le navigateur.
|
||||
| Variable | Usage |
|
||||
| --- | --- |
|
||||
| `NEXT_PUBLIC_CRM_API_URL` | URL de l'API CRM au build (défaut : `https://crm.cohaise.dev`, ou `http://localhost:8082` en local) |
|
||||
|
||||
Seules les variables préfixées par `NEXT_PUBLIC_` sont exposées au navigateur.
|
||||
Aucun secret ne doit jamais être lu par le front.
|
||||
|
||||
## Limites
|
||||
|
||||
- Export statique : pas de route dynamique serveur, pas d'optimisation d'image
|
||||
Next (`images.unoptimized: true`).
|
||||
- Le fond WebGL et les animations sont chargés côté client uniquement.
|
||||
- Les tests navigateur réels (hydratation, WebGL, reveals) restent manuels.
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import type { Metadata } from "next";
|
||||
import { About } from "../components/About";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "À propos",
|
||||
description:
|
||||
"CoHaiSe développe des outils sur mesure, rapides, maintenables et agréables à utiliser, de la première idée à la mise en ligne.",
|
||||
alternates: { canonical: "/about" },
|
||||
};
|
||||
|
||||
export default function AboutPage() {
|
||||
return <About />;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
"use client";
|
||||
|
||||
import { useLanguage } from "../contexts/LanguageContext";
|
||||
import { Section, SectionHeading } from "./Section";
|
||||
|
||||
/** Présentation, réutilisée seule (`/about`) ou avec Stack (accueil). */
|
||||
export const AboutContent = () => {
|
||||
const { t } = useLanguage();
|
||||
|
||||
return (
|
||||
<>
|
||||
<SectionHeading title={t("about.title")} className="mb-6" />
|
||||
<p
|
||||
data-reveal
|
||||
data-reveal-delay="0.15"
|
||||
className="max-w-2xl text-base leading-relaxed text-muted-foreground sm:text-lg"
|
||||
>
|
||||
{t("about.body")}
|
||||
</p>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export const About = () => (
|
||||
<Section id="about">
|
||||
<AboutContent />
|
||||
</Section>
|
||||
);
|
||||
+11
-3
@@ -1,6 +1,8 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import { cn } from "@cohaise/ui";
|
||||
import { scrollToSection } from "../lib/gsap.js";
|
||||
import { scrollToSection } from "../lib/gsap";
|
||||
|
||||
export const BackToTop = () => {
|
||||
const [visible, setVisible] = useState(false);
|
||||
@@ -19,11 +21,17 @@ export const BackToTop = () => {
|
||||
aria-label="Retour en haut"
|
||||
title="Retour en haut"
|
||||
className={cn(
|
||||
"glass fixed bottom-6 right-6 z-50 flex size-11 items-center justify-center rounded-full border border-border/60 text-foreground shadow-md transition-all duration-base hover:border-border-strong",
|
||||
visible ? "translate-y-0 opacity-100" : "pointer-events-none translate-y-3 opacity-0",
|
||||
"glass group fixed bottom-6 right-6 z-50 flex size-11 items-center justify-center rounded-full border border-border/60 text-foreground shadow-md transition-all duration-base",
|
||||
"hover:-translate-y-0.5 hover:border-accent/70 hover:text-accent hover:shadow-lg hover:ring-2 hover:ring-accent/20",
|
||||
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
||||
"active:translate-y-0",
|
||||
visible
|
||||
? "translate-y-0 opacity-100"
|
||||
: "pointer-events-none translate-y-3 opacity-0",
|
||||
)}
|
||||
>
|
||||
<svg
|
||||
className="transition-transform duration-base group-hover:-translate-y-0.5"
|
||||
width="18"
|
||||
height="18"
|
||||
viewBox="0 0 24 24"
|
||||
@@ -0,0 +1,16 @@
|
||||
"use client";
|
||||
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
// Le fond WebGL (topographie) est lourd : chargé à la demande, jamais côté
|
||||
// serveur. Il vit en position fixed (z-0) : seul le contenu (z-10) défile.
|
||||
const Topography = dynamic(() => import("./background/Topography"), {
|
||||
ssr: false,
|
||||
loading: () => null,
|
||||
});
|
||||
|
||||
export const Background = () => (
|
||||
<div className="pointer-events-none fixed inset-0 z-0" aria-hidden="true">
|
||||
<Topography color="#ff5252" opacity={0.5} speed={0.22} clickEffect="none" />
|
||||
</div>
|
||||
);
|
||||
@@ -1,12 +1,15 @@
|
||||
"use client";
|
||||
|
||||
import { useState, type FormEvent } from "react";
|
||||
import { Input } from "@cohaise/ui";
|
||||
import { useLanguage } from "../lib/i18n.js";
|
||||
import { LEADS_ENDPOINT } from "../lib/api.js";
|
||||
import { Section, SectionHeading } from "./Section.js";
|
||||
import { useLanguage } from "../contexts/LanguageContext";
|
||||
import { LEADS_ENDPOINT } from "../lib/api";
|
||||
import { Section, SectionHeading } from "./Section";
|
||||
|
||||
type Status = "idle" | "sending" | "success" | "error";
|
||||
|
||||
const text = (value: FormDataEntryValue | null): string => String(value ?? "").trim();
|
||||
const text = (value: FormDataEntryValue | null): string =>
|
||||
String(value ?? "").trim();
|
||||
|
||||
export const Contact = () => {
|
||||
const { t } = useLanguage();
|
||||
@@ -49,12 +52,16 @@ export const Contact = () => {
|
||||
|
||||
return (
|
||||
<Section id="contact">
|
||||
<SectionHeading title={t("contact.title")} subtitle={t("contact.subtitle")} />
|
||||
<SectionHeading
|
||||
title={t("contact.title")}
|
||||
subtitle={t("contact.subtitle")}
|
||||
/>
|
||||
|
||||
<form
|
||||
onSubmit={(event) => void handleSubmit(event)}
|
||||
className="glass max-w-2xl rounded-lg border border-border/60 p-6 sm:p-8"
|
||||
className="glass max-w-2xl rounded-lg border border-border/60 p-5 sm:p-6"
|
||||
data-reveal
|
||||
data-reveal-delay="0.1"
|
||||
noValidate
|
||||
>
|
||||
<input
|
||||
@@ -66,21 +73,46 @@ export const Contact = () => {
|
||||
className="absolute -left-[9999px] h-px w-px opacity-0"
|
||||
/>
|
||||
|
||||
<div className="grid gap-4 sm:grid-cols-2">
|
||||
<Input name="firstName" label={t("contact.firstName")} required autoComplete="given-name" />
|
||||
<Input name="lastName" label={t("contact.lastName")} required autoComplete="family-name" />
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
<Input
|
||||
name="firstName"
|
||||
label={t("contact.firstName")}
|
||||
required
|
||||
autoComplete="given-name"
|
||||
/>
|
||||
<Input
|
||||
name="lastName"
|
||||
label={t("contact.lastName")}
|
||||
required
|
||||
autoComplete="family-name"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-4 grid gap-4 sm:grid-cols-2">
|
||||
<Input name="organization" label={t("contact.company")} autoComplete="organization" />
|
||||
<Input name="phone" label={t("contact.phone")} type="tel" autoComplete="tel" />
|
||||
<div className="mt-3 grid grid-cols-2 gap-3">
|
||||
<Input
|
||||
name="organization"
|
||||
label={t("contact.company")}
|
||||
autoComplete="organization"
|
||||
/>
|
||||
<Input
|
||||
name="phone"
|
||||
label={t("contact.phone")}
|
||||
type="tel"
|
||||
autoComplete="tel"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-4">
|
||||
<Input name="email" label={t("contact.email")} type="email" required autoComplete="email" />
|
||||
<div className="mt-3">
|
||||
<Input
|
||||
name="email"
|
||||
label={t("contact.email")}
|
||||
type="email"
|
||||
required
|
||||
autoComplete="email"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-4 flex flex-col gap-1.5">
|
||||
<div className="mt-3 flex flex-col gap-1.5">
|
||||
<label
|
||||
htmlFor="message"
|
||||
className="font-display text-[0.6875rem] font-semibold uppercase tracking-label text-foreground"
|
||||
@@ -90,19 +122,21 @@ export const Contact = () => {
|
||||
<textarea
|
||||
id="message"
|
||||
name="message"
|
||||
rows={5}
|
||||
rows={4}
|
||||
required
|
||||
className="w-full rounded-sm border border-border-control bg-surface px-3 py-2.5 text-sm text-foreground placeholder:text-subtle-foreground transition-[border-color,box-shadow] duration-fast focus-visible:border-border-strong focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="mt-6 flex flex-wrap items-center gap-4">
|
||||
<div className="mt-5 flex flex-wrap items-center gap-4">
|
||||
<button
|
||||
type="submit"
|
||||
disabled={status === "sending"}
|
||||
className="inline-flex h-12 items-center gap-2.5 rounded-lg bg-primary px-6 font-display text-sm font-semibold uppercase tracking-label text-primary-foreground transition-colors hover:bg-primary-hover disabled:pointer-events-none disabled:opacity-50"
|
||||
>
|
||||
{status === "sending" ? t("contact.sending") : t("contact.submit")}
|
||||
{status === "sending"
|
||||
? t("contact.sending")
|
||||
: t("contact.submit")}
|
||||
</button>
|
||||
|
||||
{status === "success" ? (
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { cn } from "@cohaise/ui";
|
||||
import type { DemoVariant } from "../data/demos.js";
|
||||
import type { DemoVariant } from "../data/demos";
|
||||
|
||||
const Bar = ({ className }: { className?: string }) => (
|
||||
<span className={cn("block rounded-full bg-surface-hover", className)} aria-hidden="true" />
|
||||
@@ -1,7 +1,9 @@
|
||||
import { useLanguage } from "../lib/i18n.js";
|
||||
import type { Demo } from "../data/demos.js";
|
||||
import { DemoMockup } from "./DemoMockup.js";
|
||||
import { Section, SectionHeading } from "./Section.js";
|
||||
"use client";
|
||||
|
||||
import { useLanguage } from "../contexts/LanguageContext";
|
||||
import type { Demo } from "../data/demos";
|
||||
import { DemoMockup } from "./DemoMockup";
|
||||
import { Section, SectionHeading } from "./Section";
|
||||
|
||||
export const Demos = ({ demos }: { demos: Demo[] }) => {
|
||||
const { t, pick } = useLanguage();
|
||||
@@ -10,24 +12,29 @@ export const Demos = ({ demos }: { demos: Demo[] }) => {
|
||||
<Section id="demos">
|
||||
<SectionHeading title={t("demos.title")} subtitle={t("demos.subtitle")} />
|
||||
|
||||
<div className="grid gap-6 md:grid-cols-3">
|
||||
{/*
|
||||
Sur mobile, les cartes défilent horizontalement : la région garde la
|
||||
hauteur d'un écran au lieu d'empiler trois blocs. Dès `md`, on retrouve
|
||||
la grille de trois colonnes.
|
||||
*/}
|
||||
<div className="-mx-4 flex snap-x snap-mandatory gap-4 overflow-x-auto px-4 pb-2 [scrollbar-width:none] sm:-mx-6 sm:px-6 md:mx-0 md:grid md:grid-cols-3 md:gap-6 md:overflow-visible md:px-0 md:pb-0">
|
||||
{demos.map((demo, index) => (
|
||||
<article
|
||||
key={demo.slug}
|
||||
data-reveal
|
||||
data-reveal-delay={String(index * 0.08)}
|
||||
className="glass flex flex-col overflow-hidden rounded-lg border border-border/60 shadow-sm"
|
||||
className="glass flex w-[82%] max-w-xs shrink-0 snap-center flex-col overflow-hidden rounded-lg border border-border/60 shadow-sm md:w-auto md:max-w-none md:snap-align-none"
|
||||
>
|
||||
<DemoMockup variant={demo.mockup} />
|
||||
|
||||
<div className="flex flex-1 flex-col gap-3 p-5">
|
||||
<div className="flex flex-1 flex-col gap-3 p-4 sm:p-5">
|
||||
<span className="font-display text-[0.625rem] font-semibold uppercase tracking-label text-accent-graphic">
|
||||
{pick(demo.category)}
|
||||
</span>
|
||||
<h3 className="font-display text-lg font-bold uppercase tracking-display">
|
||||
{demo.title}
|
||||
</h3>
|
||||
<p className="text-sm leading-relaxed text-muted-foreground">
|
||||
<p className="line-clamp-3 text-sm leading-relaxed text-muted-foreground">
|
||||
{pick(demo.description)}
|
||||
</p>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import { useLanguage } from "../lib/i18n.js";
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { useLanguage } from "../contexts/LanguageContext";
|
||||
|
||||
const year = new Date().getFullYear();
|
||||
|
||||
@@ -9,15 +12,21 @@ export const Footer = () => {
|
||||
<footer className="border-t border-border/60">
|
||||
<div className="mx-auto flex w-full max-w-6xl flex-col gap-6 px-4 py-10 sm:flex-row sm:items-center sm:justify-between sm:px-6">
|
||||
<div className="flex flex-col gap-1">
|
||||
<span className="font-logo text-sm font-bold tracking-logo text-foreground">
|
||||
<Link
|
||||
href="/"
|
||||
className="font-logo text-sm font-bold tracking-logo text-foreground"
|
||||
>
|
||||
{t("brand.name")}
|
||||
</span>
|
||||
</Link>
|
||||
<span className="text-xs text-subtle-foreground">
|
||||
{t("footer.built")}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<nav className="flex flex-wrap gap-x-6 gap-y-2" aria-label="Liens">
|
||||
<nav
|
||||
className="flex flex-wrap gap-x-6 gap-y-2"
|
||||
aria-label="Liens externes"
|
||||
>
|
||||
<a
|
||||
href="https://git.cohaise.dev/Esiah"
|
||||
target="_blank"
|
||||
@@ -0,0 +1,253 @@
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { usePathname, useRouter } from "next/navigation";
|
||||
import {
|
||||
useCallback,
|
||||
useEffect,
|
||||
useLayoutEffect,
|
||||
useRef,
|
||||
useState,
|
||||
type MouseEvent,
|
||||
} from "react";
|
||||
import { cn } from "@cohaise/ui";
|
||||
import { useLanguage } from "../contexts/LanguageContext";
|
||||
import {
|
||||
scrollToSection,
|
||||
setPendingSection,
|
||||
takePendingSection,
|
||||
} from "../lib/gsap";
|
||||
import { ThemeToggle } from "./ThemeToggle";
|
||||
|
||||
const links = [
|
||||
{ id: "services", path: "/services", key: "nav.services" },
|
||||
{ id: "demos", path: "/demos", key: "nav.demos" },
|
||||
{ id: "stack", path: "/stack", key: "nav.stack" },
|
||||
{ id: "about", path: "/about", key: "nav.about" },
|
||||
{ id: "contact", path: "/contact", key: "nav.contact" },
|
||||
] as const;
|
||||
|
||||
type SectionId = (typeof links)[number]["id"];
|
||||
type NavLink = (typeof links)[number];
|
||||
|
||||
const normalize = (path: string): string =>
|
||||
path !== "/" ? path.replace(/\/+$/, "") : path;
|
||||
|
||||
/*
|
||||
Durée pendant laquelle le suivi du scroll est suspendu après un clic : le
|
||||
temps que GSAP atteigne la région sans que l'indicateur ne revienne en
|
||||
arrière. Une fois le défilement fini, l'onglet cliqué reste donc actif
|
||||
(utile pour « À propos », qui partage la région de « Stack »).
|
||||
*/
|
||||
const NAV_LOCK = 1400;
|
||||
|
||||
interface Indicator {
|
||||
left: number;
|
||||
width: number;
|
||||
}
|
||||
|
||||
export const Header = () => {
|
||||
const { t, lang, setLang } = useLanguage();
|
||||
const pathname = usePathname();
|
||||
const router = useRouter();
|
||||
const current = normalize(pathname);
|
||||
|
||||
const navRef = useRef<HTMLDivElement>(null);
|
||||
const tabRefs = useRef(new Map<SectionId, HTMLAnchorElement>());
|
||||
const lockUntil = useRef(0);
|
||||
const [active, setActive] = useState<SectionId | null>(null);
|
||||
const [indicator, setIndicator] = useState<Indicator | null>(null);
|
||||
|
||||
/** Région qui occupe la bande centrale du viewport. */
|
||||
const regionAt = useCallback((): SectionId | null => {
|
||||
const marker = window.innerHeight * 0.45;
|
||||
let found: SectionId | null = null;
|
||||
|
||||
for (const link of links) {
|
||||
const element = document.getElementById(link.id);
|
||||
if (!element) continue;
|
||||
const rect = element.getBoundingClientRect();
|
||||
if (rect.top <= marker && rect.bottom > marker) found = link.id;
|
||||
}
|
||||
|
||||
return found;
|
||||
}, []);
|
||||
|
||||
/** Aligne la pastille glissante sur l'onglet actif. */
|
||||
const measure = useCallback(() => {
|
||||
const nav = navRef.current;
|
||||
const tab = active ? tabRefs.current.get(active) : undefined;
|
||||
if (!nav || !tab) {
|
||||
setIndicator(null);
|
||||
return;
|
||||
}
|
||||
|
||||
const navRect = nav.getBoundingClientRect();
|
||||
const tabRect = tab.getBoundingClientRect();
|
||||
setIndicator({ left: tabRect.left - navRect.left, width: tabRect.width });
|
||||
}, [active]);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
measure();
|
||||
}, [measure, lang]);
|
||||
|
||||
useEffect(() => {
|
||||
const nav = navRef.current;
|
||||
if (!nav) return;
|
||||
|
||||
const observer = new ResizeObserver(measure);
|
||||
observer.observe(nav);
|
||||
|
||||
// Les libellés changent de largeur quand la police arrive.
|
||||
document.fonts?.ready.then(measure).catch(() => {});
|
||||
|
||||
return () => observer.disconnect();
|
||||
}, [measure]);
|
||||
|
||||
/*
|
||||
Sur l'accueil, l'onglet actif suit la région visible. Depuis une page SEO
|
||||
autonome, il suit le chemin courant ; au retour, la région mémorisée est
|
||||
rejointe sans passer par un `#`.
|
||||
*/
|
||||
useEffect(() => {
|
||||
if (current !== "/") {
|
||||
const match = links.find((link) => link.path === current);
|
||||
setActive(match?.id ?? null);
|
||||
return;
|
||||
}
|
||||
|
||||
let frame = 0;
|
||||
const pending = takePendingSection();
|
||||
const target = pending
|
||||
? links.find((link) => link.id === pending)
|
||||
: undefined;
|
||||
|
||||
if (target) {
|
||||
setActive(target.id);
|
||||
lockUntil.current = Date.now() + NAV_LOCK;
|
||||
// Deux frames : laisser Next monter la page d'accueil et poser les régions.
|
||||
frame = requestAnimationFrame(() => {
|
||||
frame = requestAnimationFrame(() => {
|
||||
const duration = scrollToSection(`#${target.id}`);
|
||||
lockUntil.current = Date.now() + Math.max(NAV_LOCK, duration + 400);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
setActive(regionAt());
|
||||
}
|
||||
|
||||
const onScroll = () => {
|
||||
if (Date.now() < lockUntil.current) return;
|
||||
setActive(regionAt());
|
||||
};
|
||||
|
||||
window.addEventListener("scroll", onScroll, { passive: true });
|
||||
window.addEventListener("resize", onScroll);
|
||||
|
||||
return () => {
|
||||
cancelAnimationFrame(frame);
|
||||
window.removeEventListener("scroll", onScroll);
|
||||
window.removeEventListener("resize", onScroll);
|
||||
};
|
||||
}, [current, regionAt]);
|
||||
|
||||
const goTo = (event: MouseEvent<HTMLAnchorElement>, link: NavLink) => {
|
||||
if (current !== "/") {
|
||||
event.preventDefault();
|
||||
setPendingSection(link.id);
|
||||
router.push("/");
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
lockUntil.current = Date.now() + NAV_LOCK;
|
||||
setActive(link.id);
|
||||
const duration = scrollToSection(`#${link.id}`);
|
||||
lockUntil.current = Date.now() + Math.max(NAV_LOCK, duration + 400);
|
||||
};
|
||||
|
||||
const goHome = (event: MouseEvent<HTMLAnchorElement>) => {
|
||||
if (current !== "/") return;
|
||||
event.preventDefault();
|
||||
lockUntil.current = Date.now() + NAV_LOCK;
|
||||
setActive(null);
|
||||
const duration = scrollToSection("#top");
|
||||
lockUntil.current = Date.now() + Math.max(NAV_LOCK, duration + 400);
|
||||
};
|
||||
|
||||
return (
|
||||
<header className="sticky top-0 z-40 border-b border-border/60 bg-background/70 backdrop-blur-xl">
|
||||
<div className="mx-auto flex h-16 max-w-6xl items-center gap-4 px-4 sm:px-6">
|
||||
<Link href="/" onClick={goHome} className="flex items-center gap-2.5">
|
||||
<img
|
||||
src="/images/cohaise.webp"
|
||||
alt=""
|
||||
width={28}
|
||||
height={28}
|
||||
className="size-7 object-contain"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<span className="font-logo text-sm font-bold tracking-logo text-foreground">
|
||||
{t("brand.name")}
|
||||
</span>
|
||||
</Link>
|
||||
|
||||
<nav className="ml-auto hidden md:flex" aria-label="Navigation">
|
||||
<div
|
||||
ref={navRef}
|
||||
className="relative flex items-center gap-0.5 rounded-full border border-border/70 bg-surface/50 p-1 backdrop-blur-md"
|
||||
>
|
||||
{/* Pastille unique qui glisse d'un onglet à l'autre. */}
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className={cn(
|
||||
"pointer-events-none absolute bottom-1 left-0 top-1 z-0 rounded-full bg-accent/15 ring-1 ring-accent/30 transition-[transform,width,opacity] duration-500 ease-out-soft",
|
||||
indicator ? "opacity-100" : "opacity-0",
|
||||
)}
|
||||
style={{
|
||||
width: indicator?.width ?? 0,
|
||||
transform: `translateX(${indicator?.left ?? 0}px)`,
|
||||
}}
|
||||
/>
|
||||
|
||||
{links.map((link) => {
|
||||
const isActive = active === link.id;
|
||||
return (
|
||||
<Link
|
||||
key={link.id}
|
||||
ref={(node) => {
|
||||
if (node) tabRefs.current.set(link.id, node);
|
||||
else tabRefs.current.delete(link.id);
|
||||
}}
|
||||
href={link.path}
|
||||
onClick={(event) => goTo(event, link)}
|
||||
aria-current={isActive ? "page" : undefined}
|
||||
className={cn(
|
||||
"relative z-10 flex h-8 items-center rounded-full px-3.5 font-display text-[0.6875rem] font-semibold uppercase tracking-label transition-colors duration-fast",
|
||||
isActive
|
||||
? "text-accent"
|
||||
: "text-muted-foreground hover:text-foreground",
|
||||
)}
|
||||
>
|
||||
{t(link.key)}
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div className="flex items-center gap-2 md:ml-6">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setLang(lang === "fr" ? "en" : "fr")}
|
||||
className="inline-flex h-8 items-center justify-center rounded-full border border-border/70 bg-surface/40 px-2.5 font-display text-[0.625rem] font-semibold uppercase tracking-label text-muted-foreground transition-colors hover:border-accent/50 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-none"
|
||||
aria-label={lang === "fr" ? "Switch to English" : "Passer en français"}
|
||||
>
|
||||
{lang === "fr" ? "EN" : "FR"}
|
||||
</button>
|
||||
<ThemeToggle />
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
};
|
||||
@@ -1,14 +1,17 @@
|
||||
import { useLanguage } from "../lib/i18n.js";
|
||||
import { scrollToSection } from "../lib/gsap.js";
|
||||
"use client";
|
||||
|
||||
import Link from "next/link";
|
||||
import { useLanguage } from "../contexts/LanguageContext";
|
||||
import { Section } from "./Section";
|
||||
|
||||
export const Hero = () => {
|
||||
const { t } = useLanguage();
|
||||
|
||||
return (
|
||||
<section className="mx-auto flex w-full max-w-6xl flex-col items-start gap-6 px-4 pb-28 pt-24 sm:px-6 sm:pt-32">
|
||||
<Section id="hero" delay={0.05} className="items-start gap-6">
|
||||
<h1
|
||||
data-reveal
|
||||
data-reveal-delay="0.08"
|
||||
data-reveal-delay="0.05"
|
||||
className="font-display text-5xl font-black uppercase leading-none tracking-display sm:text-7xl md:text-8xl"
|
||||
>
|
||||
{t("brand.name")}
|
||||
@@ -16,7 +19,7 @@ export const Hero = () => {
|
||||
|
||||
<p
|
||||
data-reveal
|
||||
data-reveal-delay="0.16"
|
||||
data-reveal-delay="0.1"
|
||||
className="max-w-2xl text-xl font-medium leading-relaxed text-foreground sm:text-2xl"
|
||||
>
|
||||
{t("hero.tagline")}
|
||||
@@ -24,7 +27,7 @@ export const Hero = () => {
|
||||
|
||||
<p
|
||||
data-reveal
|
||||
data-reveal-delay="0.24"
|
||||
data-reveal-delay="0.15"
|
||||
className="max-w-xl text-base leading-relaxed text-muted-foreground"
|
||||
>
|
||||
{t("hero.subtitle")}
|
||||
@@ -32,30 +35,22 @@ export const Hero = () => {
|
||||
|
||||
<div
|
||||
data-reveal
|
||||
data-reveal-delay="0.32"
|
||||
data-reveal-delay="0.2"
|
||||
className="mt-6 flex flex-wrap gap-3"
|
||||
>
|
||||
<a
|
||||
href="#services"
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
scrollToSection("#services");
|
||||
}}
|
||||
<Link
|
||||
href="/services"
|
||||
className="inline-flex h-12 items-center gap-2.5 rounded-lg bg-primary px-6 font-display text-sm font-semibold uppercase tracking-label text-primary-foreground transition-colors hover:bg-primary-hover"
|
||||
>
|
||||
{t("hero.primary")}
|
||||
</a>
|
||||
<a
|
||||
href="#contact"
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
scrollToSection("#contact");
|
||||
}}
|
||||
</Link>
|
||||
<Link
|
||||
href="/contact"
|
||||
className="inline-flex h-12 items-center gap-2.5 rounded-lg border border-border-strong bg-surface px-6 font-display text-sm font-semibold uppercase tracking-label text-foreground transition-colors hover:bg-surface-hover"
|
||||
>
|
||||
{t("hero.secondary")}
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
</section>
|
||||
</Section>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
"use client";
|
||||
|
||||
import { useScrollReveal } from "../hooks/useScrollReveal";
|
||||
|
||||
/** Monte l'observateur d'animations d'entrée, une fois par page. */
|
||||
export const ScrollReveal = () => {
|
||||
useScrollReveal();
|
||||
return null;
|
||||
};
|
||||
@@ -0,0 +1,60 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { cn } from "@cohaise/ui";
|
||||
|
||||
export interface SectionProps {
|
||||
id: string;
|
||||
children: ReactNode;
|
||||
className?: string;
|
||||
/**
|
||||
* Secondes d'attente avant de révéler la région, une fois qu'elle occupe
|
||||
* le centre de l'écran. Absent → délai par défaut de `useScrollReveal`.
|
||||
*/
|
||||
delay?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Une région = un écran. `min-h-dvh` et le scroll-snap de `globals.css`
|
||||
* garantissent qu'on ne s'arrête jamais entre deux sections ; le contenu est
|
||||
* centré verticalement et laisse respirer l'en-tête sticky en haut.
|
||||
*/
|
||||
export const Section = ({ id, children, className, delay }: SectionProps) => (
|
||||
<section
|
||||
id={id}
|
||||
data-region
|
||||
data-region-delay={delay === undefined ? undefined : String(delay)}
|
||||
className={cn(
|
||||
"relative mx-auto flex min-h-dvh w-full max-w-6xl flex-col justify-center px-4 pb-8 pt-20 sm:px-6 sm:py-16",
|
||||
className,
|
||||
)}
|
||||
>
|
||||
{children}
|
||||
</section>
|
||||
);
|
||||
|
||||
export const SectionHeading = ({
|
||||
eyebrow,
|
||||
title,
|
||||
subtitle,
|
||||
className,
|
||||
}: {
|
||||
eyebrow?: string;
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
className?: string;
|
||||
}) => (
|
||||
<div className={cn("mb-8 flex flex-col gap-3", className)} data-reveal>
|
||||
{eyebrow ? (
|
||||
<span className="font-display text-[0.625rem] font-semibold uppercase tracking-label text-accent-graphic">
|
||||
{eyebrow}
|
||||
</span>
|
||||
) : null}
|
||||
<h2 className="font-display text-3xl font-bold uppercase tracking-display sm:text-4xl">
|
||||
{title}
|
||||
</h2>
|
||||
{subtitle ? (
|
||||
<p className="max-w-2xl text-sm leading-relaxed text-muted-foreground sm:text-base">
|
||||
{subtitle}
|
||||
</p>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
@@ -0,0 +1,101 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { cn } from "@cohaise/ui";
|
||||
import { useLanguage } from "../contexts/LanguageContext";
|
||||
import type { Service } from "../data/services";
|
||||
import { Section, SectionHeading } from "./Section";
|
||||
|
||||
/**
|
||||
* Services en onglets plutôt qu'en accordéon : la hauteur de la région reste
|
||||
* stable, donc le scroll-snap ne saute jamais quand on change de service.
|
||||
*/
|
||||
export const Services = ({ services }: { services: Service[] }) => {
|
||||
const { t, pick } = useLanguage();
|
||||
const [selected, setSelected] = useState(services[0]?.slug ?? null);
|
||||
const current =
|
||||
services.find((service) => service.slug === selected) ?? services[0];
|
||||
|
||||
return (
|
||||
<Section id="services">
|
||||
<SectionHeading
|
||||
title={t("services.title")}
|
||||
subtitle={t("services.subtitle")}
|
||||
/>
|
||||
|
||||
<div className="grid gap-6 md:grid-cols-[minmax(0,0.85fr)_minmax(0,1.15fr)] md:items-center md:gap-10">
|
||||
<div className="flex flex-col" data-reveal>
|
||||
{services.map((service) => {
|
||||
const active = service.slug === current?.slug;
|
||||
return (
|
||||
<button
|
||||
key={service.slug}
|
||||
type="button"
|
||||
onClick={() => setSelected(service.slug)}
|
||||
aria-pressed={active}
|
||||
className={cn(
|
||||
"group flex w-full items-center gap-3 border-b border-border/60 py-3 text-left first:border-t sm:py-4",
|
||||
active
|
||||
? "text-foreground"
|
||||
: "text-muted-foreground hover:text-foreground",
|
||||
)}
|
||||
>
|
||||
<span
|
||||
className={cn(
|
||||
"font-display text-xl font-bold uppercase tracking-display transition-colors sm:text-2xl md:text-3xl",
|
||||
active && "text-accent",
|
||||
)}
|
||||
>
|
||||
{pick(service.title)}
|
||||
</span>
|
||||
<span
|
||||
aria-hidden="true"
|
||||
className={cn(
|
||||
"ml-auto font-display text-2xl font-light transition-transform duration-base",
|
||||
active
|
||||
? "rotate-45 text-accent"
|
||||
: "rotate-0 text-subtle-foreground",
|
||||
)}
|
||||
>
|
||||
+
|
||||
</span>
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
{current ? (
|
||||
<div
|
||||
data-reveal
|
||||
data-reveal-delay="0.12"
|
||||
aria-live="polite"
|
||||
className="glass flex min-h-40 flex-col gap-4 rounded-lg border border-border/60 p-4 sm:min-h-72 sm:p-5"
|
||||
>
|
||||
<img
|
||||
src={current.image}
|
||||
alt=""
|
||||
width={600}
|
||||
height={400}
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
className="hidden aspect-[16/9] max-h-48 w-full rounded-md border border-border/60 object-cover sm:block"
|
||||
/>
|
||||
<p className="text-sm leading-relaxed text-muted-foreground sm:text-base">
|
||||
{pick(current.description)}
|
||||
</p>
|
||||
<ul className="flex flex-wrap gap-2">
|
||||
{current.tags.map((tag) => (
|
||||
<li
|
||||
key={pick(tag)}
|
||||
className="rounded-full border border-border/60 px-3 py-1 text-[0.625rem] uppercase tracking-label text-foreground transition-colors hover:bg-surface-hover sm:px-4 sm:py-1.5 sm:text-[0.6875rem]"
|
||||
>
|
||||
{pick(tag)}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
</Section>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,110 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef } from "react";
|
||||
import { gsap, prefersReducedMotion } from "../lib/gsap";
|
||||
import { useLanguage } from "../contexts/LanguageContext";
|
||||
import { stack } from "../data/stack";
|
||||
import { Section, SectionHeading } from "./Section";
|
||||
|
||||
/** Bandeau technologique, réutilisé seul (`/stack`) ou avec About (accueil). */
|
||||
export const StackContent = () => {
|
||||
const { t } = useLanguage();
|
||||
const trackRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const track = trackRef.current;
|
||||
if (!track || prefersReducedMotion()) return;
|
||||
|
||||
const region = track.closest<HTMLElement>("[data-region]");
|
||||
|
||||
// Le bandeau ne démarre qu'une fois la région révélée : sinon les logos
|
||||
// défilent alors que le reste de Stack/About est encore masqué.
|
||||
let tween: gsap.core.Tween | undefined;
|
||||
const slow = () => {
|
||||
if (tween) gsap.to(tween, { timeScale: 0.25, duration: 0.6, overwrite: true });
|
||||
};
|
||||
const resume = () => {
|
||||
if (tween) gsap.to(tween, { timeScale: 1, duration: 0.6, overwrite: true });
|
||||
};
|
||||
|
||||
const start = () => {
|
||||
if (tween) return;
|
||||
// Deux copies rendues dans le JSX : -50 % = exactement une copie, boucle sans couture.
|
||||
tween = gsap.to(track, {
|
||||
xPercent: -50,
|
||||
duration: 36,
|
||||
ease: "none",
|
||||
repeat: -1,
|
||||
});
|
||||
track.addEventListener("mouseenter", slow);
|
||||
track.addEventListener("mouseleave", resume);
|
||||
};
|
||||
|
||||
let observer: MutationObserver | undefined;
|
||||
if (!region || region.dataset.revealed === "true") {
|
||||
start();
|
||||
} else {
|
||||
observer = new MutationObserver(() => {
|
||||
if (region.dataset.revealed !== "true") return;
|
||||
observer?.disconnect();
|
||||
observer = undefined;
|
||||
start();
|
||||
});
|
||||
observer.observe(region, {
|
||||
attributes: true,
|
||||
attributeFilter: ["data-revealed"],
|
||||
});
|
||||
}
|
||||
|
||||
return () => {
|
||||
observer?.disconnect();
|
||||
track.removeEventListener("mouseenter", slow);
|
||||
track.removeEventListener("mouseleave", resume);
|
||||
tween?.kill();
|
||||
};
|
||||
}, []);
|
||||
|
||||
const doubled = [...stack, ...stack];
|
||||
|
||||
return (
|
||||
<>
|
||||
<SectionHeading
|
||||
title={t("stack.title")}
|
||||
subtitle={t("stack.subtitle")}
|
||||
className="mb-6"
|
||||
/>
|
||||
|
||||
<div
|
||||
data-reveal
|
||||
data-reveal-delay="0.1"
|
||||
className="overflow-hidden [mask-image:linear-gradient(to_right,transparent,black_10%,black_90%,transparent)]"
|
||||
>
|
||||
<div ref={trackRef} className="flex w-max items-center gap-12">
|
||||
{doubled.map((item, index) => {
|
||||
const Icon = item.Icon;
|
||||
return (
|
||||
<span
|
||||
key={`${item.name}-${index}`}
|
||||
className="group/item flex shrink-0 items-center gap-3 whitespace-nowrap"
|
||||
>
|
||||
<Icon
|
||||
className="size-7 text-subtle-foreground transition-transform duration-300 ease-out group-hover/item:scale-125"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<span className="font-display text-lg uppercase tracking-label text-subtle-foreground">
|
||||
{item.name}
|
||||
</span>
|
||||
</span>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export const Stack = () => (
|
||||
<Section id="stack">
|
||||
<StackContent />
|
||||
</Section>
|
||||
);
|
||||
@@ -0,0 +1,20 @@
|
||||
import { AboutContent } from "./About";
|
||||
import { Section } from "./Section";
|
||||
import { StackContent } from "./Stack";
|
||||
|
||||
/**
|
||||
* Une seule région pour Stack et About : le snap ne peut donc jamais
|
||||
* s'arrêter entre les deux. Les deux blocs sont empilés et occupent toute la
|
||||
* largeur de la région.
|
||||
*/
|
||||
export const StackAbout = () => (
|
||||
<Section id="stack">
|
||||
<div className="flex w-full flex-col gap-8 sm:gap-10">
|
||||
<StackContent />
|
||||
{/* Ancre du menu : About partage la région de Stack sur l'accueil. */}
|
||||
<div id="about" className="w-full">
|
||||
<AboutContent />
|
||||
</div>
|
||||
</div>
|
||||
</Section>
|
||||
);
|
||||
@@ -0,0 +1,65 @@
|
||||
"use client";
|
||||
|
||||
import { useLanguage } from "../contexts/LanguageContext";
|
||||
import { useTheme } from "../contexts/ThemeContext";
|
||||
|
||||
/**
|
||||
* Soleil et lune au trait fin, avec une étoile : la bascule de thème prend le
|
||||
* vocabulaire « spatial » du reste du site plutôt qu'un libellé texte.
|
||||
*
|
||||
* Le CSS de `globals.css` décide laquelle est visible selon `.dark` (posé avant
|
||||
* le premier rendu par le script anti-FOUC), donc aucun flash d'icône.
|
||||
*/
|
||||
const SunIcon = () => (
|
||||
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true" className="size-[18px]">
|
||||
<circle cx="12" cy="12" r="3.6" stroke="currentColor" strokeWidth="1.5" />
|
||||
<circle cx="12" cy="12" r="1" fill="currentColor" />
|
||||
<g stroke="currentColor" strokeWidth="1.5" strokeLinecap="round">
|
||||
<path d="M12 2.75v1.9M12 19.35v1.9M2.75 12h1.9M19.35 12h1.9M5.45 5.45l1.35 1.35M17.2 17.2l1.35 1.35M18.55 5.45l-1.35 1.35M6.8 17.2l-1.35 1.35" />
|
||||
</g>
|
||||
<path
|
||||
d="M19.4 2.6l.45 1.05 1.05.45-1.05.45-.45 1.05-.45-1.05-1.05-.45 1.05-.45Z"
|
||||
fill="currentColor"
|
||||
opacity=".8"
|
||||
/>
|
||||
</svg>
|
||||
);
|
||||
|
||||
const MoonIcon = () => (
|
||||
<svg viewBox="0 0 24 24" fill="none" aria-hidden="true" className="size-[18px]">
|
||||
<path
|
||||
d="M20.2 14.6A8.6 8.6 0 0 1 9.4 3.8 8.6 8.6 0 1 0 20.2 14.6Z"
|
||||
stroke="currentColor"
|
||||
strokeWidth="1.5"
|
||||
strokeLinejoin="round"
|
||||
/>
|
||||
<path
|
||||
d="M17.6 4.1l.4.95.95.4-.95.4-.4.95-.4-.95-.95-.4.95-.4Z"
|
||||
fill="currentColor"
|
||||
/>
|
||||
<circle cx="21" cy="8.6" r=".7" fill="currentColor" />
|
||||
</svg>
|
||||
);
|
||||
|
||||
export const ThemeToggle = () => {
|
||||
const { t } = useLanguage();
|
||||
const { theme, toggleTheme } = useTheme();
|
||||
const label = t(theme === "dark" ? "theme.light" : "theme.dark");
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={toggleTheme}
|
||||
aria-label={label}
|
||||
title={label}
|
||||
className="group relative inline-flex h-8 w-8 items-center justify-center rounded-full border border-border/70 bg-surface/40 text-muted-foreground transition-[color,background-color,border-color,box-shadow] duration-fast ease-out-soft hover:border-accent/50 hover:bg-accent/10 hover:text-accent hover:shadow-[0_0_20px_-6px_var(--color-accent)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background focus-visible:outline-none"
|
||||
>
|
||||
<span className="theme-icon theme-icon-sun absolute inset-0 flex items-center justify-center transition-[opacity,transform] duration-500 ease-out-soft">
|
||||
<SunIcon />
|
||||
</span>
|
||||
<span className="theme-icon theme-icon-moon absolute inset-0 flex items-center justify-center transition-[opacity,transform] duration-500 ease-out-soft">
|
||||
<MoonIcon />
|
||||
</span>
|
||||
</button>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Contact } from "../components/Contact";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Contact",
|
||||
description:
|
||||
"Un projet en tête ? Contactez CoHaiSe pour discuter de votre site vitrine, application mobile ou logiciel sur mesure.",
|
||||
alternates: { canonical: "/contact" },
|
||||
};
|
||||
|
||||
export default function ContactPage() {
|
||||
return <Contact />;
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
createContext,
|
||||
useCallback,
|
||||
@@ -104,10 +106,14 @@ const dictionaries: Record<Lang, Record<MessageKey, string>> = { fr, en };
|
||||
|
||||
const STORAGE_KEY = "cohaise-lang";
|
||||
|
||||
const readInitialLang = (): Lang => {
|
||||
const stored = window.localStorage.getItem(STORAGE_KEY);
|
||||
if (stored === "fr" || stored === "en") return stored;
|
||||
if (navigator.language?.toLowerCase().startsWith("en")) return "en";
|
||||
const readStoredLang = (): Lang => {
|
||||
try {
|
||||
const stored = window.localStorage.getItem(STORAGE_KEY);
|
||||
if (stored === "fr" || stored === "en") return stored;
|
||||
if (window.navigator.language?.toLowerCase().startsWith("en")) return "en";
|
||||
} catch {
|
||||
// localStorage indisponible (navigation privée stricte, etc.)
|
||||
}
|
||||
return "fr";
|
||||
};
|
||||
|
||||
@@ -121,11 +127,23 @@ interface LanguageContextValue {
|
||||
const LanguageContext = createContext<LanguageContextValue | null>(null);
|
||||
|
||||
export const LanguageProvider = ({ children }: { children: ReactNode }) => {
|
||||
const [lang, setLangState] = useState<Lang>(readInitialLang);
|
||||
// Le premier rendu est toujours en français : il doit être identique côté
|
||||
// serveur (export statique) et côté client pour éviter un mismatch
|
||||
// d'hydratation. La préférence stockée est appliquée après le montage.
|
||||
const [lang, setLangState] = useState<Lang>("fr");
|
||||
|
||||
useEffect(() => {
|
||||
const next = readStoredLang();
|
||||
setLangState((current) => (current === next ? current : next));
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
document.documentElement.lang = lang;
|
||||
window.localStorage.setItem(STORAGE_KEY, lang);
|
||||
try {
|
||||
window.localStorage.setItem(STORAGE_KEY, lang);
|
||||
} catch {
|
||||
// Écriture impossible : la langue reste valable pour la session.
|
||||
}
|
||||
}, [lang]);
|
||||
|
||||
const setLang = useCallback((next: Lang) => setLangState(next), []);
|
||||
@@ -0,0 +1,66 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
createContext,
|
||||
useCallback,
|
||||
useContext,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useState,
|
||||
type ReactNode,
|
||||
} from "react";
|
||||
|
||||
export type Theme = "light" | "dark";
|
||||
|
||||
const STORAGE_KEY = "cohaise-theme";
|
||||
|
||||
interface ThemeContextValue {
|
||||
/** `null` tant que la préférence n'a pas été lue côté client. */
|
||||
theme: Theme | null;
|
||||
toggleTheme: () => void;
|
||||
}
|
||||
|
||||
const ThemeContext = createContext<ThemeContextValue | null>(null);
|
||||
|
||||
export const ThemeProvider = ({ children }: { children: ReactNode }) => {
|
||||
// Rendu serveur et premier rendu client identiques (`null`). Le script
|
||||
// inline de `layout.tsx` a déjà posé `.dark` sur <html> avant l'hydratation :
|
||||
// on se contente de lire cet état après le montage.
|
||||
const [theme, setTheme] = useState<Theme | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
setTheme(
|
||||
document.documentElement.classList.contains("dark") ? "dark" : "light",
|
||||
);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (theme === null) return;
|
||||
document.documentElement.classList.toggle("dark", theme === "dark");
|
||||
try {
|
||||
window.localStorage.setItem(STORAGE_KEY, theme);
|
||||
} catch {
|
||||
// Écriture impossible : le thème reste valable pour la session.
|
||||
}
|
||||
}, [theme]);
|
||||
|
||||
const toggleTheme = useCallback(() => {
|
||||
setTheme((current) => (current === "dark" ? "light" : "dark"));
|
||||
}, []);
|
||||
|
||||
const value = useMemo<ThemeContextValue>(
|
||||
() => ({ theme, toggleTheme }),
|
||||
[theme, toggleTheme],
|
||||
);
|
||||
|
||||
return (
|
||||
<ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export const useTheme = (): ThemeContextValue => {
|
||||
const context = useContext(ThemeContext);
|
||||
if (!context)
|
||||
throw new Error("useTheme doit être utilisé sous ThemeProvider.");
|
||||
return context;
|
||||
};
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Localized } from "../lib/i18n.js";
|
||||
import type { Localized } from "../contexts/LanguageContext";
|
||||
|
||||
export type DemoVariant = "crm" | "inventory" | "leaderboard";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Localized } from "../lib/i18n.js";
|
||||
import type { Localized } from "../contexts/LanguageContext";
|
||||
|
||||
export interface Service {
|
||||
slug: string;
|
||||
@@ -0,0 +1,14 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Demos } from "../components/Demos";
|
||||
import { demos } from "../data/demos";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Démos",
|
||||
description:
|
||||
"Des réalisations concrètes : CRM, inventaire IT et gamification scolaire. Découvrez des projets réels construits avec React, Next.js et Docker.",
|
||||
alternates: { canonical: "/demos" },
|
||||
};
|
||||
|
||||
export default function DemosPage() {
|
||||
return <Demos demos={demos} />;
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
@import "tailwindcss";
|
||||
@import "@cohaise/ui/styles";
|
||||
|
||||
@source "../../shared/src";
|
||||
|
||||
@layer base {
|
||||
body {
|
||||
min-height: 100dvh;
|
||||
}
|
||||
|
||||
/*
|
||||
Une région = un écran. Le snap est `mandatory` : le navigateur ne peut pas
|
||||
s'arrêter entre deux régions, et `scroll-snap-stop: always` empêche un
|
||||
geste rapide d'en sauter une. Pas de `scroll-padding-top` : l'en-tête est
|
||||
sticky, chaque région réserve elle-même la place sous lui.
|
||||
*/
|
||||
html:has(main[data-scroll-snap]) {
|
||||
scroll-snap-type: y mandatory;
|
||||
}
|
||||
|
||||
/*
|
||||
Pendant un saut de menu, `scrollToSection` anime la page région par région.
|
||||
Le snap obligatoire reprendrait la main à chaque étape et transformerait la
|
||||
séquence en saut direct : on le suspend le temps de l'animation.
|
||||
*/
|
||||
html[data-scroll-anim]:has(main[data-scroll-snap]) {
|
||||
scroll-snap-type: none;
|
||||
}
|
||||
|
||||
main[data-scroll-snap] > section[data-region] {
|
||||
scroll-snap-align: start;
|
||||
scroll-snap-stop: always;
|
||||
}
|
||||
|
||||
/*
|
||||
Le pied de page vit hors région, après la dernière. Sans point d'ancrage,
|
||||
un snap obligatoire rendrait le bas de page inatteignable : on aligne sa
|
||||
fin sur le bas du viewport, ce qui correspond exactement au scroll maximal.
|
||||
*/
|
||||
html:has(main[data-scroll-snap]) footer {
|
||||
scroll-snap-align: end;
|
||||
scroll-snap-stop: always;
|
||||
}
|
||||
|
||||
/*
|
||||
Si une région est plus haute que l'écran (téléphone étroit, texte long),
|
||||
un snap obligatoire bloquerait la fin de son contenu. `useScrollReveal`
|
||||
mesure les régions et coupe le snap dans ce cas.
|
||||
*/
|
||||
html[data-snap="off"]:has(main[data-scroll-snap]) {
|
||||
scroll-snap-type: none;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
html {
|
||||
scroll-behavior: auto;
|
||||
}
|
||||
|
||||
html:has(main[data-scroll-snap]) {
|
||||
scroll-snap-type: none;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Fenêtres très basses (téléphone en paysage, petite fenêtre) : une région
|
||||
plus haute que l'écran deviendrait impossible à parcourir avec un snap
|
||||
obligatoire. On rend la main au défilement libre.
|
||||
*/
|
||||
@media (max-height: 620px) {
|
||||
html:has(main[data-scroll-snap]) {
|
||||
scroll-snap-type: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Pages SEO autonomes (/services, /about, ...) : une seule région, pas de
|
||||
pied de page, hauteur bornée sous l'en-tête (h-16). La page tient donc
|
||||
exactement dans le viewport et ne défile pas. Les liens du menu, eux,
|
||||
ramènent à l'accueil sur la région correspondante.
|
||||
|
||||
Hors `@layer` : ces règles doivent l'emporter sur `min-h-dvh` de `Section`.
|
||||
*/
|
||||
html:has(main[data-scroll-snap] > section[data-region]:only-child) footer {
|
||||
display: none;
|
||||
}
|
||||
|
||||
main[data-scroll-snap]:has(> section[data-region]:only-child),
|
||||
main[data-scroll-snap] > section[data-region]:only-child {
|
||||
/* h-16 + la bordure basse de l'en-tête (1 px). */
|
||||
min-height: calc(100dvh - 4rem - 1px);
|
||||
}
|
||||
|
||||
/* L'en-tête est déjà au-dessus de la région : inutile de réserver `pt-20`. */
|
||||
main[data-scroll-snap] > section[data-region]:only-child {
|
||||
padding-block: 2rem;
|
||||
}
|
||||
|
||||
/*
|
||||
Bascule de thème : en clair on montre la lune (passage au sombre), en sombre
|
||||
le soleil. `.dark` est posé avant le premier rendu, donc pas de flash.
|
||||
*/
|
||||
.theme-icon-sun {
|
||||
opacity: 0;
|
||||
transform: rotate(-90deg) scale(0.5);
|
||||
}
|
||||
|
||||
.theme-icon-moon {
|
||||
opacity: 1;
|
||||
transform: rotate(0deg) scale(1);
|
||||
}
|
||||
|
||||
.dark .theme-icon-sun {
|
||||
opacity: 1;
|
||||
transform: rotate(0deg) scale(1);
|
||||
}
|
||||
|
||||
.dark .theme-icon-moon {
|
||||
opacity: 0;
|
||||
transform: rotate(90deg) scale(0.5);
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.theme-icon {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Animations d'entrée : le contenu est visible par défaut (pas de JS, pas de
|
||||
masquage SSR). `useScrollReveal` ajoute `.reveal-init` côté client avant
|
||||
d'observer l'élément, puis `.is-revealed` quand le threshold est franchi.
|
||||
*/
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
.reveal-init {
|
||||
opacity: 0;
|
||||
transform: translateY(24px);
|
||||
will-change: opacity, transform;
|
||||
}
|
||||
|
||||
.reveal-init.is-revealed {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
transition:
|
||||
opacity 0.7s ease-out,
|
||||
transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
|
||||
transition-delay: var(--reveal-delay, 0s);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { usePathname } from "next/navigation";
|
||||
|
||||
export interface RevealOptions {
|
||||
/** Attente par défaut, en secondes, avant de révéler une région. */
|
||||
delay?: number;
|
||||
/**
|
||||
* Bande du viewport qui rend une région « active ». Par défaut le tiers
|
||||
* central : une région est active quand elle occupe le milieu de l'écran.
|
||||
*/
|
||||
rootMargin?: string;
|
||||
}
|
||||
|
||||
const DEFAULT_DELAY = 0.25;
|
||||
const DEFAULT_ROOT_MARGIN = "-35% 0px -35% 0px";
|
||||
|
||||
/**
|
||||
* Anime l'entrée d'une région après que le visiteur s'y est arrêté.
|
||||
*
|
||||
* Chaque `[data-region]` est observé dans une bande centrale du viewport. Le
|
||||
* délai court (0,25 s par défaut, `data-region-delay` pour le surcharger) ne
|
||||
* démarre que lorsque la région occupe cette bande ; s'il repart avant la fin,
|
||||
* le minuteur est annulé et la région se révélera à son prochain passage. Les
|
||||
* éléments `[data-reveal]` de la région apparaissent alors en cascade via
|
||||
* `data-reveal-delay`.
|
||||
*
|
||||
* Le contenu reste visible sans JavaScript et avec `prefers-reduced-motion`.
|
||||
*/
|
||||
export const useScrollReveal = ({
|
||||
delay = DEFAULT_DELAY,
|
||||
rootMargin = DEFAULT_ROOT_MARGIN,
|
||||
}: RevealOptions = {}): void => {
|
||||
const pathname = usePathname();
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof window === "undefined") return;
|
||||
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
||||
|
||||
const regions = Array.from(
|
||||
document.querySelectorAll<HTMLElement>("[data-region]"),
|
||||
);
|
||||
if (regions.length === 0) return;
|
||||
|
||||
const timers = new Map<HTMLElement, number>();
|
||||
|
||||
// Un snap obligatoire sur une région plus haute que l'écran rendrait la fin
|
||||
// de son contenu inatteignable : dans ce cas on rend la main au défilement
|
||||
// libre (cf. `html[data-snap="off"]` dans `globals.css`).
|
||||
const root = document.documentElement;
|
||||
const syncSnap = () => {
|
||||
const tooTall = regions.some(
|
||||
(region) => region.getBoundingClientRect().height > window.innerHeight + 1,
|
||||
);
|
||||
if (tooTall) root.dataset.snap = "off";
|
||||
else delete root.dataset.snap;
|
||||
};
|
||||
syncSnap();
|
||||
const resizeObserver = new ResizeObserver(syncSnap);
|
||||
for (const region of regions) resizeObserver.observe(region);
|
||||
window.addEventListener("resize", syncSnap);
|
||||
|
||||
const reveal = (region: HTMLElement) => {
|
||||
region.dataset.revealed = "true";
|
||||
region.querySelectorAll<HTMLElement>("[data-reveal]").forEach((item) => {
|
||||
const itemDelay = Number.parseFloat(item.dataset.revealDelay ?? "");
|
||||
if (Number.isFinite(itemDelay) && itemDelay > 0) {
|
||||
item.style.setProperty("--reveal-delay", `${itemDelay}s`);
|
||||
}
|
||||
item.classList.add("is-revealed");
|
||||
});
|
||||
};
|
||||
|
||||
// Masquage posé au montage : le HTML prérendu reste lisible sans JS.
|
||||
for (const region of regions) {
|
||||
if (region.dataset.revealed === "true") continue;
|
||||
region
|
||||
.querySelectorAll<HTMLElement>("[data-reveal]")
|
||||
.forEach((item) => item.classList.add("reveal-init"));
|
||||
}
|
||||
|
||||
const waitFor = (region: HTMLElement): number => {
|
||||
const raw = region.dataset.regionDelay;
|
||||
if (raw === undefined) return delay;
|
||||
const value = Number.parseFloat(raw);
|
||||
return Number.isFinite(value) && value >= 0 ? value : delay;
|
||||
};
|
||||
|
||||
const observer = new IntersectionObserver(
|
||||
(entries) => {
|
||||
for (const entry of entries) {
|
||||
const region = entry.target as HTMLElement;
|
||||
|
||||
if (entry.isIntersecting) {
|
||||
/*
|
||||
Pendant un saut de menu, la région ne fait que traverser l'écran :
|
||||
le délai serait annulé avant la fin. On la révèle tout de suite
|
||||
pour que la séquence ne montre pas de zones vides.
|
||||
*/
|
||||
if (document.documentElement.dataset.scrollAnim !== undefined) {
|
||||
reveal(region);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (region.dataset.revealed === "true" || timers.has(region)) {
|
||||
continue;
|
||||
}
|
||||
timers.set(
|
||||
region,
|
||||
window.setTimeout(() => {
|
||||
timers.delete(region);
|
||||
reveal(region);
|
||||
}, waitFor(region) * 1000),
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
// Sortie de la bande avant la fin du délai : le visiteur a continué
|
||||
// sa route, inutile de révéler une région qu'il ne regarde plus.
|
||||
const timer = timers.get(region);
|
||||
if (timer !== undefined) {
|
||||
window.clearTimeout(timer);
|
||||
timers.delete(region);
|
||||
}
|
||||
}
|
||||
},
|
||||
{ threshold: 0, rootMargin },
|
||||
);
|
||||
|
||||
for (const region of regions) observer.observe(region);
|
||||
|
||||
return () => {
|
||||
observer.disconnect();
|
||||
resizeObserver.disconnect();
|
||||
window.removeEventListener("resize", syncSnap);
|
||||
for (const timer of timers.values()) window.clearTimeout(timer);
|
||||
timers.clear();
|
||||
};
|
||||
}, [pathname, delay, rootMargin]);
|
||||
};
|
||||
@@ -0,0 +1,120 @@
|
||||
import type { Metadata, Viewport } from "next";
|
||||
import "./globals.css";
|
||||
import { Providers } from "./providers";
|
||||
import { Header } from "./components/Header";
|
||||
import { Footer } from "./components/Footer";
|
||||
import { BackToTop } from "./components/BackToTop";
|
||||
import { Background } from "./components/Background";
|
||||
import { ScrollReveal } from "./components/ScrollReveal";
|
||||
import { SITE_DESCRIPTION, SITE_NAME, SITE_URL } from "./lib/site";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
metadataBase: new URL(SITE_URL),
|
||||
title: {
|
||||
default: "CoHaiSe — Développement web, applications et design sur mesure",
|
||||
template: "%s | CoHaiSe",
|
||||
},
|
||||
description: SITE_DESCRIPTION,
|
||||
applicationName: SITE_NAME,
|
||||
authors: [{ name: "Esiah", url: SITE_URL }],
|
||||
creator: "CoHaiSe",
|
||||
publisher: "CoHaiSe",
|
||||
category: "technology",
|
||||
keywords: [
|
||||
"développement web",
|
||||
"site vitrine",
|
||||
"application mobile",
|
||||
"React",
|
||||
"Next.js",
|
||||
"UI UX design",
|
||||
"logiciel sur mesure",
|
||||
"CoHaiSe",
|
||||
],
|
||||
alternates: {
|
||||
canonical: "/",
|
||||
},
|
||||
openGraph: {
|
||||
type: "website",
|
||||
locale: "fr_FR",
|
||||
url: SITE_URL,
|
||||
siteName: SITE_NAME,
|
||||
title: "CoHaiSe — Développement web, applications et design sur mesure",
|
||||
description: SITE_DESCRIPTION,
|
||||
images: [
|
||||
{
|
||||
url: "/images/cohaise.webp",
|
||||
width: 512,
|
||||
height: 512,
|
||||
alt: "CoHaiSe",
|
||||
},
|
||||
],
|
||||
},
|
||||
twitter: {
|
||||
card: "summary_large_image",
|
||||
title: "CoHaiSe — Développement web, applications et design sur mesure",
|
||||
description: SITE_DESCRIPTION,
|
||||
images: ["/images/cohaise.webp"],
|
||||
},
|
||||
icons: {
|
||||
icon: [{ url: "/favicon.webp", type: "image/webp" }],
|
||||
shortcut: ["/favicon.webp"],
|
||||
},
|
||||
robots: {
|
||||
index: true,
|
||||
follow: true,
|
||||
googleBot: { index: true, follow: true },
|
||||
},
|
||||
};
|
||||
|
||||
export const viewport: Viewport = {
|
||||
colorScheme: "light dark",
|
||||
themeColor: [
|
||||
{ media: "(prefers-color-scheme: light)", color: "#f7f5f4" },
|
||||
{ media: "(prefers-color-scheme: dark)", color: "#050000" },
|
||||
],
|
||||
};
|
||||
|
||||
// Script anti-FOUC : applique le thème enregistré avant le premier rendu.
|
||||
const themeScript = `(() => {
|
||||
try {
|
||||
const stored = localStorage.getItem("cohaise-theme");
|
||||
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
||||
const theme = stored ?? (prefersDark ? "dark" : "light");
|
||||
if (theme === "dark") document.documentElement.classList.add("dark");
|
||||
} catch {}
|
||||
})();`;
|
||||
|
||||
export default function RootLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<html lang="fr" suppressHydrationWarning>
|
||||
<head>
|
||||
<script dangerouslySetInnerHTML={{ __html: themeScript }} />
|
||||
</head>
|
||||
<body className="bg-background text-foreground antialiased">
|
||||
<Providers>
|
||||
<div
|
||||
id="top"
|
||||
className="relative flex min-h-screen flex-col"
|
||||
>
|
||||
<Background />
|
||||
|
||||
<div className="relative z-10 flex flex-1 flex-col">
|
||||
<Header />
|
||||
<main data-scroll-snap className="flex flex-1 flex-col">
|
||||
{children}
|
||||
</main>
|
||||
<Footer />
|
||||
</div>
|
||||
|
||||
<BackToTop />
|
||||
<ScrollReveal />
|
||||
</div>
|
||||
</Providers>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
/** Point d'entrée de l'API CRM. Surchargeable via VITE_CRM_API_URL au build. */
|
||||
/** Point d'entrée de l'API CRM. Surchargeable via NEXT_PUBLIC_CRM_API_URL au build. */
|
||||
const host = typeof window !== "undefined" ? window.location.hostname : "";
|
||||
const isLocal = host === "localhost" || host === "127.0.0.1" || host === "0.0.0.0";
|
||||
const isLocal =
|
||||
host === "localhost" || host === "127.0.0.1" || host === "0.0.0.0";
|
||||
|
||||
const base =
|
||||
(import.meta.env.VITE_CRM_API_URL as string | undefined) ??
|
||||
process.env.NEXT_PUBLIC_CRM_API_URL ??
|
||||
(isLocal ? "http://localhost:8082" : "https://crm.cohaise.dev");
|
||||
|
||||
const trimmed = base.replace(/\/+$/, "");
|
||||
@@ -0,0 +1,197 @@
|
||||
import { gsap } from "gsap";
|
||||
import { ScrollToPlugin } from "gsap/ScrollToPlugin";
|
||||
|
||||
gsap.registerPlugin(ScrollToPlugin);
|
||||
|
||||
export { gsap };
|
||||
|
||||
export const prefersReducedMotion = (): boolean =>
|
||||
typeof window !== "undefined" &&
|
||||
window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
||||
|
||||
/*
|
||||
Le menu ne touche plus à l'URL : pour ramener un visiteur d'une page SEO vers
|
||||
une région de l'accueil, on mémorise la cible le temps de la navigation.
|
||||
`sessionStorage` survit au montage de la nouvelle page et reste limité à
|
||||
l'onglet courant.
|
||||
*/
|
||||
const PENDING_SECTION_KEY = "cohaise:pending-section";
|
||||
|
||||
export const setPendingSection = (id: string): void => {
|
||||
try {
|
||||
window.sessionStorage.setItem(PENDING_SECTION_KEY, id);
|
||||
} catch {
|
||||
// Stockage indisponible : le lien ramènera simplement en haut de l'accueil.
|
||||
}
|
||||
};
|
||||
|
||||
export const takePendingSection = (): string | null => {
|
||||
try {
|
||||
const id = window.sessionStorage.getItem(PENDING_SECTION_KEY);
|
||||
if (id !== null) window.sessionStorage.removeItem(PENDING_SECTION_KEY);
|
||||
return id;
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
/** Position de scroll maximale de la page. */
|
||||
const maxScroll = (): number =>
|
||||
Math.max(0, document.documentElement.scrollHeight - window.innerHeight);
|
||||
|
||||
/** Début de chaque région, plus le haut de page, sans doublon. */
|
||||
const scrollStops = (): number[] => {
|
||||
const limit = maxScroll();
|
||||
const regions = Array.from(
|
||||
document.querySelectorAll<HTMLElement>(
|
||||
"main[data-scroll-snap] > [data-region]",
|
||||
),
|
||||
);
|
||||
const tops = regions.map((region) => {
|
||||
const top = region.getBoundingClientRect().top + window.scrollY;
|
||||
return Math.round(Math.min(Math.max(top, 0), limit));
|
||||
});
|
||||
|
||||
return [...new Set([0, ...tops])].sort((a, b) => a - b);
|
||||
};
|
||||
|
||||
/** Index du dernier point d'arrêt situé au-dessus de la position courante. */
|
||||
const stopAtOrAbove = (stops: number[], y: number): number => {
|
||||
let index = 0;
|
||||
for (let i = 0; i < stops.length; i += 1) {
|
||||
const stop = stops[i];
|
||||
if (stop === undefined || stop > y + 2) break;
|
||||
index = i;
|
||||
}
|
||||
return index;
|
||||
};
|
||||
|
||||
/*
|
||||
Un saut de menu ne téléporte plus la page : elle est animée région par
|
||||
région, avec une courte respiration entre chaque étape. Le snap obligatoire
|
||||
est suspendu pendant la séquence (`html[data-scroll-anim]`), sinon le
|
||||
navigateur reprend la main et saute directement à la destination.
|
||||
*/
|
||||
const STEP_DURATION = 0.45;
|
||||
const STEP_GAP = 0.06;
|
||||
|
||||
let sequence: gsap.core.Timeline | null = null;
|
||||
|
||||
/**
|
||||
* Anime le défilement vers une section, sans toucher à l'URL.
|
||||
*
|
||||
* @returns la durée de la séquence en millisecondes (0 si aucun mouvement).
|
||||
*/
|
||||
export const scrollToSection = (hash: string): number => {
|
||||
const target = document.querySelector<HTMLElement>(hash);
|
||||
if (!target) return 0;
|
||||
|
||||
/*
|
||||
Une région est l'unité de snap : une ancre imbriquée (About partage la
|
||||
région de Stack) doit viser la région entière, sinon le snap obligatoire
|
||||
choisit un bord et peut sauter par-dessus le contenu visé.
|
||||
*/
|
||||
const anchor = target.closest<HTMLElement>("[data-region]") ?? target;
|
||||
|
||||
if (prefersReducedMotion()) {
|
||||
sequence?.kill();
|
||||
sequence = null;
|
||||
delete document.documentElement.dataset.scrollAnim;
|
||||
anchor.scrollIntoView({ behavior: "auto" });
|
||||
return 0;
|
||||
}
|
||||
|
||||
const limit = maxScroll();
|
||||
const targetTop = Math.round(
|
||||
Math.min(
|
||||
Math.max(anchor.getBoundingClientRect().top + window.scrollY, 0),
|
||||
limit,
|
||||
),
|
||||
);
|
||||
|
||||
if (Math.abs(window.scrollY - targetTop) < 2) return 0;
|
||||
|
||||
const stops = scrollStops();
|
||||
const from = stopAtOrAbove(stops, window.scrollY);
|
||||
const to = stops.reduce((best, stop, index) => {
|
||||
const bestStop = stops[best];
|
||||
if (bestStop === undefined) return index;
|
||||
return Math.abs(stop - targetTop) < Math.abs(bestStop - targetTop)
|
||||
? index
|
||||
: best;
|
||||
}, 0);
|
||||
|
||||
// Chaque région traversée est une étape : le mouvement reste lisible et
|
||||
// n'expédie jamais le visiteur d'un bord à l'autre de la page.
|
||||
const path: number[] = [];
|
||||
if (to > from) {
|
||||
for (let i = from + 1; i <= to; i += 1) {
|
||||
const stop = stops[i];
|
||||
if (stop !== undefined) path.push(stop);
|
||||
}
|
||||
} else {
|
||||
for (let i = from - 1; i >= to; i -= 1) {
|
||||
const stop = stops[i];
|
||||
if (stop !== undefined) path.push(stop);
|
||||
}
|
||||
}
|
||||
if (path.length === 0) path.push(targetTop);
|
||||
|
||||
sequence?.kill();
|
||||
|
||||
const root = document.documentElement;
|
||||
root.dataset.scrollAnim = "";
|
||||
|
||||
/*
|
||||
Un geste de défilement pendant la séquence doit reprendre la main
|
||||
immédiatement : on coupe l'animation plutôt que de lutter contre le
|
||||
visiteur. Les événements souris/tactiles arrivent après le clic qui a lancé
|
||||
la séquence, donc ils ne l'annulent pas elle-même.
|
||||
*/
|
||||
const scrollKeys = new Set([
|
||||
"ArrowUp",
|
||||
"ArrowDown",
|
||||
"PageUp",
|
||||
"PageDown",
|
||||
"Home",
|
||||
"End",
|
||||
" ",
|
||||
]);
|
||||
|
||||
const interrupt = () => {
|
||||
sequence?.kill();
|
||||
};
|
||||
|
||||
const onKeyDown = (event: KeyboardEvent) => {
|
||||
if (scrollKeys.has(event.key)) interrupt();
|
||||
};
|
||||
|
||||
const finish = () => {
|
||||
delete root.dataset.scrollAnim;
|
||||
window.removeEventListener("wheel", interrupt);
|
||||
window.removeEventListener("touchmove", interrupt);
|
||||
window.removeEventListener("keydown", onKeyDown);
|
||||
if (sequence === timeline) sequence = null;
|
||||
};
|
||||
|
||||
const timeline = gsap.timeline({ onComplete: finish, onInterrupt: finish });
|
||||
|
||||
window.addEventListener("wheel", interrupt, { passive: true });
|
||||
window.addEventListener("touchmove", interrupt, { passive: true });
|
||||
window.addEventListener("keydown", onKeyDown);
|
||||
|
||||
path.forEach((top, index) => {
|
||||
timeline.to(
|
||||
window,
|
||||
{
|
||||
scrollTo: { y: top, autoKill: false },
|
||||
duration: STEP_DURATION,
|
||||
ease: "power2.inOut",
|
||||
},
|
||||
index === 0 ? 0 : `+=${STEP_GAP}`,
|
||||
);
|
||||
});
|
||||
|
||||
sequence = timeline;
|
||||
return Math.round(timeline.duration() * 1000);
|
||||
};
|
||||
@@ -0,0 +1,57 @@
|
||||
/** Métadonnées de site partagées par toutes les pages. */
|
||||
export const SITE_URL = "https://cohaise.dev";
|
||||
export const SITE_NAME = "CoHaiSe";
|
||||
export const SITE_DESCRIPTION =
|
||||
"CoHaiSe conçoit des sites vitrines, applications mobiles et logiciels sur mesure : modernes, rapides et agréables à utiliser.";
|
||||
|
||||
export interface RouteMeta {
|
||||
path: string;
|
||||
title: string;
|
||||
description: string;
|
||||
priority: number;
|
||||
}
|
||||
|
||||
/** Routes publiques indexables, source unique du menu et du sitemap. */
|
||||
export const ROUTES: RouteMeta[] = [
|
||||
{
|
||||
path: "/",
|
||||
title: "Développement web, applications et design sur mesure",
|
||||
description: SITE_DESCRIPTION,
|
||||
priority: 1,
|
||||
},
|
||||
{
|
||||
path: "/services",
|
||||
title: "Services",
|
||||
description:
|
||||
"Développement web, applications mobiles, UI/UX design et logiciels sur mesure. Des outils modernes, rapides et pensés pour durer.",
|
||||
priority: 0.9,
|
||||
},
|
||||
{
|
||||
path: "/demos",
|
||||
title: "Démos",
|
||||
description:
|
||||
"Des réalisations concrètes : CRM, inventaire IT et gamification scolaire. Découvrez des projets réels construits avec React, Next.js et Docker.",
|
||||
priority: 0.8,
|
||||
},
|
||||
{
|
||||
path: "/stack",
|
||||
title: "Stack technique",
|
||||
description:
|
||||
"React, Next.js, TypeScript, Node.js, MariaDB, Docker, Tailwind CSS : les technologies qui font tourner les projets CoHaiSe.",
|
||||
priority: 0.7,
|
||||
},
|
||||
{
|
||||
path: "/about",
|
||||
title: "À propos",
|
||||
description:
|
||||
"CoHaiSe développe des outils sur mesure, rapides, maintenables et agréables à utiliser, de la première idée à la mise en ligne.",
|
||||
priority: 0.7,
|
||||
},
|
||||
{
|
||||
path: "/contact",
|
||||
title: "Contact",
|
||||
description:
|
||||
"Un projet en tête ? Contactez CoHaiSe pour discuter de votre site vitrine, application mobile ou logiciel sur mesure.",
|
||||
priority: 0.8,
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,24 @@
|
||||
import Link from "next/link";
|
||||
|
||||
export default function NotFound() {
|
||||
return (
|
||||
<section className="mx-auto flex w-full max-w-6xl flex-col items-start gap-6 px-4 py-32 sm:px-6">
|
||||
<span className="font-display text-[0.625rem] font-semibold uppercase tracking-label text-accent-graphic">
|
||||
404
|
||||
</span>
|
||||
<h1 className="font-display text-4xl font-black uppercase leading-none tracking-display sm:text-6xl">
|
||||
Page introuvable
|
||||
</h1>
|
||||
<p className="max-w-xl text-base leading-relaxed text-muted-foreground">
|
||||
La page demandée n'existe pas ou a été déplacée. Revenez à
|
||||
l'accueil pour découvrir les services CoHaiSe.
|
||||
</p>
|
||||
<Link
|
||||
href="/"
|
||||
className="inline-flex h-12 items-center rounded-lg bg-primary px-6 font-display text-sm font-semibold uppercase tracking-label text-primary-foreground transition-colors hover:bg-primary-hover"
|
||||
>
|
||||
Retour à l'accueil
|
||||
</Link>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
import { ImageResponse } from "next/og";
|
||||
import { SITE_DESCRIPTION, SITE_NAME } from "./lib/site";
|
||||
|
||||
export const dynamic = "force-static";
|
||||
export const alt = `${SITE_NAME} — Développement web, applications et design sur mesure`;
|
||||
export const size = { width: 1200, height: 630 };
|
||||
export const contentType = "image/png";
|
||||
|
||||
export default function OpenGraphImage() {
|
||||
return new ImageResponse(
|
||||
(
|
||||
<div
|
||||
style={{
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
justifyContent: "space-between",
|
||||
padding: "72px",
|
||||
background: "#050000",
|
||||
color: "#f7f5f4",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
gap: "20px",
|
||||
fontSize: 40,
|
||||
fontWeight: 700,
|
||||
letterSpacing: "0.18em",
|
||||
color: "#ff5252",
|
||||
}}
|
||||
>
|
||||
COHAISE
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
gap: "24px",
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
fontSize: 76,
|
||||
fontWeight: 800,
|
||||
lineHeight: 1.05,
|
||||
textTransform: "uppercase",
|
||||
}}
|
||||
>
|
||||
<span>Développement web,</span>
|
||||
<span>applications & design</span>
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
fontSize: 30,
|
||||
lineHeight: 1.4,
|
||||
color: "#c9c4c2",
|
||||
maxWidth: "900px",
|
||||
}}
|
||||
>
|
||||
{SITE_DESCRIPTION}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
),
|
||||
{ ...size },
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Hero } from "./components/Hero";
|
||||
import { Services } from "./components/Services";
|
||||
import { Demos } from "./components/Demos";
|
||||
import { StackAbout } from "./components/StackAbout";
|
||||
import { Contact } from "./components/Contact";
|
||||
import { services } from "./data/services";
|
||||
import { demos } from "./data/demos";
|
||||
import { SITE_DESCRIPTION, SITE_NAME, SITE_URL } from "./lib/site";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
description: SITE_DESCRIPTION,
|
||||
alternates: { canonical: "/" },
|
||||
};
|
||||
|
||||
const jsonLd = {
|
||||
"@context": "https://schema.org",
|
||||
"@graph": [
|
||||
{
|
||||
"@type": "Organization",
|
||||
"@id": `${SITE_URL}/#organization`,
|
||||
name: SITE_NAME,
|
||||
url: SITE_URL,
|
||||
logo: `${SITE_URL}/images/cohaise.webp`,
|
||||
sameAs: [
|
||||
"https://git.cohaise.dev/Esiah",
|
||||
"https://github.com/xEsiah",
|
||||
],
|
||||
},
|
||||
{
|
||||
"@type": "WebSite",
|
||||
"@id": `${SITE_URL}/#website`,
|
||||
url: SITE_URL,
|
||||
name: SITE_NAME,
|
||||
inLanguage: "fr",
|
||||
publisher: { "@id": `${SITE_URL}/#organization` },
|
||||
},
|
||||
{
|
||||
"@type": "ProfessionalService",
|
||||
"@id": `${SITE_URL}/#service`,
|
||||
name: SITE_NAME,
|
||||
url: SITE_URL,
|
||||
description: SITE_DESCRIPTION,
|
||||
areaServed: "FR",
|
||||
serviceType: [
|
||||
"Développement web",
|
||||
"Applications mobiles",
|
||||
"UI/UX design",
|
||||
"Logiciels sur mesure",
|
||||
],
|
||||
parentOrganization: { "@id": `${SITE_URL}/#organization` },
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default function HomePage() {
|
||||
return (
|
||||
<>
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
|
||||
/>
|
||||
<Hero />
|
||||
<Services services={services} />
|
||||
<Demos demos={demos} />
|
||||
<StackAbout />
|
||||
<Contact />
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
"use client";
|
||||
|
||||
import { LanguageProvider } from "./contexts/LanguageContext";
|
||||
import { ThemeProvider } from "./contexts/ThemeContext";
|
||||
|
||||
export const Providers = ({ children }: { children: React.ReactNode }) => (
|
||||
<ThemeProvider>
|
||||
<LanguageProvider>{children}</LanguageProvider>
|
||||
</ThemeProvider>
|
||||
);
|
||||
@@ -0,0 +1,12 @@
|
||||
import type { MetadataRoute } from "next";
|
||||
import { SITE_URL } from "./lib/site";
|
||||
|
||||
export const dynamic = "force-static";
|
||||
|
||||
export default function robots(): MetadataRoute.Robots {
|
||||
return {
|
||||
rules: [{ userAgent: "*", allow: "/" }],
|
||||
sitemap: `${SITE_URL}/sitemap.xml`,
|
||||
host: SITE_URL,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Services } from "../components/Services";
|
||||
import { services } from "../data/services";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Services",
|
||||
description:
|
||||
"Développement web, applications mobiles, UI/UX design et logiciels sur mesure. Des outils modernes, rapides et pensés pour durer.",
|
||||
alternates: { canonical: "/services" },
|
||||
};
|
||||
|
||||
export default function ServicesPage() {
|
||||
return <Services services={services} />;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import type { MetadataRoute } from "next";
|
||||
import { ROUTES, SITE_URL } from "./lib/site";
|
||||
|
||||
export const dynamic = "force-static";
|
||||
|
||||
export default function sitemap(): MetadataRoute.Sitemap {
|
||||
const lastModified = new Date();
|
||||
|
||||
return ROUTES.map((route) => {
|
||||
// `trailingSlash: true` : l'URL canonique se termine par `/` sauf la racine.
|
||||
const path = route.path === "/" ? "/" : `${route.path}/`;
|
||||
return {
|
||||
url: new URL(path, SITE_URL).toString(),
|
||||
lastModified,
|
||||
changeFrequency: route.path === "/" ? "monthly" : "yearly",
|
||||
priority: route.priority,
|
||||
};
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import type { Metadata } from "next";
|
||||
import { Stack } from "../components/Stack";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Stack technique",
|
||||
description:
|
||||
"React, Next.js, TypeScript, Node.js, MariaDB, Docker, Tailwind CSS : les technologies qui font tourner les projets CoHaiSe.",
|
||||
alternates: { canonical: "/stack" },
|
||||
};
|
||||
|
||||
export default function StackPage() {
|
||||
return <Stack />;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="color-scheme" content="light dark" />
|
||||
<meta
|
||||
name="description"
|
||||
content="CoHaiSe conçoit des sites vitrines, applications mobiles et logiciels sur mesure : modernes, rapides et agréables à utiliser."
|
||||
/>
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.webp" />
|
||||
<title>
|
||||
CoHaiSe — Développement web, applications et design sur mesure
|
||||
</title>
|
||||
<script>
|
||||
(() => {
|
||||
const stored = localStorage.getItem("cohaise-theme");
|
||||
const prefersDark = window.matchMedia(
|
||||
"(prefers-color-scheme: dark)",
|
||||
).matches;
|
||||
const theme = stored ?? (prefersDark ? "dark" : "light");
|
||||
if (theme === "dark") document.documentElement.classList.add("dark");
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
/// <reference types="next" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
import "./.next/types/routes.d.ts";
|
||||
import "./.next/types/root-params.d.ts";
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||
@@ -0,0 +1,15 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
// Vitrine entièrement statique : `next build` produit `out/`, publié tel quel
|
||||
// par nginx (voir docker/Dockerfile.app). Aucun serveur Node en production.
|
||||
output: "export",
|
||||
trailingSlash: true,
|
||||
poweredByHeader: false,
|
||||
images: {
|
||||
// L'export statique n'a pas de serveur d'optimisation d'images.
|
||||
unoptimized: true,
|
||||
},
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
@@ -4,27 +4,26 @@
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc --noEmit && vite build",
|
||||
"preview": "vite preview",
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@cohaise/ui": "*",
|
||||
"gsap": "^3.15.1",
|
||||
"next": "16.4.6",
|
||||
"react": "^19.3.0",
|
||||
"react-dom": "^19.3.0",
|
||||
"react-icons": "^5.7.0",
|
||||
"three": "^0.187.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/vite": "^4.3.3",
|
||||
"@tailwindcss/postcss": "^4.3.3",
|
||||
"@types/node": "^24.0.0",
|
||||
"@types/react": "^19.3.0",
|
||||
"@types/react-dom": "^19.3.0",
|
||||
"@types/three": "^0.187.0",
|
||||
"@vitejs/plugin-react": "^6.1.1",
|
||||
"tailwindcss": "^4.3.3",
|
||||
"typescript": "^7.0.2",
|
||||
"vite": "^8.3.1"
|
||||
"typescript": "^7.0.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
const config = {
|
||||
plugins: {
|
||||
"@tailwindcss/postcss": {},
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -1,50 +0,0 @@
|
||||
import { lazy, Suspense } from "react";
|
||||
import { LanguageProvider } from "./lib/i18n.js";
|
||||
import { useScrollReveal } from "./hooks/useScrollReveal.js";
|
||||
import { Header } from "./components/Header.js";
|
||||
import { Hero } from "./components/Hero.js";
|
||||
import { Services } from "./components/Services.js";
|
||||
import { Demos } from "./components/Demos.js";
|
||||
import { Stack } from "./components/Stack.js";
|
||||
import { About } from "./components/About.js";
|
||||
import { Contact } from "./components/Contact.js";
|
||||
import { Footer } from "./components/Footer.js";
|
||||
import { BackToTop } from "./components/BackToTop.js";
|
||||
import { services } from "./data/services.js";
|
||||
import { demos } from "./data/demos.js";
|
||||
import { stack } from "./data/stack.js";
|
||||
|
||||
// Le fond WebGL (topographie) est lourd : chargé à la demande. Il vit en
|
||||
// `position: fixed` (z-0) : le défilement n'a aucune incidence sur lui, seul
|
||||
// le contenu (z-10) défile au-dessus.
|
||||
const Topography = lazy(() => import("./components/background/Topography.js"));
|
||||
|
||||
export const App = () => {
|
||||
useScrollReveal();
|
||||
|
||||
return (
|
||||
<LanguageProvider>
|
||||
<div id="top" className="relative flex min-h-screen flex-col bg-background text-foreground">
|
||||
<div className="pointer-events-none fixed inset-0 z-0" aria-hidden="true">
|
||||
<Suspense fallback={null}>
|
||||
<Topography color="#ff5252" opacity={0.5} speed={0.22} clickEffect="none" />
|
||||
</Suspense>
|
||||
</div>
|
||||
|
||||
<div className="relative z-10 flex flex-1 flex-col">
|
||||
<Header />
|
||||
<main className="flex flex-1 flex-col">
|
||||
<Hero />
|
||||
<Services services={services} />
|
||||
<Demos demos={demos} />
|
||||
<Stack items={stack} />
|
||||
<About />
|
||||
<Contact />
|
||||
</main>
|
||||
<Footer />
|
||||
<BackToTop />
|
||||
</div>
|
||||
</div>
|
||||
</LanguageProvider>
|
||||
);
|
||||
};
|
||||
@@ -1,18 +0,0 @@
|
||||
import { useLanguage } from "../lib/i18n.js";
|
||||
import { Section, SectionHeading } from "./Section.js";
|
||||
|
||||
export const About = () => {
|
||||
const { t } = useLanguage();
|
||||
|
||||
return (
|
||||
<Section id="about">
|
||||
<SectionHeading title={t("about.title")} />
|
||||
<p
|
||||
data-reveal
|
||||
className="max-w-2xl text-base leading-relaxed text-muted-foreground sm:text-lg"
|
||||
>
|
||||
{t("about.body")}
|
||||
</p>
|
||||
</Section>
|
||||
);
|
||||
};
|
||||
@@ -1,101 +0,0 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { cn } from "@cohaise/ui";
|
||||
import { useLanguage } from "../lib/i18n.js";
|
||||
import { useTheme } from "../hooks/useTheme.js";
|
||||
import { scrollToSection } from "../lib/gsap.js";
|
||||
|
||||
const links = [
|
||||
{ href: "#services", key: "nav.services" },
|
||||
{ href: "#demos", key: "nav.demos" },
|
||||
{ href: "#stack", key: "nav.stack" },
|
||||
{ href: "#about", key: "nav.about" },
|
||||
{ href: "#contact", key: "nav.contact" },
|
||||
] as const;
|
||||
|
||||
export const Header = () => {
|
||||
const { t, lang, setLang } = useLanguage();
|
||||
const { theme, toggleTheme } = useTheme();
|
||||
const [active, setActive] = useState<string>("");
|
||||
|
||||
useEffect(() => {
|
||||
const sections = links
|
||||
.map((link) => document.getElementById(link.href.slice(1)))
|
||||
.filter((element): element is HTMLElement => element !== null);
|
||||
|
||||
const observer = new IntersectionObserver(
|
||||
(entries) => {
|
||||
for (const entry of entries) {
|
||||
if (entry.isIntersecting) setActive(entry.target.id);
|
||||
}
|
||||
},
|
||||
{ rootMargin: "-45% 0px -50% 0px" },
|
||||
);
|
||||
|
||||
sections.forEach((section) => observer.observe(section));
|
||||
return () => observer.disconnect();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<header className="sticky top-0 z-40 border-b border-border/60 bg-background/70 backdrop-blur-xl">
|
||||
<div className="mx-auto flex h-16 max-w-6xl items-center gap-4 px-4 sm:px-6">
|
||||
<a
|
||||
href="#top"
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
scrollToSection("#top");
|
||||
}}
|
||||
className="flex items-center gap-2.5"
|
||||
>
|
||||
<img src="/images/cohaise.webp" alt="" className="size-7 object-contain" aria-hidden="true" />
|
||||
<span className="font-logo text-sm font-bold tracking-logo text-foreground">
|
||||
{t("brand.name")}
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<nav className="ml-auto hidden items-center gap-1 md:flex" aria-label="Navigation">
|
||||
{links.map((link) => {
|
||||
const id = link.href.slice(1);
|
||||
return (
|
||||
<a
|
||||
key={link.href}
|
||||
href={link.href}
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
scrollToSection(link.href);
|
||||
}}
|
||||
aria-current={active === id ? "true" : undefined}
|
||||
className={cn(
|
||||
"rounded-md px-3 py-1.5 font-display text-[0.625rem] font-semibold uppercase tracking-label transition-colors",
|
||||
active === id
|
||||
? "bg-surface-hover text-foreground"
|
||||
: "text-muted-foreground hover:bg-surface-hover hover:text-foreground",
|
||||
)}
|
||||
>
|
||||
{t(link.key)}
|
||||
</a>
|
||||
);
|
||||
})}
|
||||
</nav>
|
||||
|
||||
<div className="flex items-center gap-2 md:ml-6">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setLang(lang === "fr" ? "en" : "fr")}
|
||||
className="rounded-md border border-border px-2.5 py-1.5 font-display text-[0.625rem] font-semibold uppercase tracking-label text-muted-foreground transition-colors hover:border-border-strong hover:text-foreground"
|
||||
aria-label={lang === "fr" ? "Switch to English" : "Passer en français"}
|
||||
>
|
||||
{lang === "fr" ? "EN" : "FR"}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={toggleTheme}
|
||||
className="rounded-md border border-border px-2.5 py-1.5 font-display text-[0.625rem] font-semibold uppercase tracking-label text-muted-foreground transition-colors hover:border-border-strong hover:text-foreground"
|
||||
aria-label={t(theme === "dark" ? "theme.light" : "theme.dark")}
|
||||
>
|
||||
{t(theme === "dark" ? "theme.light" : "theme.dark")}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
};
|
||||
@@ -1,29 +0,0 @@
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
export const Section = ({ id, children }: { id: string; children: ReactNode }) => (
|
||||
<section id={id} className="mx-auto w-full max-w-6xl scroll-mt-24 px-4 py-24 sm:px-6">
|
||||
{children}
|
||||
</section>
|
||||
);
|
||||
|
||||
export const SectionHeading = ({
|
||||
eyebrow,
|
||||
title,
|
||||
subtitle,
|
||||
}: {
|
||||
eyebrow?: string;
|
||||
title: string;
|
||||
subtitle?: string;
|
||||
}) => (
|
||||
<div className="mb-12 flex flex-col gap-3" data-reveal>
|
||||
{eyebrow ? (
|
||||
<span className="font-display text-[0.625rem] font-semibold uppercase tracking-label text-accent-graphic">
|
||||
{eyebrow}
|
||||
</span>
|
||||
) : null}
|
||||
<h2 className="font-display text-3xl font-bold uppercase tracking-display sm:text-4xl">{title}</h2>
|
||||
{subtitle ? (
|
||||
<p className="max-w-2xl text-sm leading-relaxed text-muted-foreground sm:text-base">{subtitle}</p>
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
@@ -1,79 +0,0 @@
|
||||
import { useState } from "react";
|
||||
import { cn } from "@cohaise/ui";
|
||||
import { useLanguage } from "../lib/i18n.js";
|
||||
import type { Service } from "../data/services.js";
|
||||
import { Section, SectionHeading } from "./Section.js";
|
||||
|
||||
export const Services = ({ services }: { services: Service[] }) => {
|
||||
const { t, pick } = useLanguage();
|
||||
const [open, setOpen] = useState<string | null>(services[0]?.slug ?? null);
|
||||
|
||||
return (
|
||||
<Section id="services">
|
||||
<SectionHeading title={t("services.title")} subtitle={t("services.subtitle")} />
|
||||
|
||||
<div className="flex flex-col" data-reveal>
|
||||
{services.map((service) => {
|
||||
const isOpen = open === service.slug;
|
||||
return (
|
||||
<article key={service.slug} className="border-b border-border/60 first:border-t">
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setOpen(isOpen ? null : service.slug)}
|
||||
aria-expanded={isOpen}
|
||||
className="group flex w-full items-center gap-4 py-6 text-left sm:gap-8 sm:py-8"
|
||||
>
|
||||
<span className="font-display text-2xl font-bold uppercase tracking-display text-foreground transition-colors group-hover:text-accent sm:text-3xl md:text-4xl">
|
||||
{pick(service.title)}
|
||||
</span>
|
||||
<span
|
||||
className={cn(
|
||||
"ml-auto font-display text-3xl font-light text-accent-graphic transition-transform duration-base",
|
||||
isOpen ? "rotate-45" : "rotate-0",
|
||||
)}
|
||||
aria-hidden="true"
|
||||
>
|
||||
+
|
||||
</span>
|
||||
</button>
|
||||
|
||||
<div
|
||||
className={cn(
|
||||
"grid transition-[grid-template-rows] duration-slow ease-in-out-soft",
|
||||
isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]",
|
||||
)}
|
||||
>
|
||||
<div className="overflow-hidden">
|
||||
<div className="flex flex-col gap-6 pb-8 md:flex-row md:items-start md:gap-10">
|
||||
<img
|
||||
src={service.image}
|
||||
alt=""
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
className="aspect-[3/2] w-full rounded-lg border border-border/60 object-cover md:w-64"
|
||||
/>
|
||||
<div className="flex flex-col gap-4">
|
||||
<p className="max-w-2xl text-base leading-relaxed text-muted-foreground sm:text-lg">
|
||||
{pick(service.description)}
|
||||
</p>
|
||||
<ul className="flex flex-wrap gap-2.5">
|
||||
{service.tags.map((tag) => (
|
||||
<li
|
||||
key={pick(tag)}
|
||||
className="rounded-full border border-border/60 px-4 py-1.5 text-[0.6875rem] uppercase tracking-label text-foreground transition-colors hover:bg-surface-hover"
|
||||
>
|
||||
{pick(tag)}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</Section>
|
||||
);
|
||||
};
|
||||
@@ -1,65 +0,0 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
import { gsap, prefersReducedMotion } from "../lib/gsap.js";
|
||||
import { useLanguage } from "../lib/i18n.js";
|
||||
import type { StackItem } from "../data/stack.js";
|
||||
import { Section, SectionHeading } from "./Section.js";
|
||||
|
||||
export const Stack = ({ items }: { items: StackItem[] }) => {
|
||||
const { t } = useLanguage();
|
||||
const trackRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const track = trackRef.current;
|
||||
if (!track || prefersReducedMotion()) return;
|
||||
|
||||
// Deux copies rendues dans le JSX : -50 % = exactement une copie, boucle sans couture.
|
||||
const tween = gsap.to(track, {
|
||||
xPercent: -50,
|
||||
duration: 36,
|
||||
ease: "none",
|
||||
repeat: -1,
|
||||
});
|
||||
|
||||
const slow = () => gsap.to(tween, { timeScale: 0.25, duration: 0.6, overwrite: true });
|
||||
const resume = () => gsap.to(tween, { timeScale: 1, duration: 0.6, overwrite: true });
|
||||
|
||||
track.addEventListener("mouseenter", slow);
|
||||
track.addEventListener("mouseleave", resume);
|
||||
|
||||
return () => {
|
||||
track.removeEventListener("mouseenter", slow);
|
||||
track.removeEventListener("mouseleave", resume);
|
||||
tween.kill();
|
||||
};
|
||||
}, []);
|
||||
|
||||
const doubled = [...items, ...items];
|
||||
|
||||
return (
|
||||
<Section id="stack">
|
||||
<SectionHeading title={t("stack.title")} subtitle={t("stack.subtitle")} />
|
||||
|
||||
<div className="overflow-hidden [mask-image:linear-gradient(to_right,transparent,black_10%,black_90%,transparent)]">
|
||||
<div ref={trackRef} className="flex w-max items-center gap-12">
|
||||
{doubled.map((item, index) => {
|
||||
const Icon = item.Icon;
|
||||
return (
|
||||
<span
|
||||
key={`${item.name}-${index}`}
|
||||
className="group/item flex shrink-0 items-center gap-3 whitespace-nowrap"
|
||||
>
|
||||
<Icon
|
||||
className="size-7 text-subtle-foreground transition-transform duration-300 ease-out group-hover/item:scale-125"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<span className="font-display text-lg uppercase tracking-label text-subtle-foreground">
|
||||
{item.name}
|
||||
</span>
|
||||
</span>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</Section>
|
||||
);
|
||||
};
|
||||
@@ -1,30 +0,0 @@
|
||||
import { useLayoutEffect } from "react";
|
||||
import { gsap, prefersReducedMotion } from "../lib/gsap.js";
|
||||
|
||||
/**
|
||||
* Anime à l'entrée tout élément portant `data-reveal` (fade-up au scroll).
|
||||
* Un `data-reveal-delay` optionnel (secondes) retarde l'élément pour créer
|
||||
* un décalage entre des éléments voisins.
|
||||
*/
|
||||
export const useScrollReveal = (): void => {
|
||||
useLayoutEffect(() => {
|
||||
if (prefersReducedMotion()) return;
|
||||
|
||||
const context = gsap.context(() => {
|
||||
const elements = gsap.utils.toArray<HTMLElement>("[data-reveal]");
|
||||
elements.forEach((element) => {
|
||||
const delay = Number.parseFloat(element.dataset.revealDelay ?? "0") || 0;
|
||||
gsap.from(element, {
|
||||
y: 32,
|
||||
opacity: 0,
|
||||
duration: 0.9,
|
||||
delay,
|
||||
ease: "power3.out",
|
||||
scrollTrigger: { trigger: element, start: "top 88%" },
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
return () => context.revert();
|
||||
}, []);
|
||||
};
|
||||
@@ -1,23 +0,0 @@
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
|
||||
export type Theme = "light" | "dark";
|
||||
|
||||
const storageKey = "cohaise-theme";
|
||||
|
||||
const readInitialTheme = (): Theme =>
|
||||
document.documentElement.classList.contains("dark") ? "dark" : "light";
|
||||
|
||||
export const useTheme = () => {
|
||||
const [theme, setTheme] = useState<Theme>(readInitialTheme);
|
||||
|
||||
useEffect(() => {
|
||||
document.documentElement.classList.toggle("dark", theme === "dark");
|
||||
localStorage.setItem(storageKey, theme);
|
||||
}, [theme]);
|
||||
|
||||
const toggleTheme = useCallback(() => {
|
||||
setTheme((current) => (current === "dark" ? "light" : "dark"));
|
||||
}, []);
|
||||
|
||||
return { theme, toggleTheme };
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
import { gsap } from "gsap";
|
||||
import { ScrollTrigger } from "gsap/ScrollTrigger";
|
||||
import { ScrollToPlugin } from "gsap/ScrollToPlugin";
|
||||
|
||||
gsap.registerPlugin(ScrollTrigger, ScrollToPlugin);
|
||||
|
||||
export { gsap, ScrollTrigger };
|
||||
|
||||
export const prefersReducedMotion = (): boolean =>
|
||||
typeof window !== "undefined" &&
|
||||
window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
||||
|
||||
/** Défilement fluide vers une section, sans toucher à l'URL. */
|
||||
export const scrollToSection = (hash: string): void => {
|
||||
const target = document.querySelector<HTMLElement>(hash);
|
||||
if (!target) return;
|
||||
|
||||
if (prefersReducedMotion()) {
|
||||
target.scrollIntoView({ behavior: "auto" });
|
||||
return;
|
||||
}
|
||||
|
||||
gsap.to(window, {
|
||||
duration: 1,
|
||||
scrollTo: { y: target, offsetY: 96 },
|
||||
ease: "power3.inOut",
|
||||
});
|
||||
};
|
||||
@@ -1,16 +0,0 @@
|
||||
import { StrictMode } from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import { App } from "./App.js";
|
||||
import "./styles/index.css";
|
||||
|
||||
const container = document.getElementById("root");
|
||||
|
||||
if (!container) {
|
||||
throw new Error("Element racine introuvable");
|
||||
}
|
||||
|
||||
createRoot(container).render(
|
||||
<StrictMode>
|
||||
<App />
|
||||
</StrictMode>,
|
||||
);
|
||||
@@ -1,17 +0,0 @@
|
||||
@import "tailwindcss";
|
||||
@import "@cohaise/ui/styles";
|
||||
|
||||
@source "../../../../frontend/shared/src";
|
||||
|
||||
@layer base {
|
||||
body {
|
||||
min-height: 100dvh;
|
||||
}
|
||||
}
|
||||
|
||||
/* Verre « liquide » : panneau translucide flouté, posé sur le fond sombre. */
|
||||
.glass {
|
||||
background: color-mix(in oklab, var(--cohaise-surface) 58%, transparent);
|
||||
backdrop-filter: blur(16px) saturate(1.5);
|
||||
-webkit-backdrop-filter: blur(16px) saturate(1.5);
|
||||
}
|
||||
@@ -2,10 +2,24 @@
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||
"jsx": "react-jsx",
|
||||
"types": ["vite/client"],
|
||||
"noEmit": true
|
||||
"jsx": "preserve",
|
||||
"noEmit": true,
|
||||
"allowJs": true,
|
||||
"incremental": true,
|
||||
"types": ["node"],
|
||||
"plugins": [{ "name": "next" }],
|
||||
"paths": {
|
||||
"@/*": ["./*"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.tsx"]
|
||||
"include": [
|
||||
"next-env.d.ts",
|
||||
"app/**/*.ts",
|
||||
"app/**/*.tsx",
|
||||
".next/types/**/*.ts",
|
||||
".next/dev/types/**/*.ts"
|
||||
],
|
||||
"exclude": ["node_modules", "out"]
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"lib": ["ES2022"],
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react(), tailwindcss()],
|
||||
server: {
|
||||
host: true,
|
||||
port: 5173,
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user