Изменено: - Поддержка новых типов товаров: "Механические приспособления" и "Религиозные товары". - Добавлена возможность случайной генерации уровня торговца. - Улучшена производительность при загрузке предметов из компендиумов. - Обновлены тексты описаний для категорий товаров. - Исправлена ошибка при добавлении предметов к торговцу (см. `module/data.mjs`, строки 2436-2446). - Исправлена проблема с отображением характеристик торговца в интерфейсе.
This commit is contained in:
BIN
Binary file not shown.
Executable
+140
@@ -0,0 +1,140 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(global = global || self, factory(global.window = global.window || {}));
|
||||
}(this, (function (exports) { 'use strict';
|
||||
|
||||
/*!
|
||||
* CSSRulePlugin 3.12.5
|
||||
* https://gsap.com
|
||||
*
|
||||
* @license Copyright 2008-2024, GreenSock. All rights reserved.
|
||||
* Subject to the terms at https://gsap.com/standard-license or for
|
||||
* Club GSAP members, the agreement issued with that membership.
|
||||
* @author: Jack Doyle, jack@greensock.com
|
||||
*/
|
||||
var gsap,
|
||||
_coreInitted,
|
||||
_doc,
|
||||
CSSPlugin,
|
||||
_windowExists = function _windowExists() {
|
||||
return typeof window !== "undefined";
|
||||
},
|
||||
_getGSAP = function _getGSAP() {
|
||||
return gsap || _windowExists() && (gsap = window.gsap) && gsap.registerPlugin && gsap;
|
||||
},
|
||||
_checkRegister = function _checkRegister() {
|
||||
if (!_coreInitted) {
|
||||
_initCore();
|
||||
|
||||
if (!CSSPlugin) {
|
||||
console.warn("Please gsap.registerPlugin(CSSPlugin, CSSRulePlugin)");
|
||||
}
|
||||
}
|
||||
|
||||
return _coreInitted;
|
||||
},
|
||||
_initCore = function _initCore(core) {
|
||||
gsap = core || _getGSAP();
|
||||
|
||||
if (_windowExists()) {
|
||||
_doc = document;
|
||||
}
|
||||
|
||||
if (gsap) {
|
||||
CSSPlugin = gsap.plugins.css;
|
||||
|
||||
if (CSSPlugin) {
|
||||
_coreInitted = 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var CSSRulePlugin = {
|
||||
version: "3.12.5",
|
||||
name: "cssRule",
|
||||
init: function init(target, value, tween, index, targets) {
|
||||
if (!_checkRegister() || typeof target.cssText === "undefined") {
|
||||
return false;
|
||||
}
|
||||
|
||||
var div = target._gsProxy = target._gsProxy || _doc.createElement("div");
|
||||
|
||||
this.ss = target;
|
||||
this.style = div.style;
|
||||
div.style.cssText = target.cssText;
|
||||
CSSPlugin.prototype.init.call(this, div, value, tween, index, targets);
|
||||
},
|
||||
render: function render(ratio, data) {
|
||||
var pt = data._pt,
|
||||
style = data.style,
|
||||
ss = data.ss,
|
||||
i;
|
||||
|
||||
while (pt) {
|
||||
pt.r(ratio, pt.d);
|
||||
pt = pt._next;
|
||||
}
|
||||
|
||||
i = style.length;
|
||||
|
||||
while (--i > -1) {
|
||||
ss[style[i]] = style[style[i]];
|
||||
}
|
||||
},
|
||||
getRule: function getRule(selector) {
|
||||
_checkRegister();
|
||||
|
||||
var ruleProp = _doc.all ? "rules" : "cssRules",
|
||||
styleSheets = _doc.styleSheets,
|
||||
i = styleSheets.length,
|
||||
pseudo = selector.charAt(0) === ":",
|
||||
j,
|
||||
curSS,
|
||||
cs,
|
||||
a;
|
||||
selector = (pseudo ? "" : ",") + selector.split("::").join(":").toLowerCase() + ",";
|
||||
|
||||
if (pseudo) {
|
||||
a = [];
|
||||
}
|
||||
|
||||
while (i--) {
|
||||
try {
|
||||
curSS = styleSheets[i][ruleProp];
|
||||
|
||||
if (!curSS) {
|
||||
continue;
|
||||
}
|
||||
|
||||
j = curSS.length;
|
||||
} catch (e) {
|
||||
console.warn(e);
|
||||
continue;
|
||||
}
|
||||
|
||||
while (--j > -1) {
|
||||
cs = curSS[j];
|
||||
|
||||
if (cs.selectorText && ("," + cs.selectorText.split("::").join(":").toLowerCase() + ",").indexOf(selector) !== -1) {
|
||||
if (pseudo) {
|
||||
a.push(cs.style);
|
||||
} else {
|
||||
return cs.style;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return a;
|
||||
},
|
||||
register: _initCore
|
||||
};
|
||||
_getGSAP() && gsap.registerPlugin(CSSRulePlugin);
|
||||
|
||||
exports.CSSRulePlugin = CSSRulePlugin;
|
||||
exports.default = CSSRulePlugin;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
Executable
+714
@@ -0,0 +1,714 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(global = global || self, factory(global.window = global.window || {}));
|
||||
}(this, (function (exports) { 'use strict';
|
||||
|
||||
var _svgPathExp = /[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig,
|
||||
_scientific = /[\+\-]?\d*\.?\d+e[\+\-]?\d+/ig,
|
||||
_DEG2RAD = Math.PI / 180,
|
||||
_sin = Math.sin,
|
||||
_cos = Math.cos,
|
||||
_abs = Math.abs,
|
||||
_sqrt = Math.sqrt,
|
||||
_isNumber = function _isNumber(value) {
|
||||
return typeof value === "number";
|
||||
},
|
||||
_roundingNum = 1e5,
|
||||
_round = function _round(value) {
|
||||
return Math.round(value * _roundingNum) / _roundingNum || 0;
|
||||
};
|
||||
function transformRawPath(rawPath, a, b, c, d, tx, ty) {
|
||||
var j = rawPath.length,
|
||||
segment,
|
||||
l,
|
||||
i,
|
||||
x,
|
||||
y;
|
||||
|
||||
while (--j > -1) {
|
||||
segment = rawPath[j];
|
||||
l = segment.length;
|
||||
|
||||
for (i = 0; i < l; i += 2) {
|
||||
x = segment[i];
|
||||
y = segment[i + 1];
|
||||
segment[i] = x * a + y * c + tx;
|
||||
segment[i + 1] = x * b + y * d + ty;
|
||||
}
|
||||
}
|
||||
|
||||
rawPath._dirty = 1;
|
||||
return rawPath;
|
||||
}
|
||||
|
||||
function arcToSegment(lastX, lastY, rx, ry, angle, largeArcFlag, sweepFlag, x, y) {
|
||||
if (lastX === x && lastY === y) {
|
||||
return;
|
||||
}
|
||||
|
||||
rx = _abs(rx);
|
||||
ry = _abs(ry);
|
||||
|
||||
var angleRad = angle % 360 * _DEG2RAD,
|
||||
cosAngle = _cos(angleRad),
|
||||
sinAngle = _sin(angleRad),
|
||||
PI = Math.PI,
|
||||
TWOPI = PI * 2,
|
||||
dx2 = (lastX - x) / 2,
|
||||
dy2 = (lastY - y) / 2,
|
||||
x1 = cosAngle * dx2 + sinAngle * dy2,
|
||||
y1 = -sinAngle * dx2 + cosAngle * dy2,
|
||||
x1_sq = x1 * x1,
|
||||
y1_sq = y1 * y1,
|
||||
radiiCheck = x1_sq / (rx * rx) + y1_sq / (ry * ry);
|
||||
|
||||
if (radiiCheck > 1) {
|
||||
rx = _sqrt(radiiCheck) * rx;
|
||||
ry = _sqrt(radiiCheck) * ry;
|
||||
}
|
||||
|
||||
var rx_sq = rx * rx,
|
||||
ry_sq = ry * ry,
|
||||
sq = (rx_sq * ry_sq - rx_sq * y1_sq - ry_sq * x1_sq) / (rx_sq * y1_sq + ry_sq * x1_sq);
|
||||
|
||||
if (sq < 0) {
|
||||
sq = 0;
|
||||
}
|
||||
|
||||
var coef = (largeArcFlag === sweepFlag ? -1 : 1) * _sqrt(sq),
|
||||
cx1 = coef * (rx * y1 / ry),
|
||||
cy1 = coef * -(ry * x1 / rx),
|
||||
sx2 = (lastX + x) / 2,
|
||||
sy2 = (lastY + y) / 2,
|
||||
cx = sx2 + (cosAngle * cx1 - sinAngle * cy1),
|
||||
cy = sy2 + (sinAngle * cx1 + cosAngle * cy1),
|
||||
ux = (x1 - cx1) / rx,
|
||||
uy = (y1 - cy1) / ry,
|
||||
vx = (-x1 - cx1) / rx,
|
||||
vy = (-y1 - cy1) / ry,
|
||||
temp = ux * ux + uy * uy,
|
||||
angleStart = (uy < 0 ? -1 : 1) * Math.acos(ux / _sqrt(temp)),
|
||||
angleExtent = (ux * vy - uy * vx < 0 ? -1 : 1) * Math.acos((ux * vx + uy * vy) / _sqrt(temp * (vx * vx + vy * vy)));
|
||||
|
||||
isNaN(angleExtent) && (angleExtent = PI);
|
||||
|
||||
if (!sweepFlag && angleExtent > 0) {
|
||||
angleExtent -= TWOPI;
|
||||
} else if (sweepFlag && angleExtent < 0) {
|
||||
angleExtent += TWOPI;
|
||||
}
|
||||
|
||||
angleStart %= TWOPI;
|
||||
angleExtent %= TWOPI;
|
||||
|
||||
var segments = Math.ceil(_abs(angleExtent) / (TWOPI / 4)),
|
||||
rawPath = [],
|
||||
angleIncrement = angleExtent / segments,
|
||||
controlLength = 4 / 3 * _sin(angleIncrement / 2) / (1 + _cos(angleIncrement / 2)),
|
||||
ma = cosAngle * rx,
|
||||
mb = sinAngle * rx,
|
||||
mc = sinAngle * -ry,
|
||||
md = cosAngle * ry,
|
||||
i;
|
||||
|
||||
for (i = 0; i < segments; i++) {
|
||||
angle = angleStart + i * angleIncrement;
|
||||
x1 = _cos(angle);
|
||||
y1 = _sin(angle);
|
||||
ux = _cos(angle += angleIncrement);
|
||||
uy = _sin(angle);
|
||||
rawPath.push(x1 - controlLength * y1, y1 + controlLength * x1, ux + controlLength * uy, uy - controlLength * ux, ux, uy);
|
||||
}
|
||||
|
||||
for (i = 0; i < rawPath.length; i += 2) {
|
||||
x1 = rawPath[i];
|
||||
y1 = rawPath[i + 1];
|
||||
rawPath[i] = x1 * ma + y1 * mc + cx;
|
||||
rawPath[i + 1] = x1 * mb + y1 * md + cy;
|
||||
}
|
||||
|
||||
rawPath[i - 2] = x;
|
||||
rawPath[i - 1] = y;
|
||||
return rawPath;
|
||||
}
|
||||
|
||||
function stringToRawPath(d) {
|
||||
var a = (d + "").replace(_scientific, function (m) {
|
||||
var n = +m;
|
||||
return n < 0.0001 && n > -0.0001 ? 0 : n;
|
||||
}).match(_svgPathExp) || [],
|
||||
path = [],
|
||||
relativeX = 0,
|
||||
relativeY = 0,
|
||||
twoThirds = 2 / 3,
|
||||
elements = a.length,
|
||||
points = 0,
|
||||
errorMessage = "ERROR: malformed path: " + d,
|
||||
i,
|
||||
j,
|
||||
x,
|
||||
y,
|
||||
command,
|
||||
isRelative,
|
||||
segment,
|
||||
startX,
|
||||
startY,
|
||||
difX,
|
||||
difY,
|
||||
beziers,
|
||||
prevCommand,
|
||||
flag1,
|
||||
flag2,
|
||||
line = function line(sx, sy, ex, ey) {
|
||||
difX = (ex - sx) / 3;
|
||||
difY = (ey - sy) / 3;
|
||||
segment.push(sx + difX, sy + difY, ex - difX, ey - difY, ex, ey);
|
||||
};
|
||||
|
||||
if (!d || !isNaN(a[0]) || isNaN(a[1])) {
|
||||
console.log(errorMessage);
|
||||
return path;
|
||||
}
|
||||
|
||||
for (i = 0; i < elements; i++) {
|
||||
prevCommand = command;
|
||||
|
||||
if (isNaN(a[i])) {
|
||||
command = a[i].toUpperCase();
|
||||
isRelative = command !== a[i];
|
||||
} else {
|
||||
i--;
|
||||
}
|
||||
|
||||
x = +a[i + 1];
|
||||
y = +a[i + 2];
|
||||
|
||||
if (isRelative) {
|
||||
x += relativeX;
|
||||
y += relativeY;
|
||||
}
|
||||
|
||||
if (!i) {
|
||||
startX = x;
|
||||
startY = y;
|
||||
}
|
||||
|
||||
if (command === "M") {
|
||||
if (segment) {
|
||||
if (segment.length < 8) {
|
||||
path.length -= 1;
|
||||
} else {
|
||||
points += segment.length;
|
||||
}
|
||||
}
|
||||
|
||||
relativeX = startX = x;
|
||||
relativeY = startY = y;
|
||||
segment = [x, y];
|
||||
path.push(segment);
|
||||
i += 2;
|
||||
command = "L";
|
||||
} else if (command === "C") {
|
||||
if (!segment) {
|
||||
segment = [0, 0];
|
||||
}
|
||||
|
||||
if (!isRelative) {
|
||||
relativeX = relativeY = 0;
|
||||
}
|
||||
|
||||
segment.push(x, y, relativeX + a[i + 3] * 1, relativeY + a[i + 4] * 1, relativeX += a[i + 5] * 1, relativeY += a[i + 6] * 1);
|
||||
i += 6;
|
||||
} else if (command === "S") {
|
||||
difX = relativeX;
|
||||
difY = relativeY;
|
||||
|
||||
if (prevCommand === "C" || prevCommand === "S") {
|
||||
difX += relativeX - segment[segment.length - 4];
|
||||
difY += relativeY - segment[segment.length - 3];
|
||||
}
|
||||
|
||||
if (!isRelative) {
|
||||
relativeX = relativeY = 0;
|
||||
}
|
||||
|
||||
segment.push(difX, difY, x, y, relativeX += a[i + 3] * 1, relativeY += a[i + 4] * 1);
|
||||
i += 4;
|
||||
} else if (command === "Q") {
|
||||
difX = relativeX + (x - relativeX) * twoThirds;
|
||||
difY = relativeY + (y - relativeY) * twoThirds;
|
||||
|
||||
if (!isRelative) {
|
||||
relativeX = relativeY = 0;
|
||||
}
|
||||
|
||||
relativeX += a[i + 3] * 1;
|
||||
relativeY += a[i + 4] * 1;
|
||||
segment.push(difX, difY, relativeX + (x - relativeX) * twoThirds, relativeY + (y - relativeY) * twoThirds, relativeX, relativeY);
|
||||
i += 4;
|
||||
} else if (command === "T") {
|
||||
difX = relativeX - segment[segment.length - 4];
|
||||
difY = relativeY - segment[segment.length - 3];
|
||||
segment.push(relativeX + difX, relativeY + difY, x + (relativeX + difX * 1.5 - x) * twoThirds, y + (relativeY + difY * 1.5 - y) * twoThirds, relativeX = x, relativeY = y);
|
||||
i += 2;
|
||||
} else if (command === "H") {
|
||||
line(relativeX, relativeY, relativeX = x, relativeY);
|
||||
i += 1;
|
||||
} else if (command === "V") {
|
||||
line(relativeX, relativeY, relativeX, relativeY = x + (isRelative ? relativeY - relativeX : 0));
|
||||
i += 1;
|
||||
} else if (command === "L" || command === "Z") {
|
||||
if (command === "Z") {
|
||||
x = startX;
|
||||
y = startY;
|
||||
segment.closed = true;
|
||||
}
|
||||
|
||||
if (command === "L" || _abs(relativeX - x) > 0.5 || _abs(relativeY - y) > 0.5) {
|
||||
line(relativeX, relativeY, x, y);
|
||||
|
||||
if (command === "L") {
|
||||
i += 2;
|
||||
}
|
||||
}
|
||||
|
||||
relativeX = x;
|
||||
relativeY = y;
|
||||
} else if (command === "A") {
|
||||
flag1 = a[i + 4];
|
||||
flag2 = a[i + 5];
|
||||
difX = a[i + 6];
|
||||
difY = a[i + 7];
|
||||
j = 7;
|
||||
|
||||
if (flag1.length > 1) {
|
||||
if (flag1.length < 3) {
|
||||
difY = difX;
|
||||
difX = flag2;
|
||||
j--;
|
||||
} else {
|
||||
difY = flag2;
|
||||
difX = flag1.substr(2);
|
||||
j -= 2;
|
||||
}
|
||||
|
||||
flag2 = flag1.charAt(1);
|
||||
flag1 = flag1.charAt(0);
|
||||
}
|
||||
|
||||
beziers = arcToSegment(relativeX, relativeY, +a[i + 1], +a[i + 2], +a[i + 3], +flag1, +flag2, (isRelative ? relativeX : 0) + difX * 1, (isRelative ? relativeY : 0) + difY * 1);
|
||||
i += j;
|
||||
|
||||
if (beziers) {
|
||||
for (j = 0; j < beziers.length; j++) {
|
||||
segment.push(beziers[j]);
|
||||
}
|
||||
}
|
||||
|
||||
relativeX = segment[segment.length - 2];
|
||||
relativeY = segment[segment.length - 1];
|
||||
} else {
|
||||
console.log(errorMessage);
|
||||
}
|
||||
}
|
||||
|
||||
i = segment.length;
|
||||
|
||||
if (i < 6) {
|
||||
path.pop();
|
||||
i = 0;
|
||||
} else if (segment[0] === segment[i - 2] && segment[1] === segment[i - 1]) {
|
||||
segment.closed = true;
|
||||
}
|
||||
|
||||
path.totalPoints = points + i;
|
||||
return path;
|
||||
}
|
||||
function rawPathToString(rawPath) {
|
||||
if (_isNumber(rawPath[0])) {
|
||||
rawPath = [rawPath];
|
||||
}
|
||||
|
||||
var result = "",
|
||||
l = rawPath.length,
|
||||
sl,
|
||||
s,
|
||||
i,
|
||||
segment;
|
||||
|
||||
for (s = 0; s < l; s++) {
|
||||
segment = rawPath[s];
|
||||
result += "M" + _round(segment[0]) + "," + _round(segment[1]) + " C";
|
||||
sl = segment.length;
|
||||
|
||||
for (i = 2; i < sl; i++) {
|
||||
result += _round(segment[i++]) + "," + _round(segment[i++]) + " " + _round(segment[i++]) + "," + _round(segment[i++]) + " " + _round(segment[i++]) + "," + _round(segment[i]) + " ";
|
||||
}
|
||||
|
||||
if (segment.closed) {
|
||||
result += "z";
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*!
|
||||
* CustomEase 3.12.5
|
||||
* https://gsap.com
|
||||
*
|
||||
* @license Copyright 2008-2024, GreenSock. All rights reserved.
|
||||
* Subject to the terms at https://gsap.com/standard-license or for
|
||||
* Club GSAP members, the agreement issued with that membership.
|
||||
* @author: Jack Doyle, jack@greensock.com
|
||||
*/
|
||||
|
||||
var gsap,
|
||||
_coreInitted,
|
||||
_getGSAP = function _getGSAP() {
|
||||
return gsap || typeof window !== "undefined" && (gsap = window.gsap) && gsap.registerPlugin && gsap;
|
||||
},
|
||||
_initCore = function _initCore() {
|
||||
gsap = _getGSAP();
|
||||
|
||||
if (gsap) {
|
||||
gsap.registerEase("_CE", CustomEase.create);
|
||||
_coreInitted = 1;
|
||||
} else {
|
||||
console.warn("Please gsap.registerPlugin(CustomEase)");
|
||||
}
|
||||
},
|
||||
_bigNum = 1e20,
|
||||
_round$1 = function _round(value) {
|
||||
return ~~(value * 1000 + (value < 0 ? -.5 : .5)) / 1000;
|
||||
},
|
||||
_numExp = /[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/gi,
|
||||
_needsParsingExp = /[cLlsSaAhHvVtTqQ]/g,
|
||||
_findMinimum = function _findMinimum(values) {
|
||||
var l = values.length,
|
||||
min = _bigNum,
|
||||
i;
|
||||
|
||||
for (i = 1; i < l; i += 6) {
|
||||
+values[i] < min && (min = +values[i]);
|
||||
}
|
||||
|
||||
return min;
|
||||
},
|
||||
_normalize = function _normalize(values, height, originY) {
|
||||
if (!originY && originY !== 0) {
|
||||
originY = Math.max(+values[values.length - 1], +values[1]);
|
||||
}
|
||||
|
||||
var tx = +values[0] * -1,
|
||||
ty = -originY,
|
||||
l = values.length,
|
||||
sx = 1 / (+values[l - 2] + tx),
|
||||
sy = -height || (Math.abs(+values[l - 1] - +values[1]) < 0.01 * (+values[l - 2] - +values[0]) ? _findMinimum(values) + ty : +values[l - 1] + ty),
|
||||
i;
|
||||
|
||||
if (sy) {
|
||||
sy = 1 / sy;
|
||||
} else {
|
||||
sy = -sx;
|
||||
}
|
||||
|
||||
for (i = 0; i < l; i += 2) {
|
||||
values[i] = (+values[i] + tx) * sx;
|
||||
values[i + 1] = (+values[i + 1] + ty) * sy;
|
||||
}
|
||||
},
|
||||
_bezierToPoints = function _bezierToPoints(x1, y1, x2, y2, x3, y3, x4, y4, threshold, points, index) {
|
||||
var x12 = (x1 + x2) / 2,
|
||||
y12 = (y1 + y2) / 2,
|
||||
x23 = (x2 + x3) / 2,
|
||||
y23 = (y2 + y3) / 2,
|
||||
x34 = (x3 + x4) / 2,
|
||||
y34 = (y3 + y4) / 2,
|
||||
x123 = (x12 + x23) / 2,
|
||||
y123 = (y12 + y23) / 2,
|
||||
x234 = (x23 + x34) / 2,
|
||||
y234 = (y23 + y34) / 2,
|
||||
x1234 = (x123 + x234) / 2,
|
||||
y1234 = (y123 + y234) / 2,
|
||||
dx = x4 - x1,
|
||||
dy = y4 - y1,
|
||||
d2 = Math.abs((x2 - x4) * dy - (y2 - y4) * dx),
|
||||
d3 = Math.abs((x3 - x4) * dy - (y3 - y4) * dx),
|
||||
length;
|
||||
|
||||
if (!points) {
|
||||
points = [{
|
||||
x: x1,
|
||||
y: y1
|
||||
}, {
|
||||
x: x4,
|
||||
y: y4
|
||||
}];
|
||||
index = 1;
|
||||
}
|
||||
|
||||
points.splice(index || points.length - 1, 0, {
|
||||
x: x1234,
|
||||
y: y1234
|
||||
});
|
||||
|
||||
if ((d2 + d3) * (d2 + d3) > threshold * (dx * dx + dy * dy)) {
|
||||
length = points.length;
|
||||
|
||||
_bezierToPoints(x1, y1, x12, y12, x123, y123, x1234, y1234, threshold, points, index);
|
||||
|
||||
_bezierToPoints(x1234, y1234, x234, y234, x34, y34, x4, y4, threshold, points, index + 1 + (points.length - length));
|
||||
}
|
||||
|
||||
return points;
|
||||
};
|
||||
|
||||
var CustomEase = function () {
|
||||
function CustomEase(id, data, config) {
|
||||
_coreInitted || _initCore();
|
||||
this.id = id;
|
||||
this.setData(data, config);
|
||||
}
|
||||
|
||||
var _proto = CustomEase.prototype;
|
||||
|
||||
_proto.setData = function setData(data, config) {
|
||||
config = config || {};
|
||||
data = data || "0,0,1,1";
|
||||
var values = data.match(_numExp),
|
||||
closest = 1,
|
||||
points = [],
|
||||
lookup = [],
|
||||
precision = config.precision || 1,
|
||||
fast = precision <= 1,
|
||||
l,
|
||||
a1,
|
||||
a2,
|
||||
i,
|
||||
inc,
|
||||
j,
|
||||
point,
|
||||
prevPoint,
|
||||
p;
|
||||
this.data = data;
|
||||
|
||||
if (_needsParsingExp.test(data) || ~data.indexOf("M") && data.indexOf("C") < 0) {
|
||||
values = stringToRawPath(data)[0];
|
||||
}
|
||||
|
||||
l = values.length;
|
||||
|
||||
if (l === 4) {
|
||||
values.unshift(0, 0);
|
||||
values.push(1, 1);
|
||||
l = 8;
|
||||
} else if ((l - 2) % 6) {
|
||||
throw "Invalid CustomEase";
|
||||
}
|
||||
|
||||
if (+values[0] !== 0 || +values[l - 2] !== 1) {
|
||||
_normalize(values, config.height, config.originY);
|
||||
}
|
||||
|
||||
this.segment = values;
|
||||
|
||||
for (i = 2; i < l; i += 6) {
|
||||
a1 = {
|
||||
x: +values[i - 2],
|
||||
y: +values[i - 1]
|
||||
};
|
||||
a2 = {
|
||||
x: +values[i + 4],
|
||||
y: +values[i + 5]
|
||||
};
|
||||
points.push(a1, a2);
|
||||
|
||||
_bezierToPoints(a1.x, a1.y, +values[i], +values[i + 1], +values[i + 2], +values[i + 3], a2.x, a2.y, 1 / (precision * 200000), points, points.length - 1);
|
||||
}
|
||||
|
||||
l = points.length;
|
||||
|
||||
for (i = 0; i < l; i++) {
|
||||
point = points[i];
|
||||
prevPoint = points[i - 1] || point;
|
||||
|
||||
if ((point.x > prevPoint.x || prevPoint.y !== point.y && prevPoint.x === point.x || point === prevPoint) && point.x <= 1) {
|
||||
prevPoint.cx = point.x - prevPoint.x;
|
||||
prevPoint.cy = point.y - prevPoint.y;
|
||||
prevPoint.n = point;
|
||||
prevPoint.nx = point.x;
|
||||
|
||||
if (fast && i > 1 && Math.abs(prevPoint.cy / prevPoint.cx - points[i - 2].cy / points[i - 2].cx) > 2) {
|
||||
fast = 0;
|
||||
}
|
||||
|
||||
if (prevPoint.cx < closest) {
|
||||
if (!prevPoint.cx) {
|
||||
prevPoint.cx = 0.001;
|
||||
|
||||
if (i === l - 1) {
|
||||
prevPoint.x -= 0.001;
|
||||
closest = Math.min(closest, 0.001);
|
||||
fast = 0;
|
||||
}
|
||||
} else {
|
||||
closest = prevPoint.cx;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
points.splice(i--, 1);
|
||||
l--;
|
||||
}
|
||||
}
|
||||
|
||||
l = 1 / closest + 1 | 0;
|
||||
inc = 1 / l;
|
||||
j = 0;
|
||||
point = points[0];
|
||||
|
||||
if (fast) {
|
||||
for (i = 0; i < l; i++) {
|
||||
p = i * inc;
|
||||
|
||||
if (point.nx < p) {
|
||||
point = points[++j];
|
||||
}
|
||||
|
||||
a1 = point.y + (p - point.x) / point.cx * point.cy;
|
||||
lookup[i] = {
|
||||
x: p,
|
||||
cx: inc,
|
||||
y: a1,
|
||||
cy: 0,
|
||||
nx: 9
|
||||
};
|
||||
|
||||
if (i) {
|
||||
lookup[i - 1].cy = a1 - lookup[i - 1].y;
|
||||
}
|
||||
}
|
||||
|
||||
lookup[l - 1].cy = points[points.length - 1].y - a1;
|
||||
} else {
|
||||
for (i = 0; i < l; i++) {
|
||||
if (point.nx < i * inc) {
|
||||
point = points[++j];
|
||||
}
|
||||
|
||||
lookup[i] = point;
|
||||
}
|
||||
|
||||
if (j < points.length - 1) {
|
||||
lookup[i - 1] = points[points.length - 2];
|
||||
}
|
||||
}
|
||||
|
||||
this.ease = function (p) {
|
||||
var point = lookup[p * l | 0] || lookup[l - 1];
|
||||
|
||||
if (point.nx < p) {
|
||||
point = point.n;
|
||||
}
|
||||
|
||||
return point.y + (p - point.x) / point.cx * point.cy;
|
||||
};
|
||||
|
||||
this.ease.custom = this;
|
||||
this.id && gsap && gsap.registerEase(this.id, this.ease);
|
||||
return this;
|
||||
};
|
||||
|
||||
_proto.getSVGData = function getSVGData(config) {
|
||||
return CustomEase.getSVGData(this, config);
|
||||
};
|
||||
|
||||
CustomEase.create = function create(id, data, config) {
|
||||
return new CustomEase(id, data, config).ease;
|
||||
};
|
||||
|
||||
CustomEase.register = function register(core) {
|
||||
gsap = core;
|
||||
|
||||
_initCore();
|
||||
};
|
||||
|
||||
CustomEase.get = function get(id) {
|
||||
return gsap.parseEase(id);
|
||||
};
|
||||
|
||||
CustomEase.getSVGData = function getSVGData(ease, config) {
|
||||
config = config || {};
|
||||
var width = config.width || 100,
|
||||
height = config.height || 100,
|
||||
x = config.x || 0,
|
||||
y = (config.y || 0) + height,
|
||||
e = gsap.utils.toArray(config.path)[0],
|
||||
a,
|
||||
slope,
|
||||
i,
|
||||
inc,
|
||||
tx,
|
||||
ty,
|
||||
precision,
|
||||
threshold,
|
||||
prevX,
|
||||
prevY;
|
||||
|
||||
if (config.invert) {
|
||||
height = -height;
|
||||
y = 0;
|
||||
}
|
||||
|
||||
if (typeof ease === "string") {
|
||||
ease = gsap.parseEase(ease);
|
||||
}
|
||||
|
||||
if (ease.custom) {
|
||||
ease = ease.custom;
|
||||
}
|
||||
|
||||
if (ease instanceof CustomEase) {
|
||||
a = rawPathToString(transformRawPath([ease.segment], width, 0, 0, -height, x, y));
|
||||
} else {
|
||||
a = [x, y];
|
||||
precision = Math.max(5, (config.precision || 1) * 200);
|
||||
inc = 1 / precision;
|
||||
precision += 2;
|
||||
threshold = 5 / precision;
|
||||
prevX = _round$1(x + inc * width);
|
||||
prevY = _round$1(y + ease(inc) * -height);
|
||||
slope = (prevY - y) / (prevX - x);
|
||||
|
||||
for (i = 2; i < precision; i++) {
|
||||
tx = _round$1(x + i * inc * width);
|
||||
ty = _round$1(y + ease(i * inc) * -height);
|
||||
|
||||
if (Math.abs((ty - prevY) / (tx - prevX) - slope) > threshold || i === precision - 1) {
|
||||
a.push(prevX, prevY);
|
||||
slope = (ty - prevY) / (tx - prevX);
|
||||
}
|
||||
|
||||
prevX = tx;
|
||||
prevY = ty;
|
||||
}
|
||||
|
||||
a = "M" + a.join(",");
|
||||
}
|
||||
|
||||
e && e.setAttribute("d", a);
|
||||
return a;
|
||||
};
|
||||
|
||||
return CustomEase;
|
||||
}();
|
||||
_getGSAP() && gsap.registerPlugin(CustomEase);
|
||||
CustomEase.version = "3.12.5";
|
||||
|
||||
exports.CustomEase = CustomEase;
|
||||
exports.default = CustomEase;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
Executable
+2966
File diff suppressed because it is too large
Load Diff
Executable
+217
@@ -0,0 +1,217 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(global = global || self, factory(global.window = global.window || {}));
|
||||
}(this, (function (exports) { 'use strict';
|
||||
|
||||
/*!
|
||||
* EasePack 3.12.5
|
||||
* https://gsap.com
|
||||
*
|
||||
* @license Copyright 2008-2024, GreenSock. All rights reserved.
|
||||
* Subject to the terms at https://gsap.com/standard-license or for
|
||||
* Club GSAP members, the agreement issued with that membership.
|
||||
* @author: Jack Doyle, jack@greensock.com
|
||||
*/
|
||||
var gsap,
|
||||
_registerEase,
|
||||
_getGSAP = function _getGSAP() {
|
||||
return gsap || typeof window !== "undefined" && (gsap = window.gsap) && gsap.registerPlugin && gsap;
|
||||
},
|
||||
_boolean = function _boolean(value, defaultValue) {
|
||||
return !!(typeof value === "undefined" ? defaultValue : value && !~(value + "").indexOf("false"));
|
||||
},
|
||||
_initCore = function _initCore(core) {
|
||||
gsap = core || _getGSAP();
|
||||
|
||||
if (gsap) {
|
||||
_registerEase = gsap.registerEase;
|
||||
|
||||
var eases = gsap.parseEase(),
|
||||
createConfig = function createConfig(ease) {
|
||||
return function (ratio) {
|
||||
var y = 0.5 + ratio / 2;
|
||||
|
||||
ease.config = function (p) {
|
||||
return ease(2 * (1 - p) * p * y + p * p);
|
||||
};
|
||||
};
|
||||
},
|
||||
p;
|
||||
|
||||
for (p in eases) {
|
||||
if (!eases[p].config) {
|
||||
createConfig(eases[p]);
|
||||
}
|
||||
}
|
||||
|
||||
_registerEase("slow", SlowMo);
|
||||
|
||||
_registerEase("expoScale", ExpoScaleEase);
|
||||
|
||||
_registerEase("rough", RoughEase);
|
||||
|
||||
for (p in EasePack) {
|
||||
p !== "version" && gsap.core.globals(p, EasePack[p]);
|
||||
}
|
||||
}
|
||||
},
|
||||
_createSlowMo = function _createSlowMo(linearRatio, power, yoyoMode) {
|
||||
linearRatio = Math.min(1, linearRatio || 0.7);
|
||||
|
||||
var pow = linearRatio < 1 ? power || power === 0 ? power : 0.7 : 0,
|
||||
p1 = (1 - linearRatio) / 2,
|
||||
p3 = p1 + linearRatio,
|
||||
calcEnd = _boolean(yoyoMode);
|
||||
|
||||
return function (p) {
|
||||
var r = p + (0.5 - p) * pow;
|
||||
return p < p1 ? calcEnd ? 1 - (p = 1 - p / p1) * p : r - (p = 1 - p / p1) * p * p * p * r : p > p3 ? calcEnd ? p === 1 ? 0 : 1 - (p = (p - p3) / p1) * p : r + (p - r) * (p = (p - p3) / p1) * p * p * p : calcEnd ? 1 : r;
|
||||
};
|
||||
},
|
||||
_createExpoScale = function _createExpoScale(start, end, ease) {
|
||||
var p1 = Math.log(end / start),
|
||||
p2 = end - start;
|
||||
ease && (ease = gsap.parseEase(ease));
|
||||
return function (p) {
|
||||
return (start * Math.exp(p1 * (ease ? ease(p) : p)) - start) / p2;
|
||||
};
|
||||
},
|
||||
EasePoint = function EasePoint(time, value, next) {
|
||||
this.t = time;
|
||||
this.v = value;
|
||||
|
||||
if (next) {
|
||||
this.next = next;
|
||||
next.prev = this;
|
||||
this.c = next.v - value;
|
||||
this.gap = next.t - time;
|
||||
}
|
||||
},
|
||||
_createRoughEase = function _createRoughEase(vars) {
|
||||
if (typeof vars !== "object") {
|
||||
vars = {
|
||||
points: +vars || 20
|
||||
};
|
||||
}
|
||||
|
||||
var taper = vars.taper || "none",
|
||||
a = [],
|
||||
cnt = 0,
|
||||
points = (+vars.points || 20) | 0,
|
||||
i = points,
|
||||
randomize = _boolean(vars.randomize, true),
|
||||
clamp = _boolean(vars.clamp),
|
||||
template = gsap ? gsap.parseEase(vars.template) : 0,
|
||||
strength = (+vars.strength || 1) * 0.4,
|
||||
x,
|
||||
y,
|
||||
bump,
|
||||
invX,
|
||||
obj,
|
||||
pnt,
|
||||
recent;
|
||||
|
||||
while (--i > -1) {
|
||||
x = randomize ? Math.random() : 1 / points * i;
|
||||
y = template ? template(x) : x;
|
||||
|
||||
if (taper === "none") {
|
||||
bump = strength;
|
||||
} else if (taper === "out") {
|
||||
invX = 1 - x;
|
||||
bump = invX * invX * strength;
|
||||
} else if (taper === "in") {
|
||||
bump = x * x * strength;
|
||||
} else if (x < 0.5) {
|
||||
invX = x * 2;
|
||||
bump = invX * invX * 0.5 * strength;
|
||||
} else {
|
||||
invX = (1 - x) * 2;
|
||||
bump = invX * invX * 0.5 * strength;
|
||||
}
|
||||
|
||||
if (randomize) {
|
||||
y += Math.random() * bump - bump * 0.5;
|
||||
} else if (i % 2) {
|
||||
y += bump * 0.5;
|
||||
} else {
|
||||
y -= bump * 0.5;
|
||||
}
|
||||
|
||||
if (clamp) {
|
||||
if (y > 1) {
|
||||
y = 1;
|
||||
} else if (y < 0) {
|
||||
y = 0;
|
||||
}
|
||||
}
|
||||
|
||||
a[cnt++] = {
|
||||
x: x,
|
||||
y: y
|
||||
};
|
||||
}
|
||||
|
||||
a.sort(function (a, b) {
|
||||
return a.x - b.x;
|
||||
});
|
||||
pnt = new EasePoint(1, 1, null);
|
||||
i = points;
|
||||
|
||||
while (i--) {
|
||||
obj = a[i];
|
||||
pnt = new EasePoint(obj.x, obj.y, pnt);
|
||||
}
|
||||
|
||||
recent = new EasePoint(0, 0, pnt.t ? pnt : pnt.next);
|
||||
return function (p) {
|
||||
var pnt = recent;
|
||||
|
||||
if (p > pnt.t) {
|
||||
while (pnt.next && p >= pnt.t) {
|
||||
pnt = pnt.next;
|
||||
}
|
||||
|
||||
pnt = pnt.prev;
|
||||
} else {
|
||||
while (pnt.prev && p <= pnt.t) {
|
||||
pnt = pnt.prev;
|
||||
}
|
||||
}
|
||||
|
||||
recent = pnt;
|
||||
return pnt.v + (p - pnt.t) / pnt.gap * pnt.c;
|
||||
};
|
||||
};
|
||||
|
||||
var SlowMo = _createSlowMo(0.7);
|
||||
SlowMo.ease = SlowMo;
|
||||
SlowMo.config = _createSlowMo;
|
||||
var ExpoScaleEase = _createExpoScale(1, 2);
|
||||
ExpoScaleEase.config = _createExpoScale;
|
||||
var RoughEase = _createRoughEase();
|
||||
RoughEase.ease = RoughEase;
|
||||
RoughEase.config = _createRoughEase;
|
||||
var EasePack = {
|
||||
SlowMo: SlowMo,
|
||||
RoughEase: RoughEase,
|
||||
ExpoScaleEase: ExpoScaleEase
|
||||
};
|
||||
|
||||
for (var p in EasePack) {
|
||||
EasePack[p].register = _initCore;
|
||||
EasePack[p].version = "3.12.5";
|
||||
}
|
||||
|
||||
_getGSAP() && gsap.registerPlugin(SlowMo);
|
||||
|
||||
exports.EasePack = EasePack;
|
||||
exports.ExpoScaleEase = ExpoScaleEase;
|
||||
exports.RoughEase = RoughEase;
|
||||
exports.SlowMo = SlowMo;
|
||||
exports.default = EasePack;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
Executable
+351
@@ -0,0 +1,351 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(global = global || self, factory(global.window = global.window || {}));
|
||||
}(this, (function (exports) { 'use strict';
|
||||
|
||||
/*!
|
||||
* EaselPlugin 3.12.5
|
||||
* https://gsap.com
|
||||
*
|
||||
* @license Copyright 2008-2024, GreenSock. All rights reserved.
|
||||
* Subject to the terms at https://gsap.com/standard-license or for
|
||||
* Club GSAP members, the agreement issued with that membership.
|
||||
* @author: Jack Doyle, jack@greensock.com
|
||||
*/
|
||||
var gsap,
|
||||
_coreInitted,
|
||||
_win,
|
||||
_createJS,
|
||||
_ColorFilter,
|
||||
_ColorMatrixFilter,
|
||||
_colorProps = "redMultiplier,greenMultiplier,blueMultiplier,alphaMultiplier,redOffset,greenOffset,blueOffset,alphaOffset".split(","),
|
||||
_windowExists = function _windowExists() {
|
||||
return typeof window !== "undefined";
|
||||
},
|
||||
_getGSAP = function _getGSAP() {
|
||||
return gsap || _windowExists() && (gsap = window.gsap) && gsap.registerPlugin && gsap;
|
||||
},
|
||||
_getCreateJS = function _getCreateJS() {
|
||||
return _createJS || _win && _win.createjs || _win || {};
|
||||
},
|
||||
_warn = function _warn(message) {
|
||||
return console.warn(message);
|
||||
},
|
||||
_cache = function _cache(target) {
|
||||
var b = target.getBounds && target.getBounds();
|
||||
|
||||
if (!b) {
|
||||
b = target.nominalBounds || {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: 100,
|
||||
height: 100
|
||||
};
|
||||
target.setBounds && target.setBounds(b.x, b.y, b.width, b.height);
|
||||
}
|
||||
|
||||
target.cache && target.cache(b.x, b.y, b.width, b.height);
|
||||
|
||||
_warn("EaselPlugin: for filters to display in EaselJS, you must call the object's cache() method first. GSAP attempted to use the target's getBounds() for the cache but that may not be completely accurate. " + target);
|
||||
},
|
||||
_parseColorFilter = function _parseColorFilter(target, v, plugin) {
|
||||
if (!_ColorFilter) {
|
||||
_ColorFilter = _getCreateJS().ColorFilter;
|
||||
|
||||
if (!_ColorFilter) {
|
||||
_warn("EaselPlugin error: The EaselJS ColorFilter JavaScript file wasn't loaded.");
|
||||
}
|
||||
}
|
||||
|
||||
var filters = target.filters || [],
|
||||
i = filters.length,
|
||||
c,
|
||||
s,
|
||||
e,
|
||||
a,
|
||||
p,
|
||||
pt;
|
||||
|
||||
while (i--) {
|
||||
if (filters[i] instanceof _ColorFilter) {
|
||||
s = filters[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!s) {
|
||||
s = new _ColorFilter();
|
||||
filters.push(s);
|
||||
target.filters = filters;
|
||||
}
|
||||
|
||||
e = s.clone();
|
||||
|
||||
if (v.tint != null) {
|
||||
c = gsap.utils.splitColor(v.tint);
|
||||
a = v.tintAmount != null ? +v.tintAmount : 1;
|
||||
e.redOffset = +c[0] * a;
|
||||
e.greenOffset = +c[1] * a;
|
||||
e.blueOffset = +c[2] * a;
|
||||
e.redMultiplier = e.greenMultiplier = e.blueMultiplier = 1 - a;
|
||||
} else {
|
||||
for (p in v) {
|
||||
if (p !== "exposure") if (p !== "brightness") {
|
||||
e[p] = +v[p];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (v.exposure != null) {
|
||||
e.redOffset = e.greenOffset = e.blueOffset = 255 * (+v.exposure - 1);
|
||||
e.redMultiplier = e.greenMultiplier = e.blueMultiplier = 1;
|
||||
} else if (v.brightness != null) {
|
||||
a = +v.brightness - 1;
|
||||
e.redOffset = e.greenOffset = e.blueOffset = a > 0 ? a * 255 : 0;
|
||||
e.redMultiplier = e.greenMultiplier = e.blueMultiplier = 1 - Math.abs(a);
|
||||
}
|
||||
|
||||
i = 8;
|
||||
|
||||
while (i--) {
|
||||
p = _colorProps[i];
|
||||
|
||||
if (s[p] !== e[p]) {
|
||||
pt = plugin.add(s, p, s[p], e[p], 0, 0, 0, 0, 0, 1);
|
||||
|
||||
if (pt) {
|
||||
pt.op = "easel_colorFilter";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
plugin._props.push("easel_colorFilter");
|
||||
|
||||
if (!target.cacheID) {
|
||||
_cache(target);
|
||||
}
|
||||
},
|
||||
_idMatrix = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0],
|
||||
_lumR = 0.212671,
|
||||
_lumG = 0.715160,
|
||||
_lumB = 0.072169,
|
||||
_applyMatrix = function _applyMatrix(m, m2) {
|
||||
if (!(m instanceof Array) || !(m2 instanceof Array)) {
|
||||
return m2;
|
||||
}
|
||||
|
||||
var temp = [],
|
||||
i = 0,
|
||||
z = 0,
|
||||
y,
|
||||
x;
|
||||
|
||||
for (y = 0; y < 4; y++) {
|
||||
for (x = 0; x < 5; x++) {
|
||||
z = x === 4 ? m[i + 4] : 0;
|
||||
temp[i + x] = m[i] * m2[x] + m[i + 1] * m2[x + 5] + m[i + 2] * m2[x + 10] + m[i + 3] * m2[x + 15] + z;
|
||||
}
|
||||
|
||||
i += 5;
|
||||
}
|
||||
|
||||
return temp;
|
||||
},
|
||||
_setSaturation = function _setSaturation(m, n) {
|
||||
if (isNaN(n)) {
|
||||
return m;
|
||||
}
|
||||
|
||||
var inv = 1 - n,
|
||||
r = inv * _lumR,
|
||||
g = inv * _lumG,
|
||||
b = inv * _lumB;
|
||||
return _applyMatrix([r + n, g, b, 0, 0, r, g + n, b, 0, 0, r, g, b + n, 0, 0, 0, 0, 0, 1, 0], m);
|
||||
},
|
||||
_colorize = function _colorize(m, color, amount) {
|
||||
if (isNaN(amount)) {
|
||||
amount = 1;
|
||||
}
|
||||
|
||||
var c = gsap.utils.splitColor(color),
|
||||
r = c[0] / 255,
|
||||
g = c[1] / 255,
|
||||
b = c[2] / 255,
|
||||
inv = 1 - amount;
|
||||
return _applyMatrix([inv + amount * r * _lumR, amount * r * _lumG, amount * r * _lumB, 0, 0, amount * g * _lumR, inv + amount * g * _lumG, amount * g * _lumB, 0, 0, amount * b * _lumR, amount * b * _lumG, inv + amount * b * _lumB, 0, 0, 0, 0, 0, 1, 0], m);
|
||||
},
|
||||
_setHue = function _setHue(m, n) {
|
||||
if (isNaN(n)) {
|
||||
return m;
|
||||
}
|
||||
|
||||
n *= Math.PI / 180;
|
||||
var c = Math.cos(n),
|
||||
s = Math.sin(n);
|
||||
return _applyMatrix([_lumR + c * (1 - _lumR) + s * -_lumR, _lumG + c * -_lumG + s * -_lumG, _lumB + c * -_lumB + s * (1 - _lumB), 0, 0, _lumR + c * -_lumR + s * 0.143, _lumG + c * (1 - _lumG) + s * 0.14, _lumB + c * -_lumB + s * -0.283, 0, 0, _lumR + c * -_lumR + s * -(1 - _lumR), _lumG + c * -_lumG + s * _lumG, _lumB + c * (1 - _lumB) + s * _lumB, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], m);
|
||||
},
|
||||
_setContrast = function _setContrast(m, n) {
|
||||
if (isNaN(n)) {
|
||||
return m;
|
||||
}
|
||||
|
||||
n += 0.01;
|
||||
return _applyMatrix([n, 0, 0, 0, 128 * (1 - n), 0, n, 0, 0, 128 * (1 - n), 0, 0, n, 0, 128 * (1 - n), 0, 0, 0, 1, 0], m);
|
||||
},
|
||||
_parseColorMatrixFilter = function _parseColorMatrixFilter(target, v, plugin) {
|
||||
if (!_ColorMatrixFilter) {
|
||||
_ColorMatrixFilter = _getCreateJS().ColorMatrixFilter;
|
||||
|
||||
if (!_ColorMatrixFilter) {
|
||||
_warn("EaselPlugin: The EaselJS ColorMatrixFilter JavaScript file wasn't loaded.");
|
||||
}
|
||||
}
|
||||
|
||||
var filters = target.filters || [],
|
||||
i = filters.length,
|
||||
matrix,
|
||||
startMatrix,
|
||||
s,
|
||||
pg;
|
||||
|
||||
while (--i > -1) {
|
||||
if (filters[i] instanceof _ColorMatrixFilter) {
|
||||
s = filters[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!s) {
|
||||
s = new _ColorMatrixFilter(_idMatrix.slice());
|
||||
filters.push(s);
|
||||
target.filters = filters;
|
||||
}
|
||||
|
||||
startMatrix = s.matrix;
|
||||
matrix = _idMatrix.slice();
|
||||
|
||||
if (v.colorize != null) {
|
||||
matrix = _colorize(matrix, v.colorize, Number(v.colorizeAmount));
|
||||
}
|
||||
|
||||
if (v.contrast != null) {
|
||||
matrix = _setContrast(matrix, Number(v.contrast));
|
||||
}
|
||||
|
||||
if (v.hue != null) {
|
||||
matrix = _setHue(matrix, Number(v.hue));
|
||||
}
|
||||
|
||||
if (v.saturation != null) {
|
||||
matrix = _setSaturation(matrix, Number(v.saturation));
|
||||
}
|
||||
|
||||
i = matrix.length;
|
||||
|
||||
while (--i > -1) {
|
||||
if (matrix[i] !== startMatrix[i]) {
|
||||
pg = plugin.add(startMatrix, i, startMatrix[i], matrix[i], 0, 0, 0, 0, 0, 1);
|
||||
|
||||
if (pg) {
|
||||
pg.op = "easel_colorMatrixFilter";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
plugin._props.push("easel_colorMatrixFilter");
|
||||
|
||||
if (!target.cacheID) {
|
||||
_cache();
|
||||
}
|
||||
|
||||
plugin._matrix = startMatrix;
|
||||
},
|
||||
_initCore = function _initCore(core) {
|
||||
gsap = core || _getGSAP();
|
||||
|
||||
if (_windowExists()) {
|
||||
_win = window;
|
||||
}
|
||||
|
||||
if (gsap) {
|
||||
_coreInitted = 1;
|
||||
}
|
||||
};
|
||||
|
||||
var EaselPlugin = {
|
||||
version: "3.12.5",
|
||||
name: "easel",
|
||||
init: function init(target, value, tween, index, targets) {
|
||||
if (!_coreInitted) {
|
||||
_initCore();
|
||||
|
||||
if (!gsap) {
|
||||
_warn("Please gsap.registerPlugin(EaselPlugin)");
|
||||
}
|
||||
}
|
||||
|
||||
this.target = target;
|
||||
var p, pt, tint, colorMatrix, end, labels, i;
|
||||
|
||||
for (p in value) {
|
||||
end = value[p];
|
||||
|
||||
if (p === "colorFilter" || p === "tint" || p === "tintAmount" || p === "exposure" || p === "brightness") {
|
||||
if (!tint) {
|
||||
_parseColorFilter(target, value.colorFilter || value, this);
|
||||
|
||||
tint = true;
|
||||
}
|
||||
} else if (p === "saturation" || p === "contrast" || p === "hue" || p === "colorize" || p === "colorizeAmount") {
|
||||
if (!colorMatrix) {
|
||||
_parseColorMatrixFilter(target, value.colorMatrixFilter || value, this);
|
||||
|
||||
colorMatrix = true;
|
||||
}
|
||||
} else if (p === "frame") {
|
||||
if (typeof end === "string" && end.charAt(1) !== "=" && (labels = target.labels)) {
|
||||
for (i = 0; i < labels.length; i++) {
|
||||
if (labels[i].label === end) {
|
||||
end = labels[i].position;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pt = this.add(target, "gotoAndStop", target.currentFrame, end, index, targets, Math.round, 0, 0, 1);
|
||||
|
||||
if (pt) {
|
||||
pt.op = p;
|
||||
}
|
||||
} else if (target[p] != null) {
|
||||
this.add(target, p, "get", end);
|
||||
}
|
||||
}
|
||||
},
|
||||
render: function render(ratio, data) {
|
||||
var pt = data._pt;
|
||||
|
||||
while (pt) {
|
||||
pt.r(ratio, pt.d);
|
||||
pt = pt._next;
|
||||
}
|
||||
|
||||
if (data.target.cacheID) {
|
||||
data.target.updateCache();
|
||||
}
|
||||
},
|
||||
register: _initCore
|
||||
};
|
||||
|
||||
EaselPlugin.registerCreateJS = function (createjs) {
|
||||
_createJS = createjs;
|
||||
};
|
||||
|
||||
_getGSAP() && gsap.registerPlugin(EaselPlugin);
|
||||
|
||||
exports.EaselPlugin = EaselPlugin;
|
||||
exports.default = EaselPlugin;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
Executable
+1823
File diff suppressed because it is too large
Load Diff
Executable
+1807
File diff suppressed because it is too large
Load Diff
Executable
+697
@@ -0,0 +1,697 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(global = global || self, factory(global.window = global.window || {}));
|
||||
}(this, (function (exports) { 'use strict';
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var descriptor = props[i];
|
||||
descriptor.enumerable = descriptor.enumerable || false;
|
||||
descriptor.configurable = true;
|
||||
if ("value" in descriptor) descriptor.writable = true;
|
||||
Object.defineProperty(target, descriptor.key, descriptor);
|
||||
}
|
||||
}
|
||||
|
||||
function _createClass(Constructor, protoProps, staticProps) {
|
||||
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
||||
if (staticProps) _defineProperties(Constructor, staticProps);
|
||||
return Constructor;
|
||||
}
|
||||
|
||||
/*!
|
||||
* Observer 3.12.5
|
||||
* https://gsap.com
|
||||
*
|
||||
* @license Copyright 2008-2024, GreenSock. All rights reserved.
|
||||
* Subject to the terms at https://gsap.com/standard-license or for
|
||||
* Club GSAP members, the agreement issued with that membership.
|
||||
* @author: Jack Doyle, jack@greensock.com
|
||||
*/
|
||||
var gsap,
|
||||
_coreInitted,
|
||||
_clamp,
|
||||
_win,
|
||||
_doc,
|
||||
_docEl,
|
||||
_body,
|
||||
_isTouch,
|
||||
_pointerType,
|
||||
ScrollTrigger,
|
||||
_root,
|
||||
_normalizer,
|
||||
_eventTypes,
|
||||
_context,
|
||||
_getGSAP = function _getGSAP() {
|
||||
return gsap || typeof window !== "undefined" && (gsap = window.gsap) && gsap.registerPlugin && gsap;
|
||||
},
|
||||
_startup = 1,
|
||||
_observers = [];
|
||||
exports._scrollers = [];
|
||||
exports._proxies = [];
|
||||
var _getTime = Date.now,
|
||||
_bridge = function _bridge(name, value) {
|
||||
return value;
|
||||
},
|
||||
_integrate = function _integrate() {
|
||||
var core = ScrollTrigger.core,
|
||||
data = core.bridge || {},
|
||||
scrollers = core._scrollers,
|
||||
proxies = core._proxies;
|
||||
scrollers.push.apply(scrollers, exports._scrollers);
|
||||
proxies.push.apply(proxies, exports._proxies);
|
||||
exports._scrollers = scrollers;
|
||||
exports._proxies = proxies;
|
||||
|
||||
_bridge = function _bridge(name, value) {
|
||||
return data[name](value);
|
||||
};
|
||||
},
|
||||
_getProxyProp = function _getProxyProp(element, property) {
|
||||
return ~exports._proxies.indexOf(element) && exports._proxies[exports._proxies.indexOf(element) + 1][property];
|
||||
},
|
||||
_isViewport = function _isViewport(el) {
|
||||
return !!~_root.indexOf(el);
|
||||
},
|
||||
_addListener = function _addListener(element, type, func, passive, capture) {
|
||||
return element.addEventListener(type, func, {
|
||||
passive: passive !== false,
|
||||
capture: !!capture
|
||||
});
|
||||
},
|
||||
_removeListener = function _removeListener(element, type, func, capture) {
|
||||
return element.removeEventListener(type, func, !!capture);
|
||||
},
|
||||
_scrollLeft = "scrollLeft",
|
||||
_scrollTop = "scrollTop",
|
||||
_onScroll = function _onScroll() {
|
||||
return _normalizer && _normalizer.isPressed || exports._scrollers.cache++;
|
||||
},
|
||||
_scrollCacheFunc = function _scrollCacheFunc(f, doNotCache) {
|
||||
var cachingFunc = function cachingFunc(value) {
|
||||
if (value || value === 0) {
|
||||
_startup && (_win.history.scrollRestoration = "manual");
|
||||
var isNormalizing = _normalizer && _normalizer.isPressed;
|
||||
value = cachingFunc.v = Math.round(value) || (_normalizer && _normalizer.iOS ? 1 : 0);
|
||||
f(value);
|
||||
cachingFunc.cacheID = exports._scrollers.cache;
|
||||
isNormalizing && _bridge("ss", value);
|
||||
} else if (doNotCache || exports._scrollers.cache !== cachingFunc.cacheID || _bridge("ref")) {
|
||||
cachingFunc.cacheID = exports._scrollers.cache;
|
||||
cachingFunc.v = f();
|
||||
}
|
||||
|
||||
return cachingFunc.v + cachingFunc.offset;
|
||||
};
|
||||
|
||||
cachingFunc.offset = 0;
|
||||
return f && cachingFunc;
|
||||
},
|
||||
_horizontal = {
|
||||
s: _scrollLeft,
|
||||
p: "left",
|
||||
p2: "Left",
|
||||
os: "right",
|
||||
os2: "Right",
|
||||
d: "width",
|
||||
d2: "Width",
|
||||
a: "x",
|
||||
sc: _scrollCacheFunc(function (value) {
|
||||
return arguments.length ? _win.scrollTo(value, _vertical.sc()) : _win.pageXOffset || _doc[_scrollLeft] || _docEl[_scrollLeft] || _body[_scrollLeft] || 0;
|
||||
})
|
||||
},
|
||||
_vertical = {
|
||||
s: _scrollTop,
|
||||
p: "top",
|
||||
p2: "Top",
|
||||
os: "bottom",
|
||||
os2: "Bottom",
|
||||
d: "height",
|
||||
d2: "Height",
|
||||
a: "y",
|
||||
op: _horizontal,
|
||||
sc: _scrollCacheFunc(function (value) {
|
||||
return arguments.length ? _win.scrollTo(_horizontal.sc(), value) : _win.pageYOffset || _doc[_scrollTop] || _docEl[_scrollTop] || _body[_scrollTop] || 0;
|
||||
})
|
||||
},
|
||||
_getTarget = function _getTarget(t, self) {
|
||||
return (self && self._ctx && self._ctx.selector || gsap.utils.toArray)(t)[0] || (typeof t === "string" && gsap.config().nullTargetWarn !== false ? console.warn("Element not found:", t) : null);
|
||||
},
|
||||
_getScrollFunc = function _getScrollFunc(element, _ref) {
|
||||
var s = _ref.s,
|
||||
sc = _ref.sc;
|
||||
_isViewport(element) && (element = _doc.scrollingElement || _docEl);
|
||||
|
||||
var i = exports._scrollers.indexOf(element),
|
||||
offset = sc === _vertical.sc ? 1 : 2;
|
||||
|
||||
!~i && (i = exports._scrollers.push(element) - 1);
|
||||
exports._scrollers[i + offset] || _addListener(element, "scroll", _onScroll);
|
||||
var prev = exports._scrollers[i + offset],
|
||||
func = prev || (exports._scrollers[i + offset] = _scrollCacheFunc(_getProxyProp(element, s), true) || (_isViewport(element) ? sc : _scrollCacheFunc(function (value) {
|
||||
return arguments.length ? element[s] = value : element[s];
|
||||
})));
|
||||
func.target = element;
|
||||
prev || (func.smooth = gsap.getProperty(element, "scrollBehavior") === "smooth");
|
||||
return func;
|
||||
},
|
||||
_getVelocityProp = function _getVelocityProp(value, minTimeRefresh, useDelta) {
|
||||
var v1 = value,
|
||||
v2 = value,
|
||||
t1 = _getTime(),
|
||||
t2 = t1,
|
||||
min = minTimeRefresh || 50,
|
||||
dropToZeroTime = Math.max(500, min * 3),
|
||||
update = function update(value, force) {
|
||||
var t = _getTime();
|
||||
|
||||
if (force || t - t1 > min) {
|
||||
v2 = v1;
|
||||
v1 = value;
|
||||
t2 = t1;
|
||||
t1 = t;
|
||||
} else if (useDelta) {
|
||||
v1 += value;
|
||||
} else {
|
||||
v1 = v2 + (value - v2) / (t - t2) * (t1 - t2);
|
||||
}
|
||||
},
|
||||
reset = function reset() {
|
||||
v2 = v1 = useDelta ? 0 : v1;
|
||||
t2 = t1 = 0;
|
||||
},
|
||||
getVelocity = function getVelocity(latestValue) {
|
||||
var tOld = t2,
|
||||
vOld = v2,
|
||||
t = _getTime();
|
||||
|
||||
(latestValue || latestValue === 0) && latestValue !== v1 && update(latestValue);
|
||||
return t1 === t2 || t - t2 > dropToZeroTime ? 0 : (v1 + (useDelta ? vOld : -vOld)) / ((useDelta ? t : t1) - tOld) * 1000;
|
||||
};
|
||||
|
||||
return {
|
||||
update: update,
|
||||
reset: reset,
|
||||
getVelocity: getVelocity
|
||||
};
|
||||
},
|
||||
_getEvent = function _getEvent(e, preventDefault) {
|
||||
preventDefault && !e._gsapAllow && e.preventDefault();
|
||||
return e.changedTouches ? e.changedTouches[0] : e;
|
||||
},
|
||||
_getAbsoluteMax = function _getAbsoluteMax(a) {
|
||||
var max = Math.max.apply(Math, a),
|
||||
min = Math.min.apply(Math, a);
|
||||
return Math.abs(max) >= Math.abs(min) ? max : min;
|
||||
},
|
||||
_setScrollTrigger = function _setScrollTrigger() {
|
||||
ScrollTrigger = gsap.core.globals().ScrollTrigger;
|
||||
ScrollTrigger && ScrollTrigger.core && _integrate();
|
||||
},
|
||||
_initCore = function _initCore(core) {
|
||||
gsap = core || _getGSAP();
|
||||
|
||||
if (!_coreInitted && gsap && typeof document !== "undefined" && document.body) {
|
||||
_win = window;
|
||||
_doc = document;
|
||||
_docEl = _doc.documentElement;
|
||||
_body = _doc.body;
|
||||
_root = [_win, _doc, _docEl, _body];
|
||||
_clamp = gsap.utils.clamp;
|
||||
|
||||
_context = gsap.core.context || function () {};
|
||||
|
||||
_pointerType = "onpointerenter" in _body ? "pointer" : "mouse";
|
||||
_isTouch = Observer.isTouch = _win.matchMedia && _win.matchMedia("(hover: none), (pointer: coarse)").matches ? 1 : "ontouchstart" in _win || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0 ? 2 : 0;
|
||||
_eventTypes = Observer.eventTypes = ("ontouchstart" in _docEl ? "touchstart,touchmove,touchcancel,touchend" : !("onpointerdown" in _docEl) ? "mousedown,mousemove,mouseup,mouseup" : "pointerdown,pointermove,pointercancel,pointerup").split(",");
|
||||
setTimeout(function () {
|
||||
return _startup = 0;
|
||||
}, 500);
|
||||
|
||||
_setScrollTrigger();
|
||||
|
||||
_coreInitted = 1;
|
||||
}
|
||||
|
||||
return _coreInitted;
|
||||
};
|
||||
|
||||
_horizontal.op = _vertical;
|
||||
exports._scrollers.cache = 0;
|
||||
var Observer = function () {
|
||||
function Observer(vars) {
|
||||
this.init(vars);
|
||||
}
|
||||
|
||||
var _proto = Observer.prototype;
|
||||
|
||||
_proto.init = function init(vars) {
|
||||
_coreInitted || _initCore(gsap) || console.warn("Please gsap.registerPlugin(Observer)");
|
||||
ScrollTrigger || _setScrollTrigger();
|
||||
var tolerance = vars.tolerance,
|
||||
dragMinimum = vars.dragMinimum,
|
||||
type = vars.type,
|
||||
target = vars.target,
|
||||
lineHeight = vars.lineHeight,
|
||||
debounce = vars.debounce,
|
||||
preventDefault = vars.preventDefault,
|
||||
onStop = vars.onStop,
|
||||
onStopDelay = vars.onStopDelay,
|
||||
ignore = vars.ignore,
|
||||
wheelSpeed = vars.wheelSpeed,
|
||||
event = vars.event,
|
||||
onDragStart = vars.onDragStart,
|
||||
onDragEnd = vars.onDragEnd,
|
||||
onDrag = vars.onDrag,
|
||||
onPress = vars.onPress,
|
||||
onRelease = vars.onRelease,
|
||||
onRight = vars.onRight,
|
||||
onLeft = vars.onLeft,
|
||||
onUp = vars.onUp,
|
||||
onDown = vars.onDown,
|
||||
onChangeX = vars.onChangeX,
|
||||
onChangeY = vars.onChangeY,
|
||||
onChange = vars.onChange,
|
||||
onToggleX = vars.onToggleX,
|
||||
onToggleY = vars.onToggleY,
|
||||
onHover = vars.onHover,
|
||||
onHoverEnd = vars.onHoverEnd,
|
||||
onMove = vars.onMove,
|
||||
ignoreCheck = vars.ignoreCheck,
|
||||
isNormalizer = vars.isNormalizer,
|
||||
onGestureStart = vars.onGestureStart,
|
||||
onGestureEnd = vars.onGestureEnd,
|
||||
onWheel = vars.onWheel,
|
||||
onEnable = vars.onEnable,
|
||||
onDisable = vars.onDisable,
|
||||
onClick = vars.onClick,
|
||||
scrollSpeed = vars.scrollSpeed,
|
||||
capture = vars.capture,
|
||||
allowClicks = vars.allowClicks,
|
||||
lockAxis = vars.lockAxis,
|
||||
onLockAxis = vars.onLockAxis;
|
||||
this.target = target = _getTarget(target) || _docEl;
|
||||
this.vars = vars;
|
||||
ignore && (ignore = gsap.utils.toArray(ignore));
|
||||
tolerance = tolerance || 1e-9;
|
||||
dragMinimum = dragMinimum || 0;
|
||||
wheelSpeed = wheelSpeed || 1;
|
||||
scrollSpeed = scrollSpeed || 1;
|
||||
type = type || "wheel,touch,pointer";
|
||||
debounce = debounce !== false;
|
||||
lineHeight || (lineHeight = parseFloat(_win.getComputedStyle(_body).lineHeight) || 22);
|
||||
|
||||
var id,
|
||||
onStopDelayedCall,
|
||||
dragged,
|
||||
moved,
|
||||
wheeled,
|
||||
locked,
|
||||
axis,
|
||||
self = this,
|
||||
prevDeltaX = 0,
|
||||
prevDeltaY = 0,
|
||||
passive = vars.passive || !preventDefault,
|
||||
scrollFuncX = _getScrollFunc(target, _horizontal),
|
||||
scrollFuncY = _getScrollFunc(target, _vertical),
|
||||
scrollX = scrollFuncX(),
|
||||
scrollY = scrollFuncY(),
|
||||
limitToTouch = ~type.indexOf("touch") && !~type.indexOf("pointer") && _eventTypes[0] === "pointerdown",
|
||||
isViewport = _isViewport(target),
|
||||
ownerDoc = target.ownerDocument || _doc,
|
||||
deltaX = [0, 0, 0],
|
||||
deltaY = [0, 0, 0],
|
||||
onClickTime = 0,
|
||||
clickCapture = function clickCapture() {
|
||||
return onClickTime = _getTime();
|
||||
},
|
||||
_ignoreCheck = function _ignoreCheck(e, isPointerOrTouch) {
|
||||
return (self.event = e) && ignore && ~ignore.indexOf(e.target) || isPointerOrTouch && limitToTouch && e.pointerType !== "touch" || ignoreCheck && ignoreCheck(e, isPointerOrTouch);
|
||||
},
|
||||
onStopFunc = function onStopFunc() {
|
||||
self._vx.reset();
|
||||
|
||||
self._vy.reset();
|
||||
|
||||
onStopDelayedCall.pause();
|
||||
onStop && onStop(self);
|
||||
},
|
||||
update = function update() {
|
||||
var dx = self.deltaX = _getAbsoluteMax(deltaX),
|
||||
dy = self.deltaY = _getAbsoluteMax(deltaY),
|
||||
changedX = Math.abs(dx) >= tolerance,
|
||||
changedY = Math.abs(dy) >= tolerance;
|
||||
|
||||
onChange && (changedX || changedY) && onChange(self, dx, dy, deltaX, deltaY);
|
||||
|
||||
if (changedX) {
|
||||
onRight && self.deltaX > 0 && onRight(self);
|
||||
onLeft && self.deltaX < 0 && onLeft(self);
|
||||
onChangeX && onChangeX(self);
|
||||
onToggleX && self.deltaX < 0 !== prevDeltaX < 0 && onToggleX(self);
|
||||
prevDeltaX = self.deltaX;
|
||||
deltaX[0] = deltaX[1] = deltaX[2] = 0;
|
||||
}
|
||||
|
||||
if (changedY) {
|
||||
onDown && self.deltaY > 0 && onDown(self);
|
||||
onUp && self.deltaY < 0 && onUp(self);
|
||||
onChangeY && onChangeY(self);
|
||||
onToggleY && self.deltaY < 0 !== prevDeltaY < 0 && onToggleY(self);
|
||||
prevDeltaY = self.deltaY;
|
||||
deltaY[0] = deltaY[1] = deltaY[2] = 0;
|
||||
}
|
||||
|
||||
if (moved || dragged) {
|
||||
onMove && onMove(self);
|
||||
|
||||
if (dragged) {
|
||||
onDrag(self);
|
||||
dragged = false;
|
||||
}
|
||||
|
||||
moved = false;
|
||||
}
|
||||
|
||||
locked && !(locked = false) && onLockAxis && onLockAxis(self);
|
||||
|
||||
if (wheeled) {
|
||||
onWheel(self);
|
||||
wheeled = false;
|
||||
}
|
||||
|
||||
id = 0;
|
||||
},
|
||||
onDelta = function onDelta(x, y, index) {
|
||||
deltaX[index] += x;
|
||||
deltaY[index] += y;
|
||||
|
||||
self._vx.update(x);
|
||||
|
||||
self._vy.update(y);
|
||||
|
||||
debounce ? id || (id = requestAnimationFrame(update)) : update();
|
||||
},
|
||||
onTouchOrPointerDelta = function onTouchOrPointerDelta(x, y) {
|
||||
if (lockAxis && !axis) {
|
||||
self.axis = axis = Math.abs(x) > Math.abs(y) ? "x" : "y";
|
||||
locked = true;
|
||||
}
|
||||
|
||||
if (axis !== "y") {
|
||||
deltaX[2] += x;
|
||||
|
||||
self._vx.update(x, true);
|
||||
}
|
||||
|
||||
if (axis !== "x") {
|
||||
deltaY[2] += y;
|
||||
|
||||
self._vy.update(y, true);
|
||||
}
|
||||
|
||||
debounce ? id || (id = requestAnimationFrame(update)) : update();
|
||||
},
|
||||
_onDrag = function _onDrag(e) {
|
||||
if (_ignoreCheck(e, 1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
e = _getEvent(e, preventDefault);
|
||||
var x = e.clientX,
|
||||
y = e.clientY,
|
||||
dx = x - self.x,
|
||||
dy = y - self.y,
|
||||
isDragging = self.isDragging;
|
||||
self.x = x;
|
||||
self.y = y;
|
||||
|
||||
if (isDragging || Math.abs(self.startX - x) >= dragMinimum || Math.abs(self.startY - y) >= dragMinimum) {
|
||||
onDrag && (dragged = true);
|
||||
isDragging || (self.isDragging = true);
|
||||
onTouchOrPointerDelta(dx, dy);
|
||||
isDragging || onDragStart && onDragStart(self);
|
||||
}
|
||||
},
|
||||
_onPress = self.onPress = function (e) {
|
||||
if (_ignoreCheck(e, 1) || e && e.button) {
|
||||
return;
|
||||
}
|
||||
|
||||
self.axis = axis = null;
|
||||
onStopDelayedCall.pause();
|
||||
self.isPressed = true;
|
||||
e = _getEvent(e);
|
||||
prevDeltaX = prevDeltaY = 0;
|
||||
self.startX = self.x = e.clientX;
|
||||
self.startY = self.y = e.clientY;
|
||||
|
||||
self._vx.reset();
|
||||
|
||||
self._vy.reset();
|
||||
|
||||
_addListener(isNormalizer ? target : ownerDoc, _eventTypes[1], _onDrag, passive, true);
|
||||
|
||||
self.deltaX = self.deltaY = 0;
|
||||
onPress && onPress(self);
|
||||
},
|
||||
_onRelease = self.onRelease = function (e) {
|
||||
if (_ignoreCheck(e, 1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
_removeListener(isNormalizer ? target : ownerDoc, _eventTypes[1], _onDrag, true);
|
||||
|
||||
var isTrackingDrag = !isNaN(self.y - self.startY),
|
||||
wasDragging = self.isDragging,
|
||||
isDragNotClick = wasDragging && (Math.abs(self.x - self.startX) > 3 || Math.abs(self.y - self.startY) > 3),
|
||||
eventData = _getEvent(e);
|
||||
|
||||
if (!isDragNotClick && isTrackingDrag) {
|
||||
self._vx.reset();
|
||||
|
||||
self._vy.reset();
|
||||
|
||||
if (preventDefault && allowClicks) {
|
||||
gsap.delayedCall(0.08, function () {
|
||||
if (_getTime() - onClickTime > 300 && !e.defaultPrevented) {
|
||||
if (e.target.click) {
|
||||
e.target.click();
|
||||
} else if (ownerDoc.createEvent) {
|
||||
var syntheticEvent = ownerDoc.createEvent("MouseEvents");
|
||||
syntheticEvent.initMouseEvent("click", true, true, _win, 1, eventData.screenX, eventData.screenY, eventData.clientX, eventData.clientY, false, false, false, false, 0, null);
|
||||
e.target.dispatchEvent(syntheticEvent);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
self.isDragging = self.isGesturing = self.isPressed = false;
|
||||
onStop && wasDragging && !isNormalizer && onStopDelayedCall.restart(true);
|
||||
onDragEnd && wasDragging && onDragEnd(self);
|
||||
onRelease && onRelease(self, isDragNotClick);
|
||||
},
|
||||
_onGestureStart = function _onGestureStart(e) {
|
||||
return e.touches && e.touches.length > 1 && (self.isGesturing = true) && onGestureStart(e, self.isDragging);
|
||||
},
|
||||
_onGestureEnd = function _onGestureEnd() {
|
||||
return (self.isGesturing = false) || onGestureEnd(self);
|
||||
},
|
||||
onScroll = function onScroll(e) {
|
||||
if (_ignoreCheck(e)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var x = scrollFuncX(),
|
||||
y = scrollFuncY();
|
||||
onDelta((x - scrollX) * scrollSpeed, (y - scrollY) * scrollSpeed, 1);
|
||||
scrollX = x;
|
||||
scrollY = y;
|
||||
onStop && onStopDelayedCall.restart(true);
|
||||
},
|
||||
_onWheel = function _onWheel(e) {
|
||||
if (_ignoreCheck(e)) {
|
||||
return;
|
||||
}
|
||||
|
||||
e = _getEvent(e, preventDefault);
|
||||
onWheel && (wheeled = true);
|
||||
var multiplier = (e.deltaMode === 1 ? lineHeight : e.deltaMode === 2 ? _win.innerHeight : 1) * wheelSpeed;
|
||||
onDelta(e.deltaX * multiplier, e.deltaY * multiplier, 0);
|
||||
onStop && !isNormalizer && onStopDelayedCall.restart(true);
|
||||
},
|
||||
_onMove = function _onMove(e) {
|
||||
if (_ignoreCheck(e)) {
|
||||
return;
|
||||
}
|
||||
|
||||
var x = e.clientX,
|
||||
y = e.clientY,
|
||||
dx = x - self.x,
|
||||
dy = y - self.y;
|
||||
self.x = x;
|
||||
self.y = y;
|
||||
moved = true;
|
||||
onStop && onStopDelayedCall.restart(true);
|
||||
(dx || dy) && onTouchOrPointerDelta(dx, dy);
|
||||
},
|
||||
_onHover = function _onHover(e) {
|
||||
self.event = e;
|
||||
onHover(self);
|
||||
},
|
||||
_onHoverEnd = function _onHoverEnd(e) {
|
||||
self.event = e;
|
||||
onHoverEnd(self);
|
||||
},
|
||||
_onClick = function _onClick(e) {
|
||||
return _ignoreCheck(e) || _getEvent(e, preventDefault) && onClick(self);
|
||||
};
|
||||
|
||||
onStopDelayedCall = self._dc = gsap.delayedCall(onStopDelay || 0.25, onStopFunc).pause();
|
||||
self.deltaX = self.deltaY = 0;
|
||||
self._vx = _getVelocityProp(0, 50, true);
|
||||
self._vy = _getVelocityProp(0, 50, true);
|
||||
self.scrollX = scrollFuncX;
|
||||
self.scrollY = scrollFuncY;
|
||||
self.isDragging = self.isGesturing = self.isPressed = false;
|
||||
|
||||
_context(this);
|
||||
|
||||
self.enable = function (e) {
|
||||
if (!self.isEnabled) {
|
||||
_addListener(isViewport ? ownerDoc : target, "scroll", _onScroll);
|
||||
|
||||
type.indexOf("scroll") >= 0 && _addListener(isViewport ? ownerDoc : target, "scroll", onScroll, passive, capture);
|
||||
type.indexOf("wheel") >= 0 && _addListener(target, "wheel", _onWheel, passive, capture);
|
||||
|
||||
if (type.indexOf("touch") >= 0 && _isTouch || type.indexOf("pointer") >= 0) {
|
||||
_addListener(target, _eventTypes[0], _onPress, passive, capture);
|
||||
|
||||
_addListener(ownerDoc, _eventTypes[2], _onRelease);
|
||||
|
||||
_addListener(ownerDoc, _eventTypes[3], _onRelease);
|
||||
|
||||
allowClicks && _addListener(target, "click", clickCapture, true, true);
|
||||
onClick && _addListener(target, "click", _onClick);
|
||||
onGestureStart && _addListener(ownerDoc, "gesturestart", _onGestureStart);
|
||||
onGestureEnd && _addListener(ownerDoc, "gestureend", _onGestureEnd);
|
||||
onHover && _addListener(target, _pointerType + "enter", _onHover);
|
||||
onHoverEnd && _addListener(target, _pointerType + "leave", _onHoverEnd);
|
||||
onMove && _addListener(target, _pointerType + "move", _onMove);
|
||||
}
|
||||
|
||||
self.isEnabled = true;
|
||||
e && e.type && _onPress(e);
|
||||
onEnable && onEnable(self);
|
||||
}
|
||||
|
||||
return self;
|
||||
};
|
||||
|
||||
self.disable = function () {
|
||||
if (self.isEnabled) {
|
||||
_observers.filter(function (o) {
|
||||
return o !== self && _isViewport(o.target);
|
||||
}).length || _removeListener(isViewport ? ownerDoc : target, "scroll", _onScroll);
|
||||
|
||||
if (self.isPressed) {
|
||||
self._vx.reset();
|
||||
|
||||
self._vy.reset();
|
||||
|
||||
_removeListener(isNormalizer ? target : ownerDoc, _eventTypes[1], _onDrag, true);
|
||||
}
|
||||
|
||||
_removeListener(isViewport ? ownerDoc : target, "scroll", onScroll, capture);
|
||||
|
||||
_removeListener(target, "wheel", _onWheel, capture);
|
||||
|
||||
_removeListener(target, _eventTypes[0], _onPress, capture);
|
||||
|
||||
_removeListener(ownerDoc, _eventTypes[2], _onRelease);
|
||||
|
||||
_removeListener(ownerDoc, _eventTypes[3], _onRelease);
|
||||
|
||||
_removeListener(target, "click", clickCapture, true);
|
||||
|
||||
_removeListener(target, "click", _onClick);
|
||||
|
||||
_removeListener(ownerDoc, "gesturestart", _onGestureStart);
|
||||
|
||||
_removeListener(ownerDoc, "gestureend", _onGestureEnd);
|
||||
|
||||
_removeListener(target, _pointerType + "enter", _onHover);
|
||||
|
||||
_removeListener(target, _pointerType + "leave", _onHoverEnd);
|
||||
|
||||
_removeListener(target, _pointerType + "move", _onMove);
|
||||
|
||||
self.isEnabled = self.isPressed = self.isDragging = false;
|
||||
onDisable && onDisable(self);
|
||||
}
|
||||
};
|
||||
|
||||
self.kill = self.revert = function () {
|
||||
self.disable();
|
||||
|
||||
var i = _observers.indexOf(self);
|
||||
|
||||
i >= 0 && _observers.splice(i, 1);
|
||||
_normalizer === self && (_normalizer = 0);
|
||||
};
|
||||
|
||||
_observers.push(self);
|
||||
|
||||
isNormalizer && _isViewport(target) && (_normalizer = self);
|
||||
self.enable(event);
|
||||
};
|
||||
|
||||
_createClass(Observer, [{
|
||||
key: "velocityX",
|
||||
get: function get() {
|
||||
return this._vx.getVelocity();
|
||||
}
|
||||
}, {
|
||||
key: "velocityY",
|
||||
get: function get() {
|
||||
return this._vy.getVelocity();
|
||||
}
|
||||
}]);
|
||||
|
||||
return Observer;
|
||||
}();
|
||||
Observer.version = "3.12.5";
|
||||
|
||||
Observer.create = function (vars) {
|
||||
return new Observer(vars);
|
||||
};
|
||||
|
||||
Observer.register = _initCore;
|
||||
|
||||
Observer.getAll = function () {
|
||||
return _observers.slice();
|
||||
};
|
||||
|
||||
Observer.getById = function (id) {
|
||||
return _observers.filter(function (o) {
|
||||
return o.vars.id === id;
|
||||
})[0];
|
||||
};
|
||||
|
||||
_getGSAP() && gsap.registerPlugin(Observer);
|
||||
|
||||
exports.Observer = Observer;
|
||||
exports._getProxyProp = _getProxyProp;
|
||||
exports._getScrollFunc = _getScrollFunc;
|
||||
exports._getTarget = _getTarget;
|
||||
exports._getVelocityProp = _getVelocityProp;
|
||||
exports._horizontal = _horizontal;
|
||||
exports._isViewport = _isViewport;
|
||||
exports._vertical = _vertical;
|
||||
exports.default = Observer;
|
||||
|
||||
if (typeof(window) === 'undefined' || window !== exports) {Object.defineProperty(exports, '__esModule', { value: true });} else {delete window.default;}
|
||||
|
||||
})));
|
||||
Executable
+463
@@ -0,0 +1,463 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(global = global || self, factory(global.window = global.window || {}));
|
||||
}(this, (function (exports) { 'use strict';
|
||||
|
||||
/*!
|
||||
* PixiPlugin 3.12.5
|
||||
* https://gsap.com
|
||||
*
|
||||
* @license Copyright 2008-2024, GreenSock. All rights reserved.
|
||||
* Subject to the terms at https://gsap.com/standard-license or for
|
||||
* Club GSAP members, the agreement issued with that membership.
|
||||
* @author: Jack Doyle, jack@greensock.com
|
||||
*/
|
||||
var gsap,
|
||||
_splitColor,
|
||||
_coreInitted,
|
||||
_PIXI,
|
||||
PropTween,
|
||||
_getSetter,
|
||||
_isV4,
|
||||
_windowExists = function _windowExists() {
|
||||
return typeof window !== "undefined";
|
||||
},
|
||||
_getGSAP = function _getGSAP() {
|
||||
return gsap || _windowExists() && (gsap = window.gsap) && gsap.registerPlugin && gsap;
|
||||
},
|
||||
_isFunction = function _isFunction(value) {
|
||||
return typeof value === "function";
|
||||
},
|
||||
_warn = function _warn(message) {
|
||||
return console.warn(message);
|
||||
},
|
||||
_idMatrix = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0],
|
||||
_lumR = 0.212671,
|
||||
_lumG = 0.715160,
|
||||
_lumB = 0.072169,
|
||||
_filterClass = function _filterClass(name) {
|
||||
return _isFunction(_PIXI[name]) ? _PIXI[name] : _PIXI.filters[name];
|
||||
},
|
||||
_applyMatrix = function _applyMatrix(m, m2) {
|
||||
var temp = [],
|
||||
i = 0,
|
||||
z = 0,
|
||||
y,
|
||||
x;
|
||||
|
||||
for (y = 0; y < 4; y++) {
|
||||
for (x = 0; x < 5; x++) {
|
||||
z = x === 4 ? m[i + 4] : 0;
|
||||
temp[i + x] = m[i] * m2[x] + m[i + 1] * m2[x + 5] + m[i + 2] * m2[x + 10] + m[i + 3] * m2[x + 15] + z;
|
||||
}
|
||||
|
||||
i += 5;
|
||||
}
|
||||
|
||||
return temp;
|
||||
},
|
||||
_setSaturation = function _setSaturation(m, n) {
|
||||
var inv = 1 - n,
|
||||
r = inv * _lumR,
|
||||
g = inv * _lumG,
|
||||
b = inv * _lumB;
|
||||
return _applyMatrix([r + n, g, b, 0, 0, r, g + n, b, 0, 0, r, g, b + n, 0, 0, 0, 0, 0, 1, 0], m);
|
||||
},
|
||||
_colorize = function _colorize(m, color, amount) {
|
||||
var c = _splitColor(color),
|
||||
r = c[0] / 255,
|
||||
g = c[1] / 255,
|
||||
b = c[2] / 255,
|
||||
inv = 1 - amount;
|
||||
|
||||
return _applyMatrix([inv + amount * r * _lumR, amount * r * _lumG, amount * r * _lumB, 0, 0, amount * g * _lumR, inv + amount * g * _lumG, amount * g * _lumB, 0, 0, amount * b * _lumR, amount * b * _lumG, inv + amount * b * _lumB, 0, 0, 0, 0, 0, 1, 0], m);
|
||||
},
|
||||
_setHue = function _setHue(m, n) {
|
||||
n *= Math.PI / 180;
|
||||
var c = Math.cos(n),
|
||||
s = Math.sin(n);
|
||||
return _applyMatrix([_lumR + c * (1 - _lumR) + s * -_lumR, _lumG + c * -_lumG + s * -_lumG, _lumB + c * -_lumB + s * (1 - _lumB), 0, 0, _lumR + c * -_lumR + s * 0.143, _lumG + c * (1 - _lumG) + s * 0.14, _lumB + c * -_lumB + s * -0.283, 0, 0, _lumR + c * -_lumR + s * -(1 - _lumR), _lumG + c * -_lumG + s * _lumG, _lumB + c * (1 - _lumB) + s * _lumB, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1], m);
|
||||
},
|
||||
_setContrast = function _setContrast(m, n) {
|
||||
return _applyMatrix([n, 0, 0, 0, 0.5 * (1 - n), 0, n, 0, 0, 0.5 * (1 - n), 0, 0, n, 0, 0.5 * (1 - n), 0, 0, 0, 1, 0], m);
|
||||
},
|
||||
_getFilter = function _getFilter(target, type) {
|
||||
var filterClass = _filterClass(type),
|
||||
filters = target.filters || [],
|
||||
i = filters.length,
|
||||
filter;
|
||||
|
||||
filterClass || _warn(type + " not found. PixiPlugin.registerPIXI(PIXI)");
|
||||
|
||||
while (--i > -1) {
|
||||
if (filters[i] instanceof filterClass) {
|
||||
return filters[i];
|
||||
}
|
||||
}
|
||||
|
||||
filter = new filterClass();
|
||||
|
||||
if (type === "BlurFilter") {
|
||||
filter.blur = 0;
|
||||
}
|
||||
|
||||
filters.push(filter);
|
||||
target.filters = filters;
|
||||
return filter;
|
||||
},
|
||||
_addColorMatrixFilterCacheTween = function _addColorMatrixFilterCacheTween(p, plugin, cache, vars) {
|
||||
plugin.add(cache, p, cache[p], vars[p]);
|
||||
|
||||
plugin._props.push(p);
|
||||
},
|
||||
_applyBrightnessToMatrix = function _applyBrightnessToMatrix(brightness, matrix) {
|
||||
var filterClass = _filterClass("ColorMatrixFilter"),
|
||||
temp = new filterClass();
|
||||
|
||||
temp.matrix = matrix;
|
||||
temp.brightness(brightness, true);
|
||||
return temp.matrix;
|
||||
},
|
||||
_copy = function _copy(obj) {
|
||||
var copy = {},
|
||||
p;
|
||||
|
||||
for (p in obj) {
|
||||
copy[p] = obj[p];
|
||||
}
|
||||
|
||||
return copy;
|
||||
},
|
||||
_CMFdefaults = {
|
||||
contrast: 1,
|
||||
saturation: 1,
|
||||
colorizeAmount: 0,
|
||||
colorize: "rgb(255,255,255)",
|
||||
hue: 0,
|
||||
brightness: 1
|
||||
},
|
||||
_parseColorMatrixFilter = function _parseColorMatrixFilter(target, v, pg) {
|
||||
var filter = _getFilter(target, "ColorMatrixFilter"),
|
||||
cache = target._gsColorMatrixFilter = target._gsColorMatrixFilter || _copy(_CMFdefaults),
|
||||
combine = v.combineCMF && !("colorMatrixFilter" in v && !v.colorMatrixFilter),
|
||||
i,
|
||||
matrix,
|
||||
startMatrix;
|
||||
|
||||
startMatrix = filter.matrix;
|
||||
|
||||
if (v.resolution) {
|
||||
filter.resolution = v.resolution;
|
||||
}
|
||||
|
||||
if (v.matrix && v.matrix.length === startMatrix.length) {
|
||||
matrix = v.matrix;
|
||||
|
||||
if (cache.contrast !== 1) {
|
||||
_addColorMatrixFilterCacheTween("contrast", pg, cache, _CMFdefaults);
|
||||
}
|
||||
|
||||
if (cache.hue) {
|
||||
_addColorMatrixFilterCacheTween("hue", pg, cache, _CMFdefaults);
|
||||
}
|
||||
|
||||
if (cache.brightness !== 1) {
|
||||
_addColorMatrixFilterCacheTween("brightness", pg, cache, _CMFdefaults);
|
||||
}
|
||||
|
||||
if (cache.colorizeAmount) {
|
||||
_addColorMatrixFilterCacheTween("colorize", pg, cache, _CMFdefaults);
|
||||
|
||||
_addColorMatrixFilterCacheTween("colorizeAmount", pg, cache, _CMFdefaults);
|
||||
}
|
||||
|
||||
if (cache.saturation !== 1) {
|
||||
_addColorMatrixFilterCacheTween("saturation", pg, cache, _CMFdefaults);
|
||||
}
|
||||
} else {
|
||||
matrix = _idMatrix.slice();
|
||||
|
||||
if (v.contrast != null) {
|
||||
matrix = _setContrast(matrix, +v.contrast);
|
||||
|
||||
_addColorMatrixFilterCacheTween("contrast", pg, cache, v);
|
||||
} else if (cache.contrast !== 1) {
|
||||
if (combine) {
|
||||
matrix = _setContrast(matrix, cache.contrast);
|
||||
} else {
|
||||
_addColorMatrixFilterCacheTween("contrast", pg, cache, _CMFdefaults);
|
||||
}
|
||||
}
|
||||
|
||||
if (v.hue != null) {
|
||||
matrix = _setHue(matrix, +v.hue);
|
||||
|
||||
_addColorMatrixFilterCacheTween("hue", pg, cache, v);
|
||||
} else if (cache.hue) {
|
||||
if (combine) {
|
||||
matrix = _setHue(matrix, cache.hue);
|
||||
} else {
|
||||
_addColorMatrixFilterCacheTween("hue", pg, cache, _CMFdefaults);
|
||||
}
|
||||
}
|
||||
|
||||
if (v.brightness != null) {
|
||||
matrix = _applyBrightnessToMatrix(+v.brightness, matrix);
|
||||
|
||||
_addColorMatrixFilterCacheTween("brightness", pg, cache, v);
|
||||
} else if (cache.brightness !== 1) {
|
||||
if (combine) {
|
||||
matrix = _applyBrightnessToMatrix(cache.brightness, matrix);
|
||||
} else {
|
||||
_addColorMatrixFilterCacheTween("brightness", pg, cache, _CMFdefaults);
|
||||
}
|
||||
}
|
||||
|
||||
if (v.colorize != null) {
|
||||
v.colorizeAmount = "colorizeAmount" in v ? +v.colorizeAmount : 1;
|
||||
matrix = _colorize(matrix, v.colorize, v.colorizeAmount);
|
||||
|
||||
_addColorMatrixFilterCacheTween("colorize", pg, cache, v);
|
||||
|
||||
_addColorMatrixFilterCacheTween("colorizeAmount", pg, cache, v);
|
||||
} else if (cache.colorizeAmount) {
|
||||
if (combine) {
|
||||
matrix = _colorize(matrix, cache.colorize, cache.colorizeAmount);
|
||||
} else {
|
||||
_addColorMatrixFilterCacheTween("colorize", pg, cache, _CMFdefaults);
|
||||
|
||||
_addColorMatrixFilterCacheTween("colorizeAmount", pg, cache, _CMFdefaults);
|
||||
}
|
||||
}
|
||||
|
||||
if (v.saturation != null) {
|
||||
matrix = _setSaturation(matrix, +v.saturation);
|
||||
|
||||
_addColorMatrixFilterCacheTween("saturation", pg, cache, v);
|
||||
} else if (cache.saturation !== 1) {
|
||||
if (combine) {
|
||||
matrix = _setSaturation(matrix, cache.saturation);
|
||||
} else {
|
||||
_addColorMatrixFilterCacheTween("saturation", pg, cache, _CMFdefaults);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
i = matrix.length;
|
||||
|
||||
while (--i > -1) {
|
||||
if (matrix[i] !== startMatrix[i]) {
|
||||
pg.add(startMatrix, i, startMatrix[i], matrix[i], "colorMatrixFilter");
|
||||
}
|
||||
}
|
||||
|
||||
pg._props.push("colorMatrixFilter");
|
||||
},
|
||||
_renderColor = function _renderColor(ratio, _ref) {
|
||||
var t = _ref.t,
|
||||
p = _ref.p,
|
||||
color = _ref.color,
|
||||
set = _ref.set;
|
||||
set(t, p, color[0] << 16 | color[1] << 8 | color[2]);
|
||||
},
|
||||
_renderDirtyCache = function _renderDirtyCache(ratio, _ref2) {
|
||||
var g = _ref2.g;
|
||||
|
||||
if (g) {
|
||||
g.dirty++;
|
||||
g.clearDirty++;
|
||||
}
|
||||
},
|
||||
_renderAutoAlpha = function _renderAutoAlpha(ratio, data) {
|
||||
data.t.visible = !!data.t.alpha;
|
||||
},
|
||||
_addColorTween = function _addColorTween(target, p, value, plugin) {
|
||||
var currentValue = target[p],
|
||||
startColor = _splitColor(_isFunction(currentValue) ? target[p.indexOf("set") || !_isFunction(target["get" + p.substr(3)]) ? p : "get" + p.substr(3)]() : currentValue),
|
||||
endColor = _splitColor(value);
|
||||
|
||||
plugin._pt = new PropTween(plugin._pt, target, p, 0, 0, _renderColor, {
|
||||
t: target,
|
||||
p: p,
|
||||
color: startColor,
|
||||
set: _getSetter(target, p)
|
||||
});
|
||||
plugin.add(startColor, 0, startColor[0], endColor[0]);
|
||||
plugin.add(startColor, 1, startColor[1], endColor[1]);
|
||||
plugin.add(startColor, 2, startColor[2], endColor[2]);
|
||||
},
|
||||
_colorProps = {
|
||||
tint: 1,
|
||||
lineColor: 1,
|
||||
fillColor: 1
|
||||
},
|
||||
_xyContexts = "position,scale,skew,pivot,anchor,tilePosition,tileScale".split(","),
|
||||
_contexts = {
|
||||
x: "position",
|
||||
y: "position",
|
||||
tileX: "tilePosition",
|
||||
tileY: "tilePosition"
|
||||
},
|
||||
_colorMatrixFilterProps = {
|
||||
colorMatrixFilter: 1,
|
||||
saturation: 1,
|
||||
contrast: 1,
|
||||
hue: 1,
|
||||
colorize: 1,
|
||||
colorizeAmount: 1,
|
||||
brightness: 1,
|
||||
combineCMF: 1
|
||||
},
|
||||
_DEG2RAD = Math.PI / 180,
|
||||
_isString = function _isString(value) {
|
||||
return typeof value === "string";
|
||||
},
|
||||
_degreesToRadians = function _degreesToRadians(value) {
|
||||
return _isString(value) && value.charAt(1) === "=" ? value.substr(0, 2) + parseFloat(value.substr(2)) * _DEG2RAD : value * _DEG2RAD;
|
||||
},
|
||||
_renderPropWithEnd = function _renderPropWithEnd(ratio, data) {
|
||||
return data.set(data.t, data.p, ratio === 1 ? data.e : Math.round((data.s + data.c * ratio) * 100000) / 100000, data);
|
||||
},
|
||||
_addRotationalPropTween = function _addRotationalPropTween(plugin, target, property, startNum, endValue, radians) {
|
||||
var cap = 360 * (radians ? _DEG2RAD : 1),
|
||||
isString = _isString(endValue),
|
||||
relative = isString && endValue.charAt(1) === "=" ? +(endValue.charAt(0) + "1") : 0,
|
||||
endNum = parseFloat(relative ? endValue.substr(2) : endValue) * (radians ? _DEG2RAD : 1),
|
||||
change = relative ? endNum * relative : endNum - startNum,
|
||||
finalValue = startNum + change,
|
||||
direction,
|
||||
pt;
|
||||
|
||||
if (isString) {
|
||||
direction = endValue.split("_")[1];
|
||||
|
||||
if (direction === "short") {
|
||||
change %= cap;
|
||||
|
||||
if (change !== change % (cap / 2)) {
|
||||
change += change < 0 ? cap : -cap;
|
||||
}
|
||||
}
|
||||
|
||||
if (direction === "cw" && change < 0) {
|
||||
change = (change + cap * 1e10) % cap - ~~(change / cap) * cap;
|
||||
} else if (direction === "ccw" && change > 0) {
|
||||
change = (change - cap * 1e10) % cap - ~~(change / cap) * cap;
|
||||
}
|
||||
}
|
||||
|
||||
plugin._pt = pt = new PropTween(plugin._pt, target, property, startNum, change, _renderPropWithEnd);
|
||||
pt.e = finalValue;
|
||||
return pt;
|
||||
},
|
||||
_initCore = function _initCore() {
|
||||
if (!_coreInitted) {
|
||||
gsap = _getGSAP();
|
||||
_PIXI = _coreInitted = _PIXI || _windowExists() && window.PIXI;
|
||||
_isV4 = _PIXI && _PIXI.VERSION && _PIXI.VERSION.charAt(0) === "4";
|
||||
|
||||
_splitColor = function _splitColor(color) {
|
||||
return gsap.utils.splitColor((color + "").substr(0, 2) === "0x" ? "#" + color.substr(2) : color);
|
||||
};
|
||||
}
|
||||
},
|
||||
i,
|
||||
p;
|
||||
|
||||
for (i = 0; i < _xyContexts.length; i++) {
|
||||
p = _xyContexts[i];
|
||||
_contexts[p + "X"] = p;
|
||||
_contexts[p + "Y"] = p;
|
||||
}
|
||||
|
||||
var PixiPlugin = {
|
||||
version: "3.12.5",
|
||||
name: "pixi",
|
||||
register: function register(core, Plugin, propTween) {
|
||||
gsap = core;
|
||||
PropTween = propTween;
|
||||
_getSetter = Plugin.getSetter;
|
||||
|
||||
_initCore();
|
||||
},
|
||||
headless: true,
|
||||
registerPIXI: function registerPIXI(pixi) {
|
||||
_PIXI = pixi;
|
||||
},
|
||||
init: function init(target, values, tween, index, targets) {
|
||||
_PIXI || _initCore();
|
||||
|
||||
if (!_PIXI) {
|
||||
_warn("PIXI was not found. PixiPlugin.registerPIXI(PIXI);");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
var context, axis, value, colorMatrix, filter, p, padding, i, data;
|
||||
|
||||
for (p in values) {
|
||||
context = _contexts[p];
|
||||
value = values[p];
|
||||
|
||||
if (context) {
|
||||
axis = ~p.charAt(p.length - 1).toLowerCase().indexOf("x") ? "x" : "y";
|
||||
this.add(target[context], axis, target[context][axis], context === "skew" ? _degreesToRadians(value) : value, 0, 0, 0, 0, 0, 1);
|
||||
} else if (p === "scale" || p === "anchor" || p === "pivot" || p === "tileScale") {
|
||||
this.add(target[p], "x", target[p].x, value);
|
||||
this.add(target[p], "y", target[p].y, value);
|
||||
} else if (p === "rotation" || p === "angle") {
|
||||
_addRotationalPropTween(this, target, p, target[p], value, p === "rotation");
|
||||
} else if (_colorMatrixFilterProps[p]) {
|
||||
if (!colorMatrix) {
|
||||
_parseColorMatrixFilter(target, values.colorMatrixFilter || values, this);
|
||||
|
||||
colorMatrix = true;
|
||||
}
|
||||
} else if (p === "blur" || p === "blurX" || p === "blurY" || p === "blurPadding") {
|
||||
filter = _getFilter(target, "BlurFilter");
|
||||
this.add(filter, p, filter[p], value);
|
||||
|
||||
if (values.blurPadding !== 0) {
|
||||
padding = values.blurPadding || Math.max(filter[p], value) * 2;
|
||||
i = target.filters.length;
|
||||
|
||||
while (--i > -1) {
|
||||
target.filters[i].padding = Math.max(target.filters[i].padding, padding);
|
||||
}
|
||||
}
|
||||
} else if (_colorProps[p]) {
|
||||
if ((p === "lineColor" || p === "fillColor") && target instanceof _PIXI.Graphics) {
|
||||
data = (target.geometry || target).graphicsData;
|
||||
this._pt = new PropTween(this._pt, target, p, 0, 0, _renderDirtyCache, {
|
||||
g: target.geometry || target
|
||||
});
|
||||
i = data.length;
|
||||
|
||||
while (--i > -1) {
|
||||
_addColorTween(_isV4 ? data[i] : data[i][p.substr(0, 4) + "Style"], _isV4 ? p : "color", value, this);
|
||||
}
|
||||
} else {
|
||||
_addColorTween(target, p, value, this);
|
||||
}
|
||||
} else if (p === "autoAlpha") {
|
||||
this._pt = new PropTween(this._pt, target, "visible", 0, 0, _renderAutoAlpha);
|
||||
this.add(target, "alpha", target.alpha, value);
|
||||
|
||||
this._props.push("alpha", "visible");
|
||||
} else if (p !== "resolution") {
|
||||
this.add(target, p, "get", value);
|
||||
}
|
||||
|
||||
this._props.push(p);
|
||||
}
|
||||
}
|
||||
};
|
||||
_getGSAP() && gsap.registerPlugin(PixiPlugin);
|
||||
|
||||
exports.PixiPlugin = PixiPlugin;
|
||||
exports.default = PixiPlugin;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
Executable
+277
@@ -0,0 +1,277 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(global = global || self, factory(global.window = global.window || {}));
|
||||
}(this, (function (exports) { 'use strict';
|
||||
|
||||
/*!
|
||||
* ScrollToPlugin 3.12.5
|
||||
* https://gsap.com
|
||||
*
|
||||
* @license Copyright 2008-2024, GreenSock. All rights reserved.
|
||||
* Subject to the terms at https://gsap.com/standard-license or for
|
||||
* Club GSAP members, the agreement issued with that membership.
|
||||
* @author: Jack Doyle, jack@greensock.com
|
||||
*/
|
||||
var gsap,
|
||||
_coreInitted,
|
||||
_window,
|
||||
_docEl,
|
||||
_body,
|
||||
_toArray,
|
||||
_config,
|
||||
ScrollTrigger,
|
||||
_windowExists = function _windowExists() {
|
||||
return typeof window !== "undefined";
|
||||
},
|
||||
_getGSAP = function _getGSAP() {
|
||||
return gsap || _windowExists() && (gsap = window.gsap) && gsap.registerPlugin && gsap;
|
||||
},
|
||||
_isString = function _isString(value) {
|
||||
return typeof value === "string";
|
||||
},
|
||||
_isFunction = function _isFunction(value) {
|
||||
return typeof value === "function";
|
||||
},
|
||||
_max = function _max(element, axis) {
|
||||
var dim = axis === "x" ? "Width" : "Height",
|
||||
scroll = "scroll" + dim,
|
||||
client = "client" + dim;
|
||||
return element === _window || element === _docEl || element === _body ? Math.max(_docEl[scroll], _body[scroll]) - (_window["inner" + dim] || _docEl[client] || _body[client]) : element[scroll] - element["offset" + dim];
|
||||
},
|
||||
_buildGetter = function _buildGetter(e, axis) {
|
||||
var p = "scroll" + (axis === "x" ? "Left" : "Top");
|
||||
|
||||
if (e === _window) {
|
||||
if (e.pageXOffset != null) {
|
||||
p = "page" + axis.toUpperCase() + "Offset";
|
||||
} else {
|
||||
e = _docEl[p] != null ? _docEl : _body;
|
||||
}
|
||||
}
|
||||
|
||||
return function () {
|
||||
return e[p];
|
||||
};
|
||||
},
|
||||
_clean = function _clean(value, index, target, targets) {
|
||||
_isFunction(value) && (value = value(index, target, targets));
|
||||
|
||||
if (typeof value !== "object") {
|
||||
return _isString(value) && value !== "max" && value.charAt(1) !== "=" ? {
|
||||
x: value,
|
||||
y: value
|
||||
} : {
|
||||
y: value
|
||||
};
|
||||
} else if (value.nodeType) {
|
||||
return {
|
||||
y: value,
|
||||
x: value
|
||||
};
|
||||
} else {
|
||||
var result = {},
|
||||
p;
|
||||
|
||||
for (p in value) {
|
||||
result[p] = p !== "onAutoKill" && _isFunction(value[p]) ? value[p](index, target, targets) : value[p];
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
},
|
||||
_getOffset = function _getOffset(element, container) {
|
||||
element = _toArray(element)[0];
|
||||
|
||||
if (!element || !element.getBoundingClientRect) {
|
||||
return console.warn("scrollTo target doesn't exist. Using 0") || {
|
||||
x: 0,
|
||||
y: 0
|
||||
};
|
||||
}
|
||||
|
||||
var rect = element.getBoundingClientRect(),
|
||||
isRoot = !container || container === _window || container === _body,
|
||||
cRect = isRoot ? {
|
||||
top: _docEl.clientTop - (_window.pageYOffset || _docEl.scrollTop || _body.scrollTop || 0),
|
||||
left: _docEl.clientLeft - (_window.pageXOffset || _docEl.scrollLeft || _body.scrollLeft || 0)
|
||||
} : container.getBoundingClientRect(),
|
||||
offsets = {
|
||||
x: rect.left - cRect.left,
|
||||
y: rect.top - cRect.top
|
||||
};
|
||||
|
||||
if (!isRoot && container) {
|
||||
offsets.x += _buildGetter(container, "x")();
|
||||
offsets.y += _buildGetter(container, "y")();
|
||||
}
|
||||
|
||||
return offsets;
|
||||
},
|
||||
_parseVal = function _parseVal(value, target, axis, currentVal, offset) {
|
||||
return !isNaN(value) && typeof value !== "object" ? parseFloat(value) - offset : _isString(value) && value.charAt(1) === "=" ? parseFloat(value.substr(2)) * (value.charAt(0) === "-" ? -1 : 1) + currentVal - offset : value === "max" ? _max(target, axis) - offset : Math.min(_max(target, axis), _getOffset(value, target)[axis] - offset);
|
||||
},
|
||||
_initCore = function _initCore() {
|
||||
gsap = _getGSAP();
|
||||
|
||||
if (_windowExists() && gsap && typeof document !== "undefined" && document.body) {
|
||||
_window = window;
|
||||
_body = document.body;
|
||||
_docEl = document.documentElement;
|
||||
_toArray = gsap.utils.toArray;
|
||||
gsap.config({
|
||||
autoKillThreshold: 7
|
||||
});
|
||||
_config = gsap.config();
|
||||
_coreInitted = 1;
|
||||
}
|
||||
};
|
||||
|
||||
var ScrollToPlugin = {
|
||||
version: "3.12.5",
|
||||
name: "scrollTo",
|
||||
rawVars: 1,
|
||||
register: function register(core) {
|
||||
gsap = core;
|
||||
|
||||
_initCore();
|
||||
},
|
||||
init: function init(target, value, tween, index, targets) {
|
||||
_coreInitted || _initCore();
|
||||
var data = this,
|
||||
snapType = gsap.getProperty(target, "scrollSnapType");
|
||||
data.isWin = target === _window;
|
||||
data.target = target;
|
||||
data.tween = tween;
|
||||
value = _clean(value, index, target, targets);
|
||||
data.vars = value;
|
||||
data.autoKill = !!value.autoKill;
|
||||
data.getX = _buildGetter(target, "x");
|
||||
data.getY = _buildGetter(target, "y");
|
||||
data.x = data.xPrev = data.getX();
|
||||
data.y = data.yPrev = data.getY();
|
||||
ScrollTrigger || (ScrollTrigger = gsap.core.globals().ScrollTrigger);
|
||||
gsap.getProperty(target, "scrollBehavior") === "smooth" && gsap.set(target, {
|
||||
scrollBehavior: "auto"
|
||||
});
|
||||
|
||||
if (snapType && snapType !== "none") {
|
||||
data.snap = 1;
|
||||
data.snapInline = target.style.scrollSnapType;
|
||||
target.style.scrollSnapType = "none";
|
||||
}
|
||||
|
||||
if (value.x != null) {
|
||||
data.add(data, "x", data.x, _parseVal(value.x, target, "x", data.x, value.offsetX || 0), index, targets);
|
||||
|
||||
data._props.push("scrollTo_x");
|
||||
} else {
|
||||
data.skipX = 1;
|
||||
}
|
||||
|
||||
if (value.y != null) {
|
||||
data.add(data, "y", data.y, _parseVal(value.y, target, "y", data.y, value.offsetY || 0), index, targets);
|
||||
|
||||
data._props.push("scrollTo_y");
|
||||
} else {
|
||||
data.skipY = 1;
|
||||
}
|
||||
},
|
||||
render: function render(ratio, data) {
|
||||
var pt = data._pt,
|
||||
target = data.target,
|
||||
tween = data.tween,
|
||||
autoKill = data.autoKill,
|
||||
xPrev = data.xPrev,
|
||||
yPrev = data.yPrev,
|
||||
isWin = data.isWin,
|
||||
snap = data.snap,
|
||||
snapInline = data.snapInline,
|
||||
x,
|
||||
y,
|
||||
yDif,
|
||||
xDif,
|
||||
threshold;
|
||||
|
||||
while (pt) {
|
||||
pt.r(ratio, pt.d);
|
||||
pt = pt._next;
|
||||
}
|
||||
|
||||
x = isWin || !data.skipX ? data.getX() : xPrev;
|
||||
y = isWin || !data.skipY ? data.getY() : yPrev;
|
||||
yDif = y - yPrev;
|
||||
xDif = x - xPrev;
|
||||
threshold = _config.autoKillThreshold;
|
||||
|
||||
if (data.x < 0) {
|
||||
data.x = 0;
|
||||
}
|
||||
|
||||
if (data.y < 0) {
|
||||
data.y = 0;
|
||||
}
|
||||
|
||||
if (autoKill) {
|
||||
if (!data.skipX && (xDif > threshold || xDif < -threshold) && x < _max(target, "x")) {
|
||||
data.skipX = 1;
|
||||
}
|
||||
|
||||
if (!data.skipY && (yDif > threshold || yDif < -threshold) && y < _max(target, "y")) {
|
||||
data.skipY = 1;
|
||||
}
|
||||
|
||||
if (data.skipX && data.skipY) {
|
||||
tween.kill();
|
||||
data.vars.onAutoKill && data.vars.onAutoKill.apply(tween, data.vars.onAutoKillParams || []);
|
||||
}
|
||||
}
|
||||
|
||||
if (isWin) {
|
||||
_window.scrollTo(!data.skipX ? data.x : x, !data.skipY ? data.y : y);
|
||||
} else {
|
||||
data.skipY || (target.scrollTop = data.y);
|
||||
data.skipX || (target.scrollLeft = data.x);
|
||||
}
|
||||
|
||||
if (snap && (ratio === 1 || ratio === 0)) {
|
||||
y = target.scrollTop;
|
||||
x = target.scrollLeft;
|
||||
snapInline ? target.style.scrollSnapType = snapInline : target.style.removeProperty("scroll-snap-type");
|
||||
target.scrollTop = y + 1;
|
||||
target.scrollLeft = x + 1;
|
||||
target.scrollTop = y;
|
||||
target.scrollLeft = x;
|
||||
}
|
||||
|
||||
data.xPrev = data.x;
|
||||
data.yPrev = data.y;
|
||||
ScrollTrigger && ScrollTrigger.update();
|
||||
},
|
||||
kill: function kill(property) {
|
||||
var both = property === "scrollTo",
|
||||
i = this._props.indexOf(property);
|
||||
|
||||
if (both || property === "scrollTo_x") {
|
||||
this.skipX = 1;
|
||||
}
|
||||
|
||||
if (both || property === "scrollTo_y") {
|
||||
this.skipY = 1;
|
||||
}
|
||||
|
||||
i > -1 && this._props.splice(i, 1);
|
||||
return !this._props.length;
|
||||
}
|
||||
};
|
||||
ScrollToPlugin.max = _max;
|
||||
ScrollToPlugin.getOffset = _getOffset;
|
||||
ScrollToPlugin.buildGetter = _buildGetter;
|
||||
_getGSAP() && gsap.registerPlugin(ScrollToPlugin);
|
||||
|
||||
exports.ScrollToPlugin = ScrollToPlugin;
|
||||
exports.default = ScrollToPlugin;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
Executable
+3219
File diff suppressed because it is too large
Load Diff
Executable
+254
File diff suppressed because one or more lines are too long
Executable
+16669
File diff suppressed because one or more lines are too long
Executable
+5617
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user