Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions apps/landing/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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.
Expand Down Expand Up @@ -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.

Expand Down
13 changes: 9 additions & 4 deletions apps/landing/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
20 changes: 18 additions & 2 deletions apps/landing/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<html lang="en" className={geist.variable}>
<head>
<script dangerouslySetInnerHTML={{ __html: TO_TOP }} />
</head>
<body>
<PageLoader />
<OverlayScrollbar />
{children}
</body>
</html>
Expand Down
1 change: 1 addition & 0 deletions apps/landing/app/opengraph-image.alt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HelloNear: a Mind peeking over a grassy hill beside the headline "A Mind that can't spend more than you allow."
Binary file added apps/landing/app/opengraph-image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/landing/app/twitter-image.alt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
HelloNear: a Mind peeking over a grassy hill beside the headline "A Mind that can't spend more than you allow."
Binary file added apps/landing/app/twitter-image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
98 changes: 98 additions & 0 deletions apps/landing/components/OverlayScrollbar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
"use client";

import { useEffect, useRef, useState } from "react";

// The page's own scrollbar, floating over the page (Ancung, 12 Nov: the browser's bar on Windows sat
// in a light strip of its own beside the sky; a native bar can't be see-through, since its gutter
// always shows the page's background). The native one is hidden in globals.css; this thin thumb
// shows while scrolling or when the pointer is near the edge, fades out after, and can be dragged.
// A dark thumb with a light edge, so it reads on the sky and on the night sections alike.
const MIN_THUMB = 40;
const HIDE_AFTER_MS = 900;

export function OverlayScrollbar() {
const thumb = useRef<HTMLDivElement>(null);
const [shown, setShown] = useState(false);
const [dragging, setDragging] = useState(false);
const hideTimer = useRef<number | undefined>(undefined);
const drag = useRef<{ startY: number; startScroll: number } | null>(null);

useEffect(() => {
let raf = 0;
const place = () => {
raf = 0;
const el = thumb.current;
if (!el) return;
const doc = document.documentElement;
const view = window.innerHeight;
const total = doc.scrollHeight;
if (total <= view + 1) {
el.style.display = "none";
return;
}
el.style.display = "";
const h = Math.max(MIN_THUMB, (view / total) * view);
const top = (window.scrollY / (total - view)) * (view - h);
el.style.height = `${h}px`;
el.style.transform = `translateY(${top}px)`;
};
const schedule = () => {
if (!raf) raf = requestAnimationFrame(place);
};
const onScroll = () => {
schedule();
setShown(true);
window.clearTimeout(hideTimer.current);
hideTimer.current = window.setTimeout(() => setShown(false), HIDE_AFTER_MS);
};
place();
window.addEventListener("scroll", onScroll, { passive: true });
window.addEventListener("resize", schedule);
// The page grows as sections and images load.
const ro = new ResizeObserver(schedule);
ro.observe(document.body);
return () => {
window.removeEventListener("scroll", onScroll);
window.removeEventListener("resize", schedule);
ro.disconnect();
if (raf) cancelAnimationFrame(raf);
window.clearTimeout(hideTimer.current);
};
}, []);

const onDown = (e: React.PointerEvent<HTMLDivElement>) => {
e.preventDefault();
e.currentTarget.setPointerCapture(e.pointerId);
drag.current = { startY: e.clientY, startScroll: window.scrollY };
setDragging(true);
};
const onMove = (e: React.PointerEvent<HTMLDivElement>) => {
const d = drag.current;
const el = thumb.current;
if (!d || !el) return;
const view = window.innerHeight;
const total = document.documentElement.scrollHeight;
const travel = view - el.offsetHeight;
if (travel <= 0) return;
// Thumb pixels to page pixels; "instant", since the page scrolls smoothly by default.
const top = d.startScroll + ((e.clientY - d.startY) / travel) * (total - view);
window.scrollTo({ top, behavior: "instant" });
};
const onUp = () => {
drag.current = null;
setDragging(false);
};

return (
<div aria-hidden="true" className="overlay-scrollbar group fixed top-0 right-0 z-[60] h-full w-3 pointer-coarse:pointer-events-none">
<div
ref={thumb}
onPointerDown={onDown}
onPointerMove={onMove}
onPointerUp={onUp}
onPointerCancel={onUp}
className={`absolute top-0 right-[3px] w-[6px] rounded-full bg-black/35 shadow-[0_0_0_1px_rgba(255,255,255,0.35)] transition-[opacity,width] duration-300 group-hover:w-[8px] group-hover:opacity-100 ${shown || dragging ? "opacity-100" : "opacity-0"}`}
/>
</div>
);
}
3 changes: 2 additions & 1 deletion apps/landing/components/PageLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ export function PageLoader() {
setTimeout(() => {
const y = targetY(hash) ?? 0;
window.scrollTo({ top: y, behavior: "instant" as ScrollBehavior });
history.replaceState(null, "", hash === "#top" ? location.pathname : hash);
// No "#…" in the address (Ancung, 13 Nov): the link still works, the bar stays hellonear.xyz.
history.replaceState(null, "", location.pathname + location.search);
// let the scroll-driven scenes settle and the images there decode, then lift
setTimeout(() => {
setPhase("out");
Expand Down
Loading
Loading