UNPKG

luminomorphism

Version:

A UI design system built around light, blur, ambient motion and perceptual feedback.

1 lines 10.5 kB
const a1_0x19b4d6=a1_0x37d8;(function(_0xb9d23d,_0x5409c0){const _0x803572=a1_0x37d8,_0x35c0df=_0xb9d23d();while(!![]){try{const _0x206093=-parseInt(_0x803572(0xc3))/0x1*(-parseInt(_0x803572(0x8f))/0x2)+-parseInt(_0x803572(0x8b))/0x3*(-parseInt(_0x803572(0xc1))/0x4)+-parseInt(_0x803572(0xd2))/0x5+-parseInt(_0x803572(0x94))/0x6*(parseInt(_0x803572(0x80))/0x7)+-parseInt(_0x803572(0xa7))/0x8+-parseInt(_0x803572(0xc7))/0x9+parseInt(_0x803572(0x76))/0xa;if(_0x206093===_0x5409c0)break;else _0x35c0df['push'](_0x35c0df['shift']());}catch(_0x312c91){_0x35c0df['push'](_0x35c0df['shift']());}}}(a1_0x29d0,0xcd12f));const a1_0x2a0c85=(function(){let _0xbf88a3=!![];return function(_0x4559cd,_0x4c5efb){const _0x30221e=_0xbf88a3?function(){const _0x86623c=a1_0x37d8;if(_0x4c5efb){const _0x1c6658=_0x4c5efb[_0x86623c(0xa0)](_0x4559cd,arguments);return _0x4c5efb=null,_0x1c6658;}}:function(){};return _0xbf88a3=![],_0x30221e;};}()),a1_0x4c6cd0=a1_0x2a0c85(this,function(){const _0x4ff22e=a1_0x37d8;return a1_0x4c6cd0['toString']()[_0x4ff22e(0x93)](_0x4ff22e(0xbf))['toString']()['constructor'](a1_0x4c6cd0)['search']('(((.+)+)+)+$');});function a1_0x37d8(_0x4abaaf,_0x2a2db2){const _0x4e97c3=a1_0x29d0();return a1_0x37d8=function(_0x4c6cd0,_0x2a0c85){_0x4c6cd0=_0x4c6cd0-0x76;let _0x29d02d=_0x4e97c3[_0x4c6cd0];return _0x29d02d;},a1_0x37d8(_0x4abaaf,_0x2a2db2);}function a1_0x29d0(){const _0x5ecf3f=['glowColor','clientY','field-reactivity','random','autopilot','initNodes','l-particle-net-v3','addEventListener','left','add','1746960BrfqPK','shadowRoot','count','pulse-rate','offsetWidth','20738630xvCKoC','frame','length','resizeCanvas','true','lineWidth','arc','fieldReactivity','stroke','observedAttributes','14keFdNH','width','floor','animate','min','host','excitationMemory','mouse','trail','color','#00ffff','3igghjZ','connectionScore','pow','reduce','1646psdGot','fill','memory-decay','getAttribute','search','3185376jyBmYR','show-learned','shift','maxDist','speed','attributeChangedCallback','trailEnabled','offsetHeight','canvas','pointerleave','push','createElement','apply','config','learning','sqrt','strokeStyle','ctx','size','3842184djBvGw','addColorStop','#00000000','define','glow-sensitivity','lineTo','false','clientX','radius','fillStyle','learned','#ff99ff','peerConnections','top','open','clearRect','padStart','excitationScore','toString','height','nodes','attachShadow','beginPath','getBoundingClientRect','(((.+)+)+)+$','appendChild','3892836YAlHBC','resize','823swzxRC','sin','connectedCallback','updateConfig','8936649EqhKLd'];a1_0x29d0=function(){return _0x5ecf3f;};return a1_0x29d0();}a1_0x4c6cd0();class LParticleNetV3 extends HTMLElement{static get[a1_0x19b4d6(0x7f)](){const _0x27f61d=a1_0x19b4d6;return[_0x27f61d(0xbb),_0x27f61d(0x98),'color',_0x27f61d(0xca),_0x27f61d(0xd5),'excitation-level',_0x27f61d(0x88),'autopilot'];}constructor(){const _0x4a4565=a1_0x19b4d6;super(),this[_0x4a4565(0xbc)]({'mode':_0x4a4565(0xb5)}),this['canvas']=document[_0x4a4565(0x9f)](_0x4a4565(0x9c)),this[_0x4a4565(0xa5)]=this[_0x4a4565(0x9c)]['getContext']('2d'),this[_0x4a4565(0xd3)][_0x4a4565(0xc0)](this['canvas']),this[_0x4a4565(0xbb)]=[],this[_0x4a4565(0x87)]={'x':null,'y':null},this[_0x4a4565(0x77)]=0x0,this[_0x4a4565(0xa1)]={},this['maxVelocity']=2.5;}[a1_0x19b4d6(0xc5)](){const _0x4f4aae=a1_0x19b4d6;this['resizeCanvas'](),window[_0x4f4aae(0xcf)](_0x4f4aae(0xc2),()=>this['resizeCanvas']()),this[_0x4f4aae(0xd3)][_0x4f4aae(0x85)][_0x4f4aae(0xcf)]('pointermove',_0x1a4efe=>{const _0x527047=_0x4f4aae,_0x2bf55f=this[_0x527047(0x9c)][_0x527047(0xbe)]();this[_0x527047(0x87)]['x']=_0x1a4efe[_0x527047(0xae)]-_0x2bf55f[_0x527047(0xd0)],this[_0x527047(0x87)]['y']=_0x1a4efe[_0x527047(0xc9)]-_0x2bf55f[_0x527047(0xb4)];}),this[_0x4f4aae(0xd3)][_0x4f4aae(0x85)][_0x4f4aae(0xcf)](_0x4f4aae(0x9d),()=>{const _0x481b52=_0x4f4aae;if(!this[_0x481b52(0xa1)]['autopilot'])this['mouse']['x']=this['mouse']['y']=null;}),this[_0x4f4aae(0xc6)](),this[_0x4f4aae(0xcd)](),requestAnimationFrame(()=>this['animate']());}[a1_0x19b4d6(0x99)](){const _0x2c1e01=a1_0x19b4d6;this[_0x2c1e01(0xc6)](),this['initNodes']();}[a1_0x19b4d6(0xc6)](){const _0x276aa1=a1_0x19b4d6,_0xee799e=_0x46d4ce=>this[_0x276aa1(0x92)](_0x46d4ce);this[_0x276aa1(0xa1)]={'learning':_0xee799e(_0x276aa1(0xa2))!==_0x276aa1(0xad),'glowSensitivity':parseFloat(_0xee799e(_0x276aa1(0xab)))||2.5,'memoryDecay':parseFloat(_0xee799e(_0x276aa1(0x91)))||0.01,'count':parseInt(_0xee799e(_0x276aa1(0xbb)))||0x40,'maxDist':0x78,'radius':0x3,'glowColor':_0xee799e(_0x276aa1(0x89))||_0x276aa1(0x8a),'speed':parseFloat(_0xee799e(_0x276aa1(0x98)))||0.3,'fieldReactivity':parseFloat(_0xee799e(_0x276aa1(0xca)))||0.8,'pulseRate':parseFloat(_0xee799e('pulse-rate'))||0x1,'excitationLevel':parseFloat(_0xee799e('excitation-level'))||0.5,'trailEnabled':_0xee799e('trail')===_0x276aa1(0x7a),'autopilot':_0xee799e(_0x276aa1(0xcc))===_0x276aa1(0x7a)},this[_0x276aa1(0xa1)][_0x276aa1(0xcc)]&&(this[_0x276aa1(0x87)]['x']=this['canvas'][_0x276aa1(0x81)]/0x2,this[_0x276aa1(0x87)]['y']=this[_0x276aa1(0x9c)][_0x276aa1(0xba)]/0x2);}[a1_0x19b4d6(0x79)](){const _0x453dc6=a1_0x19b4d6;this[_0x453dc6(0x9c)][_0x453dc6(0x81)]=this[_0x453dc6(0xd6)],this[_0x453dc6(0x9c)]['height']=this[_0x453dc6(0x9b)];}[a1_0x19b4d6(0xcd)](){const _0xcae0a6=a1_0x19b4d6,{speed:_0x13e345}=this[_0xcae0a6(0xa1)];this[_0xcae0a6(0xbb)]=Array['from']({'length':this[_0xcae0a6(0xa1)][_0xcae0a6(0xd4)]},(_0x5e0701,_0x591850)=>({'id':_0x591850,'x':Math[_0xcae0a6(0xcb)]()*this[_0xcae0a6(0x9c)][_0xcae0a6(0x81)],'y':Math[_0xcae0a6(0xcb)]()*this[_0xcae0a6(0x9c)]['height'],'vx':(Math[_0xcae0a6(0xcb)]()-0.5)*_0x13e345,'vy':(Math[_0xcae0a6(0xcb)]()-0.5)*_0x13e345,'excited':![],'excitedFrames':0x0,'trail':[],'excitationMemory':[],'peerConnections':new Set(),'excitationScore':0x0,'connectionScore':0x0,'learned':![]}));}[a1_0x19b4d6(0x83)](){const _0x4f9ef6=a1_0x19b4d6,{ctx:_0x5a06f9,canvas:_0x1a912d,config:_0x45d9d1,nodes:_0x40dfce,mouse:_0x3a717a}=this;_0x5a06f9[_0x4f9ef6(0xb6)](0x0,0x0,_0x1a912d[_0x4f9ef6(0x81)],_0x1a912d[_0x4f9ef6(0xba)]);const _0x416fd6=this[_0x4f9ef6(0xa1)][_0x4f9ef6(0xa2)];this['frame']++;if(_0x45d9d1[_0x4f9ef6(0xcc)]){const _0xfd7c99=this[_0x4f9ef6(0x77)]*0.005;this[_0x4f9ef6(0x87)]['x']=_0x1a912d['width']/0x2+Math[_0x4f9ef6(0xc4)](_0xfd7c99*1.2)*_0x1a912d[_0x4f9ef6(0x81)]*0.25,this[_0x4f9ef6(0x87)]['y']=_0x1a912d['height']/0x2+Math['cos'](_0xfd7c99)*_0x1a912d['height']*0.25;}const _0x43a757=0x1+0.2*Math['sin'](this['frame']*0.05*_0x45d9d1['pulseRate']);for(let _0x4923ea of _0x40dfce){_0x4923ea['x']+=_0x4923ea['vx'],_0x4923ea['y']+=_0x4923ea['vy'];if(_0x4923ea['x']<=0x0||_0x4923ea['x']>=_0x1a912d['width'])_0x4923ea['vx']*=-0x1;if(_0x4923ea['y']<=0x0||_0x4923ea['y']>=_0x1a912d[_0x4f9ef6(0xba)])_0x4923ea['vy']*=-0x1;if(_0x3a717a['x']!==null&&_0x3a717a['y']!==null){const _0x31cb13=_0x4923ea['x']-_0x3a717a['x'],_0x4d6934=_0x4923ea['y']-_0x3a717a['y'],_0x11f3cb=Math[_0x4f9ef6(0xa3)](_0x31cb13*_0x31cb13+_0x4d6934*_0x4d6934),_0x58a543=_0x45d9d1[_0x4f9ef6(0x97)]*_0x43a757;if(_0x11f3cb<_0x58a543){const _0x25461c=(0x1-_0x11f3cb/_0x58a543)*_0x45d9d1[_0x4f9ef6(0x7d)],_0x39bf66=_0x31cb13/_0x11f3cb*_0x25461c*-0.3*_0x45d9d1[_0x4f9ef6(0x98)],_0x51adc3=_0x4d6934/_0x11f3cb*_0x25461c*-0.3*_0x45d9d1[_0x4f9ef6(0x98)];_0x4923ea['vx']+=_0x39bf66,_0x4923ea['vy']+=_0x51adc3,_0x4923ea[_0x4f9ef6(0x86)][_0x4f9ef6(0x9e)](_0x25461c);if(_0x4923ea[_0x4f9ef6(0x86)][_0x4f9ef6(0x78)]>0x14)_0x4923ea['excitationMemory'][_0x4f9ef6(0x96)]();}}if(_0x45d9d1[_0x4f9ef6(0x9a)]){_0x4923ea['trail'][_0x4f9ef6(0x9e)]({'x':_0x4923ea['x'],'y':_0x4923ea['y'],'life':0x1});if(_0x4923ea[_0x4f9ef6(0x88)]['length']>0x14)_0x4923ea[_0x4f9ef6(0x88)][_0x4f9ef6(0x96)]();}}for(let _0x319755=0x0;_0x319755<_0x40dfce[_0x4f9ef6(0x78)];_0x319755++){for(let _0x372c5e=_0x319755+0x1;_0x372c5e<_0x40dfce[_0x4f9ef6(0x78)];_0x372c5e++){const _0x1d6d7f=_0x40dfce[_0x319755],_0x24950d=_0x40dfce[_0x372c5e],_0x1f9b95=_0x1d6d7f['x']-_0x24950d['x'],_0x539592=_0x1d6d7f['y']-_0x24950d['y'],_0x14d671=Math[_0x4f9ef6(0xa3)](_0x1f9b95*_0x1f9b95+_0x539592*_0x539592);_0x14d671<_0x45d9d1[_0x4f9ef6(0x97)]&&(_0x1d6d7f[_0x4f9ef6(0xb3)][_0x4f9ef6(0xd1)](_0x24950d['id']),_0x24950d[_0x4f9ef6(0xb3)][_0x4f9ef6(0xd1)](_0x1d6d7f['id']),_0x5a06f9[_0x4f9ef6(0xa4)]='rgba(0,255,255,'+(0x1-_0x14d671/_0x45d9d1[_0x4f9ef6(0x97)])*0.2+')',_0x5a06f9[_0x4f9ef6(0x7b)]=0.7,_0x5a06f9[_0x4f9ef6(0xbd)](),_0x5a06f9['moveTo'](_0x1d6d7f['x'],_0x1d6d7f['y']),_0x5a06f9[_0x4f9ef6(0xac)](_0x24950d['x'],_0x24950d['y']),_0x5a06f9[_0x4f9ef6(0x7e)]());}}for(let _0x193630 of _0x40dfce){const _0xdf49b2=_0x193630[_0x4f9ef6(0x86)],_0x157b8e=_0xdf49b2[_0x4f9ef6(0x8e)]((_0x4a79a8,_0x2ae5fb)=>_0x4a79a8+_0x2ae5fb,0x0);_0x193630[_0x4f9ef6(0xb8)]=_0xdf49b2['length']>0x0?_0x157b8e/_0xdf49b2[_0x4f9ef6(0x78)]:0x0,_0x193630[_0x4f9ef6(0x8c)]=_0x193630['peerConnections'][_0x4f9ef6(0xa6)]/_0x45d9d1[_0x4f9ef6(0xd4)],_0x193630[_0x4f9ef6(0xb1)]=_0x193630['excitationScore']>0.6&&_0x193630['connectionScore']>0.3;if(_0x416fd6){const _0xcf1f40=_0x193630[_0x4f9ef6(0x86)],_0x5635ca=_0xcf1f40[_0x4f9ef6(0x8e)]((_0x385883,_0x429daa)=>_0x385883+_0x429daa,0x0);_0x193630['excitationScore']=_0xcf1f40[_0x4f9ef6(0x78)]>0x0?_0x5635ca/_0xcf1f40[_0x4f9ef6(0x78)]:0x0,_0x193630[_0x4f9ef6(0x8c)]=_0x193630[_0x4f9ef6(0xb3)]['size']/_0x45d9d1[_0x4f9ef6(0xd4)],_0x193630['learned']=_0x193630[_0x4f9ef6(0xb8)]>0.6&&_0x193630[_0x4f9ef6(0x8c)]>0.3;}else _0x193630['excitationScore']=0x0,_0x193630[_0x4f9ef6(0x8c)]=0x0,_0x193630['learned']=![];const _0x320237=this[_0x4f9ef6(0x92)](_0x4f9ef6(0x95))!==_0x4f9ef6(0xad),_0x537f2f=(_0x193630['excitationScore']+_0x193630['connectionScore'])/0x2,_0x55b6f3=Math[_0x4f9ef6(0x8d)](Math[_0x4f9ef6(0x84)](0x1,Math['max'](0.05,_0x537f2f)),2.5),_0x5cb993=_0x45d9d1['radius']*(_0x193630[_0x4f9ef6(0xb1)]?0x6:0x4),_0x2a1c95=_0x320237&&_0x193630[_0x4f9ef6(0xb1)]?_0x4f9ef6(0xb2):_0x45d9d1[_0x4f9ef6(0xc8)],_0x3fac40=_0x5a06f9['createRadialGradient'](_0x193630['x'],_0x193630['y'],0x0,_0x193630['x'],_0x193630['y'],_0x5cb993);_0x3fac40[_0x4f9ef6(0xa8)](0x0,''+_0x2a1c95+Math[_0x4f9ef6(0x82)](_0x55b6f3*0xff)[_0x4f9ef6(0xb9)](0x10)[_0x4f9ef6(0xb7)](0x2,'0')),_0x3fac40[_0x4f9ef6(0xa8)](0x1,_0x4f9ef6(0xa9)),_0x5a06f9[_0x4f9ef6(0xb0)]=_0x3fac40,_0x5a06f9['beginPath'](),_0x5a06f9[_0x4f9ef6(0x7c)](_0x193630['x'],_0x193630['y'],_0x45d9d1[_0x4f9ef6(0xaf)]+_0x55b6f3*0x2,0x0,Math['PI']*0x2),_0x5a06f9[_0x4f9ef6(0x90)]();}requestAnimationFrame(()=>this[_0x4f9ef6(0x83)]());}}customElements[a1_0x19b4d6(0xaa)](a1_0x19b4d6(0xce),LParticleNetV3);