PageSourceSearch

https://unlnovae.org/assets/MovePluginInstance-CRWAZmgT.js

js unlnovae.org collected 2026-10-07 17:37:46 UTC 4,128 bytes, 1 lines download raw bytes

1import{Y as P,a6 as p,h as x,a5 as g,U as z,au as u,aa as c,Z as w,a9 as m,o as b,s as F,ao as O}from"./knowledge-base.index-CmsIYW_p.js";import"./index-Da1Qcots.js";import"./knowledge-base.functions-BRR0ZRLF.js";import"./createServerFn-BFoknPxH.js";import"./FadeInUp-Dd3PIKa6.js";import"./createLucideIcon-BoBgNB8U.js";const G=60,M=0,T=.01,I=0,R=1;function C(n){const t=n.initialPosition,{dx:e,dy:i}=w(t,n.position),r=Math.abs(e),s=Math.abs(i),{maxDistance:o}=n.retina,a=o.horizontal,h=o.vertical;if(!a&&!h)return;const l=(a&&r>=a)??!1,y=(h&&s>=h)??!1;if((l||y)&&!n.misplaced)n.misplaced=!!a&&r>a||!!h&&s>h,a&&(n.velocity.x=n.velocity.y*m-n.velocity.x),h&&(n.velocity.y=n.velocity.x*m-n.velocity.y);else if((!a||r<a)&&(!h||s<h)&&n.misplaced)n.misplaced=!1;else if(n.misplaced){const f=n.position,v=n.velocity;a&&(f.x<t.x&&v.x<u||f.x>t.x&&v.x>u)&&(v.x*=-g()),h&&(f.y<t.y&&v.y<u||f.y>t.y&&v.y>u)&&(v.y*=-g())}}function S(n,t,e,i,r,s,o){V(n,o);const a=n.gravity,h=a?.enable&&a.inverse?-c:c;r&&e&&(n.velocity.x+=r*o.factor/(G*e)),a?.enable&&e&&(n.velocity.y+=h*(a.acceleration*o.factor)/(G*e));const l=n.moveDecay;n.velocity.multTo(l??R);const y=n.velocity.mult(e);a?.enable&&i>u&&(!a.inverse&&y.y>=u&&y.y>=i||a.inverse&&y.y<=u&&y.y<=-i)&&(y.y=h*i,e&&(n.velocity.y=y.y/e));const f=n.options.zIndex,v=(c-n.zIndexFactor)**f.velocityRate;y.multTo(v),y.multTo(s);const{position:d}=n;d.addTo(y),t.vibrate&&(d.x+=Math.sin(d.x*Math.cos(d.y))*s,d.y+=Math.cos(d.y*Math.sin(d.x))*s)}function k(n,t,e,i){if(!t.spin)return;const r=t.spin.direction===x.clockwise,s={x:r?Math.cos:Math.sin,y:r?Math.sin:Math.cos};t.position.x=t.spin.center.x+t.spin.radius*s.x(t.spin.angle)*i,t.position.y=t.spin.center.y+t.spin.radius*s.y(t.spin.angle)*i,t.spin.radius+=t.spin.acceleration*i;const o=Math.max(n.canvas.size.width,n.canvas.size.height),a=o*m;t.spin.radius>a?(t.spin.radius=a,t.spin.acceleration*=-c):t.spin.radius<M&&(t.spin.radius=M,t.spin.acceleration*=-c),t.spin.angle+=e*T*(c-t.spin.radius/o)}function V(n,t){const e=n.options,i=e.move.path;if(!i.enable)return;const s=n.pathDelay??I;if(n.lastPathTime<=s){n.lastPathTime+=t.value;return}const o=n.pathGenerator?.generate(n,t);o&&n.velocity.addTo(o),i.clamp&&(n.velocity.x=b(n.velocity.x,-c,c),n.velocity.y=b(n.velocity.y,-c,c)),n.lastPathTime-=s}function A(n){const t=n.getModifier("slow");return t?.enabled?t.speedFactor??c:c}function E(n,t){const e=t.options,i=e.move.spin;if(!i.enable)return;const r=i.position??{x:50,y:50},s=.01,o={x:r.x*s*n.canvas.size.width,y:r.y*s*n.canvas.size.height},a=t.getPosition(),h=P(a,o),l=p(i.acceleration);t.retina.spinAcceleration=l*n.retina.pixelRatio,t.spin={center:o,direction:t.velocity.x>=u?x.clockwise:x.counterClockwise,angle:g()*z,radius:h,acceleration:t.retina.spinAcceleration}}const U=1,H=1;class K{availablePathGenerators;pathGenerators;#t;#n;constructor(t,e){this.#n=t,this.#t=e,this.availablePathGenerators=new Map,this.pathGenerators=new Map}destroy(){this.availablePathGenerators=new Map,this.pathGenerators=new Map}isEnabled(t){return!t.destroyed&&t.options.move.enable}particleCreated(t){const e=t.options,i=e.move,r=i.gravity,s=i.path;if(t.moveDecay=F-p(i.decay),t.pathDelay=p(s.delay.value)*O,s.generator){let o=this.pathGenerators.get(s.generator);o||(o=this.availablePathGenerators.get(s.generator),o&&(this.pathGenerators.set(s.generator,o),o.init())),t.pathGenerator=o}t.gravity={enable:r.enable,acceleration:p(r.acceleration),inverse:r.inverse},E(this.#t,t)}particleDestroyed(t){t.pathGenerator?.reset(t)}particleUpdate(t,e){const i=t.options,r=i.move;if(!r.enable)return;const s=this.#t,o=A(t),a=s.retina.reduceFactor,h=t.retina.moveSpeed,l=t.retina.moveDrift,y=t.size.max,f=r.size?t.getRadius()/y:U,v=e.factor||H,d=h*f*o*v*m,D=t.retina.maxSpeed;r.spin.enable?k(s,t,d,a):S(t,r,d,D,l,a,e),C(t)}preInit(){return this.#e()}redrawInit(){return this.#e()}update(){for(const t of this.pathGenerators.values())t.update()}async#e(){const t=await this.#n.getPathGenerators?.(this.#t,!0);if(t){this.availablePathGenerators=t,this.pathGenerators=new Map;for(const e of this.pathGenerators.values())e.init()}}}export{K as MovePluginInstance};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.