Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

chore(web): remove narrating comments from homepage components

Richie McIlroy972043df2e01
diff --git a/apps/web/components/pages/HomeTwo/demo/CapEditorWindow.tsx b/apps/web/components/pages/HomeTwo/demo/CapEditorWindow.tsx
index d0602dcc2..7b804f631 100644
--- a/apps/web/components/pages/HomeTwo/demo/CapEditorWindow.tsx
+++ b/apps/web/components/pages/HomeTwo/demo/CapEditorWindow.tsx
@@ -64,7 +64,6 @@ const WALLPAPERS = [
].map((city) => ({
id: city,
thumb: `/backgrounds/thumbs/${city}.webp`,
- // 1280px copies: the editor stage never draws them wider than that.
full: `/backgrounds/landing/${city}.webp`,
}));
diff --git a/apps/web/components/pages/HomeTwo/demo/media.tsx b/apps/web/components/pages/HomeTwo/demo/media.tsx
index 7a0ed6df9..39d1636c2 100644
--- a/apps/web/components/pages/HomeTwo/demo/media.tsx
+++ b/apps/web/components/pages/HomeTwo/demo/media.tsx
@@ -8,10 +8,6 @@ export const SceneMediaProvider = SceneMediaContext.Provider;
export const useSceneMedia = () => useContext(SceneMediaContext);
-/**
- * An 8 second 960x600 talking-head loop cut from a real Cap camera track:
- * AV1 (~100 KB) where supported, H.264 (~160 KB) otherwise, no audio.
- */
export const PRESENTER = {
av1: "/videos/landing/presenter.webm",
mp4: "/videos/landing/presenter.mp4",
diff --git a/apps/web/components/pages/HomeTwo/fonts.ts b/apps/web/components/pages/HomeTwo/fonts.ts
index 17edd02c5..d428db2ce 100644
--- a/apps/web/components/pages/HomeTwo/fonts.ts
+++ b/apps/web/components/pages/HomeTwo/fonts.ts
@@ -5,7 +5,6 @@ import {
Source_Serif_4,
} from "next/font/google";
-// Variable: one file covers 400 and 500 instead of two ~50 KB statics.
export const htSans = Instrument_Sans({
subsets: ["latin"],
display: "swap",
diff --git a/apps/web/components/pages/HomeTwo/showcase/ai.tsx b/apps/web/components/pages/HomeTwo/showcase/ai.tsx
index 0cc71a1a3..1ac14b721 100644
--- a/apps/web/components/pages/HomeTwo/showcase/ai.tsx
+++ b/apps/web/components/pages/HomeTwo/showcase/ai.tsx
@@ -9,7 +9,6 @@ import { Avatar, RecordingFrame } from "./share";
export { CANVAS };
-/** Warm surface for this section only, holding the player and the AI panel. */
const SURFACE = { x: 70, y: 34, w: 900, h: 470 } as const;
const PLAYER = { x: 32, y: 32, w: 520 } as const;
const PANEL = { x: 572, y: 32, w: 296, h: 406 } as const;
@@ -57,7 +56,6 @@ const Surface = ({ children }: { children: ReactNode }) => (
</div>
);
-/** The share page's player card: title, owner, video and its timeline. */
const Player = ({
seconds,
playing,
@@ -69,7 +67,6 @@ const Player = ({
seconds: number;
playing: boolean;
title: ReactNode;
- /** How many chapters have landed, drawn as markers on the timeline. */
ticks?: number;
caption?: string;
chapter?: string;
@@ -138,7 +135,6 @@ const Player = ({
);
};
-/** The AI side of the share page, in its own card next to the player. */
const Panel = ({
heading,
status,
@@ -194,8 +190,6 @@ const Typed = ({ text, k }: { text: string; k: number }) => {
);
};
-// Summary: the raw file name turns into a real title, then the summary
-// writes itself underneath.
const SummaryView = ({ t, playing }: { t: number; playing: boolean }) => {
const titleK = seg(t, 500, 1300);
const bodyK = Math.min(1, Math.max(0, (t - 1400) / 3400));
@@ -232,7 +226,6 @@ const SummaryView = ({ t, playing }: { t: number; playing: boolean }) => {
);
};
-// Chapters: markers land on the timeline, then a click jumps to one.
const ChaptersView = ({ t, playing }: { t: number; playing: boolean }) => {
const shown = Math.min(
CHAPTERS.length,
@@ -296,7 +289,6 @@ const ChaptersView = ({ t, playing }: { t: number; playing: boolean }) => {
);
};
-// Transcript: the line being spoken lights up and shows as a caption.
const TranscriptView = ({ t, playing }: { t: number; playing: boolean }) => {
const seconds = Math.min(23.5, 1.5 + t / 260);
const current = LINES.findLastIndex(([at]) => at <= seconds);
diff --git a/apps/web/components/pages/HomeTwo/showcase/physics.ts b/apps/web/components/pages/HomeTwo/showcase/physics.ts
index a71cd5cbf..a88e0d82a 100644
--- a/apps/web/components/pages/HomeTwo/showcase/physics.ts
+++ b/apps/web/components/pages/HomeTwo/showcase/physics.ts
@@ -87,7 +87,6 @@ export const sampleAt = (samples: number[][], ms: number, sampleMs = 4) => {
return a.map((v, n) => v + ((b[n] ?? v) - v) * k);
};
-/** Minimum-jerk easing, the shape of a real hand moving a mouse. */
export const minJerk = (s: number) => {
const x = Math.min(1, Math.max(0, s));
return x * x * x * (10 - 15 * x + 6 * x * x);
@@ -95,7 +94,6 @@ export const minJerk = (s: number) => {
export type Waypoint = { at: number; x: number; y: number; hold?: number };
-/** A recorded-looking raw mouse path through timed waypoints. */
export const rawPath = (points: Waypoint[]) => (ms: number) => {
const first = points[0];
if (!first) return [0, 0];
@@ -111,11 +109,9 @@ export const rawPath = (points: Waypoint[]) => (ms: number) => {
return [prev.x, prev.y];
};
-/** 0..1 through a click press, for the cursor's shrink and release. */
export const clickShrink = (ms: number, downAt: number) => {
const t = ms - downAt;
if (t < -CLICK.ms || t > CLICK.ms * 2) return 1;
- // Shrinks into the press, springs back out on release.
const k =
t < 0 ? 1 + t / CLICK.ms : t < CLICK.ms ? 0 : (t - CLICK.ms) / CLICK.ms;
const eased = Math.min(1, Math.max(0, k));
diff --git a/apps/web/components/pages/HomeTwo/showcase/screenshot.tsx b/apps/web/components/pages/HomeTwo/showcase/screenshot.tsx
index 93f910751..f88cab15e 100644
--- a/apps/web/components/pages/HomeTwo/showcase/screenshot.tsx
+++ b/apps/web/components/pages/HomeTwo/showcase/screenshot.tsx
@@ -7,13 +7,10 @@ export const CANVAS = { w: 640, h: 520 } as const;
const INK = "#F43F5E";
-/** The window as it sits on screen before the capture. */
const WIN = { x: 55, y: 96, scale: 0.78 } as const;
-/** The part of the invoice that gets captured, in page pixels. */
const CROP = { x: 364, y: 277, w: 304, h: 133 } as const;
-/** Where the capture lands, on its background card. */
const PAD = 34;
const IMG = { x: 84, y: 172, w: 472 } as const;
const SCALE_OUT = IMG.w / CROP.w;
@@ -25,7 +22,6 @@ const CARD = {
h: IMG_H + PAD * 2,
};
-/** Page coordinates to stage coordinates, once the capture has landed. */
const at = (px: number, py: number) => ({
x: IMG.x + (px - CROP.x) * SCALE_OUT,
y: IMG.y + (py - CROP.y) * SCALE_OUT,
@@ -99,7 +95,6 @@ const Arrow = ({
);
};
-/** A rounded box that draws itself clockwise from the top left. */
const Box = ({
x,
y,
@@ -231,7 +226,6 @@ const ScreenshotView = ({ t }: { t: number; playing: boolean }) => {
? "text"
: null;
- // The capture flies from the selection to its spot on the card.
const crop = {
x: lerp(SEL.x, IMG.x, lift),
y: lerp(SEL.y, IMG.y, lift),
@@ -258,7 +252,6 @@ const ScreenshotView = ({ t }: { t: number; playing: boolean }) => {
return (
<div className="absolute inset-0 overflow-hidden">
- {/* The window on screen, before the capture. */}
<div
className="absolute overflow-hidden rounded-[10px] shadow-[0_0_0_1px_rgba(0,0,0,0.08),0_18px_44px_-20px_rgba(17,24,39,0.45)]"
style={{
@@ -317,7 +310,6 @@ const ScreenshotView = ({ t }: { t: number; playing: boolean }) => {
) : null}
{t < 450 ? <Crosshair x={SEL.x} y={SEL.y} /> : null}
- {/* The background card the capture lands on. */}
<div
className="absolute overflow-hidden"
style={{
@@ -333,7 +325,6 @@ const ScreenshotView = ({ t }: { t: number; playing: boolean }) => {
}}
/>
- {/* The capture itself. */}
{t >= 1420 ? (
<div
className="absolute overflow-hidden bg-white"
diff --git a/apps/web/components/pages/HomeTwo/showcase/share.tsx b/apps/web/components/pages/HomeTwo/showcase/share.tsx
index bcde8c722..5d6bd44b3 100644
--- a/apps/web/components/pages/HomeTwo/showcase/share.tsx
+++ b/apps/web/components/pages/HomeTwo/showcase/share.tsx
@@ -4,12 +4,6 @@ import { classNames } from "@cap/utils/helpers";
import type { ReactNode } from "react";
import { INVOICE, InvoicePage, PRESENTER, Webcam } from "./subjects";
-/**
- * The Cap share page (apps/web/app/s/[videoId]) rebuilt at a fixed 1200px
- * width: header with title, owner and the blue Share button, the player in
- * its white card on the grey page, the Player/Timeline toggle and reaction
- * bar, and the Comments / Summary / Transcript sidebar.
- */
export const SHARE_W = 1200;
export const SHARE_URL = "Cap.so/s/m4k8x2qz";
export const CAP_TITLE = "Sending an invoice in Ledgerly";
@@ -53,7 +47,6 @@ export const stamp = (seconds: number) =>
const clock = (seconds: number) =>
`${Math.floor(seconds / 60)}:${String(Math.floor(seconds % 60)).padStart(2, "0")}`;
-/** What the recording looks like inside the player. */
export const RecordingFrame = ({
playing,
pageScale,
@@ -224,7 +217,6 @@ export const SharePage = ({
playing: boolean;
views: number;
sidebar: ReactNode;
- /** Reactions rising off the bar: emoji and 0..1 progress. */
floating?: { emoji: string; k: number; x: number }[];
pressed?: string;
}) => (
diff --git a/apps/web/components/pages/HomeTwo/showcase/stage.tsx b/apps/web/components/pages/HomeTwo/showcase/stage.tsx
index 80989b09b..39ed98430 100644
--- a/apps/web/components/pages/HomeTwo/showcase/stage.tsx
+++ b/apps/web/components/pages/HomeTwo/showcase/stage.tsx
@@ -21,8 +21,6 @@ type StageName =
| "ownership"
| "agents";
-// Each animated stage is its own chunk, fetched only when the section gets
-// close to the viewport, so none of it is in the initial page load.
const STAGES: Record<StageName, ComponentType> = {
instant: lazy(() =>
import("./instant").then((m) => ({ default: m.InstantStage })),
diff --git a/apps/web/components/pages/HomeTwo/showcase/subjects.tsx b/apps/web/components/pages/HomeTwo/showcase/subjects.tsx
index 2837d15f7..c97d9dcaa 100644
--- a/apps/web/components/pages/HomeTwo/showcase/subjects.tsx
+++ b/apps/web/components/pages/HomeTwo/showcase/subjects.tsx
@@ -11,14 +11,8 @@ export { PRESENTER };
import { useVideo } from "../scenes/engine";
-/**
- * The thing being recorded in every demo: a small, real looking invoicing app.
- * Fixed 680x425 layout so scenes can aim the cursor, zooms and masks at exact
- * coordinates (see INVOICE_SPOTS).
- */
export const INVOICE = { w: 680, h: 425 } as const;
-/** Rects in page pixels (top left corner, size). */
export const INVOICE_SPOTS = {
send: { x: 524, y: 360, w: 128, h: 34 },
email: { x: 326, y: 140, w: 160, h: 20 },
@@ -50,10 +44,6 @@ const Field = ({
</div>
);
-/**
- * A browser window's top bar in the visitor's OS: traffic lights and a
- * centred address on macOS, an address bar and caption buttons on Windows.
- */
export const BrowserBar = ({
url,
className,
@@ -115,7 +105,6 @@ export const BrowserBar = ({
);
};
-/** An app window's title bar with the visitor's OS window controls. */
export const AppBar = ({
children,
className,
@@ -150,7 +139,6 @@ export const InvoicePage = ({
emailStyle,
chrome = true,
}: {
- /** 0..1 how far the button has flipped to its sent state. */
sent?: number;
press?: number;
emailStyle?: CSSProperties;
@@ -345,7 +333,6 @@ export const Ripple = ({
}: {
x: number;
y: number;
- /** 0..1 through the ripple, nothing drawn outside that range. */
k: number;
color?: string;
}) =>
@@ -364,7 +351,6 @@ export const Ripple = ({
/>
);
-/** 1280px copies of the editor wallpapers (~60 KB each), sized for the stages. */
export const WALLPAPERS = {
sf: "/backgrounds/landing/sf.webp",
santorini: "/backgrounds/landing/santorini.webp",
@@ -375,7 +361,6 @@ export const WALLPAPERS = {
rome: "/backgrounds/landing/rome.webp",
} as const;
-/** 112px thumbnails for swatches, so a picker never pulls the full images. */
export const thumbOf = (src: string) => src.replace(/\.webp$/, "-thumb.webp");
export const Wallpaper = ({
@@ -391,7 +376,6 @@ export const Wallpaper = ({
/>
);
-/** A label chip in the corner of an output frame, like the editor's own. */
export const FrameChip = ({
children,
className,