Remove deprecated components from the project
- Delete unused components including About19, Contact21, CTA, Faq7, Feature284, Hero235, Landing, Pricing4, Stats11, and Accordion. - Clean up the codebase by removing unnecessary files to improve maintainability and reduce clutter. - Ensure that the removal of these components does not affect the existing functionality of the application.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { ArrowUpRight } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
import { WebcamPixelGrid } from "@/components/ui/webcam-pixel-grid";
|
||||
@@ -11,6 +11,47 @@ const PRIMARY_HERO_BG = "#B54440";
|
||||
|
||||
const LandingHeroSection = () => {
|
||||
const [liveRasterOn, setLiveRasterOn] = useState(false);
|
||||
const [hasWebcam, setHasWebcam] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const mediaDevices = navigator.mediaDevices;
|
||||
|
||||
if (!mediaDevices?.enumerateDevices) {
|
||||
setHasWebcam(false);
|
||||
return;
|
||||
}
|
||||
|
||||
const updateWebcamAvailability = async () => {
|
||||
try {
|
||||
const devices = await mediaDevices.enumerateDevices();
|
||||
const hasVideoInput = devices.some(
|
||||
(device) => device.kind === "videoinput",
|
||||
);
|
||||
|
||||
setHasWebcam(hasVideoInput);
|
||||
if (!hasVideoInput) {
|
||||
setLiveRasterOn(false);
|
||||
}
|
||||
} catch {
|
||||
setHasWebcam(false);
|
||||
setLiveRasterOn(false);
|
||||
}
|
||||
};
|
||||
|
||||
updateWebcamAvailability();
|
||||
mediaDevices.addEventListener?.("devicechange", updateWebcamAvailability);
|
||||
|
||||
return () => {
|
||||
mediaDevices.removeEventListener?.(
|
||||
"devicechange",
|
||||
updateWebcamAvailability,
|
||||
);
|
||||
};
|
||||
}, []);
|
||||
|
||||
const handleToggleLiveRaster = () => {
|
||||
setLiveRasterOn((isOn) => !isOn);
|
||||
};
|
||||
|
||||
return (
|
||||
<section className="relative grid min-h-screen grid-cols-1 border-b border-border lg:grid-cols-[1.08fr_0.92fr]">
|
||||
@@ -70,6 +111,7 @@ const LandingHeroSection = () => {
|
||||
borderColor="#ffffff"
|
||||
borderOpacity={0}
|
||||
quietWebcamErrors
|
||||
onWebcamError={() => setLiveRasterOn(false)}
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
@@ -80,42 +122,44 @@ const LandingHeroSection = () => {
|
||||
<span>©2026</span>
|
||||
</div>
|
||||
|
||||
<div className="hidden shrink-0 flex-col items-end gap-2 pt-4 lg:flex">
|
||||
<p
|
||||
className={cn(
|
||||
"max-w-[18ch] text-right text-[10px] leading-snug font-medium uppercase tracking-[0.22em] text-primary-foreground/85",
|
||||
!liveRasterOn && "motion-safe:animate-pulse",
|
||||
)}
|
||||
>
|
||||
{liveRasterOn
|
||||
? "Kamera aus? Schalter zurück, fertig."
|
||||
: "Psst ... einmal wippen, dann lebt die Seite."}
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
role="switch"
|
||||
aria-checked={liveRasterOn}
|
||||
aria-label={
|
||||
liveRasterOn
|
||||
? "Live-Raster und Kamera beenden"
|
||||
: "Live-Raster mit Kamera starten"
|
||||
}
|
||||
onClick={() => setLiveRasterOn((v) => !v)}
|
||||
className={cn(
|
||||
"relative h-9 w-13 shrink-0 rounded-full border transition-colors duration-300 focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-primary-foreground",
|
||||
liveRasterOn
|
||||
? "border-primary-foreground/50 bg-primary-foreground/20"
|
||||
: "border-primary-foreground/45 bg-primary-foreground/10 hover:border-primary-foreground/70",
|
||||
)}
|
||||
>
|
||||
<span
|
||||
{hasWebcam ? (
|
||||
<div className="hidden shrink-0 flex-col items-end gap-2 pt-4 lg:flex">
|
||||
<p
|
||||
className={cn(
|
||||
"absolute top-1 left-1 size-7 rounded-full bg-primary-foreground shadow-sm transition-transform duration-300 ease-out",
|
||||
liveRasterOn ? "translate-x-4" : "translate-x-0",
|
||||
"max-w-[18ch] text-right text-[10px] leading-snug font-medium uppercase tracking-[0.22em] text-primary-foreground/85",
|
||||
!liveRasterOn && "motion-safe:animate-pulse",
|
||||
)}
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
>
|
||||
{liveRasterOn
|
||||
? "Kamera aus? Schalter zurück, fertig."
|
||||
: "Psst ... einmal wippen, dann lebt die Seite."}
|
||||
</p>
|
||||
<button
|
||||
type="button"
|
||||
role="switch"
|
||||
aria-checked={liveRasterOn}
|
||||
aria-label={
|
||||
liveRasterOn
|
||||
? "Live-Raster beenden"
|
||||
: "Live-Raster mit Kamera starten"
|
||||
}
|
||||
onClick={handleToggleLiveRaster}
|
||||
className={cn(
|
||||
"relative h-9 w-13 shrink-0 rounded-full border transition-colors duration-300 focus-visible:outline focus-visible:outline-offset-2 focus-visible:outline-primary-foreground",
|
||||
liveRasterOn
|
||||
? "border-primary-foreground/50 bg-primary-foreground/20"
|
||||
: "border-primary-foreground/45 bg-primary-foreground/10 hover:border-primary-foreground/70",
|
||||
)}
|
||||
>
|
||||
<span
|
||||
className={cn(
|
||||
"absolute top-1 left-1 size-7 rounded-full bg-primary-foreground shadow-sm transition-transform duration-300 ease-out",
|
||||
liveRasterOn ? "translate-x-4" : "translate-x-0",
|
||||
)}
|
||||
/>
|
||||
</button>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
<div className="relative mt-auto pt-16 pb-8 lg:pt-24 lg:pb-10">
|
||||
<div className="pointer-events-none absolute bottom-0 right-0 h-36 w-36 border border-primary-foreground/35 sm:right-2 lg:right-10" />
|
||||
|
||||
Reference in New Issue
Block a user