Exploding like buttonOne-line
North Mini Code (free)
by CohereReasoningClean
Running live in a sandboxed frame. Click inside it before using the keyboard.
How it went
- Total time
- 46.4 s
- Cost
- $0
- Output tokens
- 9,253
- Spent thinking
- 7,809 tokens
- Speed
- 200.6 tok/s
- Console errors
- 0
- First token after
- 224 ms
- First visible text after
- 42.0 s
- Prompt tokens
- 346
- Code size
- 4.1 KB
- Finish reason
- stop
- Served by
- Cohere
- Model id
cohere/north-mini-code: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 · 139 lines
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CSS Like Button</title>
<style>
*,
*::before,
*::after {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
font-family: 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
background: #f5f7fa;
color: #333;
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
}
.like-container {
text-align: center;
}
#like-btn {
display: none;
}
.btn {
padding: 1em 2.5em;
font-size: 1.4rem;
background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
color: #fff;
border: none;
border-radius: 2rem;
cursor: pointer;
box-shadow: 0 4px 15px rgba(0,0,0,.2);
transition: transform .2s, box-shadow .2s;
}
.btn:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.btn:active {
transform: scale(.95);
}
/* Crazy animation when liked */
#like-btn:checked + .btn {
animation: crazy 2s ease forwards;
}
@keyframes crazy {
0% { transform: scale(1) rotate(0); background: linear-gradient(135deg,#6a11cb,#2575fc); box-shadow:0 4px 15px rgba(0,0,0,.2); }
20% { transform: scale(1.3) rotate(-15deg); background: linear-gradient(135deg,#ff5f6d,#ffc371); box-shadow:0 0 30px #ff5f6d; }
40% { transform: scale(.9) rotate(15deg); background: linear-gradient(135deg,#43e97b,#38f9d7); box-shadow:0 0 30px #43e97b; }
60% { transform: scale(1.2) rotate(-10deg); background: linear-gradient(135deg,#ffcc00,#ff6600); box-shadow:0 0 30px #ffcc00; }
80% { transform: scale(.8) rotate(10deg); background: linear-gradient(135deg,#8e44ad,#77dde2); box-shadow:0 0 30px #8e44ad; }
100% { transform: scale(1) rotate(0); background: linear-gradient(135deg,#6a11cb,#2575fc); box-shadow:0 4px 15px rgba(0,0,0,.2); }
}
/* Feedback text */
#like-btn:checked ~ .msg {
display: inline-block;
opacity: 0;
animation: fadeIn .5s forwards;
}
@keyframes fadeIn {
to { opacity: 1; transform: translateY( πα ); }
from { transform: translateY(5px); }
}
/* Sparkles container */
.sparkles {
position: relative;
width: 200px;
height: 200px;
margin: 20px auto 0;
pointer-events: none;
}
/* Individual sparkle */
.sparkle {
position: absolute;
width: 8px;
height: 8px;
border-radius: 50%;
background: #ffeb3b;
opacity: 0;
transform: translate(var(--dx,0), var(--dx,0)) scale(0);
}
/* Sparkle bursts on like */
#like-btn:checked ~ .sparkles .sparkle:nth-child(1) {
animation: burst1 1.2s ease forwards;
}
#like-btn:checked ~ .sparkles .sparkle:nth-child(2) {
animation: burst2 1.2s ease forwards;
}
#like-btn:checked ~ .sparkles .sparkle:nth-child(3) {
animation: burst3 1.2s ease forwards;
}
/* Burst keyframes */
@keyframes burst1 {
0% { opacity:0; transform: translate(var(--dx,0), var(--dy,0)) scale(0); }
30% { opacity:1; transform: translate(var(--dx,0), var(--dy,0)) scale(1); }
100% { opacity:0; transform: translate(calc(var(--dx,0)*1.5), calc(var(--dy,0)*1.5)) scale(.2); }
}
@keyframes burst2 {
0% { opacity:0; transform: translate(var(--dx,0), var(--dy,0)) scale(0); }
30% { opacity:1; transform: translate(var(--dx,0), var(--dy,0)) scale(1); }
100% { opacity:0; transform: translate(calc(var(--dx,0)*1.5), calc(var(--dy,0)*1.5)) scale(.2); }
}
@keyframes burst3 {
0% { opacity:0; transform: translate(var(--dx,0), var(--dy,0)) scale(0); }
30% { opacity:1; transform: translate(var(--dx,0), var(--dy,0)) scale(1); }
100% { opacity:0; transform: translate(calc(var(--dx,0)*1.5), calc(var(--dy,0)*1.5)) scale(.2); }
}
/* Position each sparkle */
.sparkle:nth-child(1) { --dx: -40px; --dy: -40px; }
.sparkle:nth-child(2) { --dx: 40px; --dy: -40px; }
.sparkle:nth-child(3) { --dx: 0px; --dy: 60px; }
</style>
</head>
<body>
<div class="like-container">
<input type="checkbox" id="like-btn" hidden>
<label for="like-btn" class="btn">Like</label>
<span class="msg" hidden>Liked!</span>
<div class="sparkles">
<span class="sparkle"></span>
<span class="sparkle"></span>
<span class="sparkle"></span>
</div>
</div>
</body>
</html>Reasoning trace (7,809 tokens)
We need to output an HTML page (self-contained) with a "like" button implemented purely with CSS, no JavaScript. Clicking on it triggers a crazy animation. Since we cannot use JS, the animation must be triggered by the :active state or :checked state, maybe using a hidden checkbox and label for toggling, using CSS transitions and animations.
We must ensure that the page looks right in 1280x800 and adapt down to 375px. Must have something visible on first paint. Must have self-playing demo mode for games? This is not a game, it's a button. But the rule: "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." This is not a game. Probably it's okay.
We need a "like" button that does a crazy animation when clicked. Using pure CSS we can simulate a click via :checked on a hidden input. Label styled as button, and we can use the ~ sibling combinator to trigger animation on the sibling's state.
For example:
<input type="checkbox" id="like-btn" hidden>
<label for="like-btn" class="like-button">Like</label>
We can style .like-button with transitions, and when the checkbox is checked, we can apply a animation to the label (like scale, color change, confetti, etc). We can use CSS animations to produce a "crazy" animation: maybe a burst of particles, or a morphing shape, or a shaking and growing effect.
We cannot use JS to add/remove classes; we can use :checked + label to apply styles. Or we can use the general sibling combinator to animate a hidden element after click.
We can have a pseudo-element after the label to show confetti or stars when checked. Could use CSS only.
Implementation plan:
- Use CSS only. Use a hidden checkbox to capture click.
- The label is the button.
- When the checkbox is checked, we can apply a CSS animation to the label (like bouncing, rotating) and change its background, text, maybe add pseudo-elements that animate like fireworks.
- Use CSS @keyframes for crazy animation, maybe "pop" with scale, rotate, and change background gradient.
- Also can have a "like count" that increments using CSS? Could use counters, but pure CSS counters can't increment on interaction. However, we could have a static number or something.
The crazy animation: maybe the button expands, changes color, shows confetti bursts. We can use pseudo-elements before and after to simulate sparkles that animate when checked.
We need to make sure that on first paint, the button is visible and perhaps the animation starts automatically? However, we need a click to trigger, so we need a "Click or press a key to start" message? It says the iframe only receives keyboard events after user clicks it: we can ignore keyboard.
We can add a message "Click the button to see the crazy like animation!" but the requirement: "Click or press a key to start" is for games only. Since this is a button demonstration, perhaps we just show the button and let it be clicked.
We could also simulate a click automatically after some time? But the button is only triggered by the user clicking. The sandbox might not detect a click automatically. We could use a :target pseudo-class? Possibly we could use the URL hash to simulate a click. But we need no JS.
Alternative: Use a hidden checkbox that is automatically checked via CSS using the :checked state for a sibling without user interaction? For example, we could have the checkbox be a "checked" by default using HTML attribute? <input type="checkbox" checked> would be checked initially. But we want animation when clicked. But we could have the page auto-click the checkbox using CSS? There is no way to auto-click.
Maybe we can use CSS only to trigger animation on page load using :checked on an adjacent element that is checked initially. For example, we can have a "demo mode" where we have a hidden checkbox, and we show a label that has both the button and animation, but we could have the button's label show animation after a delay using CSS animation that runs on page load, but the crazy part must be on click. But we can have the page automatically check the checkbox after a delay using CSS? There's no timer in CSS alone (no @keyframes on input). However we could use the "appearance: none" and style as a button that triggers animation via :active state (like pressing). But :active is only while mouse is held down, not after release. We could use :focus for button (if we use button element) which can be programmatically set to focus by CSS? No, can't.
But we could use a pure CSS approach with the hidden checkbox and label, and use CSS to simulate the click by using the "checked" state for the checkbox via the URL hash: e.g., use HTML like <input type="checkbox" id="like" class="trigger" name="like"> and then include a link with href="#like:checked". Not sure.
But we can maybe cheat: we can use the :checked pseudo class for the hidden checkbox, but we can pre-check it by default (like <input type="checkbox" id="like" checked>) then the animation triggers on initial page load. However, the requirement is that animation should be triggered when you click the button. But the prompt says "a 'like' button in pure CSS, no JavaScript, that does a crazy animation when you click it". So it should work when clicked. We can make a demonstration where clicking works. Since it's an interactive demo, it should respond to user clicks. That is okay.
Thus, we provide a static HTML page with a button that on click triggers the crazy CSS animation via :checked. That will be interactive.
We need to ensure that the animation is crazy: maybe include many keyframes with multiple transformations, color changes, glow, and additional pseudo-elements for sparkles.
Implementation details:
- Use a container with width 100% and min-height to center the button.
- The button label should have default styling: some gradient background, rounded corners, padding, font size, transition for smooth changes.
- When the hidden checkbox is checked, we can apply a class to the label (e.g., .checked). But we can use the adjacent selector: input:checked + label { animation: crazy 1s forwards; } But we also need to add keyframes.
- Also we can add a "like count" element that shows "1" or something after click using counters? Possibly not needed.
- Ensure that the animation doesn't loop infinitely; it can play once.
- Provide fallback for browsers without CSS animations? Not required.
Will need to embed all CSS in <style>. No external fonts or images; we can use CSS gradient, box-shadow, etc.
Let's design:
HTML:
<div class="demo">
<input type="checkbox" id="like-btn" hidden>
<label for="like-btn" class="like-btn">Like</label>
</div>
CSS:
.demo {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
background: #f0f0f0;
font-family: sans-serif;
}
.like-btn {
padding: 1em 2em;
font-size: 1.5rem;
background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
color: white;
border: none;
border-radius: 2rem;
cursor: pointer;
box-shadow: 0 4px 15px rgba(0,0,0,0.2);
transition: transform 0.2s, box-shadow 0.2s;
}
.like-btn:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.like-btn:active {
transform: scale(0.95);
}
/* Crazy animation when checked */
#like-btn:checked + .like-btn {
animation: crazyAnim 2s ease forwards;
}
@keyframes crazyAnim {
0% { transform: scale(1); background: linear-gradient(135deg, #6a11cb, #2575fc); }
20% { transform: rotate(-15deg) scale(1.3); background: linear-gradient(135deg, #ff5f6d, #ffc371); }
40% { transform: rotate(15deg) scale(0.9); background: linear-gradient(135deg, #43e97b, #38f9d7); }
60% { transform: rotate(-10deg) scale(1.2); background: linear-gradient(135deg, #ffcc00, #ff6600); }
80% { transform: rotate(10deg) scale(0.8); background: linear-gradient(135deg, #8e44ad, #77dde2); }
100% { transform: none; background: linear-gradient(135deg, #6a11cb, #2575fc); }
}
/* Sparkles effect */
#like-btn:checked + .like-btn::before,
#like-btn:checked + .like-btn::after {
content: "";
position: absolute;
width: 8px;
height:/close
}
We need to create sparkles via pseudo-elements that also animate.
We can add two pseudo-elements before and after that are displayed only when checked, with animations for confetti bursts.
Simplify: we can add a container with .sparkles that uses :checked + label ~ .sparkles. But we can just use label::before and label::after with absolute positions and animation.
Pseudo-elements:
.like-btn::before, .like-btn::after {
content: "";
position: absolute;
width: 10px;
height: 10px;
background: #fff;
border-radius: 50%;
opacity: 0;
animation: sparkle 1.5s ease forwards;
}
When checked, we can show them.
We need to define keyframes for sparkle.
@keyframes sparkle {
0% { opacity: 0; transform: translate(0,0); }
50% { opacity: 1; }
100% { opacity: 0; }
}
We can also vary positions and delays for multiple sparkles. Could use multiple before/after with different delays via CSS only? We could use nth-child? Not easy.
Alternatively, we can create a wrapper with multiple pseudo-elements with different animation delays via CSS (e.g., .like-btn::before { animation: sparkle1 2s infinite; } etc). We can define separate keyframes.
Simpler: we can just have one sparkle that flashes.
But to be "crazy", maybe we can also have confetti falling animation. Might be too complex.
Alternatively, we can animate the button to bounce and change colors and shape (like hearts) using CSS.
We can also use shape transformation via background image? But pure CSS can't change shape easily. Use border-radius to morph from circle to square maybe.
Simplify: The crazy animation includes multiple phases, color changes, rotation, scaling, and sparkles.
We can also add a pseudo-element that creates a burst of circles after the animation.
We can use the "before" and "after" for sparkles, but we need multiple sparkles to appear.
We can create a container that has multiple .sparkle elements created via CSS using :checked + label ~ .sparkles .sparkle. But we need to add those elements to HTML? We can include them in HTML but we must ensure they are not interactive.
We could have a hidden div with class "sparkles" that contains multiple <span class="sparkle">. And style them. Then use CSS to show them when checked.
E.g.:
<input type="checkbox" id="like-btn" hidden>
<label for="like-btn" class="like-btn">Like</label>
<div class="sparkles">
<span class="sparkle"></span>
<span class="sparkle"></span>
<span class="sparkle"></span>
</div>
Then style .sparkles .sparkle to be absolutely positioned, small circles, opacity 0, animation when parent input is checked.
We can use adjacent sibling combinator: #like-btn:checked ~ .sparkles .sparkle { animation: sparkleAnim 1s forwards; } And define keyframes that make them appear and fade out.
We can set different animation delays for each sparkle by using nth-child selectors:
#like-btn:checked ~ .sparkles .sparkle:nth-child(1) { animation-delay: 0s; }
#like-btn:checked ~ .sparkles .sparkle:nth-child(2) { animation-delay: 0.2s; }
#like-btn:checked ~ .sparkles .sparkle:nth-child(3) { animation-delay: 0.4s; }
Define keyframe "sparkleAnim" that makes the sparkle appear with scale and opacity.
Now, we need to position sparkles around the button, maybe randomly.
We could compute positions via CSS using calc? Or simpler: place them at button edges. For simplicity, we can position them at four corners using absolute and transform.
We can style .sparkles { position: relative; } and each .sparkle with position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #ffeb3b; top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: 0; }
But that would place them at center. We could use offset transformations: e.g., for sparkle1: top:0; left:0; etc.
But we can do simple: each sparkle at button center but animated with burst radius using transform: translate(var(--dx), var(--dy)). Using CSS variables to define offsets.
We can define for each sparkle a --dx and --dy variable with values for different directions.
E.g.,
.sparkle:nth-child(1) { --dx: -30px; --dy: -30px; }
.sparkle:nth-child(2) { --dx: 30px; --dy: -30px; }
.sparkle:nth-child(3) { --dx: 0px; --dy: 40px; }
Then in animation, scale from 0 to 1 and move outward.
Keyframes for sparkleAnim:
0% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0); }
50% { opacity: 1; transform: translate(var(--dx), var(--dy)) scale(1); }
100% { opacity: 0; transform: translate(calc(var(--dx)*1.5), calc(var(--dy)*1.5)) scale(0.5); }
We need to define variables inside animation, which is possible via custom properties in keyframes.
But using CSS variables inside @keyframes works in modern browsers.
We must ensure no JavaScript errors.
Now ensure viewport adaptation: We can use CSS relative units, and maybe set body height to 100vh, etc.
The page should be self-contained, no external resources.
We'll output a single HTML file with inline <style> and <script> (though we won't need <script> if pure CSS). However the requirement says "Everything must be inline: CSS in <style>, JavaScript in <script>." It doesn't forbid including empty <script> tags, but we likely don't need script.
We can include a <script> with no code, but not required. The instructions say "Everything must be inline: CSS in <style>, JavaScript in <script>." So we can have a <script> that does nothing.
But might be safer to include a <script> that is empty or just a comment.
I think we can just not include <script>.
But the rule says "Everything must be inline: CSS in <style>, JavaScript in <script>." It does not say we must include a script, but we could have none. I think it's okay.
Now ensure no console errors: Our CSS uses CSS custom properties, @keyframes, pseudo-elements, etc. Should be fine.
Make sure the hidden checkbox is fully hidden: `display:none` or `position:absolute; left:-9999px`. Use `display:none`.
Make sure the label has `user-select:none`? Not needed.
Now test concept: When the page loads, the checkbox is unchecked. Clicking the label toggles the checkbox (since it is for). CSS will apply the crazy animation when checked. It will run once. After that, the checkbox remains checked? The button will stay in crazy state. If clicked again, it will retrigger animation? It will toggle again; the checked state persists. But that is okay; the animation will replay on subsequent clicks.
We could also make it toggle with CSS animation only on checked state; after unchecking, we might want to revert. But not necessary.
The crazy animation includes scaling, rotation, color changes. We may also add a "pop" sound effect? No JS, cannot play audio.
The button might also show a "LIKED" text after click? Could be done with ::after content. Using CSS only: we can use :checked + label::after { content: "Liked!"; display: inline; } But that will always show after click; we could hide initially with display:none and show on checked. This would be a simple text change.
We can add a pseudo-element after the label that appears when checked, maybe with opacity transition. But label is inline; we could use display to show it.
But we can just use a separate element for text, e.g., a <span class="feedback">Liked!</span> hidden initially; then when checked, show it.
Simplify: We can just keep the animation and have "Like" text change to "Liked!" after click. We can implement that by adding a pseudo-element on the label that appears when checked.
Implementation steps:
HTML:
<div class="container">
<input type granddaughter? Use hidden.
<input type="checkbox" id="like-btn" hidden>
<label for="like-btn" class="btn">Like</label>
<span class="msg" hidden>Liked!</span>
<div class="sparkles" hidden>
<span class="sparkle"></span>
<span class="sparkle"></span>
<span class="sparkle"></span>
</div>
</div>
We need to style .msg to show when checked:
#like-btn:checked ~ .msg {
display: inline-block;
opacity: 1;
animation: fadeIn 0.5s forwards;
}
Similarly, the sparkles should appear.
Define keyframes for fadeIn:
@keyframes fadeIn {
from { opacity: 0; transform: translateY(5px); }
to { opacity: 1; transform: translateY(0); }
}
Now, we need to ensure that the sparkles have animation that runs when checked.
CSS for .sparkles:
.sparkles {
position: relative;
width: 200px;
height: 200px;
margin: 20px auto 0;
}
.sparkle {
position: absolute;
width: 8px;
height: 8px;
border-radius: 50%;
background: #ffeb3b;
opacity: 0;
transform: translate(var(--dx,0), var(--dy,0)) scale(0);
}
... define --dx and --dy per child.
Now, define animations for each sparkle:
#like-btn:checked ~ .sparkles .sparkle:nth-child(1) {
animation: sparkleBurst1 1.2s ease forwards;
}
... we can have same keyframes for each but different delays.
Define:
@keyframes sparkleBurst1 {
0% { opacity: 0; transform: translate(var(--dx)0) scale(0); }
30% { opacity: 1; transform: translate(var(--dx), var(--dy)) scale(1); }
100% { opacity: 0; transform: translate(calc(var(--dx)*1.5), calc(var(--dy)*1.5)) scale(0.2); }
}
And for other sparkles, same but with animation-delay.
Set animation-delay for each .sparkle:
#like-btn:checked ~ .sparkles .sparkle:nth-child(1) { animation-delay: 0s; }
#like-btn:checked ~ .sparkles .sparkle:nth-child(2) { animation-delay: 0.2s; }
#like-btn:checked ~ .sparkles .sparkle:nth-child(3) { animation-delay: 0.4s; }
Now, define CSS variables for each sparkle:
.sparkle:nth-child(1) { --dx: -40px; --dy: -40px; }
.sparkle:nth-child(2) { --dx: 40px; --dy: -40px; }
.sparkle:nth-child(3) { --dx: 0px; --dy: 60px; }
Thus sparkles will burst outward.
We also need to hide sparkles when unchecked. By default they have opacity 0; animation only runs on checked. That's fine.
Now, for the button crazy animation: We can do the scale/rotate/color change, and maybe also add a glow effect.
Define:
#like-btn:checked + .btn {
animation: crazyButton 2s ease forwards;
}
Define:
@keyframes crazyButton {
0% { transform: scale(1) rotate(0); background: linear-gradient(...); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
20% { transform: scale(1.3) rotate(-15deg); background: linear-gradient(...); box-shadow: 0 0 30px #ff5f6d; }
40% { transform: scale(0.9) rotate(15deg); background: linear-gradient(...); box-shadow: 0 0 30px #43e97b; }
60% { transform: scale(1.2) rotate(-10deg); background: linear-gradient(...); box-shadow: 0 0 30px #ffcc00; }
80% { transform: scale(0.8) rotate(10deg); background: linear-gradient(...); box-shadow: 0 0 30px #8e44ad; }
100% { transform: scale(1) rotate(0); background: linear-gradient(...); box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
}
We need multiple gradient definitions for each phase, but we can just reuse gradient values.
Also, we may want to change text color maybe? The button text is white; we can keep it.
We can also add a pseudo-element after the button that shows a burst of confetti when checked. But we already have sparkles.
The crazy animation includes the sparkles as well.
Now, for "Click or press a key to start" message: This is optional as we are not a game. But we might include a small instruction that the button can be clicked. However, the instructions: "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." Since we are using mouse click, keyboard not needed. So it's fine.
Now, we need to ensure that the page is self-contained and meets all constraints.
Now, I'll write the HTML code.
Will include meta viewport tag for proper scaling:
<meta name="viewport" content="width=device-width, initial-scale=1">
Set body margin:0.
Now, design the container.
Will use CSS variables for colors for easier editing.
Now, write the code.
One more thing: The page must look right in 1280×800 and adapt down to 375px. We'll use flexbox and relative units.
We need to ensure there is something visible on first paint: the button is visible.
Now, write the HTML with inline styles.
We need to ensure there are no console errors. Use proper CSS syntax.
Potential issues: The custom property syntax inside @keyframes may cause errors if the property is not defined. But we define it in each sparkle element.
Make sure to include `contain: strict` maybe.
Also note that using CSS variables in @keyframes may be okay. But some older browsers may not support variable interpolation in animations. However, the sandbox likely uses a modern Chrome.
Testing mental: The CSS will be applied to the page; there will be no errors.
Now, let's produce the code.
We need to output exactly one fenced code block with the HTML, starting with ```html and ending with ```.
I'll produce code with comments maybe not needed.
Let's write:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-��">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CSS Like Button</title>
<style>
*,
*::before,
*::after {
box-sizing: border-box;
}
body {
margin:0;
padding:0;
font-family:'Segoe UI',Roboto,Oxygen-Sans,Ubuntu,Cantarell,'Helvetica Neue',Arial,sans-serif;
background:#f5f7fa;
color:#333;
display:flex;
align-items:center;
justify-content:center;
min-height:100vh;
}
.like-container {
text-align:center;
}
#like-btn {
display:none;
}
.btn {
padding:1em 2.5em;
font-size:1.4rem;
background:linear-gradient(135deg,#6a11cb 0%,#2575fc 100%);
color:#fff;
border:none;
border-radius:2rem;
cursor:pointer;
box-shadow:0 4px 15px rgba(0,0,0,.2);
transition:transform .2s,box-shadow .2s;
}
.btn:hover {
transform:translateY(-2px);
box-shadow:0 6px 20px rgba(0,0,0,.3);
}
.btn:active {
transform:scale(.95);
}
/* Crazy animation when liked */
#like-btn:checked + .btn {
animation:crazy 2s ease forwards;
}
@keyframes crazy {
0% {transform:scale(1) rotate(0); background:linear-gradient(135deg,#6a11cb,#2575fc); box-shadow:0 4px 15px rgba(0,0,0,.2);}
20% {transform:scale(1.3) rotate(-15deg); background:linear-gradient(135deg,#ff5f6d,#ffc371); box-shadow:0 0 30px #ff5f6d;}
40% {transform:scale(.9) rotate(15deg); background:linear-gradient(135deg,#43e97b,#38f9d7); box-shadow:0 0 30px #43e97b;}
60% {transform:scale(1.2) rotate(-10deg); background:linear-gradient(135deg,#ffcc00,#ff6600); box-shadow:0 0 30px #ffcc00;}
80% {transform:scale(.8) rotate(10deg); background:linear-gradient(135deg,#8e44ad,#77dde2); box-shadow:0 0 30px #8e44ad;}
100% {transform:scale(1) rotate(0); background:linear-gradient(135deg,#6a11cb,#2575fc); box-shadow:0 4px 15px rgba(0,0,0,.2);}
}
/* Feedback text */
#like-btn:checked ~ .msg {
display:inline-block;
opacity:0;
animation:fadeIn .5s forwards;
}
@keyframes fadeIn {
to {opacity:1; transform:translateY(0);}
from {transform:translateY(5px);}
}
/* Sparkles container */
.sparkles {
position:relative;
width:200px;
height:200px;
margin:20px auto 0;
pointer-events:none;
}
/* Individual sparkle */
.sparkle {
position:absolute;
width:8px;
height:8px;
border-radius:50%;
background:#ffeb3b;
opacity:0;
transform:translate(var(--dx,0),var(--dy,0)) scale(0);
}
/* Sparkle bursts on like */
#like-btn:checked ~ .sparkles .sparkle:nth-child(1) {
animation:burst1 1.2s ease forwards;
}
#like-btn:checked ~ .sparkles .sparkle:nth-child(2) {
animation:burst2 1.2s ease forwards;
}
#like-btn:checked ~ .sparkles .sparkle:nth-child(3) {
animation:burst3 1.2s ease forwards;
}
/* Burst keyframes with different delays */
@keyframes burst1 {
0% {opacity:0; transform:translate(var(--dx,0),var(--dy,0)) scale(0);}
30% {opacity:1; transform:translate(var(--dx,0),var(--dy,0)) scale(1);}
100% {opacity:0; transform:translate(calc(var(--dx,0)*1.5),calc(var(--dy,0)*1.5)) scale(.2);}
}
@keyframes burst2 {
0% {opacity:0; transform:translate(var(--dx,0),var(--dy,0)) scale(0);}
30% {opacity:1; transform:translate(var(--dx,0),var(--dy,0)) scale(1);}
100% {opacity:0; transform:translate(calc(var(--dx,0)*1.5),calc(var(--dy,0)*1.5)) scale(.2);}
}
@keyframes burst3 {
0% {opacity:0; transform:translate(var(--dx,0),var(--dy,0)) scale(0);}
30% {opacity:1; transform:translate(var(--dx,0),var(--dy,0)) scale(1);}
100% {opacity:0; transform:translate(calc(var(--dx,0)*1.5),calc(var(--dy,0)*1.5)) scale(.2);}
}
/* Position each sparkle */
.sparkle:nth-child(1) {--dx:-40px; --dy:-40px;}
.sparkle:nth-child(2) {--dx:40px; --dy:-40px;}
.sparkle:nth-child(3) {--dx:0px; --dy:60px;}
</style>
<div class="like-container">
<input type="checkbox" id="like-btn" hidden>
<label for="like-btn" class="btn">Like</label>
<span class="msg" hidden>Liked!</span>
<div class="sparkles">
<span class="sparkle"></span>
<span class="sparkle"></span>
<span class="sparkle"></span>
</div>
</div>
</body>
</html>
```
But there is a typo: "Liked!"? I wrote "Liked!" but previously I used "Liked!"? Actually I used "Liked!" in HTML but need to match class .msg. I wrote `<span class="msg" hidden>Liked!</span>` but I need "Liked!" string. I wrote "Liked!" maybe correct.
But double-check HTML: I have `<span class="msg" hidden>Liked!</span>` (typo: "Liked!" vs "Liked!"). Let's ensure correct spelling: "Liked!" is correct. I typed "Liked!" earlier? It appears as "Liked!" in the code. However, there's a small mistake: The meta charset is "UTF-8"? I wrote "UTF-8"? Actually I wrote `<meta charset="UTF-8">`. There's a stray "<?> " after the comment. I have "meta charset="UTF-8">" line is fine. The `<meta charset="UTF-8">` line is correct.
One more: I wrote `<meta charset="UTF-8">`? Actually I wrote `<meta charset="UTF-8">` incorrectly? Let's double-check:
In the head:
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
That's fine.
The button label text is "Like". The feedback text is "Liked!" but I want "Liked!"? Actually "Liked!" should be "Liked!". I wrote "Liked!"? In the code I wrote "Liked!". It's correct.
Now, there may be syntax errors: The CSS includes "box-sizing" style for *? It's fine.
Now, check for missing closing tags: The `<style>` is closed; then `<div class="like-container">` ... after that, we have `</body>` and `</html>`. Need to ensure there is `</body>` and `</html>`.
The code has `<body>`? Actually I didn't include `<body>` tag in the code snippet. I wrote `<div class="like-container">` directly after `<style>`, but I need to wrap inside `<body>` tag.
My code currently is:
```
<head>
...
</style>
<div class="like-container">
<input ...>
...
</div>
</body>
</html>
```
But I missed `<body>` opening tag before the container.
Actually after `<style>` we need `<body>` before the container. Let's correct.
Also need to ensure proper indentation.
Let's reconstruct with proper tags:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content'')?? Actually content='width=device-width, initial-scale=1'>
<title>CSS Like Button</title>
<style>
...css...
</style>
</head>
<body>
<div class="like-container">
<input type="checkbox" id="like-btn" hidden>
<label for="like-btn" class="btn">Like</label>
<span class="msg" hidden>Liked!</span>
<div class="sparkles">
<span class="sparkle"></span>
<span class="sparkle"></span>
<span class="sparkle"></span>
</div>
</div>
</body>
</html>
```
Make sure the meta tag is correct: `<meta name="viewport" content="width=device-width, initial-scale=1">` is a syntax error; should be `content="width=device-width, initial-scale=1"`? Actually correct is `content="width=device-width, initial-scale=1"`? The correct viewport meta is:
`<meta name="viewport" content="width=device-width, initial-scale=1">` This is wrong. Should be:
`<meta name="viewport" content="width=device-width, initial-scale=1">` Actually no, the correct is:
`<meta name="viewport" content="width=device-width, initial-scale=1">` That's still wrong. The correct string is:
`content="width=device-width, initial-scale=1"` but missing quoting? Actually it's:
`<meta name="viewport" content="width=device-width, initial-scale=1">` Wait, the attribute is `content="width=device-width, initial-scale=1"` which is correct.
But we need the correct syntax: `<meta name="viewport" content="width=device-width, initial-scale=1">`. Yes, that is the correct syntax. So it's okay.
We need to ensure that in the code, the meta line is exactly `<meta name="viewport" content="width=device-width, meisten? Actually we need to check for typos.
Let's rewrite the code cleanly, with all proper tags.
Also, we need to ensure CSS syntax: "box-sizing" property for * is okay.
We should also ensure there are no stray spaces or syntax errors. The CSS includes `box-sizing:border`? Actually we wrote:
```
*,
*::before,
*::after {
box-sizing:border-box;
}
```
That's correct.
Now check for stray errors: The CSS includes `display:none;` for input, that's fine.
Now check for CSS variable usage: `--dx` and `--dy` are defined in CSS for sparkles. That's fine.
Now check for animations: The sparkle bursts have keyframes defined for each, with `calc(var(--dx,0)*1.5)`. This is okay.
Now check for missing units: `--dx:-40px` includes unit.
Now check for correct syntax of the `<input>` hidden attribute: We used `hidden` attribute inside HTML5. That's fine.
Now ensure the `<label>` for is correct: `for="like-btn"` matches input id.
Now the message hidden: `<span class="msg" hidden>Liked!</span>` we used "Liked!" with an exclamation. That's correct.
Now container: `<div class="like-container">` wraps all.
Now the CSS styling for `.like-container` is not defined. We haven't defined `.like-container` in CSS. We need to style it to center elements. We defined `.like-container` as text-align:center; we should include that in CSS.
We need to add `.like-container { text-align:center; }` to CSS.
Also maybe add `margin-top:20px` for spacing.
Now final adjustments.
Also ensure we imported meta viewport and title.
Now, we need to ensure that the HTML is valid.
One more: The `<style>` tag should be closed properly.
Now let's rewrite the HTML with proper tags and styling.
We should also consider adding a small instruction to click the button? Not necessary.
The final code should be a single fenced code block.
Now, I'll craft the final code block.
Make sure there are no stray backticks inside the code. The code block must contain the HTML.
Now, generate final answer.