Models 44

Mistral Small 4

by MistralReasoningClean
Open in new window

Running live in a sandboxed frame. Click inside it before using the keyboard.

How it went

Total time
19.6 s
Cost
$0.0024
Output tokens
3,488
Spent thinking
1,919 tokens
Speed
183.8 tok/s
Console errors
0
First token after
586 ms
First visible text after
10.6 s
Prompt tokens
376
Code size
4.0 KB
Finish reason
stop
Served by
Mistral
Model id
mistralai/mistral-small-2603
Reasoning sent
{"effort":"high"}
Max output
209,715 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 · 179 lines

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Pure CSS Like Button</title>
<style>
:root {
  --heart-color: #ff4757;
  --heart-hover: #ff6b6b;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.like-container {
  position: relative;
  display: inline-block;
  margin: 100px auto;
  cursor: pointer;
}

.like-checkbox {
  display: none;
}

.like-button {
  position: relative;
  width: 80px;
  height: 70px;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.like-button:hover {
  transform: scale(1.1);
}

.heart {
  position: relative;
  width: 40px;
  height: 35px;
  transform: rotate(-45deg);
  transition: all 0.3s ease;
}

.heart:before,
.heart:after {
  content: "";
  position: absolute;
  width: 40px;
  height: 35px;
  background: var(--heart-color);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.heart:before {
  top: -17.5px;
  left: 0;
}

.heart:after {
  top: 0;
  left: 20px;
}

.like-checkbox:checked + .like-button .heart {
  transform: rotate(-45deg) scale(1.3);
  animation: pulse 0.5s ease-out;
}

.like-checkbox:checked + .like-button .heart:before,
.like-checkbox:checked + .like-button .heart:after {
  background: #ff6b6b;
}

.floating-hearts {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.floating {
  position: absolute;
  display: none;
  width: var(--size, 16px);
  height: calc(var(--size, 16px) * 0.866);
  background: var(--color, #ff4757);
  border-radius: 50%;
  animation: float 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  animation-delay: var(--delay, 0s);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
}

@keyframes float {
  0% {
    transform: translate(-50%, -50%) rotate(-45deg) scale(1);
    opacity: 1;
  }
  20% {
    transform: translate(calc(-50% - 20px), calc(-50% - 40px)) rotate(-45deg) scale(1.2);
  }
  40% {
    transform: translate(calc(-50% + 30px), calc(-50% - 60px)) rotate(-45deg) scale(0.9);
  }
  60% {
    transform: translate(calc(-50% - 10px), calc(-50% - 80px)) rotate(-45deg) scale(1.1);
  }
  80% {
    transform: translate(calc(-50% + 25px), calc(-50% - 100px)) rotate(-45deg) scale(0.8);
  }
  100% {
    transform: translate(-50%, -150%) rotate(-45deg) scale(0.5);
    opacity: 0;
  }
}

@keyframes pulse {
  0% { transform: rotate(-45deg) scale(1); }
  50% { transform: rotate(-45deg) scale(1.4); }
  100% { transform: rotate(-45deg) scale(1); }
}

.instructions {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.like-checkbox:checked ~ .instructions {
  opacity: 1;
}
</style>
</head>
<body>
<div class="like-container">
  <input type="checkbox" id="like-btn" class="like-checkbox">
  <label for="like-btn" class="like-button">
    <span class="heart"></span>
  </label>
  <div class="floating-hearts">
    <span class="floating" style="--size: 12px; --delay: 0s; --color: #ff6b6b;"></span>
    <span class="floating" style="--size: 16px; --delay: 0.1s; --color: #ff8e53;"></span>
    <span class="floating" style="--size: 10px; --delay: 0.2s; --color: #ffd166;"></span>
    <span class="floating" style="--size: 14px; --delay: 0.3s; --color: #06d6a0;"></span>
    <span class="floating" style="--size: 12px; --delay: 0.4s; --color: #4cc9f0;"></span>
    <span class="floating" style="--size: 18px; --delay: 0.5s; --color: #a78bfa;"></span>
    <span class="floating" style="--size: 14px; --delay: 0.6s; --color: #ff6b9d;"></span>
    <span class="floating" style="--size: 12px; --delay: 0.7s; --color: #74b9ff;"></span>
  </div>
  <div class="instructions">Click to see the crazy animation!</div>
</div>
</body>
</html>
Reasoning trace (1,919 tokens)
The user wants a "like" button in pure CSS with no JavaScript, featuring a crazy animation on click. Since it's pure CSS, I'll need to use the :active pseudo-class or :checked pseudo-class with a hidden checkbox to simulate click behavior. The animation should be visually interesting and happen when clicked.

Let me think about the approach:
1. Use a checkbox input styled as a heart/like button
2. Use the :checked pseudo-class to trigger animations
3. Create a visually appealing animation that happens on click
4. Make it responsive and work well in the viewport

For the "crazy animation", I could do something like:
- Heart shape that pulses and explodes into particles
- Ripple effect
- Color change with multiple elements
- Floating hearts that emerge

I think a good approach would be:
- A heart button that when clicked, transforms into multiple smaller hearts that float away
- Use CSS keyframes for the animation
- Use the :checked state to trigger the animation
- The animation should be visually impressive but also meaningful on first paint

Let me structure this:
- Hidden checkbox input
- Label styled as a heart button
- Multiple heart elements that appear when checked
- Keyframes animation for the floating hearts
- The main heart should have a click effect too

I'll use Font Awesome heart icon via CDN for the like button, but wait - the user said no external files except CDN URLs explicitly allowed. Font Awesome is a CDN URL, so that should be fine.

Actually, let me reconsider - maybe using pure CSS heart shapes would be better to avoid external dependencies. I can create a heart with CSS using pseudo-elements.

Let me plan the animation:
1. Default state: a heart button
2. On click (checked state): the heart transforms and emits smaller hearts that float outward
3. The main heart could pulse or change color
4. The smaller hearts should have different sizes, colors, and trajectories

For the floating hearts, I'll need multiple elements with different animation delays and paths.

Structure:
- Container div
- Hidden checkbox input
- Label for the checkbox (styled as the main heart button)
- Multiple span elements for the floating hearts (initially hidden)
- CSS that shows the floating hearts when checkbox is checked
- Keyframes animations for the floating effect

Let me write the code:

HTML:
```html
<input type="checkbox" id="like-btn" class="like-checkbox">
<label for="like-btn" class="like-button">
  <span class="heart"></span>
</label>
<div class="floating-hearts">
  <span class="heart floating" style="--size: 12px; --delay: 0s; --color: #ff6b6b;"></span>
  <span class="heart floating" style="--size: 16px; --delay: 0.1s; --color: #ff8e53;"></span>
  <span class="heart floating" style="--size: 10px; --delay: 0.2s; --color: #ffd166;"></span>
  <span class="heart floating" style="--size: 14px; --delay: 0.3s; --color: #06d6a0;"></span>
  <span class="heart floating" style="--size: 12px; --delay: 0.4s; --color: #4cc9f0;"></span>
  <span class="heart floating" style="--size: 18px; --delay: 0.5s; --color: #a78bfa;"></span>
</div>
```

CSS:
- Style the checkbox as hidden
- Style the label as a heart button
- Style the floating hearts
- Use :checked to trigger animations
- Keyframes for floating hearts

The heart shape can be created with:
```css
.heart {
  position: relative;
  width: 30px;
  height: 26px;
  transform: rotate(-45deg);
}
.heart:before, .heart:after {
  content: "";
  position: absolute;
  width: 30px;
  height: 26px;
  background: red;
  border-radius: 50%;
}
.heart:before {
  top: -13px;
  left: 0;
}
.heart:after {
  top: 0;
  left: 15px;
}
```

For the animation, when checked:
- The main heart could scale up and change color
- The floating hearts become visible and animate outward

Let me write the complete CSS with keyframes:

```css
@keyframes float {
  0% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) scale(0.5);
    opacity: 0;
  }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.like-checkbox {
  display: none;
}

.like-button {
  display: inline-block;
  cursor: pointer;
  position: relative;
  width: 60px;
  height: 52px;
  background: transparent;
  border: none;
  outline: none;
  margin: 20px;
}

.heart {
  position: relative;
  width: 30px;
  height: 26px;
  transform: rotate(-45deg);
  transition: all 0.3s ease;
}

.heart:before, .heart:after {
  content: "";
  position: absolute;
  width: 30px;
  height: 26px;
  background: #ff4757;
  border-radius: 50%;
}

.heart:before {
  top: -13px;
  left: 0;
}

.heart:after {
  top: 0;
  left: 15px;
}

.like-checkbox:checked + .like-button .heart {
  transform: rotate(-45deg) scale(1.2);
  animation: pulse 0.5s ease;
}

.like-checkbox:checked ~ .floating-hearts .floating {
  display: block;
}

.floating-hearts {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.floating {
  position: absolute;
  display: none;
  width: var(--size);
  height: calc(var(--size) * 0.866);
  background: var(--color);
  border-radius: 50%;
  animation: float 1s ease-in-out forwards;
  animation-delay: var(--delay);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.like-checkbox:checked + .like-button {
  animation: pulse 0.5s ease;
}
```

Wait, I need to position the floating hearts properly. They should originate from the main heart. Let me adjust the positioning.

Actually, the floating hearts container is positioned absolutely, so they'll be positioned relative to the button. I need to set the container to position: relative on the button or something.

Let me restructure:

```html
<div class="like-container">
  <input type="checkbox" id="like-btn" class="like-checkbox">
  <label for="like-btn" class="like-button">
    <span class="heart"></span>
  </label>
  <div class="floating-hearts">
    <!-- floating hearts -->
  </div>
</div>
```

And CSS:
```css
.like-container {
  position: relative;
  display: inline-block;
  margin: 100px auto;
}

.floating-hearts {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
```

This way the floating hearts are positioned relative to the container.

Let me also add some initial state styling and make sure it looks good on first paint.

For the "crazy animation", I want something more impressive. Maybe:
- The heart bursts into multiple hearts that fly out in different directions
- Each heart has a different color
- The hearts fade out as they fly up
- The main heart pulses or changes color

Let me refine the animation. The floating animation should have different trajectories, not just straight up. I can use different keyframes for different hearts or use transform with different values.

Actually, for simplicity and to keep it pure CSS, I'll have the hearts float upward but with slight horizontal movement using different animation functions.

Let me write the complete code now.