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.0016
- Output tokens
- 1,005
- Spent thinking
- 0 tokens
- Speed
- 390.4 tok/s
- Console errors
- 0
- First token after
- 629 ms
- First visible text after
- 629 ms
- Prompt tokens
- 362
- Code size
- 2.9 KB
- Finish reason
- stop
- Served by
- Model id
google/gemini-3.1-flash-lite- Reasoning sent
{"effort":"minimal"}- 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 · 107 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: #f0f2f5;
font-family: sans-serif;
}
.like-container {
position: relative;
}
input[type="checkbox"] {
display: none;
}
.like-btn {
cursor: pointer;
width: 80px;
height: 80px;
background: #fff;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
transition: all 0.3s ease;
position: relative;
z-index: 2;
}
.heart {
width: 40px;
height: 40px;
background: #ccc;
clip-path: path('M20 38c-8-6-16-12-16-20a8 8 0 0 1 16-4 8 8 0 0 1 16 4c0 8-8 14-16 20z');
transition: background 0.3s ease;
}
/* The Animation Overlay */
.particles {
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
pointer-events: none;
}
/* Magic trigger */
input:checked ~ .like-btn .heart {
background: #ff4757;
animation: pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
input:checked ~ .particles::before,
input:checked ~ .particles::after {
content: '';
position: absolute;
width: 10px;
height: 10px;
background: #ff4757;
border-radius: 50%;
animation: explode 0.8s ease-out forwards;
}
@keyframes pop {
0% { transform: scale(1); }
50% { transform: scale(1.4); }
100% { transform: scale(1); }
}
@keyframes explode {
0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
100% { transform: translate(-50%, -50%) scale(0) rotate(360deg); opacity: 0; box-shadow: -50px -50px 0 #ff4757, 50px -50px 0 #ff4757, -50px 50px 0 #ff4757, 50px 50px 0 #ff4757, 0 -70px 0 #ff4757, 0 70px 0 #ff4757; }
}
.hint {
position: absolute;
bottom: -50px;
color: #888;
font-size: 14px;
}
</style>
</head>
<body>
<div class="like-container">
<input type="checkbox" id="like-toggle">
<label for="like-toggle" class="like-btn">
<div class="heart"></div>
</label>
<div class="particles"></div>
<p class="hint">Click the button!</p>
</div>
</body>
</html>