From 2a372fdec256b8be890e181c221c2a012ead9efa Mon Sep 17 00:00:00 2001 From: cashmere Date: Mon, 27 Jul 2026 01:21:02 +0200 Subject: refactor: strip landing page and upstream branding / redirects to /projects; marketing landing components, the feedback popover + API route, and all Discord links removed (editor header, footer, onboarding copy). --- apps/web/src/components/landing/handlebars.tsx | 203 ------------------------- apps/web/src/components/landing/hero.tsx | 41 ----- 2 files changed, 244 deletions(-) delete mode 100644 apps/web/src/components/landing/handlebars.tsx delete mode 100644 apps/web/src/components/landing/hero.tsx (limited to 'apps/web/src/components/landing') diff --git a/apps/web/src/components/landing/handlebars.tsx b/apps/web/src/components/landing/handlebars.tsx deleted file mode 100644 index 4a81cdba..00000000 --- a/apps/web/src/components/landing/handlebars.tsx +++ /dev/null @@ -1,203 +0,0 @@ -"use client"; - -import { - type PropsWithChildren, - useEffect, - useLayoutEffect, - useRef, - useState, -} from "react"; - -type HandlebarsProps = PropsWithChildren; - -const MIN_HANDLE_SEPARATION_PX = 60; -const MASK_GRADIENT_EDGE_PADDING_PX = 10; -const HANDLEBARS_ROTATE_DEG = 2.76; -const RIGHT_HANDLE_LEFT_OFFSET_PX = -30; - -export function Handlebars({ children }: HandlebarsProps) { - const containerRef = useRef(null); - const leftHandleRef = useRef(null); - const rightHandleRef = useRef(null); - - const [width, setWidth] = useState(0); - const [leftHandle, setLeftHandle] = useState(0); - const [rightHandle, setRightHandle] = useState(0); - - const widthRef = useRef(0); - const leftHandlePositionRef = useRef(0); - const rightHandlePositionRef = useRef(0); - - const dragRef = useRef<{ - isDragging: boolean; - side: "left" | "right" | null; - pointerId: number | null; - startX: number; - initialPosition: number; - }>({ - isDragging: false, - side: null, - pointerId: null, - startX: 0, - initialPosition: 0, - }); - - useLayoutEffect(() => { - const container = containerRef.current; - if (!container) return; - - const updateWidth = () => { - const newWidth = container.offsetWidth; - setWidth(newWidth); - setRightHandle(newWidth); - }; - - const observer = new ResizeObserver(updateWidth); - observer.observe(container); - updateWidth(); - - return () => observer.disconnect(); - }, []); - - useEffect(() => { - widthRef.current = width; - leftHandlePositionRef.current = leftHandle; - rightHandlePositionRef.current = rightHandle; - }, [leftHandle, rightHandle, width]); - - useEffect(() => { - const handlePointerMove = (event: PointerEvent) => { - const { isDragging, side, pointerId, startX, initialPosition } = - dragRef.current; - - if (!isDragging) return; - if (pointerId !== null && event.pointerId !== pointerId) return; - if (!side) return; - - const deltaX = event.clientX - startX; - - if (side === "left") { - const maxLeft = Math.max( - 0, - rightHandlePositionRef.current - MIN_HANDLE_SEPARATION_PX, - ); - const nextLeftHandle = Math.max( - 0, - Math.min(maxLeft, initialPosition + deltaX), - ); - setLeftHandle(nextLeftHandle); - return; - } - - const minRight = Math.min( - widthRef.current, - leftHandlePositionRef.current + MIN_HANDLE_SEPARATION_PX, - ); - const nextRightHandle = Math.max( - minRight, - Math.min(widthRef.current, initialPosition + deltaX), - ); - setRightHandle(nextRightHandle); - }; - - const handlePointerEnd = (event: PointerEvent) => { - const { pointerId } = dragRef.current; - if (pointerId !== null && event.pointerId !== pointerId) return; - - dragRef.current.isDragging = false; - dragRef.current.side = null; - dragRef.current.pointerId = null; - }; - - window.addEventListener("pointermove", handlePointerMove); - window.addEventListener("pointerup", handlePointerEnd); - window.addEventListener("pointercancel", handlePointerEnd); - - return () => { - window.removeEventListener("pointermove", handlePointerMove); - window.removeEventListener("pointerup", handlePointerEnd); - window.removeEventListener("pointercancel", handlePointerEnd); - }; - }, []); - - const hasMeasuredWidth = width > 0; - const leftGradientPercent = hasMeasuredWidth - ? (leftHandle / (width - MASK_GRADIENT_EDGE_PADDING_PX)) * 100 - : 0; - const rightGradientPercent = hasMeasuredWidth - ? (rightHandle / (width + MASK_GRADIENT_EDGE_PADDING_PX)) * 100 - : 100; - const textMask = hasMeasuredWidth - ? `linear-gradient(90deg, - rgba(255, 255, 255, 0) 0%, - rgba(255, 255, 255, 0) ${leftGradientPercent}%, - rgba(0, 0, 0) ${leftGradientPercent}%, - rgba(0, 0, 0) ${rightGradientPercent}%, - rgba(255, 255, 255, 0) ${rightGradientPercent}%, - rgba(255, 255, 255, 0) 100%)` - : undefined; - - return ( -
-
-
-
{ - event.preventDefault(); - leftHandleRef.current?.setPointerCapture(event.pointerId); - dragRef.current.isDragging = true; - dragRef.current.side = "left"; - dragRef.current.pointerId = event.pointerId; - dragRef.current.startX = event.clientX; - dragRef.current.initialPosition = leftHandlePositionRef.current; - }} - > -
-
- -
{ - event.preventDefault(); - rightHandleRef.current?.setPointerCapture(event.pointerId); - dragRef.current.isDragging = true; - dragRef.current.side = "right"; - dragRef.current.pointerId = event.pointerId; - dragRef.current.startX = event.clientX; - dragRef.current.initialPosition = rightHandlePositionRef.current; - }} - > -
-
-
- - - {children} - -
-
- ); -} diff --git a/apps/web/src/components/landing/hero.tsx b/apps/web/src/components/landing/hero.tsx deleted file mode 100644 index ac49e4be..00000000 --- a/apps/web/src/components/landing/hero.tsx +++ /dev/null @@ -1,41 +0,0 @@ -"use client"; - -import { Button } from "../ui/button"; -import { ArrowRight } from "lucide-react"; -import Image from "next/image"; -import { Handlebars } from "./handlebars"; -import Link from "next/link"; - -export function Hero() { - return ( -
- OpenCut video editor landing page background -
-
-

The open source

- Video editor -
- -

- A simple but powerful video editor that gets the job done. Works on - any platform. -

- -
- - - -
-
-
- ); -} -- cgit v1.3.1