3d-animations
БесплатноБез исполняемых скриптовНе проверенExpert knowledge for CSS/JS-based 3D animations - perspective transforms, depth effects, card flips, cube rotations, and parallax depth without WebGL.
от TheLobbi★ 22 звезды на GitHubОб этом скилле
3D Animations Skill
Expert knowledge for CSS/JS-based 3D animations - perspective transforms, depth effects, card flips, cube rotations, and parallax depth without WebGL.
When to Use
Activate this skill when:
- User wants 3D flip cards
- Creating perspective-based animations
- Building parallax depth effects
- Need rotating cubes or 3D objects
- Creating tilt-on-hover effects
- Building 3D carousels
File Patterns
**/*.tsxwith 3D transform components**/components/*3D*.tsx**/components/*Flip*.tsx**/components/*Tilt*.tsx
Core Concepts
Perspective
/* Parent container needs perspective */
.perspective-container {
perspective: 1000px;
perspective-origin: center;
}
/* Child can now use 3D transforms */
.card-3d {
transform-style: preserve-3d;
transform: rotateY(45deg);
}
3D Animation Types
1. 3D Flip Cards
Basic Flip Card
import { motion } from 'framer-motion';
import { useState } from 'react';
interface FlipCardProps {
front: React.ReactNode;
back: React.ReactNode;
}
export function FlipCard({ front, back }: FlipCardProps) {
const [isFlipped, setIsFlipped] = useState(false);
return (
<div
className="relative w-64 h-80 cursor-pointer"
style={{ perspective: '1000px' }}
onClick={() => setIsFlipped(!isFlipped)}
>
<motion.div
className="w-full h-full relative"
style={{ transformStyle: 'preserve-3d' }}
animate={{ rotateY: isFlipped ? 180 : 0 }}
transition={{ duration: 0.6, type: 'spring', stiffness: 100 }}
>
{/* Front */}
<div
className="absolute inset-0 bg-gradient-to-br from-purple-500 to-pink-500 rounded-xl p-6 flex items-center justify-center"
style={{ backfaceVisibility: 'hidden' }}
>
{front}
</div>
{/* Back */}
<div
className="absolute inset-0 bg-gradient-to-br from-blue-500 to-cyan-500 rounded-xl p-6 flex items-center justify-center"
style={{ backfaceVisibility: 'hidden', transform: 'rotateY(180deg)' }}
>
{back}
</div>
</motion.div>
</div>
);
}
Flip Card on Hover
export function HoverFlipCard({ front, back }: FlipCardProps) {
return (
<motion.div
className="relative w-64 h-80 cursor-pointer group"
style={{ perspective: '1000px' }}
whileHover="flipped"
initial="initial"
>
<motion.div
className="w-full h-full relative"
style={{ transformStyle: 'preserve-3d' }}
variants={{
initial: { rotateY: 0 },
flipped: { rotateY: 180 },
}}
transition={{ duration: 0.6 }}
>
<div
className="absolute inset-0 bg-white rounded-xl shadow-xl p-6"
style={{ backfaceVisibility: 'hidden' }}
>
{front}
</div>
<div
className="absolute inset-0 bg-slate-900 text-white rounded-xl shadow-xl p-6"
style={{ backfaceVisibility: 'hidden', transform: 'rotateY(180deg)' }}
>
{back}
</div>
</motion.div>
</motion.div>
);
}
2. Tilt Effects
Tilt on Hover
import { motion, useMotionValue, useSpring, useTransform } from 'framer-motion';
export function TiltCard({ children }: { children: React.ReactNode }) {
const x = useMotionValue(0);
const y = useMotionValue(0);
const rotateX = useSpring(useTransform(y, [-0.5, 0.5], [15, -15]), {
stiffness: 300,
damping: 30,
});
const rotateY = useSpring(useTransform(x, [-0.5, 0.5], [-15, 15]), {
stiffness: 300,
damping: 30,
});
const handleMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {
const rect = e.currentTarget.getBoundingClientRect();
const centerX = rect.left + rect.width / 2;
const centerY = rect.top + rect.height / 2;
x.set((e.clientX - centerX) / rect.width);
y.set((e.clientY - centerY) / rect.height);
};
const handleMouseLeave = () => {
x.set(0);
y.set(0);
};
return (
<motion.div
className="relative bg-white rounded-xl shadow-xl p-6"
style={{
perspective: '1000px',
rotateX,
rotateY,
transformStyle: 'preserve-3d',
}}
onMouseMove={handleMouseMove}
onMouseLeave={handleMouseLeave}
>
<div style={{ transform: 'translateZ(50px)' }}>{children}</div>
</motion.div>
);
}
Tilt with Shine Effect
export function ShinyTiltCard({ children }: { children: React.ReactNode }) {
const x = useMotionValue(0);
const y = useMotionValue(0);
const rotateX = useSpring(useTransform(y, [-0.5, 0.5], [10, -10]));
const rotateY = useSpring(useTransform(x, [-0.5, 0.5], [-10, 10]));
const shineX = useTransform(x, [-0.5, 0.5], ['0%', '100%']);
const shineY = useTransform(y, [-0.5, 0.5], ['0%', '100%']);
const handleMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {
const rect = e.currentTarget.ge
Установить 3d-animations в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл 3d-animations?
Expert knowledge for CSS/JS-based 3D animations - perspective transforms, depth effects, card flips, cube rotations, and parallax depth without WebGL.
Как установить скилл 3d-animations?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл 3d-animations запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic