Skip to content

Add Pile Parallax scrolling and 3D Grid effect #367

@georgeolaru

Description

@georgeolaru

Summary

Port the Pile theme's parallax scrolling and 3D grid depth effect to Anima for use with Nova Blocks Cards Collection blocks.

What this does

Parallax Scrolling

  • Vanilla JS + requestAnimationFrame (no GSAP dependency)
  • Each grid item gets translateY offset based on scroll position
  • Travel distance = itemHeight × (parallaxAmount / 100) / 2
  • Items with 3D class (js-3d) travel 2× further for depth illusion
  • Vertical padding added to grid container to accommodate travel

3D Grid

  • Applies js-3d class in a checkerboard or column pattern
  • Configurable target (Individual items vs Columns) and pattern (Odd vs Even)
  • CSS: transform: scale(0.88) on 3D items creates "pushed back" visual depth
  • Uses transform instead of width reduction — no layout shift

CSS fixes

  • overflow: visible on grid layout and items for parallax movement
  • min-width: 0 on grid items — prevents CSS Grid min-width: auto from making columns wider than the container when overflow: visible
  • will-change: transform for GPU compositing

Files

  • src/js/components/pile-parallax/index.js (new) — parallax engine
  • src/js/components/app.js — imports and initializes pile-parallax
  • src/scss/components/_pile-parallax.scss (new) — parallax + 3D CSS
  • src/scss/style.scss — imports the new component
  • dist/js/scripts.js, dist/js/scripts.min.js — compiled output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions