JIVAN

A VIDA, NOSSO BEM MAIS PRECIOSO

Tudo está conectado.

A ciência observa. A filosofia questiona. A arte revela. A espiritualidade contempla. A tecnologia aproxima. A vida integra.

O que deseja compreender hoje?

//==================================================== // PROJECT GENESIS // JIVAN v3 // Universo Vivo //==================================================== const canvas = document.getElementById("universe"); const ctx = canvas.getContext("2d"); let w; let h; let stars=[]; function resize(){ w=canvas.width=window.innerWidth; h=canvas.height=window.innerHeight; } window.addEventListener("resize",resize); resize(); //------------------------------------- // Mouse //------------------------------------- const mouse={ x:w/2, y:h/2 }; window.addEventListener("mousemove",e=>{ mouse.x=e.clientX; mouse.y=e.clientY; }); //------------------------------------- // Estrelas //------------------------------------- class Star{ constructor(){ this.reset(); } reset(){ this.x=Math.random()*w; this.y=Math.random()*h; this.radius=Math.random()*1.8; this.alpha=Math.random(); this.speed=.05+Math.random()*.15; this.offset=Math.random()*500; } draw(time){ this.alpha=.4+.6*Math.sin(time*.001+this.offset); ctx.beginPath(); ctx.arc(this.x,this.y,this.radius,0,Math.PI*2); ctx.fillStyle="rgba(255,255,255,"+this.alpha+")"; ctx.fill(); this.y+=this.speed; if(this.y>h){ this.y=0; this.x=Math.random()*w; } } } for(let i=0;i<320;i++){ stars.push(new Star()); } //------------------------------------- // Nebulosa //------------------------------------- function nebula(){ let g=ctx.createRadialGradient( w*.5, h*.5, 0, w*.5, h*.5, w*.8 ); g.addColorStop(0,"rgba(80,160,255,.05)"); g.addColorStop(.3,"rgba(50,90,180,.04)"); g.addColorStop(.6,"rgba(0,0,0,.02)"); g.addColorStop(1,"rgba(0,0,0,.18)"); ctx.fillStyle=g; ctx.fillRect(0,0,w,h); } //------------------------------------- // Linhas próximas //------------------------------------- function connections(){ ctx.strokeStyle="rgba(120,180,255,.08)"; for(let i=0;is.draw(time)); connections(); mouseAura(); requestAnimationFrame(animate); } animate();