Enhance SEO and loading experience across the application
- Updated meta tags and descriptions for improved SEO in multiple pages. - Added a LoadingScreen component with progress indication. - Implemented lazy loading for components to optimize performance. - Introduced SEO component for consistent meta management. - Added sitemap and robots.txt for better search engine indexing.
This commit is contained in:
+25
-11
@@ -1,10 +1,19 @@
|
||||
import { useLayoutEffect, useRef, useState, useCallback, useMemo } from "react";
|
||||
import {
|
||||
useLayoutEffect,
|
||||
useRef,
|
||||
useState,
|
||||
useCallback,
|
||||
useMemo,
|
||||
lazy,
|
||||
Suspense,
|
||||
} from "react";
|
||||
import { Link, useNavigate, useLocation } from "react-router-dom";
|
||||
import { gsap } from "gsap";
|
||||
import InfiniteMenu from "./InfiniteMenu";
|
||||
import Lanyard from "./Lanyard";
|
||||
import "./CardNav.css";
|
||||
|
||||
const InfiniteMenu = lazy(() => import("./InfiniteMenu"));
|
||||
const Lanyard = lazy(() => import("./Lanyard"));
|
||||
|
||||
const CardNav = ({
|
||||
logo = "/images/logo.webp",
|
||||
logoAlt = "Esiah Logo",
|
||||
@@ -90,7 +99,8 @@ const CardNav = ({
|
||||
image: "/images/Zatyshok.webp",
|
||||
link: "/projects/zatyshok",
|
||||
title: "Затишок",
|
||||
description: "Moodboard application",
|
||||
description:
|
||||
"Moodboard/Planner highly customisable application developed with love !",
|
||||
},
|
||||
{
|
||||
image: "/images/SPRotD.webp",
|
||||
@@ -197,16 +207,20 @@ const CardNav = ({
|
||||
pointerEvents: isExpanded ? "auto" : "none",
|
||||
}}
|
||||
>
|
||||
<InfiniteMenu
|
||||
items={menuItems}
|
||||
scale={0.8}
|
||||
onClose={closeMenuIfOpen}
|
||||
onItemClick={handleCardClick}
|
||||
/>
|
||||
<Suspense fallback={null}>
|
||||
<InfiniteMenu
|
||||
items={menuItems}
|
||||
scale={0.8}
|
||||
onClose={closeMenuIfOpen}
|
||||
onItemClick={handleCardClick}
|
||||
/>
|
||||
</Suspense>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<Lanyard show={showLanyard} />
|
||||
<Suspense fallback={null}>
|
||||
<Lanyard show={showLanyard} />
|
||||
</Suspense>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
.loading-screen {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 999999;
|
||||
background-color: #050000;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-family: "Orbitron", sans-serif;
|
||||
color: var(--clr-text);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.loading-content {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
width: 80vw;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.loader-title {
|
||||
font-size: 2rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 4px;
|
||||
margin-bottom: 24px;
|
||||
color: var(--clr-accent);
|
||||
text-shadow: 0 0 15px rgba(183, 28, 28, 0.6);
|
||||
animation: pulse-loader 1.5s infinite ease-in-out;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.progress-container {
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border-radius: 10px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
height: 100%;
|
||||
background: var(--clr-accent);
|
||||
box-shadow: 0 0 10px var(--clr-accent);
|
||||
transition: width 0.2s ease-out;
|
||||
}
|
||||
|
||||
/* Background effect */
|
||||
.space-background {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: radial-gradient(circle at center, #1a0505 0%, #050000 100%);
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.stars-mini {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-image:
|
||||
radial-gradient(1px 1px at 20px 30px, #eee, rgba(0, 0, 0, 0)),
|
||||
radial-gradient(1px 1px at 40px 70px, #fff, rgba(0, 0, 0, 0)),
|
||||
radial-gradient(1px 1px at 50px 160px, #ddd, rgba(0, 0, 0, 0)),
|
||||
radial-gradient(1px 1px at 80px 120px, #fff, rgba(0, 0, 0, 0)),
|
||||
radial-gradient(1px 1px at 110px 210px, #fff, rgba(0, 0, 0, 0)),
|
||||
radial-gradient(1px 1px at 150px 250px, #ddd, rgba(0, 0, 0, 0));
|
||||
background-repeat: repeat;
|
||||
background-size: 200px 250px;
|
||||
opacity: 0.3;
|
||||
animation: drift 20s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse-loader {
|
||||
0%,
|
||||
100% {
|
||||
opacity: 0.5;
|
||||
transform: scale(0.98);
|
||||
}
|
||||
50% {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes drift {
|
||||
from {
|
||||
transform: translateY(0);
|
||||
}
|
||||
to {
|
||||
transform: translateY(500px);
|
||||
}
|
||||
}
|
||||
|
||||
.loading-screen.fade-out {
|
||||
opacity: 0;
|
||||
transition: opacity 0.5s ease-out;
|
||||
pointer-events: none;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
import React, { useEffect, useState } from "react";
|
||||
import "./LoadingScreen.css";
|
||||
|
||||
const LoadingScreen: React.FC = () => {
|
||||
const [progress, setProgress] = useState(0);
|
||||
|
||||
useEffect(() => {
|
||||
const interval = window.setInterval(() => {
|
||||
setProgress((prev) => {
|
||||
const next = prev + 25 + Math.random() * 10;
|
||||
if (next >= 100) {
|
||||
window.clearInterval(interval);
|
||||
return 100;
|
||||
}
|
||||
return next;
|
||||
});
|
||||
}, 40);
|
||||
|
||||
return () => window.clearInterval(interval);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="loading-screen">
|
||||
<div className="space-background">
|
||||
<div className="stars-mini"></div>
|
||||
</div>
|
||||
<div className="loading-content">
|
||||
<div className="loader-title">Travelling to next galaxy</div>
|
||||
<div className="progress-container">
|
||||
<div className="progress-bar" style={{ width: `${progress}%` }}></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default LoadingScreen;
|
||||
@@ -61,7 +61,8 @@ const cardData: CardDataItem[] = [
|
||||
{
|
||||
title: "Затишок",
|
||||
image: "/images/Zatyshok.webp",
|
||||
description: "Moodboard developed with love !",
|
||||
description:
|
||||
"Moodboard/Planner highly customisable application developed with love !",
|
||||
label: "Desktop App",
|
||||
link: "/projects/zatyshok",
|
||||
},
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
import React, { useEffect } from "react";
|
||||
|
||||
interface SEOProps {
|
||||
title: string;
|
||||
description?: string;
|
||||
image?: string;
|
||||
url?: string;
|
||||
type?: string;
|
||||
}
|
||||
|
||||
const SEO: React.FC<SEOProps> = ({
|
||||
title,
|
||||
description,
|
||||
image = "/images/Esiah-s-Universe.webp",
|
||||
url = window.location.href,
|
||||
type = "website",
|
||||
}) => {
|
||||
useEffect(() => {
|
||||
// Mise à jour du titre
|
||||
const baseTitle = "Esiah's Universe";
|
||||
document.title = title ? `${title} | ${baseTitle}` : baseTitle;
|
||||
|
||||
const updateMeta = (name: string, content: string, isProperty = false) => {
|
||||
const selector = isProperty
|
||||
? `meta[property="${name}"]`
|
||||
: `meta[name="${name}"]`;
|
||||
let el = document.querySelector(selector);
|
||||
if (el) {
|
||||
el.setAttribute("content", content);
|
||||
}
|
||||
};
|
||||
|
||||
// Mise à jour des meta descriptions (Standard, OG, Twitter)
|
||||
if (description) {
|
||||
updateMeta("description", description);
|
||||
updateMeta("og:description", description, true);
|
||||
updateMeta("twitter:description", description);
|
||||
}
|
||||
|
||||
// Mise à jour des titres (OG, Twitter)
|
||||
updateMeta("og:title", document.title, true);
|
||||
updateMeta("twitter:title", document.title);
|
||||
|
||||
// URL et Type
|
||||
updateMeta("og:url", url, true);
|
||||
updateMeta("og:type", type, true);
|
||||
|
||||
// Image
|
||||
updateMeta("og:image", image, true);
|
||||
|
||||
// Canonical URL
|
||||
let canonical = document.querySelector('link[rel="canonical"]');
|
||||
if (!canonical) {
|
||||
canonical = document.createElement("link");
|
||||
canonical.setAttribute("rel", "canonical");
|
||||
document.head.appendChild(canonical);
|
||||
}
|
||||
canonical.setAttribute("href", url);
|
||||
}, [title, description, image, url, type]);
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
export default SEO;
|
||||
@@ -68,7 +68,8 @@ const desktopAppItems = [
|
||||
img: "images/Zatyshok.webp",
|
||||
link: "/projects/zatyshok",
|
||||
title: "Затишок",
|
||||
description: "Moodboard application created for my partner !",
|
||||
description:
|
||||
"Moodboard/Planner highly customisable application with Spotify & meteo integrations !",
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user