Models 44

Gemma 4 31B

by Googlereasoning defaultClean
Open in new window

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

How it went

Total time
10.5 s
Cost
$0.0007
Output tokens
1,576
Spent thinking
0 tokens
Speed
154.7 tok/s
Console errors
0
First token after
289 ms
First visible text after
289 ms
Prompt tokens
381
Code size
5.2 KB
Finish reason
stop
Served by
NextBit
Model id
google/gemma-4-31b-it
Reasoning sent
model default
Max output
16,384 tokens
Generated
Nov 13, 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 · 187 lines

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Pure CSS Like Button</title>
    <style>
        :root {
            --primary-color: #ff4b6e;
            --bg-color: #f0f2f5;
            --transition-speed: 0.4s;
        }

        body {
            margin: 0;
            height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: var(--bg-color);
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        .container {
            text-align: center;
        }

        h1 {
            color: #444;
            margin-bottom: 2rem;
            font-weight: 300;
        }

        /* THE MAGIC: Using a hidden checkbox to maintain state without JS */
        #like-checkbox {
            display: none;
        }

        .like-button {
            display: inline-block;
            cursor: pointer;
            user-select: none;
            position: relative;
            transition: transform 0.1s active;
        }

        /* The Heart Shape using pseudo-elements */
        .heart {
            position: relative;
            width: 100px;
            height: 90px;
            background-color: #ddd;
            display: block;
            margin: 0 auto;
            transform: rotate(-45deg);
            transition: background-color var(--transition-speed), transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        }

        .heart::before,
        .heart::after {
            content: "";
            position: absolute;
            width: 100px;
            height: 100px;
            background-color: #ddd;
            border-radius: 50%;
            transition: background-color var(--transition-speed);
        }

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

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

        /* Label styling to act as the button */
        .button-label {
            display: flex;
            flex-direction: column;
            align-items: center;
            cursor: pointer;
        }

        .text {
            margin-top: 60px;
            font-weight: bold;
            color: #888;
            transition: color var(--transition-color);
            font-size: 1.2rem;
        }

        /* ANIMATION LOGIC: When checkbox is checked */
        #like-checkbox:checked + .button-label .heart {
            background-color: var(--primary-color);
            transform: rotate(-45deg) scale(1.2);
            animation: heart-pop 0.5s ease-out;
        }

        #like-checkbox:checked + .button-label .heart::before,
        #like-checkbox:checked + .button-label .heart::after {
            background-color: var(--primary-color);
        }

        #like-checkbox:checked + .button-label .text {
            color: var(--primary-color);
            transform: scale(1.1);
        }

        /* Confetti / Particles using pseudo-elements on the label */
        .button-label::before,
        .button-label::after {
            content: "";
            position: absolute;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            opacity: 0;
            pointer-events: none;
        }

        /* Multiple "particles" simulation via complex shadows or just a few pseudo elements */
        /* Since we only have 2 pseudos, we use a box-shadow trick for "burst" effect */
        #like-checkbox:checked + .button-label::before {
            opacity: 1;
            animation: burst 0.6s ease-out forwards;
            box-shadow: 
                -20px -20px 0 #ffeb3b, 20px -20px 0 #ffeb3b,
                -30px 0px 0 #4caf50, 30px 0px 0 #4caf50,
                -20px 20px 0 #2196f3, 20px 20px 0 #2196f3,
                0px -30px 0 #ff9800, 0px 30px 0 #ff9800;
        }

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

        @keyframes burst {
            0% { 
                transform: scale(0); 
                opacity: 1; 
            }
            100% { 
                transform: scale(1.5); 
                opacity: 0; 
            }
        }

        /* Hover effect */
        .button-label:hover .heart {
            transform: rotate(-45deg) scale(1.05);
        }
        
        .button-label:hover .heart::before,
        .button-label:hover .heart::after {
            background-color: #ccc;
        }

        .hint {
            margin-top: 80px;
            font-size: 0.9rem;
            color: #aaa;
        }
    </style>
</head>
<body>

    <div class="container">
        <h1>Pure CSS Interaction</h1>
        
        <input type="checkbox" id="like-checkbox">
        <label for="like-checkbox" class="button-label">
            <div class="heart"></div>
            <span class="text">Like it!</span>
        </label>

        <p class="hint">No JavaScript used. Only CSS checkboxes and selectors.</p>
    </div>

</body>
</html>