Files
VPS_Setup/caddy/site/site-lib/scripts/webpage.js

1 line
108 KiB
JavaScript
Raw Normal View History

2025-11-04 21:35:28 +00:00
"use strict";(()=>{var t=(t,e,i)=>{if(!e.has(t))throw TypeError("Cannot "+i)},e=(e,i,s)=>(t(e,i,"read from private field"),s?s.call(e):i.get(e)),i=(t,e,i)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,i)},s=(e,i,s,n)=>(t(e,i,"write to private field"),n?n.call(e,s):i.set(e,s),s),n=(e,i,s)=>(t(e,i,"access private method"),s);async function o(t){return new Promise((e=>setTimeout(e,t)))}async function a(t,e=100){for(;!t();)await o(e)}function r(t,e){const i=document.createElement("div");i.style.position="absolute",i.style.visibility="hidden",i.style.width=t,e.appendChild(i);const s=i.offsetWidth;return e.removeChild(i),s}var h=class{get width(){return this.right-this.left}set width(t){this.right=this.left+t}get height(){return this.bottom-this.top}set height(t){this.bottom=this.top+t}get center(){return new c(this.left+this.width/2,this.top+this.height/2)}get min(){return new c(this.left,this.top)}set min(t){this.left=t.x,this.top=t.y}set position(t){this.min=t}get max(){return new c(this.right,this.bottom)}set max(t){this.right=t.x,this.bottom=t.y}get size(){return new c(this.width,this.height)}set size(t){this.width=t.x,this.height=t.y}constructor(t,e,i,s){this.left=t,this.top=e,this.right=t+i,this.bottom=e+s}containsPoint(t){return t.x>=this.left&&t.x<=this.right&&t.y>=this.top&&t.y<=this.bottom}containsBounds(t){return t.left>=this.left&&t.right<=this.right&&t.top>=this.top&&t.bottom<=this.bottom}encapsulate(t){return this.left=Math.min(this.left,t.left),this.top=Math.min(this.top,t.top),this.right=Math.max(this.right,t.right),this.bottom=Math.max(this.bottom,t.bottom),this}encapsulatePoint(t){if(!t.isUndefined)return this.left=Math.min(this.left,t.x),this.top=Math.min(this.top,t.y),this.right=Math.max(this.right,t.x),this.bottom=Math.max(this.bottom,t.y),this}expand(t){return this.left-=t,this.right+=t,this.top-=t,this.bottom+=t,this}translate(t){return this.left+=t.x,this.right+=t.x,this.top+=t.y,this.bottom+=t.y,this}scale(t){let e=this.width,i=this.height;return this.left+=e*(1-t)/2,this.right-=e*(1-t)/2,this.top+=i*(1-t)/2,this.bottom-=i*(1-t)/2,this}overlaps(t){return this.left<t.right&&this.right>t.left&&this.top<t.bottom&&this.bottom>t.top}static fromElement(t){const e=t.getBoundingClientRect();return new h(e.x,e.y,e.width,e.height)}static get screenBounds(){return new h(0,0,window.innerWidth,window.innerHeight)}},l=class{constructor(t,e){this.x=t,this.y=e}add(t){return new l(this.x+t.x,this.y+t.y)}sub(t){return new l(this.x-t.x,this.y-t.y)}scale(t){return new l(this.x*t,this.y*t)}divide(t){return new l(this.x/t,this.y/t)}get isUndefined(){return isNaN(this.x)||isNaN(this.y)}get magnitude(){return Math.sqrt(this.sqrMagnitude)}get sqrMagnitude(){return this.x*this.x+this.y*this.y}get normalized(){const t=this.magnitude;return new l(this.x/t,this.y/t)}get inverse(){return new l(-this.x,-this.y)}static distance(t,e){return t.sub(e).magnitude}static dot(t,e){return t.x*e.x+t.y*e.y}},c=l;c.Undefined=new l(NaN,NaN);var d=class{constructor(t){this.callbacks=[],this.targetFPS=t,this.measuredFPS=t,this._lastTime=performance.now(),this._deltaTime=1/t,this._time=this._lastTime}get deltaTime(){return this._deltaTime/1e3}get time(){return this._time}async start(){for(;;){this._time=performance.now(),requestAnimationFrame((()=>{for(let t of this.callbacks)t(this.deltaTime)}));const t=this._time-this._lastTime;let e=t-1e3/this.targetFPS;this._lastTime=this._time+Math.max(e,0),await o(Math.max(0,e)),this._deltaTime=Math.min(t+Math.max(e,0),1e3/this.targetFPS*3),this.measuredFPS=1/this.deltaTime*.1+.9*this.measuredFPS}}add(t){this.callbacks.push(t)}};function u(t,e=500){"none"!==t.style.display&&(t.style.transitionProperty="height, margin, padding",t.style.transitionTimingFunction="ease-in-out",t.style.transitionDuration=e+"ms",t.style.boxSizing="border-box",t.style.height=t.offsetHeight+"px",t.offsetHeight,t.style.overflow="hidden",t.style.height="0",t.style.paddingTop="0",t.style.paddingBottom="0",t.style.marginTop="0",t.style.marginBottom="0",window.se