Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
refactor(web): redesign site footer with collapsible mobile columns
Richie McIlroye827ad588f8b
diff --git a/apps/web/app/(site)/Footer.tsx b/apps/web/app/(site)/Footer.tsxindex 29181a596..e99a00697 100644--- a/apps/web/app/(site)/Footer.tsx+++ b/apps/web/app/(site)/Footer.tsx@@ -1,5 +1,16 @@+"use client";+import { Logo } from "@cap/ui";+import type { IconDefinition } from "@fortawesome/fontawesome-svg-core";+import {+ faDiscord,+ faLinkedinIn,+ faXTwitter,+} from "@fortawesome/free-brands-svg-icons";+import { faChevronDown } from "@fortawesome/free-solid-svg-icons";+import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import Link from "next/link";+import { useState } from "react";type FooterLink = {label: string;@@ -47,19 +58,6 @@ const footerLinks = {isExternal: true,},] as FooterLink[],- socials: [- { label: "X (@Cap)", href: "https://x.com/cap", isExternal: true },- {- label: "Discord",- href: "https://discord.gg/y8gdQ3WRN3",- isExternal: true,- },- {- label: "LinkedIn",- href: "https://www.linkedin.com/company/caprecorder/",- isExternal: true,- },- ] as FooterLink[],tools: [{ label: "WebM to MP4", href: "/tools/convert/webm-to-mp4" },{ label: "MOV to MP4", href: "/tools/convert/mov-to-mp4" },@@ -101,155 +99,171 @@ const footerLinks = {{ label: "Screen Recorder for Mac", href: "/screen-recorder-mac" },{ label: "Screen Recorder for Windows", href: "/screen-recorder-windows" },{ label: "Screen Recording Software", href: "/screen-recording-software" },+ {+ label: "Google Drive Screen Recorder",+ href: "/google-drive-screen-recorder",+ },{ label: "Cap vs Loom", href: "/loom-alternative" },{ label: "Student Discount", href: "/student-discount" },] as FooterLink[],};-export const Footer = () => {+const socialLinks: { label: string; href: string; icon: IconDefinition }[] = [+ { label: "X (@Cap)", href: "https://x.com/cap", icon: faXTwitter },+ { label: "Discord", href: "https://discord.gg/y8gdQ3WRN3", icon: faDiscord },+ {+ label: "LinkedIn",+ href: "https://www.linkedin.com/company/caprecorder/",+ icon: faLinkedinIn,+ },+];++const FooterColumn = ({+ title,+ titleHref,+ links,+}: {+ title: string;+ titleHref?: string;+ links: FooterLink[];+}) => {+ const [isOpen, setIsOpen] = useState(false);+return (- <footer className="p-5">+ <div className="border-b border-gray-4 lg:border-none">+ <button+ type="button"+ aria-expanded={isOpen}+ onClick={() => setIsOpen((prev) => !prev)}+ className="flex justify-between items-center py-4 w-full text-lg font-semibold text-left text-gray-12 lg:hidden"+ >+ {title}+ <FontAwesomeIcon+ icon={faChevronDown}+ className={`size-3.5 text-gray-10 transition-transform duration-200 ${+ isOpen ? "rotate-180" : ""+ }`}+ />+ </button>++ {titleHref ? (+ <Link+ href={titleHref}+ className="hidden pb-2 text-lg font-semibold transition-colors text-gray-12 hover:text-gray-11 lg:block"+ >+ {title}+ </Link>+ ) : (+ <h3 className="hidden pb-2 text-lg font-semibold text-gray-12 lg:block">+ {title}+ </h3>+ )}+<div- style={{ boxShadow: "0px 2px 8px rgba(18, 22, 31, 0.02)" }}- className="mx-auto max-w-[1400px] bg-gray-1 border-[1px] border-gray-200 p-8 lg:p-12 rounded-[20px] mb-10 relative overflow-hidden"+ className={`grid transition-[grid-template-rows] duration-200 ease-out lg:grid-rows-[1fr] ${+ isOpen ? "grid-rows-[1fr]" : "grid-rows-[0fr]"+ }`}>- <div className="flex relative z-10 flex-col-reverse items-center">- <div className="flex-1 mt-10 space-y-2 text-center md:mt-0">- <Logo className="w-[104px] h-auto mx-auto" />- <div className="w-full">- <p className="max-w-sm text-gray-12">- Cap is the open source alternative to Loom. Lightweight,- powerful, and cross-platform. Record and share in seconds.- Import your existing Loom videos seamlessly.+ <div className="overflow-hidden">+ <ul className="grid grid-cols-1 gap-2 pb-4 lg:pb-0">+ {links.map((link) => (+ <li key={`${link.href}:${link.label}`}>+ <Link+ className="transition-colors text-gray-10 hover:text-gray-12"+ href={link.href}+ target={link.isExternal ? "_blank" : undefined}+ >+ {link.label}+ </Link>+ </li>+ ))}+ </ul>+ </div>+ </div>+ </div>+ );+};++export const Footer = () => {+ return (+ <footer className="overflow-hidden relative border-t border-gray-4">+ <div className="wrapper relative pt-20 pb-10">+ <div+ aria-hidden="true"+ className="absolute bottom-0 left-1/2 w-[700px] -translate-x-1/2 translate-y-2/3 select-none pointer-events-none opacity-[0.05] sm:w-[1000px] lg:w-[1300px]"+ >+ <Logo+ hideLogoName+ viewBoxDimensions="0 0 40 40"+ className="w-full h-auto"+ />+ </div>++ <div className="relative z-10">+ <div className="flex flex-col gap-12 xl:flex-row xl:gap-16">+ <div className="xl:w-[260px] xl:shrink-0">+ <Logo className="w-[104px] h-auto" />+ <p className="mt-5 max-w-sm text-sm leading-6 text-gray-11">+ The open source alternative to Loom. Lightweight, powerful, and+ cross-platform — record and share in seconds.</p>+ <div className="flex gap-2.5 items-center mt-6">+ {socialLinks.map((social) => (+ <a+ key={social.href}+ href={social.href}+ target="_blank"+ rel="noopener noreferrer"+ aria-label={social.label}+ className="flex justify-center items-center rounded-full border transition-colors size-9 border-gray-4 text-gray-10 hover:text-gray-12 hover:border-gray-6 hover:bg-gray-3"+ >+ <FontAwesomeIcon icon={social.icon} className="size-4" />+ </a>+ ))}+ </div></div>- <p className="pt-4 text-sm text-gray-9">++ <div className="grid flex-1 grid-cols-1 border-t border-gray-4 lg:grid-cols-5 lg:gap-x-8 lg:gap-y-10 lg:border-none">+ <FooterColumn title="Product" links={footerLinks.product} />+ <FooterColumn+ title="Additional Links"+ links={footerLinks.additional}+ />+ <FooterColumn title="Cap" links={footerLinks.help} />+ <FooterColumn title="Use Cases" links={footerLinks.useCases} />+ <FooterColumn+ title="Tools"+ titleHref="/tools"+ links={footerLinks.tools}+ />+ </div>+ </div>++ <div className="flex flex-col gap-4 pt-8 mt-20 border-t sm:flex-row sm:justify-between sm:items-center border-gray-4">+ <p className="text-sm text-gray-9">© Cap Software, Inc. {new Date().getFullYear()}.</p>- <div className="flex flex-wrap justify-center gap-x-10 gap-y-3 pt-6">- <a className="text-sm text-gray-8" href="/terms">+ <div className="flex flex-wrap gap-x-8 gap-y-2">+ <a+ className="text-sm transition-colors text-gray-9 hover:text-gray-12"+ href="/terms"+ >Terms of Service</a>- <a className="text-sm text-gray-8" href="/privacy">+ <a+ className="text-sm transition-colors text-gray-9 hover:text-gray-12"+ href="/privacy"+ >Privacy Policy</a>- <a className="text-sm text-gray-8" href="/dpa">+ <a+ className="text-sm transition-colors text-gray-9 hover:text-gray-12"+ href="/dpa"+ >Data Processing Agreement</a></div></div>-- <div className="grid grid-cols-1 gap-10 w-full md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6">- <div className="space-y-2">- <h3 className="text-lg font-semibold text-gray-12">Product</h3>- <ul className="grid grid-cols-1 gap-2 pt-2">- {footerLinks.product.map((link, index) => (- <li key={index.toString()}>- <Link- className="text-gray-10"- href={link.href}- target={link.isExternal ? "_blank" : undefined}- >- {link.label}- </Link>- </li>- ))}- </ul>- </div>-- <div className="space-y-2">- <h3 className="text-lg font-semibold text-gray-12">- Additional Links- </h3>- <ul className="grid grid-cols-1 gap-2 pt-2">- {footerLinks.additional.map((link, index) => (- <li key={index.toString()}>- <Link- className="text-gray-10"- href={link.href}- target={link.isExternal ? "_blank" : undefined}- >- {link.label}- </Link>- </li>- ))}- </ul>- </div>-- <div className="space-y-2">- <h3 className="text-lg font-semibold text-gray-12">Cap</h3>- <ul className="grid grid-cols-1 gap-2 pt-2">- {footerLinks.help.map((link, index) => (- <li key={index.toString()}>- <Link- className="text-gray-10"- href={link.href}- target={link.isExternal ? "_blank" : undefined}- >- {link.label}- </Link>- </li>- ))}- </ul>- </div>-- <div className="space-y-2">- <h3 className="text-lg font-semibold text-gray-12">Use Cases</h3>- <ul className="grid grid-cols-1 gap-2 pt-2">- {footerLinks.useCases.map((link, index) => (- <li key={index.toString()}>- <Link- className="text-gray-10"- href={link.href}- target={link.isExternal ? "_blank" : undefined}- >- {link.label}- </Link>- </li>- ))}- </ul>- </div>-- <div className="space-y-2">- <h3 className="text-lg font-semibold text-gray-12">Socials</h3>- <ul className="grid grid-cols-1 gap-2 pt-2">- {footerLinks.socials.map((link, index) => (- <li key={index.toString()}>- <Link- className="text-gray-10"- href={link.href}- target={link.isExternal ? "_blank" : undefined}- >- {link.label}- </Link>- </li>- ))}- </ul>- </div>-- <div className="space-y-2">- <Link- href="/tools"- className="text-lg font-semibold text-gray-12"- >- Tools- </Link>-- <ul className="grid grid-cols-1 gap-2 pt-2">- {footerLinks.tools.map((link, index) => (- <li key={index.toString()}>- <Link- className="text-gray-10"- href={link.href}- target={link.isExternal ? "_blank" : undefined}- >- {link.label}- </Link>- </li>- ))}- </ul>- </div>- </div></div></div></footer>