3d-transforms
Skill7 starsChanged 10 months agoMITView on GitHub
3D CSS transforms with perspective, z-positioning, and spatial motion. Use when creating card flips, page turns, depth effects, and immersive UI experiences.
In this repository87 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- motion-designSkill
- accessibilitySkill
- android-nativeSkill
- animation-recipesSkill
- anticipationSkill
- arc-motionSkill
- attention-choreographySkill
- attentionSkill
- audio-reactiveSkill
- blurSkill
- brand-animationSkill
- cameraSkill
- characterSkill
- choice-resolutionSkill
- cinematicSkill
- code-generationSkill
- colorSkill
- component-animationsSkill
- compositingSkill
- consequenceSkill
- container-transformSkill
- css-advancedSkill
- data-visualizationSkill
- depthSkill
- distortionSkill
- dramaturgySkill
- durationSkill
- easingSkill
- emotional-journeySkill
- emotion-mappingSkill
- emotion-selectionSkill
- empty-statesSkill
- entrance-patternsSkill
- exaggerationSkill
- exit-patternsSkill
- exportSkill
- figma-integrationSkill
- follow-throughSkill
- frame-timingSkill
- gesture-motionSkill
- glow-shadowSkill
- intentSkill
- ios-nativeSkill
- loading-statesSkill
- loopingSkill
- lottieSkill
- masksSkill
- microstateSkill
- morphingSkill
- motion-auditSkill
- motion-blurSkill
- motion-principlesSkill
- motion-specsSkill
- narrative-arcSkill
- notificationsSkill
- onboardingSkill
- opacitySkill
- orchestratorSkill
- particlesSkill
- The first 60 shown.
The file
Files
3D Transforms & Depth
Creating spatial depth through CSS 3D transforms. Adds dimensionality and visual hierarchy to UI elements.
Core Concepts
Perspective
Distance from viewer to z-plane. Lower values = more dramatic 3D effect.
.container {
perspective: 800px; /* Viewer 800px away */
perspective-origin: 50% 50%; /* Looking at center */
}Transform Style
Whether children exist in 3D space or flatten.
.parent {
transform-style: preserve-3d; /* Children in 3D space */
}Backface Visibility
Show or hide element when rotated away.
.card-face {
backface-visibility: hidden; /* Hide when facing away */
}Token Reference
Load from: tokens/depth.tokens.json
Perspective Values
| Token | Value | Effect |
shallow | 1200px | Subtle depth, safe |
medium | 800px | Standard 3D |
deep | 500px | Dramatic perspective |
extreme | 300px | Maximum distortion |
Z-Offset Values
| Token | Value | Use Case |
subtle | 10px | Hover lifts |
small | 20px | Card hovers |
medium | 40px | Modals, overlays |
large | 80px | Hero elements |
Common Patterns
Card Flip
.flip-card {
perspective: 800px;
width: 200px;
height: 300px;
}
.flip-card-inner {
position: relative;
width: 100%;
height: 100%;
transition: transform 600ms ease-in-out;
transform-style: preserve-3d;
}
.flip-card:hover .flip-card-inner {
transform: rotateY(180deg);
}
.flip-card-front,
.flip-card-back {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
}
.flip-card-back {
transform: rotateY(180deg);
}3D Hover Tilt
.tilt-card {
perspective: 1000px;
transform-style: preserve-3d;
}
.tilt-card:hover {
transform: rotateX(-10deg) rotateY(10deg) translateZ(20px);
transition: transform 300ms ease-out;
}Depth Layers
.layer-background { transform: translateZ(-100px) scale(1.1); }
.layer-base { transform: translateZ(0); }
.layer-elevated { transform: translateZ(30px); }
.layer-floating { transform: translateZ(60px) scale(1.02); }
.layer-overlay { transform: translateZ(100px) scale(1.05); }Performance Considerations
/* Enable GPU acceleration */
.gpu-accelerated {
transform: translateZ(0);
will-change: transform;
}
/* Avoid layout thrashing */
.avoid-reflow {
transform: translate3d(0, 0, 0); /* Use 3D transform instead of top/left */
}Accessibility
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
// Reduce 3D effects for accessibility
const perspective = prefersReducedMotion ? 'none' : '800px';
const rotation = prefersReducedMotion ? 0 : calculatedRotation;
// Use opacity transitions instead of 3D for reduced motion
const transition = prefersReducedMotion
? { opacity: [0, 1] }
: { rotateY: [-90, 0], opacity: [0, 1] };Common Mistakes
- No perspective container - Children need parent with perspective
- Wrong perspective value - Too low = extreme distortion
- Forgetting backface-visibility - Causes bleed-through on flips
- Mixing 2D and 3D - Can cause unexpected flattening
- Performance issues - Too many 3D elements hurts FPS
Related Skills
entrance-patterns/- 3D entrance animationsexit-patterns/- 3D exit animationseasing/- Easing curves for 3D motionaccessibility/- Reduced motion alternativesremotion/- 3D transforms in video
See references/ for detailed implementation guides.
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
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.

