[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6NT7YX7BQMWG98YXB05C4SP":3,"skill-same:01M6NT7YX7BQMWG98YXB05C4SP":61},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":34,"linkOnly":35,"markdownContent":36,"markdownBody":37,"frontMatter":38,"refName":39,"commitSha":40,"skillDirectory":41,"forksCount":14,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":44,"ownerDescription":45,"updatedAt":46,"install":47,"resources":60},"01M6NT7YX7BQMWG98YXB05C4SP","animation-patterns",null,"Framer Motion patterns, page transitions, skeleton loading, scroll-linked animations, and gesture-based interactions for React.","rubicanjr\u002FFinCognis","rubicanjr","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F234912519?v=4","01M6NT156NND8J474G34SB3923","Rubi","01M6NT15B70RWXE1N3YV0BZY8A",0,"MIT","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fanimation-patterns\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33],"Animation","patterns","animation patterns","react","page","motion","framer motion","transitions","scroll","loading","for","skeleton","framer","motion patterns","animations","2026-11-10 10:12:30",false,"---\nname: animation-patterns\ndescription: Framer Motion patterns, page transitions, skeleton loading, scroll-linked animations, and gesture-based interactions for React.\n---\n\n# Animation Patterns\n\nFramer Motion patterns for production-quality React animations.\n\n## Framer Motion Basics (motion components, variants)\n\n```typescript\n\u002F\u002F Install: npm install framer-motion\n\nimport { motion } from 'framer-motion'\n\n\u002F\u002F Basic motion component\n\u003Cmotion.div\n  initial={{ opacity: 0, y: 20 }}\n  animate={{ opacity: 1, y: 0 }}\n  transition={{ duration: 0.3, ease: 'easeOut' }}\n\u002F>\n\n\u002F\u002F Variants — define states, animate by name\nconst cardVariants = {\n  hidden: { opacity: 0, y: 20, scale: 0.98 },\n  visible: {\n    opacity: 1,\n    y: 0,\n    scale: 1,\n    transition: { duration: 0.25, ease: [0.16, 1, 0.3, 1] },\n  },\n  hover: {\n    y: -4,\n    boxShadow: '0 12px 24px -4px rgb(0 0 0 \u002F 0.15)',\n    transition: { duration: 0.2 },\n  },\n}\n\nfunction Card({ children }: { children: React.ReactNode }) {\n  return (\n    \u003Cmotion.div\n      variants={cardVariants}\n      initial=\"hidden\"\n      animate=\"visible\"\n      whileHover=\"hover\"\n      className=\"rounded-lg border bg-white p-4\"\n    >\n      {children}\n    \u003C\u002Fmotion.div>\n  )\n}\n```\n\n## Page Transitions with AnimatePresence\n\n```typescript\nimport { AnimatePresence, motion } from 'framer-motion'\nimport { usePathname } from 'next\u002Fnavigation'\n\nconst pageVariants = {\n  initial: { opacity: 0, x: -8 },\n  enter:   { opacity: 1, x: 0, transition: { duration: 0.2, ease: 'easeOut' } },\n  exit:    { opacity: 0, x: 8,  transition: { duration: 0.15, ease: 'easeIn' } },\n}\n\n\u002F\u002F app\u002Flayout.tsx (Next.js App Router)\nexport default function RootLayout({ children }: { children: React.ReactNode }) {\n  const pathname = usePathname()\n\n  return (\n    \u003Chtml>\n      \u003Cbody>\n        \u003CAnimatePresence mode=\"wait\">\n          \u003Cmotion.main\n            key={pathname}\n            variants={pageVariants}\n            initial=\"initial\"\n            animate=\"enter\"\n            exit=\"exit\"\n          >\n            {children}\n          \u003C\u002Fmotion.main>\n        \u003C\u002FAnimatePresence>\n      \u003C\u002Fbody>\n    \u003C\u002Fhtml>\n  )\n}\n\n\u002F\u002F Modal transitions — mount\u002Funmount\nfunction Modal({ isOpen, onClose, children }: ModalProps) {\n  return (\n    \u003CAnimatePresence>\n      {isOpen && (\n        \u003C>\n          \u003Cmotion.div\n            key=\"overlay\"\n            className=\"fixed inset-0 bg-black\u002F40\"\n            initial={{ opacity: 0 }}\n            animate={{ opacity: 1 }}\n            exit={{ opacity: 0 }}\n            onClick={onClose}\n          \u002F>\n          \u003Cmotion.div\n            key=\"modal\"\n            className=\"fixed inset-x-4 top-[10%] mx-auto max-w-lg rounded-xl bg-white p-6 shadow-xl\"\n            initial={{ opacity: 0, scale: 0.96, y: 16 }}\n            animate={{ opacity: 1, scale: 1, y: 0 }}\n            exit={{ opacity: 0, scale: 0.96, y: 8 }}\n            transition={{ duration: 0.2, ease: [0.16, 1, 0.3, 1] }}\n          >\n            {children}\n          \u003C\u002Fmotion.div>\n        \u003C\u002F>\n      )}\n    \u003C\u002FAnimatePresence>\n  )\n}\n```\n\n## Layout Animations (Shared Layout, Layout ID)\n\n```typescript\nimport { motion, LayoutGroup } from 'framer-motion'\nimport { useState } from 'react'\n\n\u002F\u002F Tabs with animated indicator\nfunction AnimatedTabs({ tabs }: { tabs: string[] }) {\n  const [active, setActive] = useState(tabs[0])\n\n  return (\n    \u003CLayoutGroup>\n      \u003Cdiv className=\"flex gap-1 rounded-lg bg-gray-100 p-1\">\n        {tabs.map(tab => (\n          \u003Cbutton\n            key={tab}\n            onClick={() => setActive(tab)}\n            className=\"relative px-4 py-2 text-sm font-medium\"\n          >\n            {active === tab && (\n              \u003Cmotion.div\n                layoutId=\"tab-indicator\"      \u002F\u002F shared across tabs\n                className=\"absolute inset-0 rounded-md bg-white shadow-sm\"\n                transition={{ type: 'spring', stiffness: 400, damping: 30 }}\n              \u002F>\n            )}\n            \u003Cspan className=\"relative z-10\">{tab}\u003C\u002Fspan>\n          \u003C\u002Fbutton>\n        ))}\n      \u003C\u002Fdiv>\n    \u003C\u002FLayoutGroup>\n  )\n}\n\n\u002F\u002F Expandable card with layout animation\nfunction ExpandableCard({ title, body }: { title: string; body: string }) {\n  const [expanded, setExpanded] = useState(false)\n\n  return (\n    \u003Cmotion.div\n      layout                                \u002F\u002F animate height changes\n      className=\"rounded-lg border bg-white p-4 cursor-pointer\"\n      onClick={() => setExpanded(e => !e)}\n    >\n      \u003Cmotion.h3 layout=\"position\" className=\"font-semibold\">{title}\u003C\u002Fmotion.h3>\n      \u003CAnimatePresence>\n        {expanded && (\n          \u003Cmotion.p\n            initial={{ opacity: 0 }}\n            animate={{ opacity: 1 }}\n            exit={{ opacity: 0 }}\n            className=\"mt-2 text-gray-600 text-sm\"\n          >\n            {body}\n          \u003C\u002Fmotion.p>\n        )}\n      \u003C\u002FAnimatePresence>\n    \u003C\u002Fmotion.div>\n  )\n}\n```\n\n## Skeleton Loading Components\n\n```typescript\n\u002F\u002F Base skeleton primitive\nfunction Skeleton({ className }: { className?: string }) {\n  return (\n    \u003Cdiv\n      className={cn('animate-pulse rounded bg-gray-200 dark:bg-gray-700', className)}\n      aria-hidden=\"true\"\n    \u002F>\n  )\n}\n\n\u002F\u002F Shimmer variant (more polished)\nfunction SkeletonShimmer({ className }: { className?: string }) {\n  return (\n    \u003Cdiv className={cn('relative overflow-hidden rounded bg-gray-200', className)}>\n      \u003Cmotion.div\n        className=\"absolute inset-0 bg-gradient-to-r from-transparent via-white\u002F60 to-transparent\"\n        animate={{ x: ['-100%', '100%'] }}\n        transition={{ repeat: Infinity, duration: 1.2, ease: 'linear' }}\n      \u002F>\n    \u003C\u002Fdiv>\n  )\n}\n\n\u002F\u002F Card skeleton\nfunction CardSkeleton() {\n  return (\n    \u003Cdiv className=\"rounded-lg border bg-white p-4 space-y-3\" aria-busy=\"true\" aria-label=\"Loading\">\n      \u003Cdiv className=\"flex items-center gap-3\">\n        \u003CSkeleton className=\"size-10 rounded-full\" \u002F>\n        \u003Cdiv className=\"flex-1 space-y-2\">\n          \u003CSkeleton className=\"h-4 w-1\u002F2\" \u002F>\n          \u003CSkeleton className=\"h-3 w-1\u002F3\" \u002F>\n        \u003C\u002Fdiv>\n      \u003C\u002Fdiv>\n      \u003CSkeleton className=\"h-3 w-full\" \u002F>\n      \u003CSkeleton className=\"h-3 w-4\u002F5\" \u002F>\n      \u003CSkeleton className=\"h-8 w-24 rounded-md\" \u002F>\n    \u003C\u002Fdiv>\n  )\n}\n```\n\n## Scroll-Linked Animations\n\n```typescript\nimport { useScroll, useTransform, motion } from 'framer-motion'\nimport { useRef } from 'react'\n\n\u002F\u002F Parallax hero\nfunction ParallaxHero() {\n  const ref = useRef\u003CHTMLDivElement>(null)\n  const { scrollYProgress } = useScroll({ target: ref, offset: ['start start', 'end start'] })\n\n  const y = useTransform(scrollYProgress, [0, 1], ['0%', '50%'])\n  const opacity = useTransform(scrollYProgress, [0, 0.5], [1, 0])\n\n  return (\n    \u003Cdiv ref={ref} className=\"relative h-screen overflow-hidden\">\n      \u003Cmotion.div style={{ y, opacity }} className=\"absolute inset-0\">\n        \u003Cimg src=\"\u002Fhero.jpg\" alt=\"\" className=\"w-full h-full object-cover\" \u002F>\n      \u003C\u002Fmotion.div>\n      \u003Cdiv className=\"relative z-10 flex h-full items-center justify-center\">\n        \u003Ch1 className=\"text-6xl font-bold text-white\">Hero Title\u003C\u002Fh1>\n      \u003C\u002Fdiv>\n    \u003C\u002Fdiv>\n  )\n}\n\n\u002F\u002F Fade-in on scroll (section reveal)\nfunction FadeInSection({ children }: { children: React.ReactNode }) {\n  const ref = useRef\u003CHTMLDivElement>(null)\n  const { scrollYProgress } = useScroll({ target: ref, offset: ['start 0.9', 'start 0.6'] })\n  const opacity = useTransform(scrollYProgress, [0, 1], [0, 1])\n  const y = useTransform(scrollYProgress, [0, 1], [24, 0])\n\n  return (\n    \u003Cmotion.div ref={ref} style={{ opacity, y }}>\n      {children}\n    \u003C\u002Fmotion.div>\n  )\n}\n```\n\n## Staggered Children Animations\n\n```typescript\nconst listVariants = {\n  hidden: {},\n  visible: {\n    transition: {\n      staggerChildren: 0.06,     \u002F\u002F 60ms between each child\n      delayChildren: 0.1,\n    },\n  },\n}\n\nconst itemVariants = {\n  hidden:  { opacity: 0, x: -12 },\n  visible: { opacity: 1, x: 0, transition: { duration: 0.25, ease: 'easeOut' } },\n}\n\nfunction AnimatedList({ items }: { items: string[] }) {\n  return (\n    \u003Cmotion.ul variants={listVariants} initial=\"hidden\" animate=\"visible\" className=\"space-y-2\">\n      {items.map(item => (\n        \u003Cmotion.li key={item} variants={itemVariants} className=\"rounded border p-3\">\n          {item}\n        \u003C\u002Fmotion.li>\n      ))}\n    \u003C\u002Fmotion.ul>\n  )\n}\n```\n\n## Gesture Interactions (Drag, Tap, Hover)\n\n```typescript\nimport { motion, useDragControls } from 'framer-motion'\n\n\u002F\u002F Draggable card\nfunction DraggableCard() {\n  return (\n    \u003Cmotion.div\n      drag\n      dragConstraints={{ left: -100, right: 100, top: -50, bottom: 50 }}\n      dragElastic={0.1}\n      whileDrag={{ scale: 1.05, rotate: 2, cursor: 'grabbing' }}\n      className=\"cursor-grab rounded-lg bg-white p-4 shadow\"\n    >\n      Drag me\n    \u003C\u002Fmotion.div>\n  )\n}\n\n\u002F\u002F Bottom sheet (drag to dismiss)\nfunction BottomSheet({ onClose }: { onClose: () => void }) {\n  return (\n    \u003Cmotion.div\n      drag=\"y\"\n      dragConstraints={{ top: 0 }}\n      onDragEnd={(_, info) => {\n        if (info.offset.y > 100) onClose()\n      }}\n      initial={{ y: '100%' }}\n      animate={{ y: 0 }}\n      exit={{ y: '100%' }}\n      transition={{ type: 'spring', damping: 30, stiffness: 300 }}\n      className=\"fixed bottom-0 inset-x-0 rounded-t-2xl bg-white p-6 shadow-lg\"\n    >\n      \u003Cdiv className=\"mx-auto mb-4 h-1 w-12 rounded-full bg-gray-300\" \u002F>\n      {\u002F* content *\u002F}\n    \u003C\u002Fmotion.div>\n  )\n}\n\n\u002F\u002F Press \u002F tap feedback\nfunction PressButton({ children, onClick }: ButtonProps) {\n  return (\n    \u003Cmotion.button\n      whileTap={{ scale: 0.97 }}\n      whileHover={{ scale: 1.02 }}\n      transition={{ type: 'spring', stiffness: 400, damping: 17 }}\n      onClick={onClick}\n      className=\"btn btn-primary\"\n    >\n      {children}\n    \u003C\u002Fmotion.button>\n  )\n}\n```\n\n## Reduced Motion Respect\n\n```typescript\nimport { useReducedMotion, motion } from 'framer-motion'\n\n\u002F\u002F Hook-based — apply conditionally\nfunction FadeIn({ children }: { children: React.ReactNode }) {\n  const prefersReducedMotion = useReducedMotion()\n\n  return (\n    \u003Cmotion.div\n      initial={{ opacity: prefersReducedMotion ? 1 : 0 }}\n      animate={{ opacity: 1 }}\n      transition={prefersReducedMotion ? { duration: 0 } : { duration: 0.3 }}\n    >\n      {children}\n    \u003C\u002Fmotion.div>\n  )\n}\n\n\u002F\u002F Global — wrap app with MotionConfig\nimport { MotionConfig } from 'framer-motion'\n\nexport function Providers({ children }: { children: React.ReactNode }) {\n  const prefersReducedMotion = useReducedMotion()\n  return (\n    \u003CMotionConfig reducedMotion={prefersReducedMotion ? 'always' : 'never'}>\n      {children}\n    \u003C\u002FMotionConfig>\n  )\n}\n\n\u002F\u002F CSS fallback (always include alongside JS animations)\n\u002F\u002F @media (prefers-reduced-motion: reduce) { .animated { animation: none !important; } }\n```\n\n## Performance Tips\n\n```typescript\n\u002F\u002F 1. Use transform properties — GPU accelerated\n\u002F\u002F GOOD: x, y, scale, rotate, opacity (compositor layer)\n\u002F\u002F BAD: width, height, top, left, margin (layout thrash)\n\n\u002F\u002F 2. will-change for known animations (use sparingly)\n\u003Cmotion.div style={{ willChange: 'transform' }} \u002F>\n\n\u002F\u002F 3. layout prop only when needed — triggers LayoutAnimation (expensive)\n\u003Cmotion.div layout \u002F>          \u002F\u002F layout: expensive, triggers every render\n\u003Cmotion.div layout=\"position\"> \u002F\u002F layout=\"position\": cheaper, only position\n\n\u002F\u002F 4. LazyMotion — reduces bundle size (removes unused features)\nimport { LazyMotion, domAnimation, m } from 'framer-motion'\n\n\u003CLazyMotion features={domAnimation}>  {\u002F* load only DOM animations *\u002F}\n  \u003Cm.div animate={{ opacity: 1 }} \u002F>  {\u002F* use m instead of motion *\u002F}\n\u003C\u002FLazyMotion>\n\n\u002F\u002F 5. Avoid animating inside virtualized lists\n\u002F\u002F AnimatePresence + virtualization = bugs. Use CSS transitions for list items.\n\n\u002F\u002F 6. Spring physics vs duration — springs feel more natural\nconst spring = { type: 'spring', stiffness: 300, damping: 25 }\nconst duration = { duration: 0.3, ease: [0.16, 1, 0.3, 1] }\n\u002F\u002F Springs: interactive elements (drag release, hover)\n\u002F\u002F Duration: page transitions, content reveal\n```\n","# Animation Patterns\n\nFramer Motion patterns for production-quality React animations.\n\n## Framer Motion Basics (motion components, variants)\n\n```typescript\n\u002F\u002F Install: npm install framer-motion\n\nimport { motion } from 'framer-motion'\n\n\u002F\u002F Basic motion component\n\u003Cmotion.div\n  initial={{ opacity: 0, y: 20 }}\n  animate={{ opacity: 1, y: 0 }}\n  transition={{ duration: 0.3, ease: 'easeOut' }}\n\u002F>\n\n\u002F\u002F Variants — define states, animate by name\nconst cardVariants = {\n  hidden: { opacity: 0, y: 20, scale: 0.98 },\n  visible: {\n    opacity: 1,\n    y: 0,\n    scale: 1,\n    transition: { duration: 0.25, ease: [0.16, 1, 0.3, 1] },\n  },\n  hover: {\n    y: -4,\n    boxShadow: '0 12px 24px -4px rgb(0 0 0 \u002F 0.15)',\n    transition: { duration: 0.2 },\n  },\n}\n\nfunction Card({ children }: { children: React.ReactNode }) {\n  return (\n    \u003Cmotion.div\n      variants={cardVariants}\n      initial=\"hidden\"\n      animate=\"visible\"\n      whileHover=\"hover\"\n      className=\"rounded-lg border bg-white p-4\"\n    >\n      {children}\n    \u003C\u002Fmotion.div>\n  )\n}\n```\n\n## Page Transitions with AnimatePresence\n\n```typescript\nimport { AnimatePresence, motion } from 'framer-motion'\nimport { usePathname } from 'next\u002Fnavigation'\n\nconst pageVariants = {\n  initial: { opacity: 0, x: -8 },\n  enter:   { opacity: 1, x: 0, transition: { duration: 0.2, ease: 'easeOut' } },\n  exit:    { opacity: 0, x: 8,  transition: { duration: 0.15, ease: 'easeIn' } },\n}\n\n\u002F\u002F app\u002Flayout.tsx (Next.js App Router)\nexport default function RootLayout({ children }: { children: React.ReactNode }) {\n  const pathname = usePathname()\n\n  return (\n    \u003Chtml>\n      \u003Cbody>\n        \u003CAnimatePresence mode=\"wait\">\n          \u003Cmotion.main\n            key={pathname}\n            variants={pageVariants}\n            initial=\"initial\"\n            animate=\"enter\"\n            exit=\"exit\"\n          >\n            {children}\n          \u003C\u002Fmotion.main>\n        \u003C\u002FAnimatePresence>\n      \u003C\u002Fbody>\n    \u003C\u002Fhtml>\n  )\n}\n\n\u002F\u002F Modal transitions — mount\u002Funmount\nfunction Modal({ isOpen, onClose, children }: ModalProps) {\n  return (\n    \u003CAnimatePresence>\n      {isOpen && (\n        \u003C>\n          \u003Cmotion.div\n            key=\"overlay\"\n            className=\"fixed inset-0 bg-black\u002F40\"\n            initial={{ opacity: 0 }}\n            animate={{ opacity: 1 }}\n            exit={{ opacity: 0 }}\n            onClick={onClose}\n          \u002F>\n          \u003Cmotion.div\n            key=\"modal\"\n            className=\"fixed inset-x-4 top-[10%] mx-auto max-w-lg rounded-xl bg-white p-6 shadow-xl\"\n            initial={{ opacity: 0, scale: 0.96, y: 16 }}\n            animate={{ opacity: 1, scale: 1, y: 0 }}\n            exit={{ opacity: 0, scale: 0.96, y: 8 }}\n            transition={{ duration: 0.2, ease: [0.16, 1, 0.3, 1] }}\n          >\n            {children}\n          \u003C\u002Fmotion.div>\n        \u003C\u002F>\n      )}\n    \u003C\u002FAnimatePresence>\n  )\n}\n```\n\n## Layout Animations (Shared Layout, Layout ID)\n\n```typescript\nimport { motion, LayoutGroup } from 'framer-motion'\nimport { useState } from 'react'\n\n\u002F\u002F Tabs with animated indicator\nfunction AnimatedTabs({ tabs }: { tabs: string[] }) {\n  const [active, setActive] = useState(tabs[0])\n\n  return (\n    \u003CLayoutGroup>\n      \u003Cdiv className=\"flex gap-1 rounded-lg bg-gray-100 p-1\">\n        {tabs.map(tab => (\n          \u003Cbutton\n            key={tab}\n            onClick={() => setActive(tab)}\n            className=\"relative px-4 py-2 text-sm font-medium\"\n          >\n            {active === tab && (\n              \u003Cmotion.div\n                layoutId=\"tab-indicator\"      \u002F\u002F shared across tabs\n                className=\"absolute inset-0 rounded-md bg-white shadow-sm\"\n                transition={{ type: 'spring', stiffness: 400, damping: 30 }}\n              \u002F>\n            )}\n            \u003Cspan className=\"relative z-10\">{tab}\u003C\u002Fspan>\n          \u003C\u002Fbutton>\n        ))}\n      \u003C\u002Fdiv>\n    \u003C\u002FLayoutGroup>\n  )\n}\n\n\u002F\u002F Expandable card with layout animation\nfunction ExpandableCard({ title, body }: { title: string; body: string }) {\n  const [expanded, setExpanded] = useState(false)\n\n  return (\n    \u003Cmotion.div\n      layout                                \u002F\u002F animate height changes\n      className=\"rounded-lg border bg-white p-4 cursor-pointer\"\n      onClick={() => setExpanded(e => !e)}\n    >\n      \u003Cmotion.h3 layout=\"position\" className=\"font-semibold\">{title}\u003C\u002Fmotion.h3>\n      \u003CAnimatePresence>\n        {expanded && (\n          \u003Cmotion.p\n            initial={{ opacity: 0 }}\n            animate={{ opacity: 1 }}\n            exit={{ opacity: 0 }}\n            className=\"mt-2 text-gray-600 text-sm\"\n          >\n            {body}\n          \u003C\u002Fmotion.p>\n        )}\n      \u003C\u002FAnimatePresence>\n    \u003C\u002Fmotion.div>\n  )\n}\n```\n\n## Skeleton Loading Components\n\n```typescript\n\u002F\u002F Base skeleton primitive\nfunction Skeleton({ className }: { className?: string }) {\n  return (\n    \u003Cdiv\n      className={cn('animate-pulse rounded bg-gray-200 dark:bg-gray-700', className)}\n      aria-hidden=\"true\"\n    \u002F>\n  )\n}\n\n\u002F\u002F Shimmer variant (more polished)\nfunction SkeletonShimmer({ className }: { className?: string }) {\n  return (\n    \u003Cdiv className={cn('relative overflow-hidden rounded bg-gray-200', className)}>\n      \u003Cmotion.div\n        className=\"absolute inset-0 bg-gradient-to-r from-transparent via-white\u002F60 to-transparent\"\n        animate={{ x: ['-100%', '100%'] }}\n        transition={{ repeat: Infinity, duration: 1.2, ease: 'linear' }}\n      \u002F>\n    \u003C\u002Fdiv>\n  )\n}\n\n\u002F\u002F Card skeleton\nfunction CardSkeleton() {\n  return (\n    \u003Cdiv className=\"rounded-lg border bg-white p-4 space-y-3\" aria-busy=\"true\" aria-label=\"Loading\">\n      \u003Cdiv className=\"flex items-center gap-3\">\n        \u003CSkeleton className=\"size-10 rounded-full\" \u002F>\n        \u003Cdiv className=\"flex-1 space-y-2\">\n          \u003CSkeleton className=\"h-4 w-1\u002F2\" \u002F>\n          \u003CSkeleton className=\"h-3 w-1\u002F3\" \u002F>\n        \u003C\u002Fdiv>\n      \u003C\u002Fdiv>\n      \u003CSkeleton className=\"h-3 w-full\" \u002F>\n      \u003CSkeleton className=\"h-3 w-4\u002F5\" \u002F>\n      \u003CSkeleton className=\"h-8 w-24 rounded-md\" \u002F>\n    \u003C\u002Fdiv>\n  )\n}\n```\n\n## Scroll-Linked Animations\n\n```typescript\nimport { useScroll, useTransform, motion } from 'framer-motion'\nimport { useRef } from 'react'\n\n\u002F\u002F Parallax hero\nfunction ParallaxHero() {\n  const ref = useRef\u003CHTMLDivElement>(null)\n  const { scrollYProgress } = useScroll({ target: ref, offset: ['start start', 'end start'] })\n\n  const y = useTransform(scrollYProgress, [0, 1], ['0%', '50%'])\n  const opacity = useTransform(scrollYProgress, [0, 0.5], [1, 0])\n\n  return (\n    \u003Cdiv ref={ref} className=\"relative h-screen overflow-hidden\">\n      \u003Cmotion.div style={{ y, opacity }} className=\"absolute inset-0\">\n        \u003Cimg src=\"\u002Fhero.jpg\" alt=\"\" className=\"w-full h-full object-cover\" \u002F>\n      \u003C\u002Fmotion.div>\n      \u003Cdiv className=\"relative z-10 flex h-full items-center justify-center\">\n        \u003Ch1 className=\"text-6xl font-bold text-white\">Hero Title\u003C\u002Fh1>\n      \u003C\u002Fdiv>\n    \u003C\u002Fdiv>\n  )\n}\n\n\u002F\u002F Fade-in on scroll (section reveal)\nfunction FadeInSection({ children }: { children: React.ReactNode }) {\n  const ref = useRef\u003CHTMLDivElement>(null)\n  const { scrollYProgress } = useScroll({ target: ref, offset: ['start 0.9', 'start 0.6'] })\n  const opacity = useTransform(scrollYProgress, [0, 1], [0, 1])\n  const y = useTransform(scrollYProgress, [0, 1], [24, 0])\n\n  return (\n    \u003Cmotion.div ref={ref} style={{ opacity, y }}>\n      {children}\n    \u003C\u002Fmotion.div>\n  )\n}\n```\n\n## Staggered Children Animations\n\n```typescript\nconst listVariants = {\n  hidden: {},\n  visible: {\n    transition: {\n      staggerChildren: 0.06,     \u002F\u002F 60ms between each child\n      delayChildren: 0.1,\n    },\n  },\n}\n\nconst itemVariants = {\n  hidden:  { opacity: 0, x: -12 },\n  visible: { opacity: 1, x: 0, transition: { duration: 0.25, ease: 'easeOut' } },\n}\n\nfunction AnimatedList({ items }: { items: string[] }) {\n  return (\n    \u003Cmotion.ul variants={listVariants} initial=\"hidden\" animate=\"visible\" className=\"space-y-2\">\n      {items.map(item => (\n        \u003Cmotion.li key={item} variants={itemVariants} className=\"rounded border p-3\">\n          {item}\n        \u003C\u002Fmotion.li>\n      ))}\n    \u003C\u002Fmotion.ul>\n  )\n}\n```\n\n## Gesture Interactions (Drag, Tap, Hover)\n\n```typescript\nimport { motion, useDragControls } from 'framer-motion'\n\n\u002F\u002F Draggable card\nfunction DraggableCard() {\n  return (\n    \u003Cmotion.div\n      drag\n      dragConstraints={{ left: -100, right: 100, top: -50, bottom: 50 }}\n      dragElastic={0.1}\n      whileDrag={{ scale: 1.05, rotate: 2, cursor: 'grabbing' }}\n      className=\"cursor-grab rounded-lg bg-white p-4 shadow\"\n    >\n      Drag me\n    \u003C\u002Fmotion.div>\n  )\n}\n\n\u002F\u002F Bottom sheet (drag to dismiss)\nfunction BottomSheet({ onClose }: { onClose: () => void }) {\n  return (\n    \u003Cmotion.div\n      drag=\"y\"\n      dragConstraints={{ top: 0 }}\n      onDragEnd={(_, info) => {\n        if (info.offset.y > 100) onClose()\n      }}\n      initial={{ y: '100%' }}\n      animate={{ y: 0 }}\n      exit={{ y: '100%' }}\n      transition={{ type: 'spring', damping: 30, stiffness: 300 }}\n      className=\"fixed bottom-0 inset-x-0 rounded-t-2xl bg-white p-6 shadow-lg\"\n    >\n      \u003Cdiv className=\"mx-auto mb-4 h-1 w-12 rounded-full bg-gray-300\" \u002F>\n      {\u002F* content *\u002F}\n    \u003C\u002Fmotion.div>\n  )\n}\n\n\u002F\u002F Press \u002F tap feedback\nfunction PressButton({ children, onClick }: ButtonProps) {\n  return (\n    \u003Cmotion.button\n      whileTap={{ scale: 0.97 }}\n      whileHover={{ scale: 1.02 }}\n      transition={{ type: 'spring', stiffness: 400, damping: 17 }}\n      onClick={onClick}\n      className=\"btn btn-primary\"\n    >\n      {children}\n    \u003C\u002Fmotion.button>\n  )\n}\n```\n\n## Reduced Motion Respect\n\n```typescript\nimport { useReducedMotion, motion } from 'framer-motion'\n\n\u002F\u002F Hook-based — apply conditionally\nfunction FadeIn({ children }: { children: React.ReactNode }) {\n  const prefersReducedMotion = useReducedMotion()\n\n  return (\n    \u003Cmotion.div\n      initial={{ opacity: prefersReducedMotion ? 1 : 0 }}\n      animate={{ opacity: 1 }}\n      transition={prefersReducedMotion ? { duration: 0 } : { duration: 0.3 }}\n    >\n      {children}\n    \u003C\u002Fmotion.div>\n  )\n}\n\n\u002F\u002F Global — wrap app with MotionConfig\nimport { MotionConfig } from 'framer-motion'\n\nexport function Providers({ children }: { children: React.ReactNode }) {\n  const prefersReducedMotion = useReducedMotion()\n  return (\n    \u003CMotionConfig reducedMotion={prefersReducedMotion ? 'always' : 'never'}>\n      {children}\n    \u003C\u002FMotionConfig>\n  )\n}\n\n\u002F\u002F CSS fallback (always include alongside JS animations)\n\u002F\u002F @media (prefers-reduced-motion: reduce) { .animated { animation: none !important; } }\n```\n\n## Performance Tips\n\n```typescript\n\u002F\u002F 1. Use transform properties — GPU accelerated\n\u002F\u002F GOOD: x, y, scale, rotate, opacity (compositor layer)\n\u002F\u002F BAD: width, height, top, left, margin (layout thrash)\n\n\u002F\u002F 2. will-change for known animations (use sparingly)\n\u003Cmotion.div style={{ willChange: 'transform' }} \u002F>\n\n\u002F\u002F 3. layout prop only when needed — triggers LayoutAnimation (expensive)\n\u003Cmotion.div layout \u002F>          \u002F\u002F layout: expensive, triggers every render\n\u003Cmotion.div layout=\"position\"> \u002F\u002F layout=\"position\": cheaper, only position\n\n\u002F\u002F 4. LazyMotion — reduces bundle size (removes unused features)\nimport { LazyMotion, domAnimation, m } from 'framer-motion'\n\n\u003CLazyMotion features={domAnimation}>  {\u002F* load only DOM animations *\u002F}\n  \u003Cm.div animate={{ opacity: 1 }} \u002F>  {\u002F* use m instead of motion *\u002F}\n\u003C\u002FLazyMotion>\n\n\u002F\u002F 5. Avoid animating inside virtualized lists\n\u002F\u002F AnimatePresence + virtualization = bugs. Use CSS transitions for list items.\n\n\u002F\u002F 6. Spring physics vs duration — springs feel more natural\nconst spring = { type: 'spring', stiffness: 300, damping: 25 }\nconst duration = { duration: 0.3, ease: [0.16, 1, 0.3, 1] }\n\u002F\u002F Springs: interactive elements (drag release, hover)\n\u002F\u002F Duration: page transitions, content reveal\n```\n",{"name":5,"description":7},"main","70e1c350500ee750987420bbae48837afa906b7e","skills\u002Fanimation-patterns","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis","https:\u002F\u002Fgithub.com\u002Frubicanjr","linktr.ee\u002Ffinanskodu","Industrial Engineer & CIO @FinansKodu. Architecting AI-driven financial agents and autonomous workflows. 🏗️ Building systems, not just prompts.","2026-06-09 13:50:15",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add rubicanjr\u002FFinCognis --skill animation-patterns",{"tool":53,"command":54},"bunx","bunx skills add rubicanjr\u002FFinCognis --skill animation-patterns",{"tool":56,"command":57},"pnpm","pnpm dlx skills add rubicanjr\u002FFinCognis --skill animation-patterns","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fanimation-patterns\u002FSKILL.md",true,[],[62,83,92,111,140,159],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":73,"publishedAt":34},"01M6NWS9DAXJTADT4T5MB49X8W","workflow-router","Goal-based workflow orchestration - routes tasks to specialist agents based on user goals","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow-router\u002FSKILL.md",[68],{"categoryNo":69,"categoryName":70,"taxonomyType":71,"taxonomyTypeDesc":72},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[74,75,76,77,78,79,80,81,82],"workflow router","workflow","router","orchestration","goals","goal","user","workflow orchestration","tasks",{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":34},"01M6NWS3RETSC0SHP16HP66E14","wiring","Wiring Verification","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fwiring\u002FSKILL.md",[],[85,90,91],"verification","false",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":101,"publishedAt":34},"01M6NWS0XW9CVQZBDA1EGW0TWC","websocket-patterns","Connection management, room patterns, reconnection strategies, message buffering, and binary protocol design.","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fwebsocket-patterns\u002Fskill.md",[98],{"categoryNo":99,"categoryName":100,"taxonomyType":71,"taxonomyTypeDesc":72},"01JBSEEDCAT000000000000015","视觉设计",[102,20,103,104,105,106,107,108,109,110],"websocket","websocket patterns","design","protocol","management","message","strategies","binary","connection",{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":121,"publishedAt":34},"01M6NWRDQDX9ZNETAWRRMQWV52","visual-verdict","Screenshot comparison QA for frontend development. Takes a screenshot of the current implementation, scores it across multiple visual dimensions, and returns a structured PASS\u002FREVISE\u002FFAIL verdict with concrete fixes. Use when implementing UI from a design reference or verifying visual correctness.","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fvisual-verdict\u002FSKILL.md",[117,120],{"categoryNo":118,"categoryName":119,"taxonomyType":71,"taxonomyTypeDesc":72},"01JBSEEDCAT000000000000009","前端开发",{"categoryNo":69,"categoryName":70,"taxonomyType":71,"taxonomyTypeDesc":72},[122,123,124,125,126,127,128,129,130,29,131,132,133,104,134,135,136,137,138,139],"visual","verdict","visual verdict","ui","across","revise","comparison","correctness","implementing","fixes","dimensions","frontend","development","qa","screenshot","returns","use","frontend development",{"skillNo":141,"name":142,"nameZh":6,"description":143,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":144,"categories":145,"keywords":146,"publishedAt":34},"01M6NWR8HSNRS7MNDK2J02QYMN","verification-loop","Comprehensive verification system covering build, types, lint, tests, security, and diff review before a PR.","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fverification-loop\u002FSKILL.md",[],[147,148,90,149,150,151,152,153,154,155,156,157,158],"verification loop","loop","lint","review","security","pr","system","diff","build","tests","diff review","types",{"skillNo":160,"name":161,"nameZh":6,"description":162,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":163,"categories":164,"keywords":165,"publishedAt":34},"01M6NWR4HHSFR0VR5EXFRWA747","vector-db-patterns","Embedding strategies, ANN algorithms, hybrid search, RAG chunking strategies, and reranking for semantic search and retrieval.","https:\u002F\u002Fgithub.com\u002Frubicanjr\u002FFinCognis\u002Fblob\u002Fmain\u002Fskills\u002Fvector-db-patterns\u002Fskill.md",[],[166,167,168,169,20,170,171,172,173,108,174,175,176,177,178,29,179,180],"vector db patterns","vector db","db","vector","semantic search","search","embedding strategies","algorithms","chunking","semantic","retrieval","embedding","Hybrid Search","hybrid","rag"]