deploy / deploy (push) Successful in 1m24s
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]>
50 lines
1.6 KiB
TypeScript
50 lines
1.6 KiB
TypeScript
"use client";
|
|
|
|
import { useEffect, useState } from "react";
|
|
import { cn } from "@cohaise/ui";
|
|
import { scrollToSection } from "../lib/gsap";
|
|
|
|
export const BackToTop = () => {
|
|
const [visible, setVisible] = useState(false);
|
|
|
|
useEffect(() => {
|
|
const onScroll = () => setVisible(window.scrollY > 400);
|
|
onScroll();
|
|
window.addEventListener("scroll", onScroll, { passive: true });
|
|
return () => window.removeEventListener("scroll", onScroll);
|
|
}, []);
|
|
|
|
return (
|
|
<button
|
|
type="button"
|
|
onClick={() => scrollToSection("#top")}
|
|
aria-label="Retour en haut"
|
|
title="Retour en haut"
|
|
className={cn(
|
|
"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"
|
|
fill="none"
|
|
stroke="currentColor"
|
|
strokeWidth="2"
|
|
strokeLinecap="round"
|
|
strokeLinejoin="round"
|
|
aria-hidden="true"
|
|
>
|
|
<path d="M12 19V5M5 12l7-7 7 7" />
|
|
</svg>
|
|
</button>
|
|
);
|
|
};
|