#!/usr/bin/env bash
set -e
DATA=./data/projects/demo
mkdir -p "$DATA"
cat > "$DATA/project.json" <<JSON
{ "id": "demo", "ownerId": "demo-user", "name": "Electrodynamic Sketch", "createdAt": "$(date -Iseconds)", "updatedAt": "$(date -Iseconds)" }
JSON
cat > "$DATA/index.html" <<'HTML'
<div id="app"></div>
HTML
cat > "$DATA/style.css" <<'CSS'
html,body,#app{height:100%;margin:0;background:#000;color:#40f2d0;font-family:system-ui}
canvas{position:fixed;inset:0}
CSS
cat > "$DATA/main.js" <<'JS'
const c=document.createElement('canvas');document.body.appendChild(c);const x=c.getContext('2d');function R(){c.width=innerWidth;c.height=innerHeight}addEventListener('resize',R);R();const pts=Array.from({length:888},()=>({x:Math.random()*c.width,y:Math.random()*c.height,vx:Math.random()-0.5,vy:Math.random()-0.5}));function step(){x.fillStyle='rgba(0,0,0,0.08)';x.fillRect(0,0,c.width,c.height);x.fillStyle='#40f2d0';for(const p of pts){p.x+=p.vx;p.y+=p.vy;if(p.x<0||p.x>c.width)p.vx*=-1;if(p.y<0||p.y>c.height)p.vy*=-1;x.fillRect(p.x,p.y,1.2,1.2)}requestAnimationFrame(step)}step();
JS
echo "✓ Demo project seeded at $DATA"
