Exploding like buttonOne-line
Gemini 3.1 Flash Lite
by GoogleReasoningClean
Running live in a sandboxed frame. Click inside it before using the keyboard.
How it went
- Total time
- 3.2 s
- Cost
- $0.0017
- Output tokens
- 1,044
- Spent thinking
- 0 tokens
- Speed
- 431.8 tok/s
- Console errors
- 0
- First token after
- 743 ms
- First visible text after
- 743 ms
- Prompt tokens
- 362
- Code size
- 3.3 KB
- Finish reason
- stop
- Served by
- Model id
google/gemini-3.1-flash-lite- Reasoning sent
model default- Max output
- 65,536 tokens
- Generated
- Nov 12, 2026
What it was asked
The prompt
“a "like" button in pure CSS, no JavaScript, that does a crazy animation when you click it”
System prompt, sent with every prompt
You are generating a self-contained web demo. It will be rendered automatically in a sandboxed iframe and compared side by side with the output of other AI models given the exact same task. Output rules: - Reply with exactly ONE fenced code block containing the complete file: ```html (or ```svg when the task asks for an SVG). No text before or after the code block. - Everything must be inline: CSS in <style>, JavaScript in <script>. No external files, images, fonts or network requests, except the CDN URLs explicitly allowed by the task. - Do not use localStorage, sessionStorage, cookies, IndexedDB, alert(), confirm(), prompt() or window.open(): they are blocked in the sandbox and will throw. - The page must look right in a 1280×800 viewport and adapt gracefully down to 375px wide. No horizontal scrollbar. - Something meaningful must be visible on first paint: a screenshot is taken automatically about 3 seconds after load, without any interaction. - Everything that makes the demo interesting must be visible within the first seconds: nothing hidden behind a high score, a later level or a long play session. - Games must start in a self-playing demo mode (a simple AI plays) behind a "Click or press a key to start" message, so the game can be judged in action without playing. - The iframe only receives keyboard events after the user clicks it: if the demo uses the keyboard, display a clear "Click or press a key to start" message. - The code must run with zero errors in the console of the latest Chrome.
Code run-1.html · 125 lines
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Only Like Button</title>
<style>
body {
margin: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: #0f172a;
font-family: sans-serif;
overflow: hidden;
}
/* Hidden checkbox acts as the state holder */
.like-input {
display: none;
}
.like-container {
position: relative;
cursor: pointer;
user-select: none;
}
.heart {
width: 100px;
height: 100px;
background: #334155;
position: relative;
transform: rotate(-45deg);
transition: background 0.3s ease;
}
.heart::before, .heart::after {
content: '';
width: 100px;
height: 100px;
background: inherit;
border-radius: 50%;
position: absolute;
}
.heart::before { top: -50px; left: 0; }
.heart::after { top: 0; left: 50px; }
/* Particles */
.particles {
position: absolute;
top: 50%;
left: 50%;
pointer-events: none;
}
.particle {
position: absolute;
width: 10px;
height: 10px;
background: #f43f5e;
border-radius: 50%;
opacity: 0;
}
/* Trigger Animation on Check */
.like-input:checked + .like-container .heart {
background: #f43f5e;
animation: pulse 0.6s ease-out;
}
.like-input:checked + .like-container .particle {
animation: explode 0.8s ease-out forwards;
}
@keyframes pulse {
0% { transform: rotate(-45deg) scale(1); }
50% { transform: rotate(-45deg) scale(1.3); }
100% { transform: rotate(-45deg) scale(1); }
}
@keyframes explode {
0% { transform: translate(0,0) scale(1); opacity: 1; }
100% { transform: translate(var(--x), var(--y)) scale(0); opacity: 0; }
}
/* Scatter particles in a circle */
.p1 { --x: -60px; --y: -80px; }
.p2 { --x: 60px; --y: -80px; }
.p3 { --x: 80px; --y: 0px; }
.p4 { --x: 0px; --y: 80px; }
.p5 { --x: -80px; --y: 0px; }
.p6 { --x: 40px; --y: 40px; }
.hint {
position: absolute;
bottom: 50px;
color: #94a3b8;
font-size: 1.2rem;
pointer-events: none;
}
</style>
</head>
<body>
<input type="checkbox" id="like" class="like-input">
<label for="like" class="like-container">
<div class="heart">
<div class="particles">
<div class="particle p1"></div>
<div class="particle p2"></div>
<div class="particle p3"></div>
<div class="particle p4"></div>
<div class="particle p5"></div>
<div class="particle p6"></div>
</div>
</div>
</label>
<div class="hint">Click to explode!</div>
</body>
</html>