Fix des fins de ligne (LF/CRLF)
41
.gitignore
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.*
|
||||
.yarn/*
|
||||
!.yarn/patches
|
||||
!.yarn/plugins
|
||||
!.yarn/releases
|
||||
!.yarn/versions
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# next.js
|
||||
/.next/
|
||||
/out/
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
*.pem
|
||||
|
||||
# debug
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
.pnpm-debug.log*
|
||||
|
||||
# env files (can opt-in for committing if needed)
|
||||
.env*
|
||||
|
||||
# vercel
|
||||
.vercel
|
||||
|
||||
# typescript
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
36
README.md
Normal file
@ -0,0 +1,36 @@
|
||||
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
|
||||
|
||||
## Getting Started
|
||||
|
||||
First, run the development server:
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
# or
|
||||
yarn dev
|
||||
# or
|
||||
pnpm dev
|
||||
# or
|
||||
bun dev
|
||||
```
|
||||
|
||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
||||
|
||||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
||||
|
||||
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
|
||||
|
||||
## Learn More
|
||||
|
||||
To learn more about Next.js, take a look at the following resources:
|
||||
|
||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||
|
||||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
|
||||
|
||||
## Deploy on Vercel
|
||||
|
||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
||||
|
||||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
|
||||
6
app/Competences/[slug]/page.tsx
Normal file
@ -0,0 +1,6 @@
|
||||
import ContentSectionCompetences from "../../components/ContentSectionCompetences";
|
||||
|
||||
export default function Page({ params }: { params: { slug: string } }) {
|
||||
return <ContentSectionCompetences collection="competences" slug={params.slug} />;
|
||||
}
|
||||
|
||||
63
app/Competences/page.jsx
Normal file
@ -0,0 +1,63 @@
|
||||
import Link from "next/link";
|
||||
|
||||
async function getAllCompetences() {
|
||||
try {
|
||||
const response = await fetch("http://localhost:1337/api/competences?populate=*");
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch competences");
|
||||
}
|
||||
const competences = await response.json();
|
||||
return competences.data;
|
||||
} catch (error) {
|
||||
console.error("Error fetching competences:", error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
export default async function Page() {
|
||||
const competences = await getAllCompetences();
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1 className="text-3xl mb-6 font-bold text-grey-700">Mes Compétences</h1>
|
||||
<div className="grid grid-cols-2 gap-6">
|
||||
{competences.map((competence) => {
|
||||
const picture = competence.picture?.[0]; // Récupère la première image si elle existe
|
||||
const largeImageUrl = picture?.formats?.large?.url; // Vérifie que le format "large" existe
|
||||
const originalImageUrl = picture?.url; // URL de l'image originale
|
||||
|
||||
// Utilisez l'URL de l'image originale si disponible, sinon l'URL de l'image large
|
||||
const imageUrl = originalImageUrl
|
||||
? `http://localhost:1337${originalImageUrl}`
|
||||
: `http://localhost:1337${largeImageUrl}`;
|
||||
|
||||
return (
|
||||
<div key={competence.id} className="bg-white rounded-lg shadow-md overflow-hidden transform transition-transform duration-300 hover:scale-105 hover:shadow-lg hover:bg-blue-100">
|
||||
<Link href={`/competences/${competence.slug}`}>
|
||||
<div className="overflow-hidden">
|
||||
{imageUrl ? (
|
||||
<img
|
||||
src={imageUrl}
|
||||
alt={picture?.name || "Competence image"}
|
||||
className="w-full h-48 object-cover transform transition-transform duration-300 hover:scale-125 hover:rotate-12"
|
||||
/>
|
||||
) : (
|
||||
<div className="bg-gray-200 text-gray-500 text-center rounded-md shadow-md p-4">
|
||||
Image indisponible
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="p-4">
|
||||
<p className="font-bold text-xl mb-2">{competence.name}</p>
|
||||
<p className="text-gray-700">{competence.description}</p>
|
||||
</div>
|
||||
</Link>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 8.0 MiB |
|
After Width: | Height: | Size: 8.1 MiB |
|
After Width: | Height: | Size: 7.5 MiB |
|
After Width: | Height: | Size: 7.8 MiB |
BIN
app/assets/images/photo.jpg
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
app/assets/images/photoschool/20230203_095626.jpg
Normal file
|
After Width: | Height: | Size: 2.4 MiB |
BIN
app/assets/images/photoschool/20230406_112330.jpg
Normal file
|
After Width: | Height: | Size: 2.3 MiB |
BIN
app/assets/images/photoschool/20230406_112520.jpg
Normal file
|
After Width: | Height: | Size: 2.3 MiB |
BIN
app/assets/images/photoschool/20230406_112536.jpg
Normal file
|
After Width: | Height: | Size: 2.1 MiB |
BIN
app/assets/images/photoschool/photoecole.jpg
Normal file
|
After Width: | Height: | Size: 233 KiB |
BIN
app/assets/images/wallpapersite.png
Normal file
|
After Width: | Height: | Size: 6.6 MiB |
66
app/assets/main.css
Normal file
@ -0,0 +1,66 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
|
||||
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');
|
||||
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');
|
||||
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@400;700&display=swap');
|
||||
@import url('https://fonts.googleapis.com/css2?family=Audiowide&display=swap');
|
||||
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');
|
||||
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
.bg-wallpaper {
|
||||
background-image: url('./images/wallpapersite.png');
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.homepage-content {
|
||||
min-height: 50vh; /* Hauteur minimale de 50% de la hauteur de la fenêtre */
|
||||
max-height: 80vh; /* Hauteur maximale de 80% de la hauteur de la fenêtre */
|
||||
}
|
||||
|
||||
.circle-one {
|
||||
animation: move1 10s linear infinite;
|
||||
}
|
||||
|
||||
.circle-two {
|
||||
animation: move2 10s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes move1 {
|
||||
0% {
|
||||
transform: translate(0, 0) scale 1;
|
||||
}
|
||||
25% {
|
||||
transform: translate(200px, 200px) scale(1);
|
||||
}
|
||||
50%{
|
||||
transform: translate(100px, 400px) scale(1.2);
|
||||
}
|
||||
75%{
|
||||
transform: translate(-100px, -200px) scale(1.1);
|
||||
}
|
||||
100% {
|
||||
transform: translate(0, 0) scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes move2 {
|
||||
0% {
|
||||
transform: translate(0, 0) scale 1;
|
||||
}
|
||||
25% {
|
||||
transform: translate(-30px, -300px) scale(1);
|
||||
}
|
||||
50%{
|
||||
transform: translate(-200px, -100px) scale(1.2);
|
||||
}
|
||||
75%{
|
||||
transform: translate(30px, 70px) scale(1.1);
|
||||
}
|
||||
100% {
|
||||
transform: translate(0, 0) scale(1);
|
||||
}
|
||||
}
|
||||
74
app/components/Carousel.tsx
Normal file
@ -0,0 +1,74 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { createPortal } from "react-dom"; // 🟢 Import du Portal
|
||||
import { Swiper, SwiperSlide } from "swiper/react";
|
||||
import { Navigation, Pagination, Autoplay } from "swiper/modules";
|
||||
import "swiper/css";
|
||||
import "swiper/css/navigation";
|
||||
import "swiper/css/pagination";
|
||||
|
||||
interface CarouselProps {
|
||||
images: Array<{ url: string; alt: string }>;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export default function Carousel({ images, className }: CarouselProps) {
|
||||
const [selectedImage, setSelectedImage] = useState<string | null>(null);
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Carrousel principal */}
|
||||
<div className={`relative w-full ${className || "h-64"} rounded-md shadow-md`}>
|
||||
<Swiper
|
||||
modules={[Navigation, Pagination, Autoplay]}
|
||||
spaceBetween={10}
|
||||
slidesPerView={1}
|
||||
navigation
|
||||
pagination={{ clickable: true }}
|
||||
autoplay={{ delay: 3000 }}
|
||||
className={`w-full ${className || "h-64"}`}
|
||||
>
|
||||
{images.map((img, index) => (
|
||||
<SwiperSlide key={index} className="flex items-center justify-center h-full">
|
||||
{/* Image cliquable pour affichage en plein écran */}
|
||||
<img
|
||||
src={img.url}
|
||||
alt={img.alt}
|
||||
className="w-full h-full object-cover rounded-md cursor-pointer transition-transform duration-300 hover:scale-105"
|
||||
onClick={() => setSelectedImage(img.url)} // 🟢 Ouvre l’image en plein écran
|
||||
/>
|
||||
</SwiperSlide>
|
||||
))}
|
||||
</Swiper>
|
||||
</div>
|
||||
|
||||
{/* 🟢 Modal plein écran inséré DANS `<body>` grâce à `createPortal` */}
|
||||
{selectedImage &&
|
||||
createPortal(
|
||||
<div
|
||||
className="fixed inset-0 flex items-center justify-center w-screen h-screen bg-black bg-opacity-10 backdrop-blur-2xl transition-opacity duration-300 z-[1000]"
|
||||
onClick={() => setSelectedImage(null)} // 🔴 Fermer au clic
|
||||
>
|
||||
<div className="relative w-full max-w-6xl p-6 bg-transparent">
|
||||
{/* Bouton de fermeture */}
|
||||
<button
|
||||
className="absolute top-6 right-6 text-white text-3xl bg-gray-900/70 p-2 rounded-full"
|
||||
onClick={() => setSelectedImage(null)}
|
||||
>
|
||||
✖
|
||||
</button>
|
||||
|
||||
{/* Image affichée en grand */}
|
||||
<img
|
||||
src={selectedImage}
|
||||
alt="Agrandissement"
|
||||
className="w-full max-h-[90vh] object-contain rounded-lg shadow-lg"
|
||||
/>
|
||||
</div>
|
||||
</div>,
|
||||
document.body // 🟢 Place le `modal` en dehors de `<main>` dans `<body>`
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
70
app/components/CarouselCompetences.tsx
Normal file
@ -0,0 +1,70 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { createPortal } from "react-dom";
|
||||
import { Swiper, SwiperSlide } from "swiper/react";
|
||||
import { Navigation, Pagination, Autoplay } from "swiper/modules";
|
||||
import "swiper/css";
|
||||
import "swiper/css/navigation";
|
||||
import "swiper/css/pagination";
|
||||
|
||||
interface CarouselProps {
|
||||
images: Array<{ url: string; alt: string }>;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export default function CarouselCompetences({ images, className }: CarouselProps) {
|
||||
const [selectedImage, setSelectedImage] = useState<string | null>(null);
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Carrousel compétences */}
|
||||
<div className={`relative w-full ${className || "h-64"} rounded-md shadow-md`}>
|
||||
<Swiper
|
||||
modules={[Navigation, Pagination, Autoplay]}
|
||||
spaceBetween={10}
|
||||
slidesPerView={1}
|
||||
navigation
|
||||
pagination={{ clickable: true }}
|
||||
autoplay={{ delay: 3000 }}
|
||||
className={`w-full ${className || "h-64"}`}
|
||||
>
|
||||
{images.map((img, index) => (
|
||||
<SwiperSlide key={index} className="flex items-center justify-center h-full">
|
||||
<img
|
||||
src={img.url}
|
||||
alt={img.alt}
|
||||
className="w-full h-full object-cover rounded-md cursor-pointer transition-transform duration-300 hover:scale-105"
|
||||
onClick={() => setSelectedImage(img.url)}
|
||||
/>
|
||||
</SwiperSlide>
|
||||
))}
|
||||
</Swiper>
|
||||
</div>
|
||||
|
||||
{/* Modal plein écran pour agrandir les images */}
|
||||
{selectedImage &&
|
||||
createPortal(
|
||||
<div
|
||||
className="fixed inset-0 flex items-center justify-center w-screen h-screen bg-black bg-opacity-10 backdrop-blur-2xl transition-opacity duration-300 z-[1000]"
|
||||
onClick={() => setSelectedImage(null)}
|
||||
>
|
||||
<div className="relative w-full max-w-6xl p-6 bg-transparent">
|
||||
<button
|
||||
className="absolute top-6 right-6 text-white text-3xl bg-gray-900/70 p-2 rounded-full"
|
||||
onClick={() => setSelectedImage(null)}
|
||||
>
|
||||
✖
|
||||
</button>
|
||||
<img
|
||||
src={selectedImage}
|
||||
alt="Agrandissement"
|
||||
className="w-full max-h-[90vh] object-contain rounded-lg shadow-lg"
|
||||
/>
|
||||
</div>
|
||||
</div>,
|
||||
document.body
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
54
app/components/ContentSection.tsx
Normal file
@ -0,0 +1,54 @@
|
||||
import { fetchData } from "../utils/fetchData";
|
||||
import Carousel from "./Carousel";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
|
||||
interface ContentSectionProps {
|
||||
collection: string; // Nom de la collection (projects, events, blog, etc.)
|
||||
slug: string;
|
||||
titleClass?: string; // Permet de modifier le style du titre
|
||||
contentClass?: string; // Permet de modifier le style du contenu
|
||||
}
|
||||
|
||||
export default async function ContentSection({ collection, slug, titleClass, contentClass }: ContentSectionProps) {
|
||||
const data = await fetchData(collection, slug);
|
||||
|
||||
if (!data) {
|
||||
return <div>Contenu introuvable.</div>;
|
||||
}
|
||||
|
||||
const { name, Resum: richText, picture, link, linkText } = data;
|
||||
|
||||
// Transformer les images de Strapi en format attendu par le carrousel
|
||||
const images = picture?.map((img: any) => ({
|
||||
url: `http://localhost:1337${img?.formats?.large?.url || img?.url}`,
|
||||
alt: img.name || "Image",
|
||||
})) || [];
|
||||
|
||||
return (
|
||||
<div className="max-w-3xl mx-auto p-6">
|
||||
<h1 className={titleClass || "text-3xl mb-6 font-bold text-gray-700"}>{name}</h1>
|
||||
|
||||
{/* Carrousel réutilisable */}
|
||||
<Carousel images={images} className="w-full h-64" />
|
||||
|
||||
{/* Contenu en Markdown */}
|
||||
<div className={contentClass || "bg-gray-100 rounded-md p-4 shadow-md mt-6"}>
|
||||
<ReactMarkdown>{richText}</ReactMarkdown>
|
||||
</div>
|
||||
|
||||
{/* Lien externe */}
|
||||
{link && (
|
||||
<div className="mt-6">
|
||||
<a
|
||||
href={link}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-blue-500 hover:underline transition duration-300 ease-in-out transform hover:scale-105 hover:text-blue-700"
|
||||
>
|
||||
{linkText || "Voir plus/lien externe"}
|
||||
</a>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
40
app/components/ContentSectionCompetences.tsx
Normal file
@ -0,0 +1,40 @@
|
||||
import { fetchDataCompetences } from "../utils/fetchDataCompetences"; // ✅ Importation du bon fetch
|
||||
import CarouselCompetences from "./CarouselCompetences";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
|
||||
interface ContentSectionProps {
|
||||
collection: string;
|
||||
slug: string;
|
||||
titleClass?: string;
|
||||
contentClass?: string;
|
||||
}
|
||||
|
||||
export default async function ContentSectionCompetences({ collection, slug, titleClass, contentClass }: ContentSectionProps) {
|
||||
const data = await fetchDataCompetences(collection, slug); // ✅ Utilisation du fetch spécifique
|
||||
|
||||
if (!data) {
|
||||
return <div className="text-red-500 text-center">❌ Compétence introuvable.</div>;
|
||||
}
|
||||
|
||||
const { name, content, picture } = data; // ✅ Assure-toi que `content` est bien récupéré au lieu de `Resum`
|
||||
|
||||
// 🔹 Transformation des images pour le carrousel des compétences
|
||||
const images = picture?.map((img: any) => ({
|
||||
url: `http://localhost:1337${img?.formats?.large?.url || img?.url}`,
|
||||
alt: img.name || "Image de compétence",
|
||||
})) || [];
|
||||
|
||||
return (
|
||||
<div className="max-w-3xl mx-auto p-6">
|
||||
<h1 className={titleClass || "text-3xl mb-6 font-bold text-gray-700"}>{name}</h1>
|
||||
|
||||
{/* Carrousel spécifique aux compétences */}
|
||||
<CarouselCompetences images={images} className="w-full h-64" />
|
||||
|
||||
{/* Contenu en Markdown */}
|
||||
<div className={contentClass || "mt-6 text-lg text-black-700"}>
|
||||
<ReactMarkdown>{content}</ReactMarkdown> {/* ✅ Utilisation de `content` au lieu de `Resum` */}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
18
app/components/Footer.jsx
Normal file
@ -0,0 +1,18 @@
|
||||
"use client"
|
||||
|
||||
import {useState} from "react"
|
||||
|
||||
export default function Footer() {
|
||||
const [count, setCount] = useState(0)
|
||||
function handleClick() {
|
||||
setCount(count + 1)}
|
||||
|
||||
return (
|
||||
<footer className="bg-white/50 backdrop-blur rounded-lg">
|
||||
<div className="max-w-4xl mx-auto flex flex-col items-center py-6 text-sm text-gray-400">
|
||||
<p>© {new Date().getFullYear()} Our Company.</p>
|
||||
<p>Vous avez cliqué {count} fois sur le boutton.<button onClick={handleClick}>Click Me</button></p>
|
||||
</div>
|
||||
</footer>
|
||||
)
|
||||
}
|
||||
14
app/components/NavLink.jsx
Normal file
@ -0,0 +1,14 @@
|
||||
"use client"
|
||||
|
||||
import Link from "next/link"
|
||||
import {usePathname} from "next/navigation"
|
||||
|
||||
export default function NavLink(props){
|
||||
const pathname = usePathname()
|
||||
const active = pathname === props.path
|
||||
return(
|
||||
<Link className={active ? "opacity-100" : "opacity-50 hover:opacity-65"} href={props.path}>
|
||||
{props.text}
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
7
app/contact/page.js
Normal file
@ -0,0 +1,7 @@
|
||||
export default function Page() {
|
||||
return (
|
||||
<div>
|
||||
<h1>A propos de nous!!!</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
BIN
app/favicon.ico
Normal file
|
After Width: | Height: | Size: 25 KiB |
21
app/globals.css
Normal file
@ -0,0 +1,21 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
:root {
|
||||
--background: #ffffff;
|
||||
--foreground: #171717;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--background: #0a0a0a;
|
||||
--foreground: #ededed;
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
color: var(--foreground);
|
||||
background: var(--background);
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
68
app/layout.tsx
Normal file
@ -0,0 +1,68 @@
|
||||
"use client";
|
||||
|
||||
import React, { useEffect, useState } from "react";
|
||||
import Footer from "./components/Footer";
|
||||
import "./assets/main.css";
|
||||
import NavLink from "./components/NavLink";
|
||||
|
||||
export default function RootLayout({ children }) {
|
||||
const [numElements, setNumElements] = useState(0);
|
||||
const [containerWidth, setContainerWidth] = useState("max-w-4xl");
|
||||
const [containerHeight, setContainerHeight] = useState("min-h-[50vh]");
|
||||
|
||||
useEffect(() => {
|
||||
// Supposons que children soit un tableau d'éléments
|
||||
const elementsCount = React.Children.count(children);
|
||||
setNumElements(elementsCount);
|
||||
|
||||
// Ajustez la largeur en fonction du nombre d'éléments
|
||||
if (elementsCount > 5) {
|
||||
setContainerWidth("max-w-6xl");
|
||||
setContainerHeight("min-h-[80vh]");
|
||||
} else if (elementsCount > 3) {
|
||||
setContainerWidth("max-w-5xl");
|
||||
setContainerHeight("min-h-[70vh]");
|
||||
} else {
|
||||
setContainerWidth("max-w-4xl");
|
||||
setContainerHeight("min-h-[60vh]");
|
||||
}
|
||||
}, [children]);
|
||||
|
||||
return (
|
||||
<html lang="fr">
|
||||
<body>
|
||||
<div className="bg-wallpaper min-h-[100dvh] grid grid-rows-[auto_1fr_auto]">
|
||||
<div className="absolute z-0 inset-0 overflow-hidden">
|
||||
<div className="circle-one blur-3xl w-64 h-64 rounded-full bg-rose-400/60 top-0 right-28 absolute"></div>
|
||||
<div className="circle-two blur-3xl w-64 h-64 rounded-full bg-indigo-400/60 bottom-0 left-28 absolute"></div>
|
||||
</div>
|
||||
<header className="z-10 bg-white/50 backdrop-blur rounded-lg border-2 border-gray-500">
|
||||
<div className="max-w-4xl mx-auto flex items-center justify-between p-4">
|
||||
<h2 className="text-2xl font-bold">Portofolio Gras-Calvet Fernand</h2>
|
||||
<nav>
|
||||
<ul className="flex gap-x-7 text-black-500 font-bold">
|
||||
<li>
|
||||
<NavLink text="Accueil" path="/" />
|
||||
</li>
|
||||
<li>
|
||||
<NavLink text="Portfolio" path="/portfolio" />
|
||||
</li>
|
||||
<li>
|
||||
<NavLink text="Compétences" path="/Competences" />
|
||||
</li>
|
||||
<li>
|
||||
<NavLink text="Contact" path="/contact" />
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<main className={`backdrop-blur z-10 ${containerWidth} ${containerHeight} mx-auto bg-white/20 rounded-xl py-7 px-8 m-6 overflow-hidden`}>
|
||||
{children}
|
||||
</main>
|
||||
<Footer />
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
54
app/page.tsx
Normal file
@ -0,0 +1,54 @@
|
||||
import React from "react";
|
||||
import ReactMarkdown from "react-markdown"; // Importation de ReactMarkdown
|
||||
import "./assets/main.css";
|
||||
|
||||
async function getHomepageData() {
|
||||
try {
|
||||
const response = await fetch("http://localhost:1337/api/homepages?populate=*");
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch homepage content");
|
||||
}
|
||||
const homepage = await response.json();
|
||||
return homepage.data?.[0]; // On récupère la première entrée
|
||||
} catch (error) {
|
||||
console.error("Error fetching homepage:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export default async function HomePage() {
|
||||
const homepage = await getHomepageData();
|
||||
if (!homepage) return <p className="text-center text-red-500">Erreur lors du chargement du contenu.</p>;
|
||||
|
||||
// Récupération des données
|
||||
const title = homepage?.title;
|
||||
const cv = homepage?.cv || ""; // Assurer que `cv` est une chaîne même si vide
|
||||
const photo = homepage?.photo;
|
||||
|
||||
// Correction de l'URL de l'image
|
||||
const baseUrl = "http://localhost:1337";
|
||||
const imageUrl = photo?.url ? `${baseUrl}${photo.url}` : null;
|
||||
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center homepage-content p-6">
|
||||
{/* Texte court (title) */}
|
||||
<h1 className="text-3xl font-bold text-gray-800 mb-4">{title}</h1>
|
||||
|
||||
{/* Photo en cadre ovale avec effet hover */}
|
||||
{imageUrl ? (
|
||||
<div className="relative w-64 h-64 rounded-full overflow-hidden shadow-lg border-4 border-gray-300 transition-transform duration-300 hover:scale-110">
|
||||
<img src={imageUrl} alt="Photo de profil" className="w-full h-full object-cover" />
|
||||
</div>
|
||||
) : (
|
||||
<div className="w-64 h-64 flex items-center justify-center bg-gray-500 text-gray-200 rounded-full shadow-md">
|
||||
Image indisponible
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Texte riche en Markdown */}
|
||||
<div className="mt-6 text-lg text-black-700 max-w-2xl p-4 text-center">
|
||||
<ReactMarkdown>{cv}</ReactMarkdown>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
5
app/portfolio/[slug]/page.tsx
Normal file
@ -0,0 +1,5 @@
|
||||
import ContentSection from "../../components/ContentSection";
|
||||
|
||||
export default function Page({ params }: { params: { slug: string } }) {
|
||||
return <ContentSection collection="projects" slug={params.slug} />;
|
||||
}
|
||||
59
app/portfolio/page.jsx
Normal file
@ -0,0 +1,59 @@
|
||||
import Link from "next/link";
|
||||
|
||||
async function getAllprojects() {
|
||||
try {
|
||||
const response = await fetch("http://localhost:1337/api/projects?populate=*");
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch projects");
|
||||
}
|
||||
const projects = await response.json();
|
||||
return projects.data;
|
||||
} catch (error) {
|
||||
console.error("Error fetching projects:", error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
export default async function Page() {
|
||||
const projects = await getAllprojects();
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1 className="text-3xl mb-6 font-bold text-grey-700">Portfolio formation 42</h1>
|
||||
<div className="grid grid-cols-2 gap-6">
|
||||
{projects.map((project) => {
|
||||
const picture = project.picture?.[0]; // Récupère la première image si elle existe
|
||||
const largeImageUrl = picture?.formats?.large?.url; // Vérifie que le format "large" existe
|
||||
const originalImageUrl = picture?.url; // URL de l'image originale
|
||||
|
||||
// Utilisez l'URL de l'image originale si disponible, sinon l'URL de l'image large
|
||||
const imageUrl = originalImageUrl ? `http://localhost:1337${originalImageUrl}` : `http://localhost:1337${largeImageUrl}`;
|
||||
|
||||
return (
|
||||
<div key={project.id} className="bg-white rounded-lg shadow-md overflow-hidden transform transition-transform duration-300 hover:scale-105 hover:shadow-lg hover:bg-blue-100">
|
||||
<Link href={`/portfolio/${project.slug}`}>
|
||||
<div className="overflow-hidden">
|
||||
{imageUrl ? (
|
||||
<img
|
||||
src={imageUrl}
|
||||
alt={picture?.name || "Project image"}
|
||||
className="w-full h-48 object-cover transform transition-transform duration-300 hover:scale-125 hover:rotate-12"
|
||||
/>
|
||||
) : (
|
||||
<div className="bg-gray-200 text-gray-500 text-center rounded-md shadow-md p-4">
|
||||
Image indisponible
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="p-4">
|
||||
<p className="font-bold text-xl mb-2">{project.name}</p>
|
||||
<p className="text-gray-700">{project.description}</p>
|
||||
</div>
|
||||
</Link>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
24
app/utils/fetchData.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import qs from "qs";
|
||||
|
||||
export async function fetchData(collection: string, slug: string) {
|
||||
const query = qs.stringify({
|
||||
filters: { slug },
|
||||
populate: "picture",
|
||||
});
|
||||
|
||||
try {
|
||||
const response = await fetch(`http://localhost:1337/api/${collection}?${query}`, {
|
||||
cache: "no-store",
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error("Failed to fetch data");
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
return data.data[0] || null;
|
||||
} catch (error) {
|
||||
console.error(`Error fetching ${collection} data:`, error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
25
app/utils/fetchDataCompetences.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import qs from "qs";
|
||||
|
||||
export async function fetchDataCompetences(collection: string, slug: string) {
|
||||
// 🔹 Construire la requête API avec le bon filtre et populate
|
||||
const query = qs.stringify({
|
||||
filters: { slug },
|
||||
populate: "picture", // ⚡ Ajoute d'autres champs si besoin
|
||||
});
|
||||
|
||||
try {
|
||||
const response = await fetch(`http://localhost:1337/api/$(collection)?${query}`, {
|
||||
cache: "no-store", // 🔹 Désactive le cache pour éviter les erreurs
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error(`Failed to fetch competences data: ${response.status}`);
|
||||
}
|
||||
|
||||
const data = await response.json();
|
||||
return data.data[0] || null;
|
||||
} catch (error) {
|
||||
console.error("❌ Error fetching competences data:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
7
jsconfig.json
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
28
next.config.ts
Normal file
@ -0,0 +1,28 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
// Active le mode strict de React pour signaler des erreurs potentielles
|
||||
reactStrictMode: true,
|
||||
|
||||
// Activer les fonctionnalités expérimentales nécessaires (par exemple appDir pour les layouts de l'application)
|
||||
experimental: {
|
||||
appDir: true,
|
||||
},
|
||||
|
||||
// Gestion des réécritures d'URL pour proxy local vers le backend
|
||||
async rewrites() {
|
||||
return [
|
||||
{
|
||||
source: "/api/:path*", // Toute URL commençant par /api
|
||||
destination: "http://localhost:1337/api/:path*", // Redirige vers votre backend Strapi
|
||||
},
|
||||
];
|
||||
},
|
||||
|
||||
// Optimisation des fichiers statiques
|
||||
images: {
|
||||
domains: ["localhost"], // Permet de charger les images provenant de "localhost" si nécessaire
|
||||
},
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
|
||||
4278
package-lock.json
generated
Normal file
35
package.json
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "my-next-site",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev --turbopack",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@strapi/blocks-react-renderer": "^1.0.1",
|
||||
"@tailwindcss/typography": "^0.5.16",
|
||||
"husky": "^9.1.7",
|
||||
"next": "^15.1.6",
|
||||
"qs": "^6.14.0",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-markdown": "^9.0.3",
|
||||
"react-responsive-carousel": "^3.2.23",
|
||||
"rehype-highlight": "^7.0.1",
|
||||
"rehype-sanitize": "^6.0.0",
|
||||
"remark-gfm": "^4.0.0",
|
||||
"swiper": "^11.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20",
|
||||
"@types/qs": "^6.9.18",
|
||||
"@types/react": "^19",
|
||||
"@types/react-dom": "^19",
|
||||
"postcss": "^8",
|
||||
"tailwindcss": "^3.4.1",
|
||||
"typescript": "^5"
|
||||
}
|
||||
}
|
||||
8
postcss.config.mjs
Normal file
@ -0,0 +1,8 @@
|
||||
/** @type {import('postcss-load-config').Config} */
|
||||
const config = {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
1
public/file.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>
|
||||
|
After Width: | Height: | Size: 391 B |
1
public/globe.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
1
public/next.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
1
public/vercel.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg>
|
||||
|
After Width: | Height: | Size: 128 B |
1
public/window.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>
|
||||
|
After Width: | Height: | Size: 385 B |
29
tailwind.config.ts
Normal file
@ -0,0 +1,29 @@
|
||||
import type { Config } from "tailwindcss";
|
||||
|
||||
export default {
|
||||
content: [
|
||||
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"./components/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
"./app/**/*.{js,ts,jsx,tsx,mdx}",
|
||||
],
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
background: "var(--background)",
|
||||
foreground: "var(--foreground)",
|
||||
},
|
||||
fontFamily: {
|
||||
sans: ['Helvetica', 'Arial', 'sans-serif'],
|
||||
serif: ['Georgia', 'serif'],
|
||||
mono: ['Courier New', 'monospace'],
|
||||
roboto: ['Roboto', 'sans-serif'],
|
||||
montserrat: ['Montserrat', 'sans-serif'],
|
||||
orbitron: ['Orbitron', 'sans-serif'],
|
||||
exo2: ['Exo 2', 'sans-serif'],
|
||||
audiowide: ['Audiowide', 'sans-serif'],
|
||||
bebas: ['Bebas Neue', 'sans-serif'],
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [require("@tailwindcss/typography")],
|
||||
} satisfies Config;
|
||||
27
tsconfig.json
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2017",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
"incremental": true,
|
||||
"plugins": [
|
||||
{
|
||||
"name": "next"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"@/*": ["./*"]
|
||||
}
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||