Interactive 3D aquariumOne-line
gpt-oss-120b
by OpenAIReasoningClean
Running live in a sandboxed frame. Click inside it before using the keyboard.
How it went
- Total time
- 15.3 s
- Cost
- $0.0002
- Output tokens
- 1,403
- Spent thinking
- 47 tokens
- Speed
- 96.7 tok/s
- Console errors
- 0
- First token after
- 755 ms
- First visible text after
- 1.2 s
- Prompt tokens
- 487
- Code size
- 4.6 KB
- Finish reason
- stop
- Served by
- PrimeIntellect
- Model id
openai/gpt-oss-120b- Reasoning sent
{"effort":"low"}- Max output
- 64,000 tokens
- Generated
- Nov 11, 2026
What it was asked
The prompt
“a 3D aquarium with Three.js where the fish swim away when I move the mouse near them (Load Three.js only through this import map: <script type="importmap">{"imports":{"three":"https://cdn.jsdelivr.net/npm/three@0.170.0/build/three.module.js","three/addons/":"https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/"}}</script>)”
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 · 158 lines
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>3D Aquarium Demo</title>
<style>
body,html{margin:0;height:100%;overflow:hidden;background:#001e3c;font-family:sans-serif}
#overlay{
position:absolute;top:0;left:0;width:100%;height:100%;
display:flex;align-items:center;justify-content:center;
background:rgba(0,0,0,0.6);color:#fff;font-size:1.5rem;
cursor:pointer;z-index:2;
}
</style>
<script type="importmap">
{
"imports": {
"three":"https://cdn.jsdelivr.net/npm/three@0.170.0/build/three.module.js",
"three/addons/":"https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/"
}
}
</script>
</head>
<body>
<div id="overlay">Click or press any key to start</div>
<script type="module">
import * as THREE from "three";
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
let scene, camera, renderer, controls;
let fishes = [];
const fishCount = 30;
let mouse = new THREE.Vector2(-1000, -1000);
let started = false;
init();
function init() {
scene = new THREE.Scene();
scene.fog = new THREE.FogExp2(0x001e3c, 0.02);
camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 200);
camera.position.set(0, 5, 20);
renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setPixelRatio(window.devicePixelRatio);
document.body.appendChild(renderer.domElement);
controls = new OrbitControls(camera, renderer.domElement);
controls.enableDamping = true;
// Light
const ambient = new THREE.AmbientLight(0x404080, 2);
scene.add(ambient);
const dirLight = new THREE.DirectionalLight(0xffffff, 1);
dirLight.position.set(5,10,7);
scene.add(dirLight);
// Aquarium walls (simple box)
const geo = new THREE.BoxGeometry(40, 20, 30);
const mat = new THREE.MeshPhysicalMaterial({
side: THREE.BackSide,
color: 0x003366,
transmission: 0.9,
thickness: 1,
clearcoat: 1,
clearcoatRoughness: 0.2,
reflectivity: 0.9
});
const tank = new THREE.Mesh(geo, mat);
scene.add(tank);
// Fish prototype
const fishGeo = new THREE.ConeGeometry(0.3, 1, 8);
const fishMat = new THREE.MeshStandardMaterial({ color: 0xff6600, flatShading:true });
for (let i = 0; i < fishCount; i++) {
const fish = new THREE.Mesh(fishGeo, fishMat);
fish.position.set(
(Math.random() - 0.5) * 30,
(Math.random() - 0.5) * 12 + 2,
(Math.random() - 0.5) * 20
);
fish.rotation.y = Math.random() * Math.PI * 2;
fish.userData = {
velocity: new THREE.Vector3(
(Math.random() - 0.5) * 0.05,
(Math.random() - 0.5) * 0.02,
(Math.random() - 0.5) * 0.05
)
};
scene.add(fish);
fishes.push(fish);
}
window.addEventListener('resize', onWindowResize);
renderer.domElement.addEventListener('mousemove', onMouseMove);
document.getElementById('overlay').addEventListener('click', start);
document.addEventListener('keydown', start);
}
function start(){
if(started) return;
started = true;
document.getElementById('overlay').remove();
animate();
}
function onWindowResize(){
camera.aspect = window.innerWidth/window.innerHeight;
camera.updateProjectionMatrix();
renderer.setSize(window.innerWidth, window.innerHeight);
}
function onMouseMove(event){
const rect = renderer.domElement.getBoundingClientRect();
mouse.x = ((event.clientX - rect.left) / rect.width) * 2 - 1;
mouse.y = -((event.clientY - rect.top) / rect.height) * 2 + 1;
// Convert to world coordinates near camera plane
const vec = new THREE.Vector3(mouse.x, mouse.y, 0.5).unproject(camera);
mouseWorld = vec;
}
function animate(){
requestAnimationFrame(animate);
controls.update();
fishes.forEach(fish=>{
// simple wandering
fish.position.add(fish.userData.velocity);
// keep inside tank
const limit = {x:19, y:9, z:14};
['x','y','z'].forEach(ax=>{
if(Math.abs(fish.position[ax])>limit[ax]){
fish.position[ax] = THREE.MathUtils.clamp(fish.position[ax], -limit[ax], limit[ax]);
fish.userData.velocity[ax] = -fish.userData.velocity[ax];
}
});
// mouse avoidance
if(mouseWorld){
const dist = fish.position.distanceTo(mouseWorld);
if(dist < 3){
const away = new THREE.Vector3().subVectors(fish.position, mouseWorld).normalize().multiplyScalar(0.02);
fish.userData.velocity.add(away);
}
}
// limit speed
fish.userData.velocity.clampLength(0.01, 0.07);
// orient to velocity
const dir = fish.userData.velocity.clone().normalize();
fish.rotation.y = Math.atan2(dir.x, dir.z);
});
renderer.render(scene, camera);
}
</script>
</body>
</html>Reasoning trace (47 tokens)
We need to output HTML with importmap and three.js demo. Implement simple fish as spheres moving randomly, and on mouse move, fish steer away if mouse is close. Provide start overlay. Use script type="module". All inline.