diff --git a/frontend/index.html b/frontend/index.html index 53968da3..a447e172 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -3,7 +3,7 @@ - + PASO diff --git a/frontend/public/top.png b/frontend/public/top.png new file mode 100644 index 00000000..093d5059 Binary files /dev/null and b/frontend/public/top.png differ diff --git a/frontend/src/components/landing/CTASection.jsx b/frontend/src/components/landing/CTASection.jsx new file mode 100644 index 00000000..71898649 --- /dev/null +++ b/frontend/src/components/landing/CTASection.jsx @@ -0,0 +1,243 @@ +import { useState } from "react"; +import { motion, useReducedMotion } from "framer-motion"; +import { + ArrowRight, + Bot, + Hash, + MessageSquare, + Mic, + Video, +} from "lucide-react"; +import { Link } from "react-router-dom"; + +const EASE = [0.22, 1, 0.36, 1]; + +const ORBIT_NODES = [ + { + id: "dm", + label: "Direct messages", + icon: MessageSquare, + angle: -90, + }, + { + id: "voice", + label: "Voice channels", + icon: Mic, + angle: -18, + }, + { + id: "video", + label: "Video rooms", + icon: Video, + angle: 54, + }, + { + id: "ai", + label: "Workspace assistant", + icon: Bot, + angle: 126, + }, + { + id: "rooms", + label: "Group threads", + icon: Hash, + angle: 198, + }, +]; + +const MEMBERS = [ + { + name: "Alex Rivera", + initials: "AR", + src: "https://randomuser.me/api/portraits/men/32.jpg", + sizeClass: "h-10 w-10 sm:h-11 sm:w-11 z-0", + }, + { + name: "Maya Kulkarni", + initials: "MK", + src: "https://randomuser.me/api/portraits/women/44.jpg", + sizeClass: "h-13 w-13 sm:h-14 sm:w-14 z-10", + }, + { + name: "Samir Patel", + initials: "SP", + src: "https://randomuser.me/api/portraits/men/75.jpg", + sizeClass: "h-10 w-10 sm:h-11 sm:w-11 z-0", + }, +]; + +function MemberAvatar({ member }) { + const [imgError, setImgError] = useState(false); + + return ( +
+ {!imgError ? ( + {member.name} setImgError(true)} + className="h-full w-full object-cover" + loading="lazy" + /> + ) : ( + + {member.initials} + + )} +
+ ); +} + +const CTASection = () => { + const prefersReducedMotion = useReducedMotion(); + const [hoveredNode, setHoveredNode] = useState(null); + + return ( +
+ {/* Architectural Side Rails */} +
+ ); +}; + +export default CTASection; \ No newline at end of file diff --git a/frontend/src/components/landing/FeaturesSection.jsx b/frontend/src/components/landing/FeaturesSection.jsx new file mode 100644 index 00000000..55cad0d8 --- /dev/null +++ b/frontend/src/components/landing/FeaturesSection.jsx @@ -0,0 +1,133 @@ +import { motion, useReducedMotion } from "framer-motion"; +import { + ChartNoAxesColumnIncreasing, + Image, + MessageCircle, + Sparkles, + Users, + Video, +} from "lucide-react"; + +const FEATURES = [ + { + index: "01", + icon: MessageCircle, + title: "Real-time Messaging", + description: + "1:1 and group messages with presence, typing indicators, and read receipts.", + }, + { + index: "02", + icon: Users, + title: "Group Conversations", + description: + "Group rooms, pinned threads, and shared context in one place.", + }, + { + index: "03", + icon: Video, + title: "Audio & Video Calls", + description: + "Voice and video rooms directly alongside your conversations.", + }, + { + index: "04", + icon: Image, + title: "Media & File Sharing", + description: + "Upload and preview images, audio clips, and files cleanly.", + }, + { + index: "05", + icon: ChartNoAxesColumnIncreasing, + title: "Interactive Polls", + description: + "Quick polls inside chats to make decisions without long threads.", + }, + { + index: "06", + icon: Sparkles, + title: "AI Replies & Safety", + description: + "Drafts, summaries, and basic moderation checks built into the flow.", + }, +]; + +const EASE = [0.22, 1, 0.36, 1]; + +const FeaturesSection = () => { + const prefersReducedMotion = useReducedMotion(); + + return ( +
+
+ ); +}; + +export default FeaturesSection; \ No newline at end of file diff --git a/frontend/src/components/landing/HeroLiveStage.jsx b/frontend/src/components/landing/HeroLiveStage.jsx new file mode 100644 index 00000000..1139e07e --- /dev/null +++ b/frontend/src/components/landing/HeroLiveStage.jsx @@ -0,0 +1,36 @@ +import { motion, useReducedMotion } from "framer-motion"; + +const EASE = [0.22, 1, 0.36, 1]; + +const HeroLiveStage = () => { + const prefersReducedMotion = useReducedMotion(); + + return ( +
+
+ ); +}; + +export default HeroLiveStage; \ No newline at end of file diff --git a/frontend/src/components/landing/HeroSection.jsx b/frontend/src/components/landing/HeroSection.jsx new file mode 100644 index 00000000..2fb18dc8 --- /dev/null +++ b/frontend/src/components/landing/HeroSection.jsx @@ -0,0 +1,170 @@ +import { motion, useReducedMotion } from "framer-motion"; +import { ArrowRight, Github } from "lucide-react"; +import { Link } from "react-router-dom"; +import HeroLiveStage from "./HeroLiveStage"; +import ProductShowcase from "./ProductShowcase"; +import { AnimatedTooltip } from "../ui/AnimatedTooltip"; +import { PointerHighlight } from "../ui/PointerHighlight"; + +const GITHUB_URL = "https://github.com/CodePlaygroundHub/paso-chat-app"; + +const EASE = [0.22, 1, 0.36, 1]; + +const HERO_MEMBERS = [ + { + id: 1, + name: "Rohan Das", + image: + "https://images.unsplash.com/photo-1599566150163-29194dcaad36?auto=format&fit=crop&w=240&q=80", + }, + { + id: 2, + name: "Ananya Sen", + image: + "https://images.unsplash.com/photo-1580489944761-15a19d654956?auto=format&fit=crop&w=240&q=80", + }, + { + id: 3, + name: "Kabir Roy", + image: + "https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?auto=format&fit=crop&w=240&q=80", + }, + { + id: 4, + name: "Meera Nair", + image: + "https://images.unsplash.com/photo-1438761681033-6461ffad8d80?auto=format&fit=crop&w=240&q=80", + }, +]; + +const HeroSection = () => { + const prefersReducedMotion = useReducedMotion(); + + return ( +
+ {/* Architectural Framing Rails & Datum */} +
+ ); +}; + +export default HeroSection; \ No newline at end of file diff --git a/frontend/src/components/landing/LandingFooter.jsx b/frontend/src/components/landing/LandingFooter.jsx new file mode 100644 index 00000000..b48f5d6a --- /dev/null +++ b/frontend/src/components/landing/LandingFooter.jsx @@ -0,0 +1,184 @@ +import { Link } from "react-router-dom"; +import { motion } from "framer-motion"; +import { + ArrowUpRight, + Github, + MessageSquare, +} from "lucide-react"; + +const GITHUB_URL = + "https://github.com/CodePlaygroundHub/paso-chat-app"; + +const CONTRIBUTING_URL = + "https://github.com/CodePlaygroundHub/PasoChat?tab=contributing-ov-file"; + +const EASE = [0.22, 1, 0.36, 1]; + +const LandingFooter = () => { + return ( + + ); +}; + +export default LandingFooter; \ No newline at end of file diff --git a/frontend/src/components/landing/LandingNavbar.jsx b/frontend/src/components/landing/LandingNavbar.jsx new file mode 100644 index 00000000..46244be9 --- /dev/null +++ b/frontend/src/components/landing/LandingNavbar.jsx @@ -0,0 +1,214 @@ +import { Link } from "react-router-dom"; +import { ArrowRight, Menu, MessageSquare, X } from "lucide-react"; +import { useEffect, useState } from "react"; + +const GITHUB_URL = "https://github.com/CodePlaygroundHub/paso-chat-app"; + +const NAV_LINKS = [ + { label: "Features", href: "#features" }, + { label: "Product", href: "#showcase" }, + { label: "About", href: "#about" }, +]; + +const LandingNavbar = () => { + const [menuOpen, setMenuOpen] = useState(false); + const [scrolled, setScrolled] = useState(false); + + const closeMenu = () => setMenuOpen(false); + + useEffect(() => { + const handleScroll = () => { + setScrolled(window.scrollY > 24); + }; + + handleScroll(); + window.addEventListener("scroll", handleScroll, { passive: true }); + return () => window.removeEventListener("scroll", handleScroll); + }, []); + + useEffect(() => { + if (!menuOpen) return; + + const handleKeyDown = (e) => { + if (e.key === "Escape") { + setMenuOpen(false); + } + }; + + window.addEventListener("keydown", handleKeyDown); + return () => window.removeEventListener("keydown", handleKeyDown); + }, [menuOpen]); + + return ( +
+ + + {/* Mobile Drawer */} + {menuOpen && ( +
+
+ {NAV_LINKS.map((item) => ( + + {item.label} + + ))} + + + GitHub + + ↗ + + + +
+ + Log in + + + + Get started + + +
+
+
+ )} +
+ ); +}; + +export default LandingNavbar; \ No newline at end of file diff --git a/frontend/src/components/landing/ProductShowcase.jsx b/frontend/src/components/landing/ProductShowcase.jsx new file mode 100644 index 00000000..4a93ffef --- /dev/null +++ b/frontend/src/components/landing/ProductShowcase.jsx @@ -0,0 +1,447 @@ +import { useEffect, useMemo, useRef, useState } from "react"; +import { AnimatePresence, motion, useReducedMotion } from "framer-motion"; +import { + Bot, + MessageSquare, + MoreHorizontal, + Phone, + Plus, + Search, + Send, + Video, +} from "lucide-react"; + +const INITIAL_THREADS = [ + { + id: "alex-morgan", + name: "Alex Morgan", + status: "Active now", + online: true, + isAI: false, + messages: [ + { id: "1", from: "them", text: "Tried the new huddle flow?" }, + { id: "2", from: "me", text: "Yeah, super fast and clean." }, + { id: "3", from: "them", text: "Zero clutter. Ready to ship." }, + ], + }, + { + id: "core-systems", + name: "Core Systems", + status: "14 members", + online: true, + isAI: false, + messages: [ + { id: "g1", from: "them", text: "Realtime sync is green." }, + { id: "g2", from: "me", text: "Let's run a quick voice check." }, + ], + }, + { + id: "paso-ai", + name: "PASO AI", + status: "Assistant", + online: true, + isAI: true, + messages: [ + { id: "a1", from: "them", text: "Need a quick draft or summary?" }, + ], + }, + { + id: "john-smith", + name: "John Smith", + status: "1h ago", + online: false, + isAI: false, + messages: [ + { id: "j1", from: "them", text: "Thanks for sharing the notes." }, + ], + }, +]; + +const EASE = [0.22, 1, 0.36, 1]; + +const ProductShowcase = ({ flush = false }) => { + const [threads, setThreads] = useState(INITIAL_THREADS); + const [activeId, setActiveId] = useState("alex-morgan"); + const [query, setQuery] = useState(""); + const [draft, setDraft] = useState(""); + const [aiTyping, setAiTyping] = useState(false); + + const prefersReducedMotion = useReducedMotion(); + const feedContainerRef = useRef(null); + const hasMountedRef = useRef(false); + const aiTimerRef = useRef(null); + + const activeThread = useMemo( + () => threads.find((t) => t.id === activeId) || threads[0], + [threads, activeId], + ); + + const visibleThreads = useMemo(() => { + const q = query.trim().toLowerCase(); + if (!q) return threads; + return threads.filter( + (t) => + t.name.toLowerCase().includes(q) || + t.messages[t.messages.length - 1]?.text.toLowerCase().includes(q), + ); + }, [threads, query]); + + useEffect(() => { + if (!hasMountedRef.current) { + hasMountedRef.current = true; + return; + } + + const container = feedContainerRef.current; + if (!container) return; + + container.scrollTo({ + top: container.scrollHeight, + behavior: prefersReducedMotion ? "auto" : "smooth", + }); + }, [activeId, activeThread.messages.length, aiTyping, prefersReducedMotion]); + + useEffect(() => { + return () => { + if (aiTimerRef.current) clearTimeout(aiTimerRef.current); + }; + }, []); + + const handleSend = (e) => { + e.preventDefault(); + const text = draft.trim(); + if (!text) return; + + const targetThreadId = activeThread.id; + const isAiThread = activeThread.isAI; + + const userMsg = { + id: `${Date.now()}`, + from: "me", + text, + }; + + setThreads((prev) => + prev.map((thread) => + thread.id === targetThreadId + ? { ...thread, messages: [...thread.messages, userMsg] } + : thread, + ), + ); + + setDraft(""); + + if (isAiThread) { + setAiTyping(true); + if (aiTimerRef.current) clearTimeout(aiTimerRef.current); + + aiTimerRef.current = setTimeout(() => { + setThreads((prev) => + prev.map((thread) => + thread.id === targetThreadId + ? { + ...thread, + messages: [ + ...thread.messages, + { + id: `${Date.now()}-ai`, + from: "them", + text: `Draft: "${text.slice(0, 36)}${text.length > 36 ? "…" : ""}"`, + }, + ], + } + : thread, + ), + ); + setAiTyping(false); + }, 650); + } + }; + + return ( +
+
+ + {/* Window Chrome Bar */} +
+ + + + pasochat.vercel.app + + + + {threads.filter((t) => t.online).length} active + +
+ + {/* Two-Pane Workspace */} +
+ {/* Sidebar */} + + + {/* Conversation */} +
+
+ +
+ {activeThread.isAI ? ( + + ) : ( + activeThread.name.charAt(0) + )} +
+
+

+ {activeThread.name} +

+

+ {activeThread.status} +

+
+
+ +
+ + + +
+
+ + {/* Messages */} +
+ + {activeThread.messages.map((msg) => { + const isMe = msg.from === "me"; + return ( + +
+ {msg.text} +
+
+ ); + })} + + {aiTyping && activeThread.isAI && ( + + {[0, 1, 2].map((dot) => ( + + ))} + + )} +
+
+ + {/* Input */} +
+ setDraft(e.target.value)} + placeholder={`Message ${activeThread.name}`} + aria-label="Type a preview message" + className="h-9 flex-1 rounded-full border border-zinc-900/12 bg-[#FAFAFA] px-4 text-[12.5px] text-zinc-900 placeholder:text-zinc-400 transition-colors focus:border-zinc-900/25 focus:bg-white focus:outline-none dark:border-white/12 dark:bg-[#141313] dark:text-zinc-100 dark:placeholder:text-zinc-500 dark:focus:border-white/25" + /> + + + +
+
+
+
+
+
+ ); +}; + +export default ProductShowcase; \ No newline at end of file diff --git a/frontend/src/components/ui/AnimatedTooltip.jsx b/frontend/src/components/ui/AnimatedTooltip.jsx new file mode 100644 index 00000000..927b7de1 --- /dev/null +++ b/frontend/src/components/ui/AnimatedTooltip.jsx @@ -0,0 +1,140 @@ +import React, { useRef, useState } from "react"; +import { + AnimatePresence, + motion, + useMotionValue, + useReducedMotion, + useSpring, + useTransform, +} from "framer-motion"; + +const SETTLE_EASE = [0.22, 1, 0.36, 1]; +const SPRING_FOLLOW = { stiffness: 320, damping: 32, mass: 0.55 }; + +export const AnimatedTooltip = ({ items = [] }) => { + const [hoveredId, setHoveredId] = useState(null); + const prefersReducedMotion = useReducedMotion(); + const pointerX = useMotionValue(0); + const frameRef = useRef(null); + + const followX = useSpring( + useTransform(pointerX, [-40, 40], prefersReducedMotion ? [0, 0] : [-8, 8]), + SPRING_FOLLOW + ); + + const handleMouseMove = (event) => { + if (prefersReducedMotion) return; + if (frameRef.current) { + cancelAnimationFrame(frameRef.current); + } + + const target = event.currentTarget; + const relX = event.nativeEvent.offsetX - target.offsetWidth / 2; + + frameRef.current = requestAnimationFrame(() => { + pointerX.set(relX); + }); + }; + + const hoveredIndex = items.findIndex((item) => item.id === hoveredId); + + return ( +
+ {items.map((item, idx) => { + const isHovered = hoveredId === item.id; + const hasHover = hoveredIndex !== -1; + + let neighborShift = 0; + if (!prefersReducedMotion && hasHover && !isHovered) { + neighborShift = idx < hoveredIndex ? -3 : 3; + } + + return ( + { + setHoveredId(item.id); + pointerX.set(0); + }} + onMouseLeave={() => { + setHoveredId(null); + pointerX.set(0); + }} + animate={{ + x: neighborShift, + zIndex: isHovered ? 30 : 10 + idx, + }} + transition={{ duration: 0.24, ease: SETTLE_EASE }} + className="relative -mr-2.5 last:mr-0 focus-within:z-30" + > + + {isHovered && ( + +
+ {item.name} +
+
+ )} +
+ + setHoveredId(item.id)} + onBlur={() => setHoveredId(null)} + onMouseMove={handleMouseMove} + animate={ + prefersReducedMotion + ? undefined + : { + y: isHovered ? -2 : 0, + scale: isHovered ? 1.06 : 1, + } + } + transition={{ duration: 0.22, ease: SETTLE_EASE }} + aria-label={item.name} + className="block cursor-pointer rounded-full focus:outline-none focus-visible:ring-1 focus-visible:ring-zinc-900 dark:focus-visible:ring-white" + > + {item.name} + +
+ ); + })} +
+ ); +}; \ No newline at end of file diff --git a/frontend/src/components/ui/PointerHighlight.jsx b/frontend/src/components/ui/PointerHighlight.jsx new file mode 100644 index 00000000..b31863f4 --- /dev/null +++ b/frontend/src/components/ui/PointerHighlight.jsx @@ -0,0 +1,96 @@ +import React, { useEffect, useRef, useState } from "react"; +import { motion, useReducedMotion } from "framer-motion"; + +const SLOW_EASE = [0.22, 1, 0.36, 1]; + +export function PointerHighlight({ + children, + rectangleClassName = "", + pointerClassName = "", + containerClassName = "", +}) { + const containerRef = useRef(null); + const [dimensions, setDimensions] = useState({ width: 0, height: 0 }); + const prefersReducedMotion = useReducedMotion(); + + useEffect(() => { + const el = containerRef.current; + if (!el) return; + + const updateSize = () => { + const rect = el.getBoundingClientRect(); + setDimensions({ width: rect.width, height: rect.height }); + }; + + updateSize(); + + const observer = new ResizeObserver(updateSize); + observer.observe(el); + + return () => observer.disconnect(); + }, []); + + const hasSize = dimensions.width > 0 && dimensions.height > 0; + const boxWidth = dimensions.width + 16; + const boxHeight = dimensions.height + 4; + + return ( + + {children} + + {hasSize && !prefersReducedMotion && ( + + )} + + ); +} + +const Pointer = ({ className = "" }) => ( + + + +); \ No newline at end of file diff --git a/frontend/src/pages/LandingPage.jsx b/frontend/src/pages/LandingPage.jsx new file mode 100644 index 00000000..0d1fcb80 --- /dev/null +++ b/frontend/src/pages/LandingPage.jsx @@ -0,0 +1,57 @@ +import { lazy, Suspense } from "react"; +import { MotionConfig, motion, useScroll, useSpring } from "framer-motion"; +import LandingNavbar from "../components/landing/LandingNavbar"; +import HeroSection from "../components/landing/HeroSection"; + +const ProductShowcase = lazy( + () => import("../components/landing/ProductShowcase") +); +const FeaturesSection = lazy( + () => import("../components/landing/FeaturesSection") +); +const CTASection = lazy(() => import("../components/landing/CTASection")); +const LandingFooter = lazy( + () => import("../components/landing/LandingFooter") +); + +const LandingPage = () => { + const { scrollYProgress } = useScroll(); + const scaleX = useSpring(scrollYProgress, { + stiffness: 260, + damping: 32, + restDelta: 0.001, + }); + + return ( + +
+ {/* Top Scroll Progress Hairline */} +
+
+ ); +}; + +export default LandingPage; \ No newline at end of file