{
  "format": "putcode/playground@1",
  "id": "00000000-0000-4000-9000-000000000004",
  "url": "https://putcode.dev/u/putcode/s/30lx7t6gsp",
  "title": "Music player",
  "description": "A now-playing card with gradient cover art, a styled progress slider, and equalizer bars that move while it plays.",
  "category": "cards",
  "tags": [
    "range-input",
    "svg",
    "animation"
  ],
  "visibility": "public",
  "status": "published",
  "revision": 1,
  "author": "putcode",
  "forked_from": null,
  "created_at": "2026-12-01T22:24:56.169Z",
  "updated_at": "2026-12-01T22:24:56.169Z",
  "published_at": "2026-12-01T22:24:56.169Z",
  "source": {
    "html": "<article class=\"player\">\n  <div class=\"player__art\" aria-hidden=\"true\">\n    <div class=\"eq\"><span></span><span></span><span></span><span></span></div>\n  </div>\n  <div class=\"player__meta\">\n    <h2 class=\"player__title\">Night Drive</h2>\n    <p class=\"player__artist\">Lumen Coast</p>\n  </div>\n  <input class=\"player__seek\" type=\"range\" min=\"0\" max=\"214\" value=\"83\" aria-label=\"Seek\" style=\"--progress: 39%\">\n  <div class=\"player__times\"><span>1:23</span><span>3:34</span></div>\n  <div class=\"player__controls\">\n    <button type=\"button\" aria-label=\"Previous\"><svg viewBox=\"0 0 24 24\" width=\"22\" height=\"22\" fill=\"currentColor\"><path d=\"M6 5h2v14H6zM20 5v14L9 12z\"/></svg></button>\n    <button class=\"player__play\" type=\"button\" aria-label=\"Play\" aria-pressed=\"true\">\n      <svg class=\"icon-play\" viewBox=\"0 0 24 24\" width=\"26\" height=\"26\" fill=\"currentColor\"><path d=\"M7 4v16l13-8z\"/></svg>\n      <svg class=\"icon-pause\" viewBox=\"0 0 24 24\" width=\"26\" height=\"26\" fill=\"currentColor\"><path d=\"M6 4h4v16H6zM14 4h4v16h-4z\"/></svg>\n    </button>\n    <button type=\"button\" aria-label=\"Next\"><svg viewBox=\"0 0 24 24\" width=\"22\" height=\"22\" fill=\"currentColor\"><path d=\"M16 5h2v14h-2zM4 5v14l11-7z\"/></svg></button>\n  </div>\n</article>",
    "css": "body {\n  margin: 0;\n  min-height: 100vh;\n  display: grid;\n  place-items: center;\n  background: #0e0f13;\n  color: #f3f3f5;\n  font: 15px/1.4 system-ui, sans-serif;\n}\n\n.player {\n  width: min(300px, 100% - 32px);\n  padding: 18px;\n  border: 1px solid #23252d;\n  border-radius: 22px;\n  background: #16171d;\n  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.8);\n}\n\n.player__art {\n  position: relative;\n  aspect-ratio: 1;\n  overflow: hidden;\n  border-radius: 14px;\n  background:\n    radial-gradient(circle at 30% 25%, #ffb36b, transparent 45%),\n    radial-gradient(circle at 75% 70%, #ff4f8b, transparent 50%),\n    linear-gradient(160deg, #3a1d6e, #0f1b4d);\n}\n\n.eq {\n  position: absolute;\n  right: 12px;\n  bottom: 12px;\n  display: flex;\n  align-items: flex-end;\n  gap: 3px;\n  height: 18px;\n}\n\n.eq span {\n  width: 3px;\n  height: 30%;\n  border-radius: 2px;\n  background: #fff;\n}\n\n.player:has([aria-pressed=\"true\"]) .eq span {\n  animation: eq 0.9s ease-in-out infinite alternate;\n}\n\n.eq span:nth-child(2) { animation-delay: -0.3s !important; }\n.eq span:nth-child(3) { animation-delay: -0.6s !important; }\n.eq span:nth-child(4) { animation-delay: -0.15s !important; }\n\n@keyframes eq {\n  to { height: 100%; }\n}\n\n.player__meta {\n  margin: 14px 0 10px;\n}\n\n.player__title {\n  margin: 0;\n  font-size: 1.05rem;\n}\n\n.player__artist {\n  margin: 2px 0 0;\n  color: #9497a3;\n  font-size: 0.88rem;\n}\n\n.player__seek {\n  width: 100%;\n  height: 4px;\n  margin: 0;\n  border-radius: 99px;\n  background: linear-gradient(90deg, #fff var(--progress), #33353e var(--progress));\n  appearance: none;\n  cursor: pointer;\n}\n\n.player__seek::-webkit-slider-thumb {\n  width: 12px;\n  height: 12px;\n  border-radius: 50%;\n  background: #fff;\n  appearance: none;\n}\n\n.player__seek::-moz-range-thumb {\n  width: 12px;\n  height: 12px;\n  border: 0;\n  border-radius: 50%;\n  background: #fff;\n}\n\n.player__times {\n  display: flex;\n  justify-content: space-between;\n  margin-top: 6px;\n  color: #7d808c;\n  font-size: 0.75rem;\n  font-variant-numeric: tabular-nums;\n}\n\n.player__controls {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  gap: 22px;\n  margin-top: 8px;\n}\n\n.player__controls button {\n  display: grid;\n  place-items: center;\n  padding: 6px;\n  border: 0;\n  border-radius: 50%;\n  background: none;\n  color: #d9dae0;\n  cursor: pointer;\n}\n\n.player__controls button:focus-visible {\n  outline: 2px solid #fff;\n}\n\n.player__controls .player__play {\n  width: 54px;\n  height: 54px;\n  background: #fff;\n  color: #111;\n}\n\n.player__play .icon-pause,\n.player__play[aria-pressed=\"true\"] .icon-play {\n  display: none;\n}\n\n.player__play[aria-pressed=\"true\"] .icon-pause {\n  display: block;\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .eq span {\n    animation: none !important;\n  }\n}",
    "js": "const play = document.querySelector(\".player__play\");\nplay.addEventListener(\"click\", () => {\n  const playing = play.getAttribute(\"aria-pressed\") === \"true\";\n  play.setAttribute(\"aria-pressed\", String(!playing));\n  play.setAttribute(\"aria-label\", playing ? \"Play\" : \"Pause\");\n});\n\nconst seek = document.querySelector(\".player__seek\");\nconst [current] = document.querySelectorAll(\".player__times span\");\nseek.addEventListener(\"input\", () => {\n  seek.style.setProperty(\"--progress\", (seek.value / seek.max) * 100 + \"%\");\n  const s = Number(seek.value);\n  current.textContent = Math.floor(s / 60) + \":\" + String(s % 60).padStart(2, \"0\");\n});"
  }
}