diff --git a/apps/landing/CLAUDE.md b/apps/landing/CLAUDE.md index fd9cd58f..ac15532f 100644 --- a/apps/landing/CLAUDE.md +++ b/apps/landing/CLAUDE.md @@ -31,7 +31,7 @@ Every button hovers like Open app (`.hero-btn`, `.btn-swipe`; `.btn-swipe-dark` ## Page loader (11 Nov) -`components/PageLoader.tsx`, in `app/layout.tsx`, so it is in the server HTML and nobody sees an empty page. The Mind mark from the logo builds itself on the page colour (rebuilt from HTML pieces, round divs and two small SVGs, so every animation is transform/opacity the compositor runs: it stays smooth while the main thread loads three.js and images; the progress line is CSS too): the head's bubbles (separate circles) pop in one by one, the sprout grows, the eyes open and blink, then it breathes; a lime line shows progress. It lifts once the page has loaded and, on desktop, the 3D Mind is in (`hn:mind-loaded` from `MindStage.tsx`), after at least 1.3 s and at most 8 s; then it sends `hn:reveal` and the Mind's entrance plays in view (the model stays hidden until then). In-page links (nav, footer, hero and CTA buttons) don't scroll through the page: the loader covers it for a moment, the page jumps to the target and the loader lifts. On desktop, Safety lands on the Tricked cards (section top + 1700 px) and Skills on the Mind Graph title (+ 3150 px), points inside the pinned approvals scroll. Reduced motion: no building or breathing, a short fade. +`components/PageLoader.tsx`, in `app/layout.tsx`, so it is in the server HTML and nobody sees an empty page. The Mind mark from the logo builds itself on the page colour (rebuilt from HTML pieces, round divs and two small SVGs, so every animation is transform/opacity the compositor runs: it stays smooth while the main thread loads three.js and images; the progress line is CSS too): the head's bubbles (separate circles) pop in one by one, the sprout grows, the eyes open and blink, then it breathes; a lime line shows progress. It lifts once the page has loaded and, on desktop, the 3D Mind is in (`hn:mind-loaded` from `MindStage.tsx`), after at least 1.3 s and at most 8 s; then it sends `hn:reveal` and the Mind's entrance plays in view (the model stays hidden until then). In-page links (nav, footer, hero and CTA buttons) don't scroll through the page: the loader covers it for a moment, the page jumps to the target and the loader lifts. The address stays `hellonear.xyz`, with no "#…" (Ancung, 13 Nov). On desktop, Safety lands on the Tricked cards (section top + 1700 px) and Skills on the Mind Graph title (+ 3150 px), points inside the pinned approvals scroll. Reduced motion: no building or breathing, a short fade. ## Nav (built, 7 Nov) @@ -44,8 +44,9 @@ Every button hovers like Open app (`.hero-btn`, `.btn-swipe`; `.btn-swipe-dark` - Layout: copy on the left over the sky, a big 3D Mind on the right peeking over a grass slope and gripping the crest. Parallax 2.5D: sky, cumulus, middle hill and foreground (Mind + slope) move at different speeds with the cursor and on scroll (`useParallax` in `components/hero/Hero.tsx`). - Sky is drawn in code (SVG gradient with colours sampled from the sky art, a warm sun glow top-left, thin cirrus). Sun rays: three wide soft beams from the top-left (`.hero-rays`, screen blend). The front grass is a WebGL canvas (`components/hero/GrassSlope.tsx`) whose blade tips sway, with a gust of light sweeping across. - The Mind is `public/hero/mind.glb` (`components/hero/MindStage.tsx`), rigged in Blender from the Hunyuan model (scripts in the gitignored `design/hellonear-assets/3d-mv/`: `fix_eyes.py`, `fix_blush.py`, `fix_face.py`, `extract_hands.py`, `build_rig_v4.py`, `render_mobile.py`). Bones: body (squash, stretch, slide), head (turned toward the cursor by the page), a two-joint sprout, two beak lips, and hands. Clips: `enter` (plays once on load), `idle` (loop), `hi` (one shot on a click on the head, then back to idle). Eyes, lids and blinks are driven by the page. -- The hands are 2D images (`grip-*`, `wave-left`), relit to match the 3D light (sun from the left), and moved in step with the clips through `onClip`: in `enter` they rise from behind the hill and grab the crest; in `hi` the screen-left hand waves twice. The rig's 3D hands are hidden. -- Phones and tablets (under 1024 px): the copy is centred (title, subtitle, buttons, Works with). The buttons' phone sizes live in `globals.css` (`.hero-m`), not in Tailwind classes: the unlayered `.hero-btn-lg` rules beat Tailwind utilities, which is why the old ones never applied and Meet your Mind's dot touched its edge on iPhones. +- The hands are 2D images (`grip-*`, `wave-left`), relit to match the 3D light (sun from the left), and moved in step with the clips through `onClip`: in `enter` they rise from behind the hill and grab the crest; in `hi` the screen-left hand waves twice. The rig's 3D hands are hidden. On a fresh load the hands used to rise alone and the body came seconds later (#290): the hands are CSS, which keeps moving while the main thread stalls, and the body's first draw compiled its skinned, morphing shaders then. Now `MindStage` compiles them (`compileAsync`) and draws one frame under the page loader before saying it is loaded, and `start` draws the body once before `play("enter")` starts the hands. Measured in headless Chromium (software GL): the first frame after the loader lifted took 2.4 s before, 0.6 s after; the sprout now peeks at about 0.9 s and the body is up at about 1.3 s, as the entrance means. On a real GPU it is not measured yet (likely cause, not proven). +- Under the buttons, "Built with" and the stack's logos (#290: NEAR, NEAR AI, Meteor, Composio, GLM; `STACK` in `Hero.tsx`, files from `public/brands/powered/`; Meteor and Z.ai show their mark beside the name, as in PoweredBy). The apps are listed lower down, in PoweredBy's "Works with". Phones: the label on its own line and the five logos on one line under it (`--stack-k: 0.72`), checked at 360 and 390 px. +- Phones and tablets (under 1024 px): the copy is centred (title, subtitle, buttons, Built with). The buttons' phone sizes live in `globals.css` (`.hero-m`), not in Tailwind classes: the unlayered `.hero-btn-lg` rules beat Tailwind utilities, which is why the old ones never applied and Meet your Mind's dot touched its edge on iPhones. - Phones: no WebGL and no parallax; the Mind is `mobile-back.webp` (rendered from the same rig) with the same 2D hands. - Light on the Mind comes from the left (the sun), with a low fill so the right side reads as shadow. - Reduced motion: no parallax, no wind, no rays animation, no cursor follow. @@ -80,7 +81,9 @@ Footer (`components/Footer.tsx`): a meadow with rolling hills and the Mind sitti 12 Nov, from a friend's test on Windows and a laptop: - No sideways scroll anywhere. With a classic scrollbar (Windows) the page scrolled sideways by 17 px on every desktop width: the page loader locks scrolling (`overflow: hidden` on html), so the scrollbar was gone while GSAP measured the approvals pin, and the pin kept that 17 px wider width. Fixed with `scrollbar-gutter: stable` on html, a `ScrollTrigger.refresh()` when the loader lifts (`hn:reveal`), and `overflow-x: clip` on body as a backstop. Check it with a scrollbar that takes room: Playwright with `ignoreDefaultArgs: ["--hide-scrollbars"]` and a 17 px `::-webkit-scrollbar` (headless hides scrollbars, so a plain run never shows it). -- Scrollbars look like apps/fe's: a thin rounded thumb, no arrows, no track. +- Scrollbars look like apps/fe's: a thin rounded thumb, no arrows, no track. The page's own bar is hidden (`scrollbar-width: none` and `html::-webkit-scrollbar`) and `components/OverlayScrollbar.tsx` draws a thin thumb over the page instead (Ancung, 12 Nov: a native bar's gutter always shows the page's background, a light strip beside the sky). It shows while scrolling or on hover at the edge, fades after 0.9 s, can be dragged, and is dark with a light edge so it reads on the sky and the night. With no bar there is no width to reserve, so `scrollbar-gutter: stable` is gone; checked with a real 17 px scrollbar at 1024, 1512 and 1920 px: no bar width, no sideways scroll. +- A refresh starts at the hero: an inline script in `app/layout.tsx` turns off scroll restoration and drops a section hash before the page paints (Ancung, 12 Nov). Checked: a reload after scrolling and a fresh load of `/#safety` both land at the top. +- Link previews: `app/opengraph-image.jpg` and `twitter-image.jpg` (the hero at 1200 x 630: Ancung's own screenshot of the desktop hero, picked 13 Nov, cropped to 1.9:1 from the top and scaled down; with alt text files), `metadataBase` `https://hellonear.xyz`, and a large-image Twitter card. Rebuild the image if the hero changes. - A light 1 px line across the Mind Graph at the bottom of the approvals scroll on scaled screens (reproduced at 175%, 1279 x 661): the graph's night now starts 2 px above that edge, so the two overlap. - Every stacked layout (under 1024 px) centres its title and subtitle: hero, approvals, CTA (with its buttons) and the footer's logo and line. diff --git a/apps/landing/app/globals.css b/apps/landing/app/globals.css index 2c826bad..60e62dd4 100644 --- a/apps/landing/app/globals.css +++ b/apps/landing/app/globals.css @@ -39,10 +39,15 @@ html { scroll-behavior: smooth; - /* The page loader locks scrolling (overflow: hidden on html). Keep the scrollbar's room while it does, - so the page doesn't shift sideways when it lifts and GSAP measures the real width (with a classic - scrollbar the approvals pin was measured 17 px too wide, and the page scrolled sideways). */ - scrollbar-gutter: stable; + /* The page's own scrollbar is hidden; OverlayScrollbar draws a thin thumb over the page instead + (Ancung, 12 Nov: a native bar's gutter is always the page's background, a light strip beside the + sky). With no bar there is no width to reserve either, so the page never shifts sideways when the + loader lifts and GSAP measures it (before, a classic scrollbar made the approvals pin 17 px too + wide; `scrollbar-gutter: stable` worked around that). */ + scrollbar-width: none; +} +html::-webkit-scrollbar { + display: none; } body { diff --git a/apps/landing/app/layout.tsx b/apps/landing/app/layout.tsx index 3cdd1c37..d1a9c950 100644 --- a/apps/landing/app/layout.tsx +++ b/apps/landing/app/layout.tsx @@ -1,21 +1,37 @@ import type { Metadata } from "next"; import { Geist } from "next/font/google"; import "./globals.css"; +import { OverlayScrollbar } from "@/components/OverlayScrollbar"; import { PageLoader } from "@/components/PageLoader"; const geist = Geist({ subsets: ["latin"], variable: "--font-geist" }); +// The link preview (Ancung, 12 Nov): app/opengraph-image.png and twitter-image.png, the hero at +// 1200 x 630, picked up by Next.js; metadataBase makes their URLs absolute. +const DESCRIPTION = + "An AI helper with its own NEAR wallet. Every payment asks you first, unless you set a rule, and the limits are stored where your Mind can't change them."; + export const metadata: Metadata = { + metadataBase: new URL("https://hellonear.xyz"), title: "HelloNear", - description: - "An AI helper with its own NEAR wallet. Every payment asks you first, unless you set a rule, and the limits are stored where your Mind can't change them.", + description: DESCRIPTION, + openGraph: { type: "website", siteName: "HelloNear", url: "/", title: "HelloNear", description: DESCRIPTION }, + twitter: { card: "summary_large_image", title: "HelloNear", description: DESCRIPTION }, }; +// A refresh starts at the hero (Ancung, 12 Nov): no restored scroll and no section hash. Run before +// the page paints, so it never jumps there first. +const TO_TOP = `history.scrollRestoration="manual";if(location.hash)history.replaceState(null,"",location.pathname+location.search);window.scrollTo(0,0);`; + export default function RootLayout({ children }: { children: React.ReactNode }) { return ( + +