{
  "format": "putcode/playground@1",
  "id": "00000000-0000-4000-9000-000000000016",
  "url": "https://putcode.dev/u/putcode/s/spe35l6s88",
  "title": "Stacked toasts",
  "description": "Notifications that sit in a compact stack and fan out into a list when you hover or focus them.",
  "category": "effects",
  "tags": [
    "toast",
    "stack",
    "hover"
  ],
  "visibility": "public",
  "status": "published",
  "revision": 1,
  "author": "putcode",
  "forked_from": null,
  "created_at": "2026-12-02T10:24:56.169Z",
  "updated_at": "2026-12-02T10:24:56.169Z",
  "published_at": "2026-12-02T10:24:56.169Z",
  "source": {
    "html": "<section class=\"toasts\" aria-live=\"polite\" aria-label=\"Notifications\">\n  <article class=\"toast\" style=\"--i: 0\" tabindex=\"0\">\n    <span class=\"toast__icon toast__icon--ok\">✓</span>\n    <div><p class=\"toast__title\">Deployment ready</p><p class=\"toast__text\">acme-web is live on production.</p></div>\n    <time>now</time>\n  </article>\n  <article class=\"toast\" style=\"--i: 1\" tabindex=\"0\">\n    <span class=\"toast__icon\">💬</span>\n    <div><p class=\"toast__title\">3 new comments</p><p class=\"toast__text\">On “Pricing page redesign”.</p></div>\n    <time>2m</time>\n  </article>\n  <article class=\"toast\" style=\"--i: 2\" tabindex=\"0\">\n    <span class=\"toast__icon toast__icon--pay\">$</span>\n    <div><p class=\"toast__title\">Payment received</p><p class=\"toast__text\">$1,240.00 from Northwind.</p></div>\n    <time>9m</time>\n  </article>\n</section>",
    "css": "body {\n  margin: 0;\n  min-height: 100vh;\n  display: grid;\n  place-items: center;\n  background: #eceae5;\n  font: 14px/1.4 system-ui, sans-serif;\n}\n\n.toasts {\n  position: relative;\n  width: min(340px, 100% - 32px);\n  height: 230px;\n}\n\n.toast {\n  position: absolute;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  z-index: calc(10 - var(--i));\n  display: flex;\n  align-items: flex-start;\n  gap: 12px;\n  height: 64px;\n  padding: 14px;\n  border: 1px solid #e4e1da;\n  border-radius: 14px;\n  background: #fff;\n  box-shadow: 0 10px 30px -12px rgb(0 0 0 / 0.25);\n  transform: translateY(calc(var(--i) * -12px)) scale(calc(1 - var(--i) * 0.05));\n  transform-origin: bottom center;\n  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.1), opacity 0.3s;\n}\n\n.toast + .toast > * {\n  opacity: 0;\n  transition: opacity 0.2s;\n}\n\n.toasts:is(:hover, :focus-within) .toast {\n  transform: translateY(calc(var(--i) * -76px));\n}\n\n.toasts:is(:hover, :focus-within) .toast > * {\n  opacity: 1;\n}\n\n.toast:focus-visible {\n  outline: 2px solid #18191d;\n}\n\n.toast__icon {\n  display: grid;\n  flex: none;\n  place-items: center;\n  width: 32px;\n  height: 32px;\n  border-radius: 9px;\n  background: #f0eee9;\n  font-size: 14px;\n}\n\n.toast__icon--ok { background: #dcf5e4; color: #1f7a45; font-weight: 700; }\n.toast__icon--pay { background: #e8e4ff; color: #4f3fd1; font-weight: 700; }\n\n.toast div {\n  flex: 1;\n  min-width: 0;\n}\n\n.toast__title {\n  margin: 0;\n  color: #18191d;\n  font-weight: 600;\n}\n\n.toast__text {\n  margin: 1px 0 0;\n  overflow: hidden;\n  color: #6b6e77;\n  font-size: 0.85rem;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n\n.toast time {\n  color: #9a9ca4;\n  font-size: 0.75rem;\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .toast {\n    transition: none;\n  }\n}",
    "js": ""
  }
}