{
  "id": "fan-out-cards",
  "name": "Fan-out Card Stack",
  "category": "cards",
  "tags": [
    "stack",
    "deck",
    "fan",
    "hover",
    "photos",
    "rotate"
  ],
  "description": "A neat stack of cards that fans out like a hand of cards when you hover it.",
  "url": "https://copy-css.com/snippets/fan-out-cards",
  "markdown": "https://copy-css.com/snippets/fan-out-cards.md",
  "html": "<div class=\"fan\" tabindex=\"0\" role=\"group\" aria-label=\"Photo stack\">\n  <div></div>\n  <div></div>\n  <div></div>\n</div>",
  "css": ".fan {\n  position: relative;\n  width: 120px;\n  height: 150px;\n}\n\n/* Set each card's background-image to a photo */\n.fan > * {\n  position: absolute;\n  inset: 0;\n  border: 4px solid #fff;\n  border-radius: 14px;\n  background: #e7e5e4 center / cover;\n  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.45);\n  transform-origin: 50% 100%;\n  transition: transform 0.45s cubic-bezier(0.3, 1.4, 0.5, 1);\n}\n\n.fan > :nth-child(1) { transform: rotate(-4deg); }\n.fan > :nth-child(3) { transform: rotate(4deg); }\n\n.fan:hover > :nth-child(1),\n.fan:focus-visible > :nth-child(1) {\n  transform: translateX(-18px) rotate(-12deg);\n}\n\n.fan:hover > :nth-child(2),\n.fan:focus-visible > :nth-child(2) {\n  transform: translateY(-8px);\n}\n\n.fan:hover > :nth-child(3),\n.fan:focus-visible > :nth-child(3) {\n  transform: translateX(18px) rotate(12deg);\n}\n\n.fan:focus-visible {\n  outline: none;\n}",
  "features": [
    "transitions",
    "transforms",
    "box shadows",
    "keyboard focus styles"
  ],
  "customProperties": []
}
