Exploding like buttonOne-line
Dots3-Note Preview (free)
by Dots StudioReasoningClean
Running live in a sandboxed frame. Click inside it before using the keyboard.
How it went
- Total time
- 41.7 s
- Cost
- $0
- Output tokens
- 3,933
- Spent thinking
- 2,085 tokens
- Speed
- 95.6 tok/s
- Console errors
- 0
- First token after
- 569 ms
- First visible text after
- 24.3 s
- Prompt tokens
- 355
- Code size
- 7.1 KB
- Finish reason
- stop
- Served by
- AtlasCloud
- Model id
dots-studio/dots-3-note-preview:free- Reasoning sent
model default- Max output
- 32,000 tokens
- Generated
- Nov 9, 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 · 269 lines
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Crazy CSS Like Button</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
font-family: 'Arial', sans-serif;
overflow: hidden;
}
.container {
text-align: center;
padding: 20px;
}
h1 {
color: white;
margin-bottom: 40px;
font-size: 2.5rem;
text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.like-button {
position: relative;
width: 120px;
height: 120px;
cursor: pointer;
background: none;
border: none;
outline: none;
}
.heart {
position: absolute;
top: 0;
left: 0;
width: 120px;
height: 120px;
background: #ff4757;
border-radius: 50% 50% 45% 45% / 55% 55% 40% 40%;
transform: rotate(-45deg);
transition: all 0.3s ease;
box-shadow: 0 10px 20px rgba(255, 71, 87, 0.4);
}
.heart:before,
.heart:after {
content: '';
position: absolute;
width: 120px;
height: 120px;
background: #ff4757;
border-radius: 50%;
}
.heart:before {
top: -60px;
left: 0;
}
.heart:after {
top: 0;
left: 60px;
}
.like-button input[type="checkbox"] {
display: none;
}
.like-button input[type="checkbox"]:checked ~ .heart {
animation: crazy-like 1.5s ease-in-out;
}
.like-button input[type="checkbox"]:checked ~ .heart:before,
.like-button input[type="checkbox"]:checked ~ .heart:after {
animation: crazy-like 1.5s ease-in-out;
}
@keyframes crazy-like {
0% {
transform: scale(1) rotate(-45deg);
background: #ff4757;
filter: hue-rotate(0deg);
}
10% {
transform: scale(1.2) rotate(-45deg);
background: #ffa502;
filter: hue-rotate(30deg);
}
20% {
transform: scale(0.9) rotate(-45deg);
background: #2ed573;
filter: hue-rotate(60deg);
}
30% {
transform: scale(1.1) rotate(-45deg);
background: #1e90ff;
filter: hue-rotate(90deg);
}
40% {
transform: scale(1.05) rotate(-45deg);
background: #a55eea;
filter: hue-rotate(120deg);
}
50% {
transform: scale(1.3) rotate(-45deg);
background: #ff3838;
filter: hue-rotate(150deg);
}
60% {
transform: scale(0.95) rotate(-45deg);
background: #ffa502;
filter: hue-rotate(180deg);
}
70% {
transform: scale(1.15) rotate(-45deg);
background: #2ed573;
filter: hue-rotate(210deg);
}
80% {
transform: scale(1.05) rotate(-45deg);
background: #1e90ff;
filter: hue-rotate(240deg);
}
90% {
transform: scale(1.1) rotate(-45deg);
background: #a55eea;
filter: hue-rotate(270deg);
}
100% {
transform: scale(1) rotate(-45deg);
background: #ff4757;
filter: hue-rotate(360deg);
}
}
.like-button input[type="checkbox"]:checked ~ .heart {
box-shadow:
0 0 20px #ff4757,
0 0 40px #ff4757,
0 0 60px #ff4757,
0 0 80px #ff4757;
}
.particles {
position: absolute;
top: 50%;
left: 50%;
width: 10px;
height: 10px;
background: #ff4757;
border-radius: 50%;
opacity: 0;
}
.like-button input[type="checkbox"]:checked ~ .particles {
animation: particle-burst 1.5s ease-out forwards;
}
@keyframes particle-burst {
0% {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
}
100% {
opacity: 0;
transform: translate(-50%, -50%) scale(20);
}
}
.particle-1 { animation-delay: 0s; }
.particle-2 { animation-delay: 0.1s; }
.particle-3 { animation-delay: 0.2s; }
.particle-4 { animation-delay: 0.3s; }
.particle-5 { animation-delay: 0.4s; }
.instruction {
color: white;
margin-top: 30px;
font-size: 1.2rem;
opacity: 0.8;
}
@media (max-width: 768px) {
.like-button {
width: 100px;
height: 100px;
}
.heart,
.heart:before,
.heart:after {
width: 100px;
height: 100px;
}
.heart:before {
top: -50px;
}
.heart:after {
left: 50px;
}
h1 {
font-size: 2rem;
}
}
@media (max-width: 480px) {
.like-button {
width: 80px;
height: 80px;
}
.heart,
.heart:before,
.heart:after {
width: 80px;
height: 80px;
}
.heart:before {
top: -40px;
}
.heart:after {
left: 40px;
}
h1 {
font-size: 1.8rem;
}
.instruction {
font-size: 1rem;
}
}
</style>
</head>
<body>
<div class="container">
<h1>Crazy CSS Like Button</h1>
<div class="like-button">
<input type="checkbox" id="like-btn">
<label for="like-btn" class="heart"></label>
<div class="particles particle-1"></div>
<div class="particles particle-2"></div>
<div class="particles particle-3"></div>
<div class="particles particle-4"></div>
<div class="particles particle-5"></div>
</div>
<p class="instruction">Click the heart to see the crazy animation!</p>
</div>
</body>
</html>Reasoning trace (2,085 tokens)
We are going to create a "like" button that uses only CSS for the crazy animation on click.
Since we cannot use JavaScript, we will use a checkbox to toggle the state and then style the button based on the checkbox state.
We'll use the :checked pseudo-class to trigger the animation.
Steps:
1. Create an HTML structure with a checkbox (hidden) and a label for the button.
2. The label will be the visible button. We'll style it to look like a heart.
3. When the checkbox is checked, we'll trigger an animation on the heart.
We'll use CSS animations to make the heart beat and maybe change color.
Let's design the heart using CSS (pseudo-elements and border-radius).
We'll also add a crazy effect: maybe a heart that grows, rotates, and changes color.
Example animation:
- 0%: normal size, red color
- 50%: larger size, different color (maybe pink or gradient), and rotated a bit
- 100%: back to normal
We can also add a pulse effect by scaling.
Since we want a crazy animation, we can do multiple iterations and maybe add a shake.
However, note that the animation should be triggered on click (checkbox checked) and then reset when unchecked?
But typically a like button stays liked. So we might want the animation to run once when clicked and then stay in the liked state.
But the problem says "when you click it", so we want the animation to run on click and then the button remains in the liked state.
We can do:
- The animation runs when the checkbox is checked and then stays in the final state? But our animation would have to end at the liked state.
Alternatively, we can use a transition and then an animation that runs only once. But note: if we uncheck, the animation might run again?
Since it's a like button, we probably don't want to uncheck. So we can set the checkbox to stay checked.
However, the problem doesn't specify if it should toggle. Let's assume it's a one-time like.
But if we want to allow unlike, then we have to consider the animation on unclick as well.
Let's make it toggle: when clicked, it runs the animation and then stays in the liked state. When unclicked, it runs a reverse animation?
But the problem says "crazy animation when you click it", so maybe only on click.
We can do:
- On check: run the animation and then stay in the final state.
- On uncheck: run a reverse animation? Or just reset without animation?
Since the problem doesn't specify, let's make it so that the animation runs every time the state changes from unchecked to checked.
We can use the :checked state and then an animation that runs only when the state changes. But CSS animations don't have a direct way to run only on state change without JavaScript.
Alternatively, we can use a transition and then an animation that is triggered by the :checked state. But note: if we use an animation, it will run every time the state changes.
However, if we want the animation to run only when going from unchecked to checked, we can use a trick with two states and a delay?
But let's keep it simple: we'll have the animation run every time the checkbox is checked. If the user unchecks and then checks again, the animation will run again.
We'll design the animation to be crazy and then the button will stay in the final state (which is the liked state) until unchecked.
Steps for the heart shape:
We'll create a heart using two circles and a square, all rotated.
Let's structure:
<input type="checkbox" id="like">
<label for="like" class="heart"></label>
Then we'll style the heart.
We'll use the following CSS for the heart:
.heart {
display: inline-block;
width: 50px;
height: 50px;
position: relative;
background: red;
transform: rotate(-45deg);
cursor: pointer;
}
.heart:before, .heart:after {
content: '';
width: 50px;
height: 50px;
background: red;
border-radius: 50%;
position: absolute;
}
.heart:before {
top: -25px;
left: 0;
}
.heart:after {
top: 0;
left: 25px;
}
Then when checked, we'll change the color and run an animation.
Let's define the animation:
@keyframes like-animation {
0% {
transform: scale(1) rotate(-45deg);
background: red;
}
50% {
transform: scale(1.3) rotate(-45deg);
background: pink;
}
100% {
transform: scale(1) rotate(-45deg);
background: red;
}
}
But we want it to stay in the liked state? So maybe we want the final state to be a different color?
Alternatively, we can have two animations: one for the click and then a state change.
Let's change the design:
- The unchecked state: heart is red and small.
- The checked state: heart is a different color (say, pink) and we run the animation to make it grow and then shrink back to the checked state.
But note: if we run the animation and then set the state, the animation will override the state during the animation.
We can do:
.heart {
transition: background 0.3s, transform 0.3s;
}
#like:checked + .heart {
background: pink;
animation: like-animation 0.5s ease;
}
But then the animation will run every time we check. And the final state of the animation is the same as the checked state?
Let's adjust the animation to end at the checked state:
@keyframes like-animation {
0% {
transform: scale(1);
background: red;
}
50% {
transform: scale(1.3);
background: pink;
}
100% {
transform: scale(1);
background: pink;
}
}
Then when checked, the heart will animate to the pink state and stay there.
But what if we want to allow unliking? Then we can have a reverse animation?
Since the problem doesn't specify, let's make it so that the animation runs only when going from unchecked to checked.
We can use the :checked state and then an animation that runs only once. But if we uncheck and check again, it will run again.
Alternatively, we can use a transition and then an animation that is triggered by the :checked state. But note: if we use an animation, it will run every time the state changes.
However, if we want the animation to run only when going from unchecked to checked, we can use a trick with two states and a delay?
But let's keep it simple and have the animation run every time the checkbox is checked.
We'll also add a crazy effect: maybe a shake or a spin.
Let's modify the animation to include a rotation and a shake:
@keyframes like-animation {
0% {
transform: scale(1) rotate(-45deg);
background: red;
}
25% {
transform: scale(1.2) rotate(-45deg) skewX(10deg);
background: pink;
}
50% {
transform: scale(1.3) rotate(-45deg) skewX(-10deg);
background: lightpink;
}
75% {
transform: scale(1.1) rotate(-45deg) skewX(5deg);
background: hotpink;
}
100% {
transform: scale(1) rotate(-45deg);
background: pink;
}
}
This will create a crazy effect with skewing and color changes.
We'll also add a shadow or a glow to make it more crazy.
Let's add a box-shadow that changes:
@keyframes like-animation {
0% {
transform: scale(1) rotate(-45deg);
background: red;
box-shadow: 0 0 5px red;
}
25% {
transform: scale(1.2) rotate(-45deg) skewX(10deg);
background: pink;
box-shadow: 0 0 10px pink;
}
50% {
transform: scale(1.3) rotate(-45deg) skewX(-10deg);
background: lightpink;
box-shadow: 0 0 15px lightpink;
}
75% {
transform: scale(1.1) rotate(-45deg) skewX(5deg);
background: hotpink;
box-shadow: 0 0 20px hotpink;
}
100% {
transform: scale(1) rotate(-45deg);
background: pink;
box-shadow: 0 0 5px pink;
}
}
Now, let's code it.
We'll hide the checkbox and style the label.
We'll also make sure the button is accessible and looks good.
Let's write the code.