Build log · Templates

Inside MANJARI: a three.js product landing page with no video at all

By Md Mahafuj Alam · Updated

MANJARI is a Next.js landing page for a premium juice brand whose four-chapter hero is rendered live in three.js from AI-generated images, with no video files. It uses depth maps for parallax, a procedural 3D mango that splits and bursts into GPU droplets, and a full-screen juice shader that drains to reveal the bottle. This tour explains each technique, how the page stays smooth, and what you can change.

Why a product page without video

Most cinematic scroll sites scrub a long image sequence cut from generated video. MANJARI takes the other route. Every motion is rendered live in three.js from AI-generated images made with GPT Image 2. There are no video files at all.

The trade-off is clear. An image sequence gives photoreal motion but costs hundreds of downloaded frames. A real-time scene downloads a handful of images and textures, then draws every frame on the GPU, so it can react to the pointer, rewind exactly and run at the display's own frame rate. The cost moves from bandwidth to engineering: depth, lighting and physics have to be built. The comparison of image sequences, video and three.js covers when each wins. For a single hero product, such as a bottle of mango juice, real-time is a strong fit, which is why MANJARI sits with the food and beverage templates.

The four chapters, scene by scene

  1. Into the orchard. The camera flies into a depth-parallax orchard and leaves sweep past the lens.
  2. Photo becomes object. A photographed mango swaps into a real 3D mango.
  3. Fall, split, burst. The mango falls, splits in two and bursts into GPU juice droplets.
  4. Flood and reveal. Juice floods the screen, then drains away to reveal the photoreal bottle on a stone plinth, with a light sweep across the glass.

The hero scenes react to the pointer with parallax, and everything is driven by scroll progress, so scrolling back rewinds the story exactly. That second point is a design rule, not a feature: no animation runs on a timer, so nothing can drift out of step with the scrollbar.

Depth parallax from a flat image

The orchard backdrops are flat AI images, given depth with maps made by Depth Anything V2, a model for monocular depth estimation: it takes one image and returns a depth value for every pixel.

The general technique is simple. A shader reads the colour image and its depth map. When the camera or pointer moves, each pixel's texture coordinate is shifted by an amount scaled by its depth: near pixels move more than far ones. The eye reads that difference as depth, even though the scene is one picture. It works best for small movements; push it too far and the stretched edges around near objects become visible.

Depth-displaced lookup (illustrative)glsl
uniform sampler2D uColor;
uniform sampler2D uDepth;   // white = near, black = far
uniform vec2 uOffset;       // camera or pointer offset, small values
varying vec2 vUv;

void main() {
  float depth = texture2D(uDepth, vUv).r;
  vec2 uv = vUv + uOffset * depth;
  gl_FragColor = texture2D(uColor, uv);
}

From photographed mango to 3D mango

The centrepiece is a handover. A photographed mango swaps into a procedural 3D mango whose skin and flesh textures are baked from AI images. Procedural means the shape is generated in code rather than loaded from a model file.

How a clean photo-to-mesh swap generally works

  • The 3D mango is placed and lit so that, at one scroll position, its silhouette matches the photograph on screen.
  • At that position the photo fades out and the mesh fades in. Because they overlap, the eye sees one object that has started to move.
  • From then on, the mesh can rotate and fall, which a photo cannot do.

Splitting and bursting

Splitting a fruit in two is easier with procedural geometry: the two halves can be generated as separate meshes with a cut face that shows the flesh texture. The burst uses GPU droplets. In a typical GPU particle system, every droplet's starting position and velocity is stored once in a buffer, and the vertex shader computes where it is now from a progress value. The CPU sends one number per frame instead of moving thousands of objects, and because position is a pure function of progress, the burst rewinds exactly when the visitor scrolls back.

The flood

The full-screen juice flood is a shader that drains to reveal the product. A common way to build an effect like this is a quad that covers the viewport, with a rising fill line, rippled with a little noise, deciding which pixels show juice. Reverse the fill and the juice drains, uncovering what sits behind it.

Keeping it smooth: the performance decisions

DecisionWhat it prevents
Small images load first; full-resolution photos stream in afterwardsA blank hero while large files download
Shaders compiled before the loader fadesA stall the first time a new material appears mid-scroll
Section canvases render only while on screenGPU work for scenes nobody can see
Capped pixel ratioDrawing up to nine times the pixels on a phone with a device pixel ratio of 3
Fewer particles and leaves on lower-power devicesDropped frames on weaker GPUs
Frame-rate-independent smoothingMotion that runs faster on 120 Hz screens than on 60 Hz ones

Shader compilation is the one people miss. three.js compiles a material's shader program the first time it is drawn, which can freeze a frame. The WebGLRenderer documentation describes compile() as useful to precompile shaders before the first rendering, and recommends compileAsync() where possible.

Frame-rate-independent smoothing

A common way to smooth a value is to move it a fixed share of the way to its target each frame. That share is per frame, so the motion is twice as fast at 120 frames per second as at 60. The usual fix is to make the share depend on elapsed time:

damp.tsts
/** Move current towards target. lambda sets the speed; dt is seconds since the last frame. */
export function damp(current: number, target: number, lambda: number, dt: number): number {
  return current + (target - current) * (1 - Math.exp(-lambda * dt));
}

With this, the same lambda gives the same feel on any display. Smooth scrolling itself comes from Lenis. The three.js scroll scene guide shows the render loop these pieces plug into.

For visitors who ask for reduced motion, or whose browser has no WebGL, MANJARI falls back to a static finale frame.

Below the hero

  • A pinned bottle tour, "Why Manjari", with gold stat callouts.
  • A three-step "How it's made" section with mango-shaped and bottle-shaped reveals.
  • Spring-tilt pricing cards with a featured plan.
  • An accessible FAQ accordion.
  • A CTA bottle on a spring rig with floating leaves and a splash.
  • A footer with a newsletter sign-up.

The stack is Next.js 15, React 19, TypeScript and three.js, with self-hosted fonts (Fraunces, Manrope and JetBrains Mono), deployable as a static export.

What you can change

  • Copy, prices and FAQ live in one config file, and the hero story and its timing in another.
  • Colours and type sizes are set as tokens at the top of the stylesheet.
  • Product imagery. Every image prompt and the asset pipeline are included, so you can swap in your own product. The GPT Image product shot prompts show the style of prompt involved.

For the full workflow behind pages like this, see the guide to building a 3D website with Claude.

FAQ

Questions, answered.

The questions people ask most about this topic.

01Does MANJARI use any video?

No. Every motion is rendered live in three.js from AI-generated images made with GPT Image 2. There are no video files.

02How does a flat image get depth?

The backdrops use depth maps from Depth Anything V2. A shader shifts each pixel by an amount scaled by its depth when the camera or pointer moves, so near areas move more than far ones and the eye reads depth.

03What happens on devices without WebGL?

MANJARI shows a static finale frame, the same fallback it uses for visitors who ask for reduced motion.

04Can I use it for a different product?

Yes. All copy, pricing and FAQ sit in one config file and the hero story in another, colours are tokens at the top of the stylesheet, and every image prompt plus the asset pipeline are included to swap in your own product.

05Which Next.js version does it use?

Next.js 15 with React 19 and TypeScript, built as a static export.