Create professional demos and 3D mockups in seconds, directly in your browser
feat: enhance footer and header components, add mobile menu and user menu, implement 404 not found page
CristianOlivera114f645c8c036
diff --git a/app/components/common/Footer.tsx b/app/components/common/Footer.tsxindex 0905456..cdb8362 100644--- a/app/components/common/Footer.tsx+++ b/app/components/common/Footer.tsx@@ -1,50 +1,51 @@import { Icon } from "@iconify/react";+import Link from "next/link";+import Image from "next/image";export default function Footer() {+ const currentYear = new Date().getFullYear();return (<footer className="border-t border-white/10 bg-[#050505] pt-16 pb-8"><div className="max-w-7xl mx-auto px-6 flex flex-col md:flex-row justify-between gap-12 mb-16"><div className="w-full md:w-1/3"><div className="flex items-center gap-2 mb-4">- <div className="w-5 h-5 rounded bg-neutral-200 flex items-center justify-center text-black">- <Icon icon="solar:record-circle-linear" width="14"></Icon>- </div>- <span className="text-white font-medium tracking-tight">FreeShot</span>+ <Link href="/" className="flex items-center gap-2 group">+ <Image src="/svg/logo-openvid.svg" alt="Logo" width={50} height={50} />+ <Image src="/svg/openvid.svg" alt="Logo" width={100} height={50} />+ </Link></div><p className="text-neutral-500 text-sm leading-relaxed">- The modern standard for screen recording and video editing. Built for the web.+ Aplicación moderna para la <span className="text-neutral-400 font-bold">grabación de pantalla</span> y la <span className="text-neutral-400 font-bold">edición de vídeo</span>. Diseñada para la web. Sin instalaciones, sin esperas y directamente en tu navegador.</p></div><div className="flex gap-12 md:gap-24"><div>- <h4 className="text-white font-medium text-sm mb-4">Product</h4>+ <h4 className="text-white font-medium text-sm mb-4">Producto</h4><ul className="space-y-3 text-sm text-neutral-500">- <li><a href="#" className="hover:text-white transition-colors">Features</a></li>- <li><a href="#" className="hover:text-white transition-colors">Changelog</a></li>- <li><a href="#" className="hover:text-white transition-colors">Pricing</a></li>+ <li><a href="#docs" className="hover:text-white transition-colors">Documentación</a></li>+ <li><Link href="/editor" className="hover:text-white transition-colors">Ir al editor</Link></li>+ {/* <li><a href="#" className="hover:text-white transition-colors">Pricing</a></li> */}</ul></div><div>- <h4 className="text-white font-medium text-sm mb-4">Company</h4>+ <h4 className="text-white font-medium text-sm mb-4">Contacto</h4><ul className="space-y-3 text-sm text-neutral-500">- <li><a href="#" className="hover:text-white transition-colors">About</a></li>- <li><a href="#" className="hover:text-white transition-colors">Blog</a></li>- <li><a href="#" className="hover:text-white transition-colors">Careers</a></li>+ <li><a href="https://github.com/CristianOlivera1/openvid" target="_blank" className="hover:text-white transition-colors">GitHub</a></li></ul></div><div><h4 className="text-white font-medium text-sm mb-4">Legal</h4><ul className="space-y-3 text-sm text-neutral-500">- <li><a href="#" className="hover:text-white transition-colors">Privacy</a></li>- <li><a href="#" className="hover:text-white transition-colors">Terms</a></li>+ <li><Link href="/privacy" className="hover:text-white transition-colors">Privacidad</Link></li>+ <li><Link href="/terms" className="hover:text-white transition-colors">Términos</Link></li></ul></div></div></div><div className="max-w-7xl mx-auto px-6 pt-8 border-t border-white/10 flex flex-col md:flex-row justify-between items-center gap-4">- <span className="text-xs text-neutral-600">© 2023 FreeShot Inc. All rights reserved.</span>+ <span className="text-xs text-neutral-600">© {currentYear} openvid All rights reserved.</span><div className="flex gap-4 text-neutral-600"><a href="#" className="hover:text-white transition-colors"><Icon icon="solar:brand-twitter-linear" width="18"></Icon></a><a href="#" className="hover:text-white transition-colors"><Icon icon="solar:brand-github-linear" width="18"></Icon></a>diff --git a/app/components/common/Header.tsx b/app/components/common/Header.tsxindex c8db976..dab1f1b 100644--- a/app/components/common/Header.tsx+++ b/app/components/common/Header.tsx@@ -1,14 +1,24 @@"use client";import { useState, useEffect } from "react";-import { Button } from "@/components/ui/button";-import { Icon } from "@iconify/react";import Image from "next/image";import { cn } from "@/lib/utils";import Link from "next/link";+import { hasAnyVideo } from "@/lib/video-cache-utils";+import { UserMenu } from "./UserMenu";+import { MobileMenu } from "./MobileMenu";export default function Header() {const [isScrolled, setIsScrolled] = useState(false);+ const [hasCachedVideo, setHasCachedVideo] = useState(false);+ const [isMounted, setIsMounted] = useState(false);++ useEffect(() => {+ const timer = setTimeout(() => {+ setIsMounted(true);+ }, 0);+ return () => clearTimeout(timer);+ }, []);useEffect(() => {const handleScroll = () => {@@ -19,6 +29,23 @@ export default function Header() {return () => window.removeEventListener("scroll", handleScroll);}, []);+ useEffect(() => {+ const checkVideo = () => {+ hasAnyVideo().then(setHasCachedVideo).catch(() => {});+ };++ checkVideo();++ const handleVisibilityChange = () => {+ if (!document.hidden) {+ checkVideo();+ }+ };++ document.addEventListener("visibilitychange", handleVisibilityChange);+ return () => document.removeEventListener("visibilitychange", handleVisibilityChange);+ }, []);+return (<headerclassName={cn(@@ -30,35 +57,38 @@ export default function Header() {><div className="max-w-6xl mx-auto px-3 sm:px-6 h-16 flex items-center justify-between"><Link href="/" className="flex items-center gap-2 group">- <Image src="/svg/logo-openvid.svg" alt="Logo" width={50} height={50} />- <span className="hidden sm:flex text-white font-semibold text-lg transition-colors group-hover:text-neutral-200">- Free- <span className="relative inline-block px-1 ml-0.5">- <span className="absolute inset-0 bg-blue-500/20 border border-dashed border-blue-400/50 rounded-sm -rotate-1" />-- <span className="relative">Shot</span>-- <div className="absolute -bottom-1 -right-1 size-2 bg-sky-500 border border-white rounded-full shadow-lg" />- </span>- </span>+ <Image src="/svg/logo-openvid.svg" alt="Logo" width={50} height={50} style={{ height: "auto" }} />+ <Image src="/svg/openvid.svg" alt="Logo" width={100} height={50} className="hidden sm:flex" style={{ height: "auto" }} /></Link>+<div className="hidden md:flex items-center gap-8 text-sm font-medium text-neutral-400"><a href="#docs" className="hover:text-white transition-colors">Documentación</a>- <a href="#workflow" className="hover:text-white transition-colors">Workflow</a>- <a href="#pricing" className="hover:text-white transition-colors">Pricing</a>+ <a href="https://github.com/CristianOlivera1/openvid" target="_blank" rel="noopener noreferrer" className="hover:text-white transition-colors">GitHub</a>+ {hasCachedVideo && (+ <Link href="/editor" className="hover:text-white transition-colors">+ Ir al editor+ </Link>+ )}</div>- <div className="flex items-center gap-2 sm:gap-4">- <Button asChild variant="outline">- <Link href="/login">Iniciar sesión</Link>- </Button>- <Button asChild variant="primary">- <Link href="/editor">Empezar a grabar- <Icon icon="solar:arrow-right-linear" width="16" className="hidden sm:flex" />- </Link>- </Button>+ <div className="flex items-center gap-2">+ <div className="block">+ {!isMounted ? (+ <div className="flex items-center gap-2 px-2 py-1">+ <div className="w-8 h-8 rounded-full bg-white/10 animate-pulse border border-white/5"></div>+ <div className="w-24 h-4 rounded-md bg-white/10 animate-pulse"></div>+ </div>+ ) : (+ <UserMenu />+ )}+ </div>+ {!isMounted ? (+ <div className="w-9 h-9 rounded-md bg-white/10 animate-pulse border border-white/5"></div>+ ) : (+ <MobileMenu />+ )}</div></div></header>);-}+}\ No newline at end of filediff --git a/app/components/common/MobileMenu.tsx b/app/components/common/MobileMenu.tsxnew file mode 100644index 0000000..f797bf9--- /dev/null+++ b/app/components/common/MobileMenu.tsx@@ -0,0 +1,177 @@+"use client";++import { useState, useEffect } from "react";+import Link from "next/link";+import { Icon } from "@iconify/react";+import { useAuth } from "@/hooks/useAuth";+import { hasAnyVideo } from "@/lib/video-cache-utils";+import * as Dialog from "@radix-ui/react-dialog";+import Image from "next/image";+import { Button } from "@/components/ui/button";++export function MobileMenu() {+ const [isOpen, setIsOpen] = useState(false);+ const [hasCachedVideo, setHasCachedVideo] = useState(false);+ const { user, signOut } = useAuth();+ const [isLoggingOut, setIsLoggingOut] = useState(false);++ const [isMounted, setIsMounted] = useState(false);++ useEffect(() => {+ const frameId = requestAnimationFrame(() => {+ setIsMounted(true);+ });++ return () => cancelAnimationFrame(frameId);+ }, []);++ useEffect(() => {+ const checkVideo = () => {+ hasAnyVideo().then(setHasCachedVideo).catch(() => { });+ };++ checkVideo();++ const handleVisibilityChange = () => {+ if (!document.hidden) {+ checkVideo();+ }+ };++ document.addEventListener("visibilitychange", handleVisibilityChange);+ return () => document.removeEventListener("visibilitychange", handleVisibilityChange);+ }, []);++ const handleSignOut = async () => {+ setIsLoggingOut(true);+ try {+ await signOut();+ setIsOpen(false);+ window.location.href = "/";+ } catch (error) {+ console.error("Error signing out:", error);+ setIsLoggingOut(false);+ }+ };++ const closeMenu = () => setIsOpen(false);++ if (!isMounted) {+ return (+ <button+ className="md:hidden p-2 text-neutral-400 hover:text-white hover:bg-white/5 rounded-lg transition-colors"+ aria-label="Cargando menú"+ >+ <Icon icon="solar:hamburger-menu-linear" className="w-6 h-6" />+ </button>+ );+ }++ return (+ <Dialog.Root open={isOpen} onOpenChange={setIsOpen}>+ <Dialog.Trigger asChild>+ <button+ className="md:hidden p-2 text-neutral-400 hover:text-white hover:bg-white/5 rounded-lg transition-colors"+ aria-label="Abrir menú"+ >+ <Icon icon="solar:hamburger-menu-linear" className="w-6 h-6" />+ </button>+ </Dialog.Trigger>++ <Dialog.Portal>+ <Dialog.Overlay className="fixed inset-0 bg-black/80 backdrop-blur-sm z-50 animate-in fade-in duration-200" />+ <Dialog.Content className="fixed top-0 right-0 bottom-0 w-70 bg-[#0a0a0a] border-l border-white/10 z-50 animate-in slide-in-from-right duration-300 flex flex-col">+ {/* Header */}+ <div className="flex items-center justify-between p-4 border-b border-white/5">+ <div className="flex flex-col">+ <Dialog.Title className="sr-only">Menú</Dialog.Title>+ <Dialog.Description className="sr-only">Navegación principal</Dialog.Description>++ <Link href="/" onClick={closeMenu} className="flex items-center gap-2">+ <Image src="/svg/logo-openvid.svg" alt="Logo" width={32} height={32} />+ <Image src="/svg/openvid.svg" alt="OpenVid" width={80} height={20} />+ </Link>+ </div>+ <Dialog.Close asChild>+ <button+ className="p-2 text-neutral-400 hover:text-white hover:bg-white/5 rounded-lg transition-colors"+ aria-label="Cerrar menú"+ >+ <Icon icon="solar:close-square-linear" className="w-5 h-5" />+ </button>+ </Dialog.Close>+ </div>+ <nav className="flex-1 overflow-y-auto p-4">+ <div className="space-y-2">+ <Link+ href="/#docs"+ onClick={closeMenu}+ className="flex items-center gap-3 px-4 py-3 text-neutral-300 hover:text-white hover:bg-white/5 rounded-lg transition-colors"+ >+ <Icon icon="solar:document-text-linear" className="w-5 h-5" />+ <span>Documentación</span>+ </Link>++ <a+ href="https://github.com/CristianOlivera1/openvid"+ target="_blank"+ rel="noopener noreferrer"+ onClick={closeMenu}+ className="flex items-center gap-3 px-4 py-3 text-neutral-300 hover:text-white hover:bg-white/5 rounded-lg transition-colors"+ >+ <Icon icon="mdi:github" className="w-5 h-5" />+ <span>GitHub</span>+ <Icon icon="solar:external-link-linear" className="w-4 h-4 ml-auto opacity-50" />+ </a>++ {hasCachedVideo && (+ <Link+ href="/editor"+ onClick={closeMenu}+ className="flex items-center gap-3 px-4 py-3 text-blue-400 hover:text-blue-300 hover:bg-blue-500/10 rounded-lg transition-colors"+ >+ <Icon icon="solar:video-frame-cut-2-linear" className="w-5 h-5" />+ <span>Ir al editor</span>+ </Link>+ )}+ </div>+ </nav>++ <div className="p-4 border-t border-white/5">+ {user ? (+ <button+ onClick={handleSignOut}+ disabled={isLoggingOut}+ className="w-full flex items-center justify-center gap-3 px-4 py-2 bg-red-500/10 text-red-500 hover:bg-red-500 hover:text-white rounded-lg transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed border border-red-500/20 text-sm"+ >+ {isLoggingOut ? (+ <>+ <Icon icon="svg-spinners:ring-resize" className="w-5 h-5 animate-spin" />+ <span className="font-medium">Cerrando sesión...</span>+ </>+ ) : (+ <>+ <Icon icon="solar:logout-2-linear" className="w-5 h-5" />+ <span className="font-medium">Cerrar sesión</span>+ </>+ )}+ </button>+ ) : (+ <Button variant="primary" asChild className="w-full">+ <Link+ href="/login"+ onClick={closeMenu}+ className="flex items-center gap-3 px-4 py-3"+ >+ <Icon icon="solar:login-2-linear" className="w-5 h-5" />+ <span>Iniciar sesión</span>+ </Link>+ </Button>++ )}+ </div>+ </Dialog.Content>+ </Dialog.Portal>+ </Dialog.Root>+ );+}\ No newline at end of filediff --git a/app/components/common/UserMenu.tsx b/app/components/common/UserMenu.tsxnew file mode 100644index 0000000..45dd08a--- /dev/null+++ b/app/components/common/UserMenu.tsx@@ -0,0 +1,151 @@+"use client";++import { useState } from "react";+import Image from "next/image";+import Link from "next/link";+import { Icon } from "@iconify/react";+import { useAuth } from "@/hooks/useAuth";+import * as DropdownMenu from "@radix-ui/react-dropdown-menu";+import { Button } from "@/components/ui/button";++export function UserMenu() {+ const { user, profile, signOut, loading } = useAuth();+ const [isLoggingOut, setIsLoggingOut] = useState(false);++ const handleSignOut = async () => {+ setIsLoggingOut(true);+ try {+ await signOut();+ window.location.href = "/";+ } catch (error) {+ console.error("Error signing out:", error);+ setIsLoggingOut(false);+ }+ };++ if (loading) {+ return (+ <div className="flex items-center gap-2 sm:gap-3 p-1 sm:p-1.5 h-11">+ <div className="w-8 h-8 sm:w-9 sm:h-9 rounded-full bg-white/10 animate-pulse border border-white/5 shrink-0"></div>+ <div className="hidden sm:block w-24 h-4 rounded-md bg-white/10 animate-pulse"></div>+ </div>+ );+ }++ if (!user) {+ return (+ <div className="flex items-center gap-2 sm:gap-4 h-11">+ <Button variant="primary" asChild>+ <Link+ href="/login"+ className="text-sm font-medium text-white hover:text-white/90 transition-colors"+ >+ Iniciar sesión+ </Link>+ </Button>+ </div>+ );+ }++ const meta = user.user_metadata || {};++ const displayName =+ profile?.first_name ||+ profile?.full_name ||+ meta.full_name ||+ meta.name ||+ user.email?.split("@")[0] ||+ "Usuario";++ const avatarUrl =+ profile?.avatar_url ||+ meta.avatar_url ||+ meta.picture ||+ `https://api.dicebear.com/7.x/initials/svg?seed=${displayName}`;++ const provider = profile?.provider || meta.provider || "email";++ return (+ <DropdownMenu.Root>+ <DropdownMenu.Trigger asChild>+ <button+ className="flex items-center gap-2 sm:gap-3 p-1 sm:p-1.5 rounded-full hover:bg-white/5 transition-all focus:outline-none focus:ring-2 focus:ring-blue-500/50"+ aria-label="Menú de usuario"+ >+ <div className="relative w-8 h-8 sm:w-9 sm:h-9 rounded-full overflow-hidden border border-white/10 hover:border-white/30 transition-colors">+ <Image+ src={avatarUrl}+ alt={displayName}+ fill+ sizes="36px"+ className="object-cover"+ />+ </div>+ <span className="hidden sm:block text-sm font-medium text-neutral-300 max-w-30 truncate">+ {displayName}+ </span>+ <Icon+ icon="solar:alt-arrow-down-linear"+ className="hidden sm:block size-4 text-neutral-400"+ />+ </button>+ </DropdownMenu.Trigger>++ <DropdownMenu.Portal>+ <DropdownMenu.Content+ className="min-w-50 bg-black border border-white/25 rounded-xl p-1 shadow-2xl z-50 animate-in fade-in slide-in-from-top-2 duration-200"+ sideOffset={8}+ align="end"+ >+ <div className="px-3 py-2 mb-1 border-b border-white/10">+ <p className="text-sm font-medium text-white truncate">{displayName}</p>+ <p className="text-xs text-neutral-400 truncate">{user.email}</p>+ <p className="text-xs text-neutral-500 mt-1 capitalize">+ Conectado con {provider}+ </p>+ </div>++ <DropdownMenu.Item asChild>+ <Link+ href="/"+ className="flex items-center gap-3 px-3 py-2 text-sm text-neutral-300 hover:text-white hover:bg-white/5 rounded-lg transition-colors cursor-pointer outline-none"+ >+ <Icon icon="hugeicons:home-11" className="size-4" />+ Inicio+ </Link>+ </DropdownMenu.Item>++ <DropdownMenu.Item asChild>+ <Link+ href="/editor"+ className="flex items-center gap-3 px-3 py-2 text-sm text-neutral-300 hover:text-white hover:bg-white/5 rounded-lg transition-colors cursor-pointer outline-none"+ >+ <Icon icon="solar:video-frame-cut-2-linear" className="size-4" />+ <span>Editor</span>+ </Link>+ </DropdownMenu.Item>++ <DropdownMenu.Separator className="h-px bg-white/5 my-1" />++ <DropdownMenu.Item+ onSelect={handleSignOut}+ disabled={isLoggingOut}+ className="flex items-center gap-3 px-3 py-2 text-sm text-red-400 hover:text-red-300 hover:bg-red-500/10 rounded-lg transition-colors cursor-pointer outline-none disabled:opacity-50 disabled:cursor-not-allowed"+ >+ {isLoggingOut ? (+ <>+ <Icon icon="svg-spinners:ring-resize" className="size-4" />+ <span>Cerrando sesión...</span>+ </>+ ) : (+ <>+ <Icon icon="solar:logout-2-linear" className="size-4" />+ <span>Cerrar sesión</span>+ </>+ )}+ </DropdownMenu.Item>+ </DropdownMenu.Content>+ </DropdownMenu.Portal>+ </DropdownMenu.Root>+ );+}\ No newline at end of filediff --git a/app/not-found.tsx b/app/not-found.tsxnew file mode 100644index 0000000..7f28cc7--- /dev/null+++ b/app/not-found.tsx@@ -0,0 +1,46 @@+"use client";++import Link from 'next/link';+import Image from 'next/image';+import Header from './components/common/Header';+import { AuthProvider } from '@/hooks/useAuth';+import Footer from './components/common/Footer';++export default function NotFound() {+ return (+ <AuthProvider>+ <Header />++ <div className="flex flex-col items-center justify-center min-h-dvh bg-[#050505] text-center px-6 relative overflow-hidden">++ <h1 className="text-8xl md:text-[12rem] font-black tracking-tighter animate-reveal opacity-0 [animation-delay:150ms] bg-linear-to-b from-white/20 to-transparent bg-clip-text text-transparent select-none">+ 404+ </h1>++ <div className="-mt-8 space-y-3 animate-reveal opacity-0 [animation-delay:300ms] relative z-10">+ <div className="flex justify-center mb-4 opacity-50">+ <Image src="/svg/openvid.svg" alt="Openvid" width={120} height={30} />+ </div>++ <h2 className="text-2xl md:text-4xl font-bold text-white tracking-tight">+ Página no encontrada+ </h2>+ <p className="text-neutral-500 max-w-sm mx-auto leading-relaxed text-sm md:text-base font-medium">+ La ruta que buscas no existe en nuestro editor.+ </p>+ </div>++ <Link+ href="/"+ className="mt-12 px-10 py-4 bg-gradient-primary text-white font-bold rounded-full hover:scale-105 active:scale-95 transition-all animate-reveal opacity-0"+ >+ Volver al Inicio+ </Link>++ <div className="absolute inset-0 bg-[radial-gradient(circle_at_center,rgba(0,163,255,0.08)_0%,transparent_60%)] pointer-events-none" />++ </div>+ <Footer/>+ </AuthProvider>+ );+}