code-slice-hero

Renders tiled headline surfaces with cell-by-cell 3D flip animations under depth field influence.

77.3k|7.1k|Updated Mar 10, 2026
Ready to run
npx skills add https://github.com/heygen-com/hyperframes --skill code-slice-hero-heygen-com
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: code-slice-hero
Source: https://github.com/heygen-com/hyperframes/tree/main/registry/blocks/code-slice-hero
Command: npx skills add https://github.com/heygen-com/hyperframes --skill code-slice-hero-heygen-com

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gsap, and includes scripts (resource) and assets (resource) components.

What problem does it solve? Creating complex 3D tile animations and multi-headline transitions requires deep expertise in WebGL, GSAP timelines, and projection mathematics. This Skill eliminates that complexity by providing a production-ready composition with 18 configurable variables for motion, cursor interaction, and visual styling. ## Core Features & Use Cases - 3D Tile Flip Animation: Individual square cells respond to a sweeping cursor with lift, tilt, and elastic bounce, flipping to reveal a rear headline. - Instanced WebGL 2 Rendering: One draw call per frame with shared front/rear texture atlases and batched shadow passes for performance. - Configurable Motion Parameters: Control sweep duration, easing strength, flip bounce, cursor radius, tilt depth, and cell size independently. - Use Case: A hero section transitioning between two marketing headlines ("MAKE IT" → "MATTER.") with responsive tile formations and projected shadows. ## Quick Start Set the composition variables headline to "BUILD" and reverseHeadline to "SCALE" to render a custom two-headline animation at 1920×1080 over 8 seconds.

Frequently Asked Questions about code-slice-hero

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does the tile flip animation trigger in code-slice-hero?▼

The animation is driven by a sweeping cursor that travels across the canvas from left to right (or vice versa). When the cursor reaches a tile's X position, that tile begins flipping based on its flipStart time and flipDuration. The flip progress is computed as a closed-form function of the timeline's current time, ensuring seek-safety.

What WebGL features does code-slice-hero use?▼

It uses WebGL 2 with instanced rendering (drawArraysInstanced) to render all tiles in one draw call, shared texture atlases for front and rear headlines, depth testing for proper layering, and a separate shadow pass with projected shadows using spatial bucketing.

Can I customize the headline text and motion timing?▼

Yes. The composition accepts 18 variables including headline, reverseHeadline, sweepDuration, flipDuration, cursorRadius, cellSize, fontSize, and shadow parameters. All are independent and can be set via data-composition-variables or queried at runtime with window.__hyperframes.getVariables().

Why does code-slice-hero require GSAP and does it support other animation libraries?▼

GSAP provides deterministic timeline playback with frame-accurate seek support, which is essential for render pipelines. The composition is tightly coupled to GSAP's timeline object; switching to other libraries would require rewriting the timeline and seek event handling.

How are tile formations and curl effects achieved?▼

Tiles use CSS 3D transforms (rotateX, rotateY, rotateZ) combined with translation and scale. The formation parameter interpolates between a flat grid and a sculpted surface. Curl effects come from seeded noise, radial pull from the cursor's depth field, and damped oscillation applied to tile rotation.

What are the performance constraints of code-slice-hero?▼

The composition renders at 1920×1080 and supports variable cell counts (up to ~289 tiles for 112px cells). Shadow computation uses spatial buckets to cull distant pairs; performance scales with shadow strength and activeCount. WebGL 2 and GSAP 3.14.2 are required runtime dependencies.