<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Hello World Ocean</title>
<style>
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;font-family:system-ui,-apple-system,Segoe UI,sans-serif;color:#f4fbff}
body{background:#063b62}
canvas{display:block;width:100%;height:100%;cursor:crosshair}
.ui{position:fixed;inset:0;pointer-events:none;padding:clamp(18px,4vw,42px);display:flex;flex-direction:column;justify-content:space-between}
.top{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}
h1{font-size:clamp(2.4rem,7vw,6rem);line-height:.9;margin:0;text-shadow:0 5px 0 #075078,0 8px 22px #00284080;letter-spacing:-.07em}
.subtitle{margin:.7rem 0 0;font-size:clamp(.85rem,2vw,1.05rem);opacity:.85;letter-spacing:.05em}
.score{pointer-events:auto;background:#042b4bdd;border:1px solid #a8edff55;border-radius:18px;padding:12px 17px;text-align:center;min-width:105px;box-shadow:0 8px 24px #00284055}
.score b{display:block;font-size:1.8rem;color:#ffe587}.score span{font-size:.75rem;text-transform:uppercase;letter-spacing:.12em;opacity:.8}
.bottom{display:flex;justify-content:space-between;align-items:end;gap:18px}
.tip{font-size:.9rem;opacity:.86;background:#042b4bbd;padding:10px 14px;border-radius:12px;backdrop-filter:blur(5px)}
button{pointer-events:auto;border:0;border-radius:999px;padding:14px 21px;background:#ffe587;color:#15354c;font:700 1rem inherit;box-shadow:0 5px 0 #d39d45;cursor:pointer}
button:hover{filter:brightness(1.08)}button:active{transform:translateY(3px);box-shadow:0 2px 0 #d39d45}
button:focus-visible,canvas:focus-visible{outline:3px solid white;outline-offset:4px}
@media(max-width:520px){.top{align-items:flex-start}.score{padding:9px 12px;min-width:80px}.score b{font-size:1.45rem}.bottom{align-items:stretch;flex-direction:column}.tip{order:2}button{align-self:flex-end}}
</style>
</head>
<body>
<canvas id="ocean" tabindex="0" aria-label="Ocean game. Click or tap swimming animals to catch them for points."></canvas>
<div class="ui">
<div class="top">
<div><h1>Hello<br>World</h1><p class="subtitle">A tiny ocean of friendly discoveries</p></div>
<div class="score"><b id="points">0</b><span>points</span></div>
</div>
<div class="bottom">
<div class="tip">🐟 Tap a creature to fish it out • Each one is worth 10 points</div>
<button id="cast">Cast a net</button>
</div>
</div>
<script>
const c=document.getElementById('ocean'),x=c.getContext('2d'),score=document.getElementById('points');
let W,H,dpr,pts=0, ripple=null, animals=[];
const types=['fish','fish','turtle','jelly','dolphin','seahorse','fish','jelly'];
function resize(){
dpr=devicePixelRatio||1; W=innerWidth;H=innerHeight;c.width=W*dpr;c.height=H*dpr;x.setTransform(dpr,0,0,dpr,0,0);
if(!animals.length) types.forEach((type,i)=>animals.push({type,x:80+Math.random()*(W-160),y:150+Math.random()*(H-230),s:.7+Math.random()*.55,v:(Math.random()*.8+.35)*(i%2?-1:1),phase:Math.random()*6}));
}
addEventListener('resize',resize);resize();
function bubble(px,py,r,a=1){x.globalAlpha=a;x.strokeStyle='#a8ecff88';x.lineWidth=2;x.beginPath();x.arc(px,py,r,0,7);x.stroke();x.globalAlpha=1}
function fish(a){
let flip=a.v<0;x.save();x.translate(a.x,a.y);x.scale(flip?-a.s:a.s,a.s);x.fillStyle='#ff9b61';x.beginPath();x.ellipse(0,0,25,13,0,0,7);x.fill();x.beginPath();x.moveTo(-20,0);x.lineTo(-39,-14);x.lineTo(-39,14);x.closePath();x.fillStyle='#f47c52';x.fill();x.fillStyle='#173b5a';x.beginPath();x.arc(15,-4,3,0,7);x.fill();x.strokeStyle='#ffd488';x.lineWidth=2;x.beginPath();x.arc(1,0,20,0,6);x.stroke();x.restore();
}
function turtle(a){
x.save();x.translate(a.x,a.y);x.scale(a.s,a.s);x.fillStyle='#6ecb9c';[[25,8],[-25,8],[17,-16],[-17,-16]].forEach(p=>{x.beginPath();x.ellipse(p[0],p[1],14,8,p[1]<0?.6:-.6,0,7);x.fill()});x.beginPath();x.arc(34,0,10,0,7);x.fill();x.fillStyle='#b8a866';x.beginPath();x.ellipse(0,0,30,21,0,0,7);x.fill();x.strokeStyle='#397d72';x.lineWidth=3;x.stroke();x.restore();
}
function jelly(a){
x.save();x.translate(a.x,a.y);x.scale(a.s,a.s);x.fillStyle='#ed98e7bb';x.beginPath();x.arc(0,0,22,Math.PI,0);x.lineTo(22,10);x.quadraticCurveTo(10,3,0,11);x.quadraticCurveTo(-10,3,-22,10);x.closePath();x.fill();x.strokeStyle='#ffd5f2';x.lineWidth=2;[-13,-4,6,15].forEach(q=>{x.beginPath();x.moveTo(q,9);x.quadraticCurveTo(q-5,24,q,33);x.stroke()});x.restore();
}
function dolphin(a){
x.save();x.translate(a.x,a.y);x.scale(a.v<0?-a.s:a.s,a.s);x.fillStyle='#92d8e5';x.beginPath();x.moveTo(-30,3);x.quadraticCurveTo(-5,-22,27,-4);x.quadraticCurveTo(40,3,23,10);x.quadraticCurveTo(4,20,-17,12);x.lineTo(-31,21);x.lineTo(-24,7);x.closePath();x.fill();x.beginPath();x.moveTo(2,-8);x.lineTo(8,-25);x.lineTo(16,-8);x.fill();x.fillStyle='#173b5a';x.beginPath();x.arc(23,-5,2.5,0,7);x.fill();x.restore();
}
function seahorse(a){
x.save();x.translate(a.x,a.y);x.scale(a.s,a.s);x.strokeStyle='#ffc76b';x.lineWidth=7;x.lineCap='round';x.beginPath();x.moveTo(0,25);x.bezierCurveTo(-18,8,15,4,2,-10);x.bezierCurveTo(-7,-25,14,-28,19,-14);x.stroke();x.beginPath();x.moveTo(4,-22);x.lineTo(20,-26);x.stroke();x.restore();
}
function drawAnimal(a){({fish,turtle,jelly,dolphin,seahorse}[a.type])(a)}
function catchAt(px,py){
let best=null,dist=65;
animals.forEach(a=>{let d=Math.hypot(a.x-px,a.y-py);if(d<dist){best=a;dist=d}});
if(best){pts+=10;score.textContent=pts;ripple={x:best.x,y:best.y,t:0};best.x= Math.random()*W;best.y=H*.35+Math.random()*H*.45;best.type=types[Math.floor(Math.random()*types.length)];}
else ripple={x:px,y:py,t:0};
}
c.addEventListener('pointerdown',e=>catchAt(e.clientX,e.clientY));
document.getElementById('cast').onclick=()=>catchAt(W*.5,H*.52);
c.addEventListener('keydown',e=>{if(e.key==='Enter'||e.key===' '){e.preventDefault();catchAt(W*.5,H*.52)}});
function frame(t){
let g=x.createLinearGradient(0,0,0,H);g.addColorStop(0,'#087da4');g.addColorStop(.5,'#075783');g.addColorStop(1,'#021f45');x.fillStyle=g;x.fillRect(0,0,W,H);
x.fillStyle='#ffffff18';for(let i=0;i<20;i++){let bx=(i*97+t/35*(i%3+1))%W,by=(i*61+t/70)%H;x.beginPath();x.arc(bx,by,2+i%3,0,7);x.fill()}
x.fillStyle='#06334d';x.beginPath();x.moveTo(0,H);x.lineTo(0,H-55);for(let i=0;i<W;i+=35)x.quadraticCurveTo(i+17,H-78-(i%70),i+35,H-55);x.lineTo(W,H);x.fill();
animals.forEach(a=>{a.x+=a.v; a.y+=Math.sin(t/900+a.phase)*.18;if(a.x<-70)a.x=W+70;if(a.x>W+70)a.x=-70;drawAnimal(a)});
if(ripple){ripple.t+=.045;x.strokeStyle='#fff9b0';x.lineWidth=3;x.globalAlpha=1-ripple.t/1.2;x.beginPath();x.arc(ripple.x,ripple.y,ripple.t*75,0,7);x.stroke();x.globalAlpha=1;if(ripple.t>1.2)ripple=null}
requestAnimationFrame(frame)
}
requestAnimationFrame(frame);
</script>
</body>
</html>
Nothing. This page is entirely self-contained and contacts no other website when it runs.
Published on Globefin under the MIT License. You may copy, change, and reuse this page, including commercially — just keep the notice below with it.
Copyright © 2026 Grace Bitler. Licensed under the MIT License. Published on Globefin.
Provided as is, without warranty. Any external libraries it loads keep their own licences. Terms →
Scripts run, but the demo has its own throwaway origin. It can't read your session or cookies, can't reach the page around it, and can't navigate your tab. Don't enter real passwords or personal data into any demo.