Adding contact options
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteBase /
|
||||
|
||||
# 1. Redirection du sous-domaine vers le dossier /cohaise
|
||||
RewriteCond %{HTTP_HOST} ^cohaise\.esiah\.dev$ [NC]
|
||||
RewriteRule ^(.*)$ https://esiah.dev/cohaise/$1 [L,R=301]
|
||||
|
||||
# 2. Gestion standard du SPA React (ne pas toucher)
|
||||
RewriteRule ^index\.html$ - [L]
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 169 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 144 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 104 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 80 KiB |
+30
-18
@@ -17,8 +17,28 @@ const CardNav = ({
|
||||
const navRef = useRef(null);
|
||||
const tlRef = useRef(null);
|
||||
const location = useLocation();
|
||||
|
||||
const navigate = useNavigate();
|
||||
|
||||
const closeMenuIfOpen = useCallback(() => {
|
||||
const tl = tlRef.current;
|
||||
if (!tl || !isExpanded) return;
|
||||
setIsHamburgerOpen(false);
|
||||
tl.reverse();
|
||||
tl.eventCallback("onReverseComplete", () => setIsExpanded(false));
|
||||
}, [isExpanded]);
|
||||
|
||||
const toggleMenu = () => {
|
||||
const tl = tlRef.current;
|
||||
if (!tl) return;
|
||||
if (!isExpanded) {
|
||||
setIsHamburgerOpen(true);
|
||||
setIsExpanded(true);
|
||||
tl.play();
|
||||
} else {
|
||||
closeMenuIfOpen();
|
||||
}
|
||||
};
|
||||
|
||||
const handleCardClick = (link) => {
|
||||
if (!link) return;
|
||||
const cleanLink = link.replace("_blank", "").trim();
|
||||
@@ -27,10 +47,11 @@ const CardNav = ({
|
||||
} else {
|
||||
navigate(cleanLink);
|
||||
}
|
||||
toggleMenu();
|
||||
closeMenuIfOpen();
|
||||
};
|
||||
|
||||
const handleCohaiseClick = () => {
|
||||
closeMenuIfOpen();
|
||||
if (location.pathname === "/cohaise") {
|
||||
setShowLanyard(true);
|
||||
setTimeout(() => setShowLanyard(false), 5000);
|
||||
@@ -128,20 +149,6 @@ const CardNav = ({
|
||||
return () => tl?.kill();
|
||||
}, [createTimeline]);
|
||||
|
||||
const toggleMenu = () => {
|
||||
const tl = tlRef.current;
|
||||
if (!tl) return;
|
||||
if (!isExpanded) {
|
||||
setIsHamburgerOpen(true);
|
||||
setIsExpanded(true);
|
||||
tl.play();
|
||||
} else {
|
||||
setIsHamburgerOpen(false);
|
||||
tl.reverse();
|
||||
tl.eventCallback("onReverseComplete", () => setIsExpanded(false));
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={`card-nav-container ${className}`}>
|
||||
<nav ref={navRef} className={`card-nav ${isExpanded ? "open" : ""}`}>
|
||||
@@ -157,7 +164,11 @@ const CardNav = ({
|
||||
</div>
|
||||
|
||||
<div className="center-title-container">
|
||||
<Link to="/" className="site-title cursor-target">
|
||||
<Link
|
||||
onClick={closeMenuIfOpen}
|
||||
to="/"
|
||||
className="site-title cursor-target"
|
||||
>
|
||||
Esiah's Universe
|
||||
</Link>
|
||||
</div>
|
||||
@@ -183,12 +194,13 @@ const CardNav = ({
|
||||
style={{
|
||||
opacity: isExpanded || isHamburgerOpen ? 1 : 0,
|
||||
transition: "opacity 0.3s ease 0.1s",
|
||||
pointerEvents: isExpanded ? "auto" : "none",
|
||||
}}
|
||||
>
|
||||
<InfiniteMenu
|
||||
items={menuItems}
|
||||
scale={0.8}
|
||||
onClose={toggleMenu}
|
||||
onClose={closeMenuIfOpen}
|
||||
onItemClick={handleCardClick}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
.card-swap-container {
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
perspective: 1500px;
|
||||
overflow: visible;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.card {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform-style: preserve-3d;
|
||||
will-change: transform;
|
||||
pointer-events: auto !important;
|
||||
}
|
||||
|
||||
/* Responsive : On réduit la taille des cartes de 800px sur mobile */
|
||||
@media (max-width: 1024px) {
|
||||
.card-swap-container {
|
||||
transform: scale(0.8);
|
||||
}
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.card-swap-container {
|
||||
transform: scale(0.5);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
import React, {
|
||||
Children,
|
||||
cloneElement,
|
||||
forwardRef,
|
||||
isValidElement,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useRef,
|
||||
} from "react";
|
||||
import gsap from "gsap";
|
||||
import "./CardSwap.css";
|
||||
|
||||
export const Card = forwardRef(({ customClass, ...rest }, ref) => (
|
||||
<div
|
||||
ref={ref}
|
||||
{...rest}
|
||||
className={`card ${customClass ?? ""} ${rest.className ?? ""}`.trim()}
|
||||
/>
|
||||
));
|
||||
Card.displayName = "Card";
|
||||
|
||||
const makeSlot = (i, distX, distY, total) => ({
|
||||
x: i * distX,
|
||||
y: -i * distY,
|
||||
z: -i * distX * 1.5,
|
||||
zIndex: total - i,
|
||||
});
|
||||
const placeNow = (el, slot, skew) =>
|
||||
gsap.set(el, {
|
||||
x: slot.x,
|
||||
y: slot.y,
|
||||
z: slot.z,
|
||||
xPercent: -50,
|
||||
yPercent: -50,
|
||||
skewY: skew,
|
||||
transformOrigin: "center center",
|
||||
zIndex: slot.zIndex,
|
||||
force3D: true,
|
||||
});
|
||||
|
||||
const CardSwap = ({
|
||||
width = 500,
|
||||
height = 400,
|
||||
cardDistance = 60,
|
||||
verticalDistance = 70,
|
||||
delay = 5000,
|
||||
pauseOnHover = false,
|
||||
onCardClick,
|
||||
skewAmount = 6,
|
||||
easing = "elastic",
|
||||
children,
|
||||
}) => {
|
||||
const config =
|
||||
easing === "elastic"
|
||||
? {
|
||||
ease: "elastic.out(0.6,0.9)",
|
||||
durDrop: 2,
|
||||
durMove: 2,
|
||||
durReturn: 2,
|
||||
promoteOverlap: 0.9,
|
||||
returnDelay: 0.05,
|
||||
}
|
||||
: {
|
||||
ease: "power1.inOut",
|
||||
durDrop: 0.8,
|
||||
durMove: 0.8,
|
||||
durReturn: 0.8,
|
||||
promoteOverlap: 0.45,
|
||||
returnDelay: 0.2,
|
||||
};
|
||||
|
||||
const childArr = useMemo(() => Children.toArray(children), [children]);
|
||||
const refs = useMemo(
|
||||
() => childArr.map(() => React.createRef()),
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
[childArr.length],
|
||||
);
|
||||
|
||||
const order = useRef(Array.from({ length: childArr.length }, (_, i) => i));
|
||||
|
||||
const tlRef = useRef(null);
|
||||
const intervalRef = useRef();
|
||||
const container = useRef(null);
|
||||
|
||||
useEffect(() => {
|
||||
const total = refs.length;
|
||||
refs.forEach((r, i) =>
|
||||
placeNow(
|
||||
r.current,
|
||||
makeSlot(i, cardDistance, verticalDistance, total),
|
||||
skewAmount,
|
||||
),
|
||||
);
|
||||
|
||||
const swap = () => {
|
||||
if (order.current.length < 2) return;
|
||||
|
||||
const [front, ...rest] = order.current;
|
||||
const elFront = refs[front].current;
|
||||
const tl = gsap.timeline();
|
||||
tlRef.current = tl;
|
||||
|
||||
tl.to(elFront, {
|
||||
y: "+=500",
|
||||
duration: config.durDrop,
|
||||
ease: config.ease,
|
||||
});
|
||||
|
||||
tl.addLabel("promote", `-=${config.durDrop * config.promoteOverlap}`);
|
||||
rest.forEach((idx, i) => {
|
||||
const el = refs[idx].current;
|
||||
const slot = makeSlot(i, cardDistance, verticalDistance, refs.length);
|
||||
tl.set(el, { zIndex: slot.zIndex }, "promote");
|
||||
tl.to(
|
||||
el,
|
||||
{
|
||||
x: slot.x,
|
||||
y: slot.y,
|
||||
z: slot.z,
|
||||
duration: config.durMove,
|
||||
ease: config.ease,
|
||||
},
|
||||
`promote+=${i * 0.15}`,
|
||||
);
|
||||
});
|
||||
|
||||
const backSlot = makeSlot(
|
||||
refs.length - 1,
|
||||
cardDistance,
|
||||
verticalDistance,
|
||||
refs.length,
|
||||
);
|
||||
tl.addLabel("return", `promote+=${config.durMove * config.returnDelay}`);
|
||||
tl.call(
|
||||
() => {
|
||||
gsap.set(elFront, { zIndex: backSlot.zIndex });
|
||||
},
|
||||
undefined,
|
||||
"return",
|
||||
);
|
||||
tl.to(
|
||||
elFront,
|
||||
{
|
||||
x: backSlot.x,
|
||||
y: backSlot.y,
|
||||
z: backSlot.z,
|
||||
duration: config.durReturn,
|
||||
ease: config.ease,
|
||||
},
|
||||
"return",
|
||||
);
|
||||
|
||||
tl.call(() => {
|
||||
order.current = [...rest, front];
|
||||
});
|
||||
};
|
||||
|
||||
swap();
|
||||
intervalRef.current = window.setInterval(swap, delay);
|
||||
|
||||
if (pauseOnHover) {
|
||||
const node = container.current;
|
||||
const pause = () => {
|
||||
tlRef.current?.pause();
|
||||
clearInterval(intervalRef.current);
|
||||
};
|
||||
const resume = () => {
|
||||
tlRef.current?.play();
|
||||
intervalRef.current = window.setInterval(swap, delay);
|
||||
};
|
||||
node.addEventListener("mouseenter", pause);
|
||||
node.addEventListener("mouseleave", resume);
|
||||
return () => {
|
||||
node.removeEventListener("mouseenter", pause);
|
||||
node.removeEventListener("mouseleave", resume);
|
||||
clearInterval(intervalRef.current);
|
||||
};
|
||||
}
|
||||
return () => clearInterval(intervalRef.current);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [cardDistance, verticalDistance, delay, pauseOnHover, skewAmount, easing]);
|
||||
|
||||
const rendered = childArr.map((child, i) =>
|
||||
isValidElement(child)
|
||||
? cloneElement(child, {
|
||||
key: i,
|
||||
ref: refs[i],
|
||||
style: { width, height, ...(child.props.style ?? {}) },
|
||||
onClick: (e) => {
|
||||
child.props.onClick?.(e);
|
||||
onCardClick?.(i);
|
||||
},
|
||||
})
|
||||
: child,
|
||||
);
|
||||
|
||||
return (
|
||||
<div
|
||||
ref={container}
|
||||
className="card-swap-container "
|
||||
style={{ width, height }}
|
||||
>
|
||||
{rendered}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default CardSwap;
|
||||
@@ -7,6 +7,7 @@ import TargetCursor from "../cursors/TargetCursor";
|
||||
export default function BackgroundWrapper() {
|
||||
const location = useLocation();
|
||||
const isCohaise = location.pathname === "/cohaise";
|
||||
const isHome = location.pathname === "/";
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -54,8 +55,8 @@ export default function BackgroundWrapper() {
|
||||
) : (
|
||||
<div className="w-full h-full relative">
|
||||
<Galaxy
|
||||
mouseRepulsion={true}
|
||||
mouseInteraction={true}
|
||||
mouseRepulsion={isHome}
|
||||
mouseInteraction={isHome}
|
||||
density={1.7}
|
||||
glowIntensity={0.4}
|
||||
saturation={0}
|
||||
|
||||
+6
-1
@@ -142,7 +142,7 @@ textarea {
|
||||
text-shadow: 0 0 20px rgba(183, 28, 28, 0.4);
|
||||
}
|
||||
|
||||
.main-section .title-cohaise {
|
||||
.main-section .cohaise-title {
|
||||
font-size: clamp(2.5rem, 6vw, 5rem);
|
||||
color: var(--clr-text);
|
||||
}
|
||||
@@ -153,6 +153,11 @@ textarea {
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
.loading {
|
||||
text-align: center;
|
||||
font-size: 28px;
|
||||
padding: 30vh 0px;
|
||||
}
|
||||
/* Footer */
|
||||
footer {
|
||||
position: relative;
|
||||
|
||||
@@ -78,7 +78,7 @@ const Cohaise = () => {
|
||||
return (
|
||||
<div className="layout-page" style={{ overflowX: "hidden" }}>
|
||||
<section className="main-section">
|
||||
<h1 className="title-cohaise">Co Hai Se</h1>
|
||||
<h1 className="cohaise-title">Co Hai Se</h1>
|
||||
<p className="subtitle">
|
||||
Your project starts with an idea. It comes to life with Cohaise.
|
||||
</p>
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
.contact-container {
|
||||
margin-top: 150px; /* Espace pour ne pas chevaucher le titre */
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.contact-card {
|
||||
border-radius: 20px;
|
||||
border: 4px solid rgb(255, 255, 255);
|
||||
background: #000;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
transition:
|
||||
scale 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
|
||||
border-color 0.3s ease,
|
||||
box-shadow 0.3s ease;
|
||||
}
|
||||
.contact-card:hover {
|
||||
border-color: var(--clr-accent) !important;
|
||||
box-shadow: 0 0 25px rgba(183, 28, 28, 0.6);
|
||||
border: 5px solid;
|
||||
}
|
||||
|
||||
.contact-card:hover .contact-card-icon {
|
||||
opacity: 1;
|
||||
scale: 1.2;
|
||||
color: var(--clr-accent);
|
||||
}
|
||||
|
||||
.contact-card-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
object-position: top center;
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
}
|
||||
|
||||
.contact-card-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.contact-card-info {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
padding: 40px;
|
||||
z-index: 2;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.contact-card-info h3 {
|
||||
font-size: 2rem;
|
||||
margin: 0;
|
||||
color: #fff;
|
||||
}
|
||||
.contact-card-info p {
|
||||
opacity: 0.7;
|
||||
margin: 0;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.contact-card-icon {
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
right: 30px;
|
||||
z-index: 2;
|
||||
color: #fff;
|
||||
opacity: 0.5;
|
||||
}
|
||||
@@ -1,10 +1,79 @@
|
||||
import { ExternalLink } from "lucide-react";
|
||||
import CardSwap, { Card } from "../components/CardSwap";
|
||||
import "./Contact.css";
|
||||
|
||||
export default function Contact() {
|
||||
const contacts = [
|
||||
{
|
||||
name: "GitHub",
|
||||
label: "@xEsiah",
|
||||
url: "https://github.com/thweich",
|
||||
image: "/images/contact/github-prev.jpg",
|
||||
},
|
||||
{
|
||||
name: "LinkedIn",
|
||||
label: "Personal Profile",
|
||||
url: "https://www.linkedin.com/in/xesiah/",
|
||||
image: "/images/contact/linkedin-perso-prev.jpg",
|
||||
},
|
||||
{
|
||||
name: "LinkedIn",
|
||||
label: "Co Hai Se",
|
||||
url: "https://linkedin.com/company/cohaise",
|
||||
image: "/images/contact/linkedin-cohaise-prev.jpg",
|
||||
},
|
||||
{
|
||||
name: "Instagram",
|
||||
label: "@xesiahh",
|
||||
url: "https://instagram.com/xesiahh/",
|
||||
image: "/images/contact/insta-prev.jpg",
|
||||
},
|
||||
{
|
||||
name: "eMail",
|
||||
label: "[email protected]",
|
||||
url: "mailto:[email protected]",
|
||||
image: "/images/contact/email-prev.jpg",
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<div className="layout-page">
|
||||
<section className="main-section">
|
||||
<h1 className="title">Contact</h1>
|
||||
<p className="subtitle">You can reach me there:</p>
|
||||
</section>
|
||||
|
||||
<div className="contact-container">
|
||||
<CardSwap
|
||||
width={1100}
|
||||
height={500}
|
||||
cardDistance={60}
|
||||
verticalDistance={70}
|
||||
>
|
||||
{contacts.map((contact, index) => (
|
||||
<Card
|
||||
key={index}
|
||||
className="contact-card"
|
||||
onClick={() => window.open(contact.url, "_blank")}
|
||||
>
|
||||
<img
|
||||
src={contact.image}
|
||||
alt={contact.name}
|
||||
className="contact-card-img"
|
||||
/>
|
||||
<div className="contact-card-overlay" />
|
||||
<div className="contact-card-info ">
|
||||
<h3 className="cursor-target">{contact.name}</h3>
|
||||
<p className="cursor-target">{contact.label}</p>
|
||||
</div>
|
||||
<ExternalLink
|
||||
className="contact-card-icon cursor-target"
|
||||
size={28}
|
||||
/>
|
||||
</Card>
|
||||
))}
|
||||
</CardSwap>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user