agentleFS
soilmasssoilmass/motion-design-agent/skills/depth/SKILL.md

depth

Skill7 starsChanged 10 months agoMITView on GitHub

Depth and 3D space animations including z-axis translation, perspective, parallax layers, and depth-of-field effects. Use when creating layered interfaces, 3D card effects, or spatial UI hierarchies. Provides tokens for depth values, perspective, and layer ordering.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No additional references needed for this skill

    line 226

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Depth

3D space and depth animations for layered interfaces.

Standards Reference

StandardDocumentation
W3C DTCGdesigntokens.org
CSS Transform 3Ddeveloper.mozilla.org/CSS/transform
CSS perspectivedeveloper.mozilla.org/CSS/perspective

Quick Reference

Load from: tokens/depth.tokens.json

Z-Translation Values

TokenValueUse
z.near50pxSlightly forward
z.medium100pxModerate depth
z.far200pxDistant layer
z.background-100pxBehind plane

Perspective Values

TokenValueUse
perspective.subtle1000pxSubtle 3D
perspective.medium600pxModerate distortion
perspective.dramatic300pxStrong 3D effect

Layer Depth

TokenValueUse
layer.background-3Furthest back
layer.mid0Base layer
layer.foreground3Front elements

Selection Guide

What depth effect?
│
├── Z-AXIS MOVEMENT → translateZ
│   ├── Hover lift → z.near (50px)
│   ├── Card pop → z.medium (100px)
│   └── Full emerge → z.far (200px)
│
├── PERSPECTIVE CONTAINER
│   ├── Subtle 3D → perspective.subtle (1000px)
│   ├── Medium → perspective.medium (600px)
│   └── Dramatic → perspective.dramatic (300px)
│
├── PARALLAX LAYERS
│   ├── Background → layer.background (slowest)
│   ├── Mid → layer.mid (base speed)
│   └── Foreground → layer.foreground (fastest)
│
└── DEPTH OF FIELD
    ├── Focus → blur(0)
    ├── Near blur → blur(2px)
    └── Far blur → blur(5px)

Patterns

Z-Axis Hover

CSS:

.depth-container {
  perspective: 600px; /* {motion.depth.perspective.medium} */
}

.depth-card {
  transition: transform 300ms ease-out;
  transform-style: preserve-3d;
}

.depth-card:hover {
  transform: translateZ(100px); /* {motion.depth.z.medium} */
}

Framer Motion:

<motion.div
  style={{ perspective: 600 }}
>
  <motion.div
    whileHover={{ z: 100 }} // {motion.depth.z.medium}
    transition={{ duration: 0.3 }}
    style={{ transformStyle: 'preserve-3d' }}
  />
</motion.div>

Parallax Layers

CSS + JavaScript:

const layers = document.querySelectorAll('.parallax-layer');

window.addEventListener('scroll', () => {
  const scrollY = window.scrollY;

  layers.forEach((layer) => {
    const depth = parseFloat(layer.dataset.depth); // -3 to 3
    const movement = scrollY * (depth * 0.1);
    layer.style.transform = `translateY(${movement}px)`;
  });
});

Framer Motion:

import { useScroll, useTransform, motion } from 'framer-motion';

const ParallaxLayer = ({ depth, children }) => {
  const { scrollYProgress } = useScroll();

  // depth: -3 (background) to 3 (foreground)
  const y = useTransform(
    scrollYProgress,
    [0, 1],
    [0, depth * 100]
  );

  return <motion.div style={{ y }}>{children}</motion.div>;
};

3D Card Flip

CSS:

.flip-container {
  perspective: 600px;
}

.flip-card {
  transform-style: preserve-3d;
  transition: transform 600ms ease-out;
}

.flip-card.flipped {
  transform: rotateY(180deg);
}

.flip-front,
.flip-back {
  backface-visibility: hidden;
}

.flip-back {
  transform: rotateY(180deg);
}

Depth of Field

CSS:

.dof-container {
  perspective: 600px;
}

.layer-back {
  transform: translateZ(-100px); /* {motion.depth.z.background} */
  filter: blur(5px); /* Out of focus */
}

.layer-focus {
  transform: translateZ(0);
  filter: blur(0); /* In focus */
}

.layer-front {
  transform: translateZ(50px); /* {motion.depth.z.near} */
  filter: blur(2px); /* Slight blur */
}

Reduced Motion

For prefers-reduced-motion: reduce:

Full MotionReduced Alternative
Z-axis animationOpacity or scale change
Parallax scrollFixed layers
3D perspectiveFlat 2D fallback

Implementation:

@media (prefers-reduced-motion: reduce) {
  .depth-card:hover {
    transform: none;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  }

  .parallax-layer {
    transform: none !important;
  }
}

Cross-References

  • See 3d-transforms/ for full 3D rotations
  • See blur/ for depth-of-field effects
  • See camera/ for perspective movements
  • See parallax/ in scrollytelling skill
  • See compositing/ for layer blending

References

  • No additional references needed for this skill

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.