Live preview · fully interactive
The prompt
Build an expanding note card. ## Look Button card width min(340px, 100%), background #12121a, border 1px #23232e, radius 16px, padding 18px 20px, title #f2f2f7, extra copy #8a8a99. Page #08080d. ## Behavior Click toggles aria-expanded. The extra paragraph max-height goes from 0 to 120px. ## Design tokens - Card #12121a; border #23232e; muted #8a8a99; page #08080d. ## Motion - Max-height transition 0.45s, easing cubic-bezier(0.16, 1, 0.3, 1). ## Constraints - Single self-contained HTML file. No libraries. - Honor prefers-reduced-motion: reduce by skipping the loop and leaving a readable static frame - Readable at 390px width with no horizontal page scroll
The code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100%; }
body {
background: #08080d; color: #f2f2f7; font-family: Inter, system-ui, sans-serif;
min-height: 100vh; overflow: hidden;
}
.hint { position: absolute; left: 16px; top: 16px; z-index: 5; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #8a8a99; }
main { min-height: 100vh; display: grid; place-items: center; padding: 16px; } button { width: min(340px, 100%); text-align: left; border: 1px solid #23232e; background: #12121a; color: #f2f2f7; border-radius: 16px; padding: 18px 20px; cursor: pointer; } .more { max-height: 0; overflow: hidden; color: #8a8a99; transition: max-height 0.45s cubic-bezier(0.16, 1, 0.3, 1); } button[aria-expanded="true"] .more { max-height: 120px; margin-top: 8px; }
@media (max-width: 420px) {
.hint { font-size: 10px; letter-spacing: 0.08em; }
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
</style>
</head>
<body>
<main><button id="b" aria-expanded="false"><strong>Open the note</strong><span class="more">The second paragraph is the prompt you actually paste. Keep it short enough to scan.</span></button></main>
<script>
document.getElementById("b").addEventListener("click", function (e) { var on = e.currentTarget.getAttribute("aria-expanded") === "true"; e.currentTarget.setAttribute("aria-expanded", on ? "false" : "true"); });
</script>
</body>
</html>About this effect
Click toggles aria-expanded. The card’s max-height animates from 92px to 220px over 0.45s and the extra copy fades in.