Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/app/cgv/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import Link from 'next/link';

import { Wave } from '@/components/atoms';

const articles = [
{
title: 'Objet',
Expand Down Expand Up @@ -157,12 +153,6 @@ const articles = [
const Page = () => {
return (
<section className="min-h-screen">
<Wave className={'rotate-180'} classNamePath={'fill-primary'} />
<Link href={'/'} className="absolute top-0 left-0 z-50">
<h1 className="font-barba text-md sm:text-2xl md:text-3xl lg:text-4xl text-white p-2">
C’W
</h1>
</Link>
<div className="text-black py-12 px-6 h-full">
<div className="min-h-screen p-6">
<div className="max-w-3xl mx-auto">
Expand Down
2 changes: 1 addition & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const RootLayout = ({
{children}
<Analytics />
</Toaster>
<Wave classNamePath="fill-primary/90" />
<Wave classNamePath="fill-ternary/90" />
<Footer />
</body>
</html>
Expand Down
19 changes: 4 additions & 15 deletions src/app/mentions-legales/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import Link from 'next/link';

import { Wave } from '@/components/atoms';

const legalNotices = [
{
title: 'Éditeur du site',
Expand Down Expand Up @@ -73,20 +69,13 @@ const legalNotices = [

const MentionsLegales = () => {
return (
<section className="h-svh">
<div className="min-h-screen">
<Wave className={'rotate-180'} classNamePath={'fill-primary'} />
<div className="h-svh">
<Link href={'/'} className="absolute top-0 left-0 z-50">
<h1 className="font-barba text-md sm:text-2xl md:text-3xl lg:text-4xl text-white p-2">
C’W
</h1>
</Link>
<div className="text-black py-12 px-6">
<section className="min-h-screen">
<div>
<div className="text-black py-12 px-6 h-full">
<div className="min-h-screen p-6">
<h1 className="text-4xl font-barba text-primary mb-6">
Mentions Légales
</h1>

<div className="container mx-auto max-w-3xl">
{legalNotices.map((legalNotice, index) => (
<details
Expand Down
2 changes: 0 additions & 2 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
Hero,
Services,
Loader,
NavigationBar,
ContactModal,
AnimatedArrow,
} from '@/components/atoms';
Expand Down Expand Up @@ -67,7 +66,6 @@ export default function Home() {
<Loader />
) : (
<>
<NavigationBar />
<AnimatedArrow />
<Hero />
<About />
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type Props = {
const Footer = ({ className }: Props) => {
return (
<footer
className={`bg-primary/90 text-white text-center text-sm ${className}`}
className={`bg-ternary/90 text-white text-center text-sm ${className}`}
>
<div className="flex flex-col md:flex-row justify-center items-center gap-4">
<Link
Expand Down
90 changes: 57 additions & 33 deletions src/components/atoms/NavigationBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client';

import React, { useEffect, useState } from 'react';
import { useRouter } from 'next/navigation';

const sections = [
{ id: 'hero', title: 'Accueil' },
Expand All @@ -12,6 +13,22 @@ const sections = [

const NavigationBar = () => {
const [activeSection, setActiveSection] = useState<string>('');
const router = useRouter();

// Récupération de l'ancre avec `URLSearchParams`
useEffect(() => {
if (typeof window !== 'undefined') {
const params = new URLSearchParams(window.location.search);
const targetSection = params.get('section');

if (targetSection) {
const element = document.getElementById(targetSection);
if (element) {
element.scrollIntoView({ behavior: 'smooth' });
}
}
}
}, []);

const observerOptions = {
root: null,
Expand All @@ -28,44 +45,51 @@ const NavigationBar = () => {
};

useEffect(() => {
requestAnimationFrame(() => {
const observer = new IntersectionObserver(
observerCallback,
observerOptions
);
sections.forEach((section) => {
const element = document.getElementById(section.id);
if (element) {
observer.observe(element);
}
});
const observer = new IntersectionObserver(
observerCallback,
observerOptions
);
sections.forEach((section) => {
const element = document.getElementById(section.id);
if (element) {
observer.observe(element);
}
});

return () => observer.disconnect();
}, []);

const handleNavigation = (sectionId: string) => {
if (window.location.pathname !== '/') {
router.push(`/?section=${sectionId}`);
} else {
const element = document.getElementById(sectionId);
if (element) {
element.scrollIntoView({ behavior: 'smooth' });
}
}
};

return (
<header>
<nav className="fixed top-0 w-screen z-50 flex justify-center items-center py-2 px-4 lg:py-4 lg:px-8 bg-ternary/90 backdrop-blur shadow-lg">
<ul className="flex space-x-2 lg:space-x-6 text-white">
{sections.map((section) => (
<li key={section.id}>
<a
href={`#${section.id}`}
className={`transition-colors duration-300 font-light text-sm md:text-lg lg:text-xl ${
activeSection === section.id
? 'text-secondary/70 active:text-red' // Ajoute la couleur active ici
: 'hover:text-primary'
}`}
>
{section.title}
</a>
</li>
))}
</ul>
</nav>
</header>
<nav className="fixed top-0 w-screen z-50 flex justify-center items-center py-2 px-4 lg:py-4 lg:px-8 bg-ternary/90 backdrop-blur shadow-lg">
<ul className="flex space-x-2 lg:space-x-6 text-white">
{sections.map((section) => (
<li key={section.id}>
<button
onClick={() => handleNavigation(section.id)}
className={`transition-colors duration-300 font-light text-sm md:text-lg lg:text-xl ${
activeSection === section.id
? 'text-secondary/70 active:text-red'
: 'hover:text-primary'
}`}
>
{section.title}
</button>
</li>
))}
</ul>
</nav>
);
};

// Fonction pour capitaliser le texte (ex: "hero" → "Hero")

export default NavigationBar;
9 changes: 7 additions & 2 deletions src/components/organisms/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import React from 'react';
import { Navigation } from '@/components/organisms';

import { NavigationBar } from '@/components/atoms';

const Header = () => {
return <Navigation />;
return (
<header className="sticky top-0 z-50 bg-white shadow-sm">
<NavigationBar />
</header>
);
};

export default Header;
9 changes: 0 additions & 9 deletions src/components/organisms/Navigation.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/components/organisms/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export { default as Header } from './Header';
export { default as Navigation } from './Navigation';
export { default as ServicesGrid } from './ServicesGrid';
export { default as Toaster } from './Toaster';
16 changes: 0 additions & 16 deletions src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,12 @@
@font-face {
font-family: Barba;
}
/*@font-face {*/
/* font-family: 'Orbitron';*/
/* font-style: normal;*/
/* font-weight: 900;*/
/* src: url('../assets/fonts/Orbitron-Black.ttf') format('truetype');*/
/*}*/
}

*, body, html {
@apply m-0 p-0 border-0 box-border;
}

/* width */
::-webkit-scrollbar {
@apply w-1 h-1;
}

/* Handle */
::-webkit-scrollbar-thumb {
@apply bg-background-white;
}

@layer base {
*, body, html {
font-family: Cerebris Sans, sans-serif;
Expand Down