luminomorphism
Version:
A UI design system built around light, blur, ambient motion and perceptual feedback.
1 lines • 7.13 kB
JavaScript
function a2_0x535e(_0x32c11b,_0x272232){const _0x2710ac=a2_0x4c34();return a2_0x535e=function(_0x21dbe1,_0x4e509a){_0x21dbe1=_0x21dbe1-0x1aa;let _0x4c340d=_0x2710ac[_0x21dbe1];return _0x4c340d;},a2_0x535e(_0x32c11b,_0x272232);}function a2_0x4c34(){const _0x643b69=['22337kRXjRI','initNodes','918516XudDTi','glowColor','2JUMCjo','search','reset','clearRect','#00000000','shadowRoot','mouse','host','pointermove','addEventListener','180YsAjKh','random','resizeCanvas','l-particle-net','createElement','nodes','maxDist','getBoundingClientRect','width','fill','attachShadow','color','81303IUltAN','arc','constructor','(((.+)+)+)+$','addColorStop','lineWidth','getAttribute','beginPath','animate','252102wGzUwX','speed','offsetWidth','85dGFHpp','toString','801rqGBTD','moveTo','133690gyQcOp','lineTo','appendChild','fillStyle','radius','apply','sqrt','connectedCallback','ctx','strokeStyle','stroke','define','open','offsetHeight','679841XmdHBz','36290969qlexcR','canvas','height','from','left','600zJgahR','#00ffff','top','77UfojAD','rgba(0,255,255,','config'];a2_0x4c34=function(){return _0x643b69;};return a2_0x4c34();}const a2_0x2e9e2d=a2_0x535e;(function(_0x121201,_0x1a83a4){const _0x20ebe4=a2_0x535e,_0x152c29=_0x121201();while(!![]){try{const _0x12c763=-parseInt(_0x20ebe4(0x1df))/0x1*(parseInt(_0x20ebe4(0x1ab))/0x2)+-parseInt(_0x20ebe4(0x1c1))/0x3*(-parseInt(_0x20ebe4(0x1b5))/0x4)+-parseInt(_0x20ebe4(0x1cd))/0x5*(parseInt(_0x20ebe4(0x1ca))/0x6)+-parseInt(_0x20ebe4(0x1eb))/0x7*(parseInt(_0x20ebe4(0x1e5))/0x8)+parseInt(_0x20ebe4(0x1cf))/0x9*(-parseInt(_0x20ebe4(0x1d1))/0xa)+parseInt(_0x20ebe4(0x1e8))/0xb*(-parseInt(_0x20ebe4(0x1ed))/0xc)+parseInt(_0x20ebe4(0x1e0))/0xd;if(_0x12c763===_0x1a83a4)break;else _0x152c29['push'](_0x152c29['shift']());}catch(_0x1ec140){_0x152c29['push'](_0x152c29['shift']());}}}(a2_0x4c34,0x9f31d));const a2_0x4e509a=(function(){let _0xc62637=!![];return function(_0x1292db,_0x397f01){const _0x4994c7=_0xc62637?function(){const _0x160590=a2_0x535e;if(_0x397f01){const _0x374102=_0x397f01[_0x160590(0x1d6)](_0x1292db,arguments);return _0x397f01=null,_0x374102;}}:function(){};return _0xc62637=![],_0x4994c7;};}()),a2_0x21dbe1=a2_0x4e509a(this,function(){const _0x3bc2dd=a2_0x535e;return a2_0x21dbe1[_0x3bc2dd(0x1ce)]()[_0x3bc2dd(0x1ac)]('(((.+)+)+)+$')[_0x3bc2dd(0x1ce)]()[_0x3bc2dd(0x1c3)](a2_0x21dbe1)[_0x3bc2dd(0x1ac)](_0x3bc2dd(0x1c4));});a2_0x21dbe1();class LParticleNet extends HTMLElement{constructor(){const _0x3b9783=a2_0x535e;super(),this[_0x3b9783(0x1bf)]({'mode':_0x3b9783(0x1dd)});const _0x32e4f7=document[_0x3b9783(0x1b9)](_0x3b9783(0x1e1));this[_0x3b9783(0x1e1)]=_0x32e4f7,this[_0x3b9783(0x1d9)]=_0x32e4f7['getContext']('2d'),this[_0x3b9783(0x1b0)][_0x3b9783(0x1d3)](_0x32e4f7),this['nodes']=[],this[_0x3b9783(0x1b1)]={'x':null,'y':null},this[_0x3b9783(0x1ea)]={'count':parseInt(this['getAttribute'](_0x3b9783(0x1ba)))||0x20,'maxDist':0x78,'radius':2.8,'glowColor':this['getAttribute'](_0x3b9783(0x1c0))||_0x3b9783(0x1e6),'speed':parseFloat(this[_0x3b9783(0x1c7)](_0x3b9783(0x1cb)))||0.4};}[a2_0x2e9e2d(0x1d8)](){const _0x358595=a2_0x2e9e2d;this['resizeCanvas'](),window[_0x358595(0x1b4)]('resize',()=>this[_0x358595(0x1b7)]()),this[_0x358595(0x1b0)][_0x358595(0x1b2)][_0x358595(0x1b4)](_0x358595(0x1b3),_0x4aa1b4=>{const _0x3966c5=_0x358595,_0xc522e0=this[_0x3966c5(0x1e1)][_0x3966c5(0x1bc)]();this[_0x3966c5(0x1b1)]['x']=_0x4aa1b4['clientX']-_0xc522e0[_0x3966c5(0x1e4)],this[_0x3966c5(0x1b1)]['y']=_0x4aa1b4['clientY']-_0xc522e0[_0x3966c5(0x1e7)];}),this[_0x358595(0x1b0)][_0x358595(0x1b2)]['addEventListener']('pointerleave',()=>{const _0x4e5f3d=_0x358595;this['mouse']['x']=this[_0x4e5f3d(0x1b1)]['y']=null;}),this[_0x358595(0x1ec)](),requestAnimationFrame(()=>this[_0x358595(0x1c9)]());}[a2_0x2e9e2d(0x1b7)](){const _0xa4fc77=a2_0x2e9e2d;this[_0xa4fc77(0x1e1)][_0xa4fc77(0x1bd)]=this[_0xa4fc77(0x1cc)],this[_0xa4fc77(0x1e1)][_0xa4fc77(0x1e2)]=this[_0xa4fc77(0x1de)];}['initNodes'](){const _0x208f52=a2_0x2e9e2d,{speed:_0x2bd6cc}=this['config'];this[_0x208f52(0x1ba)]=Array[_0x208f52(0x1e3)]({'length':this[_0x208f52(0x1ea)]['count']},()=>({'x':Math['random']()*this['canvas'][_0x208f52(0x1bd)],'y':Math[_0x208f52(0x1b6)]()*this['canvas'][_0x208f52(0x1e2)],'vx':(Math[_0x208f52(0x1b6)]()-0.5)*_0x2bd6cc,'vy':(Math['random']()-0.5)*_0x2bd6cc}));}[a2_0x2e9e2d(0x1ad)](){const _0x1ba74d=a2_0x2e9e2d;this[_0x1ba74d(0x1ea)]['count']=parseInt(this[_0x1ba74d(0x1c7)]('nodes'))||0x20,this[_0x1ba74d(0x1ea)][_0x1ba74d(0x1cb)]=parseFloat(this[_0x1ba74d(0x1c7)](_0x1ba74d(0x1cb)))||0.4,this[_0x1ba74d(0x1ea)][_0x1ba74d(0x1aa)]=this[_0x1ba74d(0x1c7)](_0x1ba74d(0x1c0))||'#00ffff',this[_0x1ba74d(0x1ec)]();}['animate'](){const _0x3ec438=a2_0x2e9e2d,{ctx:_0x4181b7,canvas:_0xa374cd,config:_0x2dc234,nodes:_0x1d6bd0,mouse:_0x3f05c7}=this;_0x4181b7[_0x3ec438(0x1ae)](0x0,0x0,_0xa374cd[_0x3ec438(0x1bd)],_0xa374cd[_0x3ec438(0x1e2)]);for(let _0x15cc13 of _0x1d6bd0){_0x15cc13['x']+=_0x15cc13['vx'],_0x15cc13['y']+=_0x15cc13['vy'];if(_0x15cc13['x']<=0x0||_0x15cc13['x']>=_0xa374cd[_0x3ec438(0x1bd)])_0x15cc13['vx']*=-0x1;if(_0x15cc13['y']<=0x0||_0x15cc13['y']>=_0xa374cd[_0x3ec438(0x1e2)])_0x15cc13['vy']*=-0x1;}for(let _0x58e799=0x0;_0x58e799<_0x1d6bd0['length'];_0x58e799++){for(let _0x6bd9c2=_0x58e799+0x1;_0x6bd9c2<_0x1d6bd0['length'];_0x6bd9c2++){const _0x5023f0=_0x1d6bd0[_0x58e799]['x']-_0x1d6bd0[_0x6bd9c2]['x'],_0x3a4abe=_0x1d6bd0[_0x58e799]['y']-_0x1d6bd0[_0x6bd9c2]['y'],_0x1c9fc3=Math[_0x3ec438(0x1d7)](_0x5023f0*_0x5023f0+_0x3a4abe*_0x3a4abe);if(_0x1c9fc3<_0x2dc234['maxDist']){const _0x573f28=0x1-_0x1c9fc3/_0x2dc234[_0x3ec438(0x1bb)];_0x4181b7[_0x3ec438(0x1da)]=_0x3ec438(0x1e9)+_0x573f28*0.25+')',_0x4181b7[_0x3ec438(0x1c6)]=0x1,_0x4181b7[_0x3ec438(0x1c8)](),_0x4181b7[_0x3ec438(0x1d0)](_0x1d6bd0[_0x58e799]['x'],_0x1d6bd0[_0x58e799]['y']),_0x4181b7['lineTo'](_0x1d6bd0[_0x6bd9c2]['x'],_0x1d6bd0[_0x6bd9c2]['y']),_0x4181b7[_0x3ec438(0x1db)]();}}if(_0x3f05c7['x']&&_0x3f05c7['y']){const _0x48202a=_0x1d6bd0[_0x58e799]['x']-_0x3f05c7['x'],_0x431c7c=_0x1d6bd0[_0x58e799]['y']-_0x3f05c7['y'],_0x4df8e4=Math[_0x3ec438(0x1d7)](_0x48202a*_0x48202a+_0x431c7c*_0x431c7c);if(_0x4df8e4<_0x2dc234[_0x3ec438(0x1bb)]*1.2){const _0x8ad749=0x1-_0x4df8e4/(_0x2dc234[_0x3ec438(0x1bb)]*1.2);_0x4181b7['strokeStyle']=_0x3ec438(0x1e9)+_0x8ad749*0.2+')',_0x4181b7[_0x3ec438(0x1c6)]=0.8,_0x4181b7[_0x3ec438(0x1c8)](),_0x4181b7[_0x3ec438(0x1d0)](_0x1d6bd0[_0x58e799]['x'],_0x1d6bd0[_0x58e799]['y']),_0x4181b7[_0x3ec438(0x1d2)](_0x3f05c7['x'],_0x3f05c7['y']),_0x4181b7['stroke']();}}}for(let _0x5dfd28 of _0x1d6bd0){const _0x3e7fc9=_0x4181b7['createRadialGradient'](_0x5dfd28['x'],_0x5dfd28['y'],0x0,_0x5dfd28['x'],_0x5dfd28['y'],_0x2dc234[_0x3ec438(0x1d5)]*0x4);_0x3e7fc9[_0x3ec438(0x1c5)](0x0,_0x2dc234[_0x3ec438(0x1aa)]+'88'),_0x3e7fc9['addColorStop'](0x1,_0x3ec438(0x1af)),_0x4181b7[_0x3ec438(0x1d4)]=_0x3e7fc9,_0x4181b7['beginPath'](),_0x4181b7[_0x3ec438(0x1c2)](_0x5dfd28['x'],_0x5dfd28['y'],_0x2dc234[_0x3ec438(0x1d5)],0x0,Math['PI']*0x2),_0x4181b7[_0x3ec438(0x1be)]();}requestAnimationFrame(()=>this[_0x3ec438(0x1c9)]());}}customElements[a2_0x2e9e2d(0x1dc)](a2_0x2e9e2d(0x1b8),LParticleNet);