AI Thinking Orb
A glowing particle sphere with nine moods for AI states, from calm breathing to busy solving.
Preview and code
index.html
<!--
MIT License
Copyright (c) 2026 Suraj Maurya
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
-->
<div class="to-stage">
<div class="to">
<div class="to-view"><span class="to-orb" role="img" aria-label="working orb"><canvas aria-hidden="true"></canvas></span><div class="to-tag">state: <b>working</b> • 80px • 1x</div></div>
<div class="to-ctl">
<div class="to-g"><span class="to-l">Cognitive state preset</span><div class="to-st"></div></div>
<div class="to-grid">
<div class="to-g"><span class="to-l">Size (<i class="to-sv">80</i>px)</span><div class="to-seg" data-k="size"><button type="button">40</button><button type="button">64</button><button type="button">80</button><button type="button">110</button></div></div>
<div class="to-g"><span class="to-l">Speed</span><div class="to-seg" data-k="speed"><button type="button">0.5x</button><button type="button">1x</button><button type="button">1.5x</button><button type="button">2x</button></div></div>
<div class="to-g"><span class="to-l">Atmosphere</span><button type="button" class="to-tg to-dk on">Dark (White)</button></div>
<div class="to-g"><span class="to-l">Playback</span><button type="button" class="to-tg to-pl">Playing</button></div>
</div>
</div>
</div>
</div>
styles.css
.to-stage{width:100%;height:calc(100vh - 40px);overflow-y:auto;display:grid;grid-template-columns:minmax(0,1fr);place-items:safe center;padding:16px 12px;border-radius:16px;background:#0b0b0d;font-family:Inter,system-ui,-apple-system,"Segoe UI",sans-serif;scrollbar-width:thin;scrollbar-color:#27272a transparent}
.to{display:flex;flex-direction:column;gap:16px;width:min(512px,100%);user-select:none}
.to-view{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:240px;padding:28px;border:1px solid #222227;border-radius:16px;background:#070709;transition:background .3s,border-color .3s}
.to.light .to-view{border-color:#e2e2e8;background:#f4f4f6}
.to-orb{position:relative;display:inline-flex;flex:none}
.to-orb canvas{display:block}
.to-tag{margin-top:22px;padding:4px 12px;border:1px solid #27272f;border-radius:6px;background:#121216;color:#d4d4d4;font:11px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.05em;transition:all .3s}
.to-tag b{color:#fafafa}
.to.light .to-tag{border-color:#d4d4d4;background:#fff;color:#262626}.to.light .to-tag b{color:#0a0a0a}
.to-ctl{display:flex;flex-direction:column;gap:12px;padding:16px;border:1px solid #1f1f23;border-radius:12px;background:#111114}
.to-g{display:flex;flex-direction:column;gap:6px;min-width:0}
.to-l{color:#71717a;font:10px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.05em;text-transform:uppercase}
.to-l i{font-style:normal}
.to-st{display:flex;flex-wrap:wrap;gap:6px}
.to-st button{padding:4px 10px;border:1px solid #27272a;border-radius:8px;background:#18181b;color:#a1a1aa;font:inherit;font-size:12px;font-weight:500;text-transform:capitalize;cursor:pointer;transition:all .15s}
.to-st button:hover{border-color:#3f3f46;color:#fafafa}
.to-st button.on{border-color:#fafafa;background:#fafafa;color:#09090b;font-weight:600}
.to-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding-top:10px;border-top:1px solid #1f1f23}
.to-seg{display:flex;gap:4px}
.to-seg button,.to-tg{flex:1;min-width:0;padding:4px 0;border:1px solid #27272a;border-radius:5px;background:#18181b;color:#a1a1aa;font:inherit;font-size:11px;cursor:pointer;transition:all .15s}
.to-seg button:hover,.to-tg:hover{color:#fafafa}
.to-seg button.on,.to-tg.on{border-color:#fafafa;background:#fafafa;color:#09090b;font-weight:700}
.to-tg{width:100%;font-weight:500;white-space:nowrap}
.to button:focus-visible{outline:2px solid #a1a1aa;outline-offset:2px}
@media (max-width:520px){.to-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.to-view{min-height:200px;padding:20px}}
script.js
(function(){
var C={working:[.8,.2,.35,.7,1,.2,.12,.9],searching:[1.15,.5,.8,.55,1.02,.45,.28,.75],solving:[1.35,.7,.95,.85,.92,.65,.38,1],listening:[.4,.08,.12,1.2,1.04,.06,.03,.65],connecting:[.95,.28,1.3,.5,1,.3,.4,.85],weaving:[1.1,.6,.45,.65,.88,.9,.25,.8],composing:[.75,.18,.2,.9,.75,.35,.1,.7],breathing:[.25,.04,.06,1.5,1.1,.03,.02,.5],shaping:[.95,.42,.5,.7,.92,.75,.25,.85]};
function parts(n){var a=[];for(var i=0;i<n;i++)a.push({th:Math.PI*(1+Math.sqrt(5))*i,ph:Math.acos(1-2*(i+.5)/n),r:.75+Math.random()*.25,sp:.15+Math.random()*.85,sz:.4+Math.random()*1.1,pa:Math.random()*6.283,dp:Math.random()});return a;}
var reduce=matchMedia('(prefers-reduced-motion: reduce)').matches;
document.querySelectorAll('.to').forEach(function(root){
var cv=root.querySelector('canvas'),ctx=cv.getContext('2d'),orb=root.querySelector('.to-orb'),state='working',size=80,speed=1,dark=true,paused=false,P=[],time=0,last=0,raf=null,vis=true;
var st=root.querySelector('.to-st');st.innerHTML=Object.keys(C).map(function(s){return '<button type="button" data-s="'+s+'">'+s+'</button>';}).join('');
function setup(){var dpr=Math.min(devicePixelRatio||1,2);cv.width=size*dpr;cv.height=size*dpr;cv.style.width=cv.style.height=size+'px';orb.style.width=orb.style.height=size+'px';ctx.setTransform(dpr,0,0,dpr,0,0);P=parts(size<=24?45:size<=48?90:size<=80?160:220);}
function frame(ts){var dt=(last?Math.min(ts-last,40):16)/1000;last=ts;if(!paused&&!reduce)time+=dt*speed;draw();if(paused||reduce||!vis){raf=null;return;}raf=requestAnimationFrame(frame);}
function draw(){var c=C[state],E=c[0],TU=c[1],RO=c[2],PU=c[3],CO=c[4],WA=c[5],GL=c[7],ctr=size/2,R=size*.36,t=time,W=dark?'255,255,255':'20,20,28';ctx.clearRect(0,0,size,size);
var h=ctx.createRadialGradient(ctr,ctr,0,ctr,ctr,R*1.55);if(dark){h.addColorStop(0,'rgba(255,255,255,.06)');h.addColorStop(.35,'rgba(255,255,255,.02)');h.addColorStop(.7,'rgba(255,255,255,.005)');h.addColorStop(1,'rgba(0,0,0,0)');}else{h.addColorStop(0,'rgba(0,0,0,.05)');h.addColorStop(.4,'rgba(0,0,0,.015)');h.addColorStop(.8,'rgba(0,0,0,.003)');h.addColorStop(1,'rgba(255,255,255,0)');}ctx.fillStyle=h;ctx.fillRect(0,0,size,size);
var br=1+Math.sin(t*PU*1.35)*.045*E,rot=t*RO*.65;
for(var i=0;i<P.length;i++){var p=P[i],th=p.th+rot*(.65+p.dp*.45),ph=p.ph,wv=Math.sin(th*3+t*(1.05+E*.8))*Math.cos(ph*3-t*.5),r=p.r*br*CO*(1+wv*TU*.06);
if(state==='searching'){r+=Math.sin(t*1.6+p.pa)*.03;th+=Math.sin(t*1.2+p.pa)*.02;}else if(state==='solving'){var cg=Math.sin(t*2.8+p.pa);r+=cg*.045;ph+=cg*.02;}else if(state==='listening'){r+=Math.sin(t*.75+p.pa)*.012;}else if(state==='connecting'){th+=p.r*t*.5;ph+=Math.sin(t*1.1+p.pa)*.03;}else if(state==='weaving'){th+=Math.sin(ph*6+t*1.4)*.05;ph+=Math.cos(th*4+t*1.1)*.045;}else if(state==='composing'){r*=.96;ph+=Math.sin(t*1.4+p.pa)*.015;}else if(state==='shaping'){r*=1+Math.sin(th*2+t*.9)*.08;}
var x=Math.sin(ph)*Math.cos(th)*r,y=Math.cos(ph)*r,z=Math.sin(ph)*Math.sin(th);x+=Math.sin(th*3+t)*Math.sin(ph*2-t*.4)*WA*.025;y+=Math.cos(th*2-t*.8)*WA*.02;
var pp=1/(1.22-z*.22),sx=ctr+x*R*pp,sy=ctr+y*R*pp,d=(z+1)/2,ps=p.sz*(.5+d*.85)*(size/64),al=(.2+d*.8)*(.25+p.dp*.55)*E;if(d<.25)al*=.5;al=Math.min(Math.max(al,.05),.95);
if(E>.8&&ps>.85&&size>=48){var tl=p.sp*RO*2.2,tx=sx-Math.cos(th)*tl,ty=sy-Math.sin(th)*tl,g=ctx.createLinearGradient(tx,ty,sx,sy);g.addColorStop(0,'rgba('+W+',0)');g.addColorStop(1,'rgba('+W+','+(al*(dark?.18:.22))+')');ctx.strokeStyle=g;ctx.lineWidth=Math.max(ps*.5,.35);ctx.beginPath();ctx.moveTo(tx,ty);ctx.lineTo(sx,sy);ctx.stroke();}
if(size>=40&&d>.4){ctx.shadowBlur=ps*4.5;ctx.shadowColor=dark?'rgba(255,255,255,'+al*.35+')':'rgba(0,0,0,'+al*.2+')';}else ctx.shadowBlur=0;
ctx.beginPath();ctx.arc(sx,sy,Math.max(ps,.35),0,6.2832);ctx.fillStyle='rgba('+W+','+al+')';ctx.fill();ctx.shadowBlur=0;
if(Math.sin(t*(1.5+p.sp)+p.pa*5)>.99&&d>.7&&size>=48){var ss=ps*2;ctx.strokeStyle='rgba('+W+','+al*(dark?.7:.75)+')';ctx.lineWidth=.4;ctx.beginPath();ctx.moveTo(sx-ss,sy);ctx.lineTo(sx+ss,sy);ctx.moveTo(sx,sy-ss);ctx.lineTo(sx,sy+ss);ctx.stroke();}}
var cp=1+Math.sin(t*PU*1.7)*.1*GL,cr=size*.046*cp,b=ctx.createRadialGradient(ctr,ctr,0,ctr,ctr,cr*4.2);
if(dark){b.addColorStop(0,'rgba(255,255,255,.92)');b.addColorStop(.18,'rgba(255,255,255,.55)');b.addColorStop(.4,'rgba(240,240,248,.18)');b.addColorStop(.7,'rgba(220,220,235,.04)');b.addColorStop(1,'rgba(0,0,0,0)');}else{b.addColorStop(0,'rgba(18,18,24,.92)');b.addColorStop(.2,'rgba(35,35,45,.5)');b.addColorStop(.45,'rgba(70,70,85,.16)');b.addColorStop(.75,'rgba(100,100,120,.03)');b.addColorStop(1,'rgba(255,255,255,0)');}
ctx.shadowBlur=size*.14;ctx.shadowColor=dark?'rgba(255,255,255,.25)':'rgba(0,0,0,.15)';ctx.beginPath();ctx.arc(ctr,ctr,cr*4.2,0,6.2832);ctx.fillStyle=b;ctx.fill();ctx.shadowBlur=0;
var hc=ctx.createRadialGradient(ctr,ctr,0,ctr,ctr,cr*.95);if(dark){hc.addColorStop(0,'rgba(255,255,255,.98)');hc.addColorStop(.45,'rgba(255,255,255,.45)');hc.addColorStop(1,'rgba(255,255,255,0)');}else{hc.addColorStop(0,'rgba(10,10,15,.98)');hc.addColorStop(.45,'rgba(30,30,40,.45)');hc.addColorStop(1,'rgba(0,0,0,0)');}ctx.beginPath();ctx.arc(ctr,ctr,cr*.95,0,6.2832);ctx.fillStyle=hc;ctx.fill();}
function kick(){last=0;if(!raf){raf=requestAnimationFrame(frame);}}
function ui(){st.querySelectorAll('button').forEach(function(b){b.classList.toggle('on',b.dataset.s===state);b.setAttribute('aria-pressed',b.dataset.s===state);});root.querySelectorAll('[data-k=size] button').forEach(function(b){b.classList.toggle('on',+b.textContent===size);});root.querySelectorAll('[data-k=speed] button').forEach(function(b){b.classList.toggle('on',parseFloat(b.textContent)===speed);});
root.querySelector('.to-sv').textContent=size;root.querySelector('.to-tag').innerHTML='state: <b>'+state+'</b> • '+size+'px • '+speed+'x';orb.setAttribute('aria-label',state+' orb');var dk=root.querySelector('.to-dk');dk.classList.toggle('on',dark);dk.textContent=dark?'Dark (White)':'Light (Dark)';var pl=root.querySelector('.to-pl');pl.classList.toggle('on',paused);pl.textContent=paused?'Paused':'Playing';root.classList.toggle('light',!dark);}
st.addEventListener('click',function(e){var b=e.target.closest('button');if(!b)return;state=b.dataset.s;ui();kick();});
root.querySelector('[data-k=size]').addEventListener('click',function(e){var b=e.target.closest('button');if(!b)return;size=+b.textContent;setup();ui();kick();});
root.querySelector('[data-k=speed]').addEventListener('click',function(e){var b=e.target.closest('button');if(!b)return;speed=parseFloat(b.textContent);ui();});
root.querySelector('.to-dk').addEventListener('click',function(){dark=!dark;ui();kick();});
root.querySelector('.to-pl').addEventListener('click',function(){paused=!paused;ui();kick();});
if(window.IntersectionObserver)new IntersectionObserver(function(es){vis=es[0].isIntersecting||es[0].intersectionRatio>0;if(vis)kick();},{rootMargin:'100px 0px'}).observe(cv);
setup();ui();kick();
});
})();
About
A tiny living indicator for AI products. Hundreds of specks sit on a slowly turning sphere with real depth, so near ones are brighter and larger, fast ones leave faint trails, a few sparkle, and a bright breathing core glows at the centre. Nine presets change its whole character: working, searching, solving, listening, connecting, weaving, composing, breathing and shaping. A control panel lets you switch states, sizes from 40 to 110 pixels, speed, a light or dark look, and pause. It renders sharply on retina screens, sleeps when off screen and holds still for reduced motion.


