← back to Model Arena

data/artifacts/1cbd0c1990e7/qwen25-7b.html

174 lines

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Retro Teletext Briefing</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            background-color: #222;
            color: white;
            font-family: "Courier New", Courier, monospace;
            overflow-x: hidden;
        }
        .panel {
            width: 100%;
            height: 48px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 5px;
            margin-top: 2px;
            border-bottom: solid 1px #333;
        }
        .panel-text {
            width: calc(67% - 50px);
            display: flex;
            align-items: center;
        }
        .mood-dial {
            width: 90%;
            height: 48px;
            border-radius: 12px;
            background-color: #333;
            padding-left: 5px;
        }
        .dial-bar {
            background-image: linear-gradient(to right, red 60%, green 60%);
            width: 0%;
            height: 100%;
            border-radius: inherit;
            transition: width 0.3s ease-in-out;
        }
        .crawler {
            position: fixed;
            bottom: 2px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 14px;
            color: gray;
            animation: crawl 20s infinite linear;
        }
        @keyframes crawl {
            from { background-position: 100% center; }
            to { background-position: 0% center; }
        }
        .controls {
            display: flex;
            justify-content: space-between;
            padding: 5px;
        }
    </style>
</head>
<body>
    <div class="panel">
        <div class="panel-text">Latest News</div>
        <span class="crawler" style="width: calc(100% - 24px);"><span>Teletext Channel 56/78</span></span>
    </div>
    <div class="panel">
        <span>Economic Summary:</span>
        <div id="mood-dial" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" class="mood-dial">
            <div class="dial-bar" style="width: 60%;"></div>
        </div>
    </div>
    <div class="panel">
        <span>Inflation Rate:</span>
        <span>3.2% &lt; Last Week: 3.1%</span>
    </div>
    <div class="panel" id="panel4">
        <span>GDP Growth:</span>
        <span>-0.8% &lt; Last Month: -0.7%</span>
    </div>
    <div class="panel" id="panel5">
        <span>Unemployment Rate:</span>
        <span>6.1% &lt; Last Week: 6.2%</span>
    </div>
    <div class="controls">
        <button tabindex="-1" onclick="channelFlip(-4)" style="width: 30%;"><</button>
        <input type="range" id="scanline-slider" min="180" max="360" value="270" step="1" class="scanline-control" />
        <label for="scanline-slider">Scanlines</label>
        <button tabindex="-1" onclick="channelFlip(4)">></button>
    </div>

    <script>
        const panels = document.querySelectorAll('.panel');
        const scanlineSlider = document.getElementById('scanline-slider');

        function channelFlip(direction) {
            if (direction > 0) {
                let currentPanelIndex = parseInt(document.querySelector('#panel5').dataset.index);
                currentPanelIndex--;
                if (currentPanelIndex < 1) return;
                updatePanels(currentPanelIndex);
            } else {
                let currentPanelIndex = parseInt(document.querySelector('#panel5').dataset.index);
                currentPanelIndex++;
                if (currentPanelIndex > panels.length - 3) return;
                updatePanels(currentPanelIndex);
            }
        }

        function updatePanels(panelIndex) {
            const panel4 = document.getElementById('panel4');
            const panel5 = document.getElementById('panel5');

            for (let i = 0; i < panels.length; i++) {
                if (i === panelIndex - 2 || i === panelIndex - 1) {
                    panels[i].style.backgroundColor = '#262626';
                    panels[i].querySelector('.dial-bar').style.width = '30%';
                    panels[i].dataset.index = panelIndex;
                } else if (i === panelIndex + 2 || i === panelIndex + 1) {
                    panels[i].style.backgroundColor = '#444';
                    panels[i].querySelector('.dial-bar').style.width = '90%';
                    panels[i].dataset.index = 'loading';
                } else {
                    panels[i].style.backgroundColor = '#333';
                    panels[i].querySelector('.dial-bar').style.width = '60%';
                    panels[i].dataset.index = '';
                }
            }

            panel4.style.display = (panelIndex === 1) ? 'block' : 'none';
            panel5.style.display = (panelIndex === 2 || panelIndex === 3) ? 'block' : 'none';

            if (!panels[0].hasAttribute('aria-busy')) {
                panels[0].setAttribute('aria-busy', 'true');
                setTimeout(() => {
                    panels[0].removeAttribute('aria-busy');
                }, 1500);
            }
        }

        window.onload = () => {
            updatePanels(3);
            scanlineSlider.oninput = () => {
                document.body.style.setProperty('--scanlines', scanlineSlider.value + 'px');
            };
        };

        document.addEventListener('keydown', (event) => {
            if (event.key === 'ArrowLeft') channelFlip(-4);
            else if (event.key === 'ArrowRight') channelFlip(4);
        });

        // Simulate reduced motion for testing
        window.matchMedia("(prefers-reduced-motion: reduce)").addEventListener("change", (e) => {
            document.body.style.setProperty('--scanlines', e.matches ? 270 + 'px' : scanlineSlider.value + 'px');
        });
    </script>
    <style>
        /* Apply scanline effect */
        body::after {
            content: '';
            position: fixed;
            top: -15px; right: 10%; bottom: 0; left: 80%;
            background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.7) 10px, transparent 10px);
        }
    </style>
</body>
</html>