Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Ultimate Sleeper Gen - Street Racer</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <link rel="preconnect" href="https://fonts.googleapis.com"> | |
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
| <link href="https://fonts.googleapis.com/css2?family=Gloria+Hallelujah&display=swap" rel="stylesheet"> | |
| <style> | |
| @import url('https://unpkg.com/normalize.css') layer(normalize); | |
| :root { | |
| --bg: #000; | |
| --accent: #ff1e1e; | |
| --card-bg: #fff; | |
| --text: #000; | |
| --success: #4caf50; | |
| --danger: #f44336; | |
| } | |
| body { | |
| background: light-dark(#fff, #000); | |
| display: grid; | |
| place-items: center; | |
| min-height: 100vh; | |
| margin: 0; | |
| font-family: 'SF Pro Text', system-ui, sans-serif; | |
| overflow-x: hidden; | |
| } | |
| body::before { | |
| --size: 45px; | |
| --line: color-mix(in hsl, canvasText, transparent 80%); | |
| content: ''; | |
| height: 100vh; | |
| width: 100vw; | |
| position: fixed; | |
| background: linear-gradient(90deg, var(--line) 1px, transparent 1px var(--size)) calc(var(--size) * 0.36) 50% / var(--size) var(--size), | |
| linear-gradient(var(--line) 1px, transparent 1px var(--size)) 0% calc(var(--size) * 0.32) / var(--size) var(--size); | |
| mask: linear-gradient(-20deg, transparent 50%, white); | |
| top: 0; | |
| z-index: -1; | |
| pointer-events: none; | |
| } | |
| main { | |
| display: flex; | |
| flex-direction: column; | |
| align-items: center; | |
| gap: 2rem; | |
| padding: 2rem; | |
| z-index: 1; | |
| } | |
| .generator-card { | |
| width: clamp(300px, 80vw, 600px); | |
| background: var(--card-bg); | |
| padding: 1rem; | |
| border: 2px solid #000; | |
| box-shadow: 10px 10px 0px #000; | |
| position: relative; | |
| } | |
| .image-container { | |
| width: 100%; | |
| aspect-ratio: 16/9; | |
| background: #eee; | |
| margin-bottom: 1rem; | |
| overflow: hidden; | |
| border: 1px solid #ddd; | |
| } | |
| #genImage { | |
| width: 100%; | |
| height: 100%; | |
| object-fit: cover; | |
| transition: opacity 0.3s; | |
| } | |
| h2 { | |
| font-family: 'Gloria Hallelujah', cursive; | |
| margin: 0.5rem 0; | |
| font-size: 1.5rem; | |
| } | |
| .controls { | |
| display: flex; | |
| gap: 0.5rem; | |
| margin-bottom: 1rem; | |
| flex-wrap: wrap; | |
| } | |
| .btn { | |
| padding: 0.5rem 1rem; | |
| border: 2px solid #000; | |
| background: #fff; | |
| font-weight: bold; | |
| cursor: pointer; | |
| font-family: inherit; | |
| transition: 0.2s; | |
| } | |
| .btn:hover { background: #eee; transform: translate(-2px, -2px); box-shadow: 2px 2px 0 #000; } | |
| .btn.active { background: var(--accent); color: #fff; } | |
| .input-group { | |
| width: 100%; | |
| display: flex; | |
| margin-bottom: 1rem; | |
| } | |
| #customPrompt { | |
| flex-grow: 1; | |
| padding: 0.5rem; | |
| border: 2px solid #000; | |
| font-family: inherit; | |
| } | |
| .accordion { | |
| width: 100%; | |
| border: 2px solid #000; | |
| background: #f9f9f9; | |
| margin-top: 1rem; | |
| } | |
| .accordion-header { | |
| padding: 0.75rem; | |
| cursor: pointer; | |
| font-weight: bold; | |
| display: flex; | |
| justify-content: space-between; | |
| background: #eee; | |
| } | |
| .accordion-content { | |
| max-height: 0; | |
| overflow: hidden; | |
| transition: max-height 0.3s ease-out; | |
| padding: 0 0.75rem; | |
| } | |
| .accordion-content.open { | |
| max-height: 500px; | |
| padding: 0.75rem; | |
| } | |
| .component-grid { | |
| display: grid; | |
| grid-template-columns: 1fr 1fr; | |
| gap: 0.5rem; | |
| font-size: 0.85rem; | |
| margin-top: 1rem; | |
| } | |
| .status { font-weight: bold; } | |
| .check { color: var(--success); } | |
| .cross { color: var(--danger); } | |
| .arrow { | |
| font-family: 'Gloria Hallelujah', cursive; | |
| font-size: 0.75rem; | |
| position: absolute; | |
| right: -60px; | |
| top: 20px; | |
| rotate: 15deg; | |
| pointer-events: none; | |
| } | |
| .bear-link { | |
| color: canvasText; | |
| position: fixed; | |
| top: 1rem; | |
| left: 1rem; | |
| width: 48px; | |
| aspect-ratio: 1; | |
| opacity: 0.8; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <a class="bear-link" href="#"> | |
| <svg viewBox="0 0 969 955" fill="none" xmlns="http://www.w3.org/2000/svg"> | |
| <circle cx="161.191" cy="320.191" r="133.191" stroke="currentColor" stroke-width="20"></circle> | |
| <circle cx="806.809" cy="320.191" r="133.191" stroke="currentColor" stroke-width="20"></circle> | |
| <path d="M564.388 712.083C564.388 743.994 526.035 779.911 483.372 779.911C440.709 779.911 402.356 743.994 402.356 712.083C402.356 680.173 440.709 664.353 483.372 664.353C526.035 664.353 564.388 680.173 564.388 712.083Z" fill="currentColor"></path> | |
| <rect x="310.42" y="448.31" width="343.468" height="51.4986" fill="#FF1E1E"></rect> | |
| <path fill-rule="evenodd" clip-rule="evenodd" d="M745.643 288.24C815.368 344.185 854.539 432.623 854.539 511.741H614.938V454.652C614.938 433.113 597.477 415.652 575.938 415.652H388.37C366.831 415.652 349.37 433.113 349.37 454.652V511.741L110.949 511.741C110.949 432.623 150.12 344.185 219.845 288.24C289.57 232.295 384.138 200.865 482.744 200.865C581.35 200.865 675.918 232.295 745.643 288.24Z" fill="currentColor"></path> | |
| </svg> | |
| </a> | |
| <main> | |
| <div class="generator-card"> | |
| <div class="arrow"><span>Build it!</span></div> | |
| <h2>The Sleeper Gen<sup>β’</sup></h2> | |
| <div class="image-container"> | |
| <img id="genImage" src="https://image.pollinations.ai/prompt/rusty%201992%20toyota%20corolla%20sleeper%20car%20hidden%20racing%20parts?width=800&height=450&nologo=true" alt="Sleeper Image"> | |
| </div> | |
| <div class="input-group"> | |
| <input type="text" id="customPrompt" placeholder="Enter car model (e.g. 1998 Honda Civic)..."> | |
| <button class="btn" style="background: #000; color: #fff;" onclick="generate()">GENERATE</button> | |
| </div> | |
| <div class="controls"> | |
| <button class="btn active" id="btnExt" onclick="setViewState('exterior')">EXTERIOR</button> | |
| <button class="btn" id="btnHood" onclick="setViewState('hood')">HOOD OPEN</button> | |
| <button class="btn" onclick="randomize()">RANDOMIZE</button> | |
| </div> | |
| <div class="accordion"> | |
| <div class="accordion-header" onclick="toggleAccordion()"> | |
| <span>ENGINE BAY SPECS</span> | |
| <span id="accIcon">+</span> | |
| </div> | |
| <div class="accordion-content" id="engineBay"> | |
| <p style="font-size: 0.9rem; border-bottom: 1px solid #ddd; padding-bottom: 5px;">High-performance racing swap hidden in a junk body.</p> | |
| <div class="component-grid"> | |
| <div><span class="status cross">β</span> OEM 4-Cylinder</div> | |
| <div><span class="status check">β</span> Twin-Turbo V8</div> | |
| <div><span class="status cross">β</span> Stock Airbox</div> | |
| <div><span class="status check">β</span> Custom Intercooler</div> | |
| <div><span class="status cross">β</span> Steel Rims</div> | |
| <div><span class="status check">β</span> Beadlock Slicks</div> | |
| <div><span class="status check">β</span> Nitrous System</div> | |
| <div><span class="status check">β</span> Parachute Mount</div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </main> | |
| <script> | |
| let currentMode = 'exterior'; | |
| const cars = ["1994 Toyota Camry beige", "1991 Volvo 240 Wagon", "2000 Ford Taurus dented", "1995 Nissan Sentra faded", "1988 Honda Accord rusty"]; | |
| function toggleAccordion() { | |
| const content = document.getElementById('engineBay'); | |
| const icon = document.getElementById('accIcon'); | |
| content.classList.toggle('open'); | |
| icon.innerText = content.classList.contains('open') ? "-" : "+"; | |
| if(content.classList.contains('open')) { | |
| setViewState('engine'); | |
| } | |
| } | |
| function setViewState(mode) { | |
| currentMode = mode; | |
| document.getElementById('btnExt').classList.toggle('active', mode === 'exterior'); | |
| document.getElementById('btnHood').classList.toggle('active', mode === 'hood'); | |
| generate(); | |
| } | |
| function randomize() { | |
| const randomCar = cars[Math.floor(Math.random() * cars.length)]; | |
| document.getElementById('customPrompt').value = randomCar; | |
| generate(); | |
| } | |
| function generate() { | |
| const img = document.getElementById('genImage'); | |
| const baseInput = document.getElementById('customPrompt').value || "1995 sedan beater"; | |
| let finalPrompt = ""; | |
| if(currentMode === 'exterior') { | |
| finalPrompt = `Extreme sleeper street racer, ${baseInput}, rusted body, faded paint, hidden roll cage, small drag slicks on rear, realistic 8k photography, street lighting.`; | |
| } else if (currentMode === 'hood') { | |
| finalPrompt = `1990s beater car with hood open, showing a massive chrome twin turbo V8 engine swap, racing fuel lines, intercooler, messy wires, highly detailed, realistic.`; | |
| } else { | |
| finalPrompt = `Close up engine bay of a sleeper race car, ${baseInput}, huge turbocharger, nitrous oxide lines, custom manifold, dirty engine bay but high tech parts, 8k.`; | |
| } | |
| img.style.opacity = '0.5'; | |
| const url = `https://image.pollinations.ai/prompt/${encodeURIComponent(finalPrompt)}?width=800&height=450&nologo=true&seed=${Math.floor(Math.random()*10000)}`; | |
| const newImg = new Image(); | |
| newImg.onload = () => { | |
| img.src = url; | |
| img.style.opacity = '1'; | |
| }; | |
| newImg.src = url; | |
| } | |
| </script> | |
| </body> | |
| </html> |