437 lines
16 KiB
JavaScript
Raw Normal View History

2023-11-06 01:53:33 +08:00
const f = function (t) {
u(this, e);
var n = t || {}
, r = n.mode
, a = void 0 === r ? 1 : r
, i = n.name
, o = void 0 === i ? "" : i;
this.mode = a,
this.name = o
}
const p = function (e) {
function t(e) {
u(this, t);
var n = s(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
return n.copy(e),
n
}
return l(t, e),
a(t, [{
key: "copy",
value: function (e) {
var t = e || {}
, n = t.rotateOffset
, r = void 0 === n ? 0 : n
, a = t.rotateTime
, i = void 0 === a ? 2 : a
, o = t.rotateRange
, s = void 0 === o ? 10 : o
, l = t.rotateCenter
, u = void 0 === l ? 0 : l
, c = t.childOffset
, f = void 0 === c ? .25 : c
, d = t.spring
, h = void 0 === d ? 0 : d
, p = t.affectByLevel
, m = void 0 === p ? .1 : p
, v = t.springLevel
, g = void 0 === v ? 0 : v
, y = t.scaleYRange
, A = void 0 === y ? 0 : y
, b = t.scaleYTime
, x = void 0 === b ? 2 : b
, _ = t.scaleYCenter
, w = void 0 === _ ? 0 : _
, k = t.scaleYOffset
, S = void 0 === k ? 0 : k
, E = t.scaleYChildOffset
, C = void 0 === E ? .25 : E
, T = t.scaleYSpring
, B = void 0 === T ? 0 : T
, M = t.scaleYAffectByLevel
, I = void 0 === M ? .1 : M
, O = t.scaleXRange
, R = void 0 === O ? 0 : O
, L = t.scaleXTime
, P = void 0 === L ? 2 : L
, D = t.scaleXCenter
, F = void 0 === D ? 0 : D
, N = t.scaleXOffset
, j = void 0 === N ? 0 : N
, U = t.scaleXChildOffset
, z = void 0 === U ? .25 : U
, X = t.scaleXSpring
, Q = void 0 === X ? 0 : X
, Y = t.scaleXAffectByLevel
, H = void 0 === Y ? .1 : Y;
this.rotateOffset = r,
this.rotateCenter = u,
this.rotateTime = i,
this.rotateRange = s,
this.affectByLevel = m,
this.springLevel = g,
this.spring = h,
this.childOffset = f,
this.scaleYRange = A,
this.scaleYCenter = w,
this.scaleYTime = x,
this.scaleYOffset = S,
this.scaleYChildOffset = C,
this.scaleYSpring = B,
this.scaleYAffectByLevel = I,
this.scaleXRange = R,
this.scaleXCenter = F,
this.scaleXTime = P,
this.scaleXOffset = j,
this.scaleXChildOffset = z,
this.scaleXSpring = Q,
this.scaleXAffectByLevel = H,
this.sinScaleXSameAsY = R === A && w === F && P === x && j === S && z === C && Q === B && I === H
}
}]),
t
}(f)
const h = function (e) {
function t(e) {
u(this, t);
var n = s(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
return n.copy(e),
n
}
return l(t, e),
a(t, [{
key: "copy",
value: function (e) {
var t = e || {}
, n = t.delay
, r = void 0 === n ? .1 : n
, a = t.speed
, i = void 0 === a ? .1 : a
, o = t.spring
, s = void 0 === o ? 0 : o
, l = t.affectByRange
, u = void 0 === l ? 1 : l
, c = t.affectByX
, f = void 0 === c ? 1 : c
, d = t.affectByY
, h = void 0 === d ? 1 : d
, p = t.rotateMoveRange
, m = void 0 === p ? 1 : p
, v = t.affectByLevel
, g = void 0 === v ? 0 : v
, y = t.springLevel
, A = void 0 === y ? 0 : y
, b = t.limitRange
, x = void 0 === b ? 10 : b;
this.delay = r,
this.speed = i,
this.affectByRange = u,
this.affectByX = f,
this.affectByY = h,
this.rotateMoveRange = m,
this.spring = s,
this.affectByLevel = g,
this.springLevel = A,
this.limitRange = x
}
}, {
key: "createHistory",
value: function () {
return {
speedX: 0,
speedY: 0,
buffer: []
}
}
}]),
t
}(f)
const m = function (e) {
function t(e) {
u(this, t);
var n = s(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
return n.copy(e),
n
}
return l(t, e),
a(t, [{
key: "copy",
value: function (e) {
var t = e || {}
, n = t.moveXFreq
, r = void 0 === n ? 1 : n
, a = t.moveXAmp
, i = void 0 === a ? 0 : a
, o = t.moveXOctaves
, s = void 0 === o ? 0 : o
, l = t.moveXDelay
, u = void 0 === l ? 0 : l
, c = t.moveXCenter
, f = void 0 === c ? 0 : c
, d = t.moveXSeed
, h = void 0 === d ? Math.floor(1e4 * Math.random()) : d
, p = t.moveYFreq
, m = void 0 === p ? r : p
, v = t.moveYAmp
, g = void 0 === v ? i : v
, y = t.moveYOctaves
, A = void 0 === y ? s : y
, b = t.moveYDelay
, x = void 0 === b ? u : b
, _ = t.moveYCenter
, w = void 0 === _ ? f : _
, k = t.scaleXFreq
, S = void 0 === k ? 1 : k
, E = t.scaleXAmp
, C = void 0 === E ? 0 : E
, T = t.scaleXOctaves
, B = void 0 === T ? 0 : T
, M = t.scaleXDelay
, I = void 0 === M ? 0 : M
, O = t.scaleXCenter
, R = void 0 === O ? 0 : O
, L = t.scaleYFreq
, P = void 0 === L ? S : L
, D = t.scaleYAmp
, F = void 0 === D ? C : D
, N = t.scaleYOctaves
, j = void 0 === N ? B : N
, U = t.scaleYDelay
, z = void 0 === U ? I : U
, X = t.scaleYCenter
, Q = void 0 === X ? R : X
, Y = t.rotateSpeed
, H = void 0 === Y ? 0 : Y
, G = t.rotateFreq
, V = void 0 === G ? 1 : G
, q = t.rotateAmp
, W = void 0 === q ? 0 : q
, J = t.rotateOctaves
, Z = void 0 === J ? 0 : J
, K = t.rotateDelay
, $ = void 0 === K ? 0 : K
, ee = t.rotateCenter
, te = void 0 === ee ? 0 : ee
, ne = t.rotateFollowLimit
, re = void 0 === ne ? 0 : ne
, ae = t.rotateFollowSpeed
, ie = void 0 === ae ? .1 : ae
, oe = t.rotateFollowFlip
, se = void 0 === oe ? 0 : oe
, le = t.rotateFollowXMax
, ue = void 0 === le ? 20 : le
, ce = t.rotateFollowYMax
, fe = void 0 === ce ? 20 : ce;
this.moveXFreq = r,
this.moveXAmp = i,
this.moveXOctaves = s,
this.moveXDelay = u,
this.moveXCenter = f,
this.moveXSeed = h,
this.moveYFreq = m,
this.moveYAmp = g,
this.moveYOctaves = A,
this.moveYDelay = x,
this.moveYCenter = w,
this.moveYSameAsX = r === m && i === g && s === A && u === x && f === w,
this.scaleXFreq = S,
this.scaleXAmp = C,
this.scaleXOctaves = B,
this.scaleXDelay = I,
this.scaleXCenter = R,
this.scaleYFreq = P,
this.scaleYAmp = F,
this.scaleYOctaves = j,
this.scaleYDelay = z,
this.scaleYCenter = Q,
this.scaleYSameAsX = S === P && C === F && B === j && I === z && R === Q,
this.rotateSpeed = H,
this.rotateFreq = V,
this.rotateAmp = W,
this.rotateOctaves = Z,
this.rotateDelay = $,
this.rotateCenter = te,
this.rotateFollowEnable = 0 !== re,
this.rotateFollowLimit = re,
this.rotateFollowSpeed = ie,
this.rotateFollowFlip = se,
this.rotateFollowXMax = ue,
this.rotateFollowYMax = fe
}
}]),
t
}(f)
const v = function (e) {
function t(e) {
u(this, t);
var n = s(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
return n.copy(e),
n
}
return l(t, e),
a(t, [{
key: "copy",
value: function (e) {
var t = e || {}
, n = t.delay
, r = void 0 === n ? .1 : n
, a = t.speed
, i = void 0 === a ? .1 : a
, o = t.spring
, s = void 0 === o ? 0 : o
, l = t.springRot
, u = void 0 === l ? 0 : l
, c = t.affectByLevel
, f = void 0 === c ? 0 : c
, d = t.springLevel
, h = void 0 === d ? 0 : d
, p = t.limitRange
, m = void 0 === p ? 80 : p
, v = t.rotateOffset
, g = void 0 === v ? 0 : v
, y = t.friction
, A = void 0 === y ? .7 : y
, b = t.springUseTarget
, x = void 0 !== b && b
, _ = t.windX
, w = void 0 === _ ? 0 : _
, k = t.windY
, S = void 0 === k ? 0 : k
, E = t.windFreq
, C = void 0 === E ? 1 : E
, T = t.windOctaves
, B = void 0 === T ? 0 : T
, M = t.windAccel
, I = void 0 === M ? 1 : M
, O = t.windDelay
, R = void 0 === O ? 0 : O
, L = t.gravityX
, P = void 0 === L ? 0 : L
, D = t.gravityY
, F = void 0 === D ? 0 : D;
this.delay = r,
this.speed = i,
this.spring = s,
this.springRot = u,
this.affectByLevel = f,
this.springLevel = h,
this.limitRange = m,
this.rotateOffset = g,
this.friction = A,
this.springUseTarget = x,
this.windX = w,
this.windY = S,
this.windFreq = C,
this.windAccel = I,
this.windDelay = R,
this.windOctaves = B,
this.gravityX = P,
this.gravityY = F,
this.hasWindForce = w || S
}
}]),
t
}(f)
const g = function (e) {
function t(e) {
u(this, t);
var n = s(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
return n.copy(e),
n
}
return l(t, e),
a(t, [{
key: "copy",
value: function (e) {
var t = e || {}
, n = t.elasticSpring
, r = void 0 === n ? .4 : n
, a = t.elasticFriction
, i = void 0 === a ? .6 : a
, o = t.elasticSoftness
, s = void 0 === o ? 1 : o
, l = t.elasticSpringY
, u = void 0 === l ? r : l
, c = t.elasticFrictionY
, f = void 0 === c ? i : c
, d = t.elasticSoftnessY
, h = void 0 === d ? s : d;
this.elasticSpring = r,
this.elasticFriction = i,
this.elasticSoftness = s,
this.elasticSpringY = u,
this.elasticFrictionY = f,
this.elasticSoftnessY = h
}
}]),
t
}(f)
const y = function (e) {
function t(e) {
u(this, t);
var n = s(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e));
return n.copy(e),
n
}
return l(t, e),
a(t, [{
key: "copy",
value: function (e) {
var t = e || {}
, n = t.delay
, r = void 0 === n ? 0 : n
, a = t.xFrames
, i = void 0 === a ? [] : a
, s = t.yFrames
, l = void 0 === s ? [] : s
, u = t.sxFrames
, c = void 0 === u ? [] : u
, f = t.syFrames
, d = void 0 === f ? [] : f;
this.delay = r,
this.xFrames = i.map((function (e) {
return new o.default(e)
}
)),
this.xFramesEnd = this.xFrames.length ? this.xFrames[this.xFrames.length - 1].start : 0,
this.yFrames = l.map((function (e) {
return new o.default(e)
}
)),
this.yFramesEnd = this.yFrames.length ? this.yFrames[this.yFrames.length - 1].start : 0,
this.sxFrames = c.map((function (e) {
return new o.default(e)
}
)),
this.sxFramesEnd = this.sxFrames.length ? this.sxFrames[this.sxFrames.length - 1].start : 0,
this.sYSameAsSX = 0 === d.length,
this.sYSameAsSX ? (this.syFrames = [],
this.syFramesEnd = 0) : (this.syFrames = d.map((function (e) {
return new o.default(e)
}
)),
this.syFramesEnd = this.syFrames.length ? this.syFrames[this.syFrames.length - 1].start : 0)
}
}]),
t
}(f);