install gsap
This commit is contained in:
1 parent
1fc081a048
commit
d9b2762b72
182 files changed
+111895
No files matched your search
+255
@@ -0,0 +1,255 @@
|
||||
(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 _trimExp = /(?:^\s+|\s+$)/g;
|
||||
var emojiExp = /([\uD800-\uDBFF][\uDC00-\uDFFF](?:[\u200D\uFE0F][\uD800-\uDBFF][\uDC00-\uDFFF]){2,}|\uD83D\uDC69(?:\u200D(?:(?:\uD83D\uDC69\u200D)?\uD83D\uDC67|(?:\uD83D\uDC69\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2642\u2640]\uFE0F|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDD27\uDCBC\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC6F\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3C-\uDD3E\uDDD6-\uDDDF])\u200D[\u2640\u2642]\uFE0F|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|(?:\u26F9|\uD83C[\uDFCC\uDFCB]|\uD83D\uDD75)(?:\uFE0F\u200D[\u2640\u2642]|(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642])\uFE0F|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC69\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708]))\uFE0F|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83D\uDC69\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDD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C46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\u200D(?:(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDD1-\uDDDD])(?:\uDLine truncated
|
||||
function getText(e) {
|
||||
var type = e.nodeType,
|
||||
result = "";
|
||||
|
||||
if (type === 1 || type === 9 || type === 11) {
|
||||
if (typeof e.textContent === "string") {
|
||||
return e.textContent;
|
||||
} else {
|
||||
for (e = e.firstChild; e; e = e.nextSibling) {
|
||||
result += getText(e);
|
||||
}
|
||||
}
|
||||
} else if (type === 3 || type === 4) {
|
||||
return e.nodeValue;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
function splitInnerHTML(element, delimiter, trim, preserveSpaces, unescapedCharCodes) {
|
||||
var node = element.firstChild,
|
||||
result = [],
|
||||
s;
|
||||
|
||||
while (node) {
|
||||
if (node.nodeType === 3) {
|
||||
s = (node.nodeValue + "").replace(/^\n+/g, "");
|
||||
|
||||
if (!preserveSpaces) {
|
||||
s = s.replace(/\s+/g, " ");
|
||||
}
|
||||
|
||||
result.push.apply(result, emojiSafeSplit(s, delimiter, trim, preserveSpaces, unescapedCharCodes));
|
||||
} else if ((node.nodeName + "").toLowerCase() === "br") {
|
||||
result[result.length - 1] += "<br>";
|
||||
} else {
|
||||
result.push(node.outerHTML);
|
||||
}
|
||||
|
||||
node = node.nextSibling;
|
||||
}
|
||||
|
||||
if (!unescapedCharCodes) {
|
||||
s = result.length;
|
||||
|
||||
while (s--) {
|
||||
result[s] === "&" && result.splice(s, 1, "&");
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
function emojiSafeSplit(text, delimiter, trim, preserveSpaces, unescapedCharCodes) {
|
||||
text += "";
|
||||
trim && (text = text.trim ? text.trim() : text.replace(_trimExp, ""));
|
||||
|
||||
if (delimiter && delimiter !== "") {
|
||||
return text.replace(/>/g, ">").replace(/</g, "<").split(delimiter);
|
||||
}
|
||||
|
||||
var result = [],
|
||||
l = text.length,
|
||||
i = 0,
|
||||
j,
|
||||
character;
|
||||
|
||||
for (; i < l; i++) {
|
||||
character = text.charAt(i);
|
||||
|
||||
if (character.charCodeAt(0) >= 0xD800 && character.charCodeAt(0) <= 0xDBFF || text.charCodeAt(i + 1) >= 0xFE00 && text.charCodeAt(i + 1) <= 0xFE0F) {
|
||||
j = ((text.substr(i, 12).split(emojiExp) || [])[1] || "").length || 2;
|
||||
character = text.substr(i, j);
|
||||
result.emoji = 1;
|
||||
i += j - 1;
|
||||
}
|
||||
|
||||
result.push(unescapedCharCodes ? character : character === ">" ? ">" : character === "<" ? "<" : preserveSpaces && character === " " && (text.charAt(i - 1) === " " || text.charAt(i + 1) === " ") ? " " : character);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*!
|
||||
* TextPlugin 3.14.2
|
||||
* https://gsap.com
|
||||
*
|
||||
* @license Copyright 2008-2025, GreenSock. All rights reserved.
|
||||
* Subject to the terms at https://gsap.com/standard-license
|
||||
* @author: Jack Doyle, jack@greensock.com
|
||||
*/
|
||||
|
||||
var gsap,
|
||||
_tempDiv,
|
||||
_getGSAP = function _getGSAP() {
|
||||
return gsap || typeof window !== "undefined" && (gsap = window.gsap) && gsap.registerPlugin && gsap;
|
||||
};
|
||||
|
||||
var TextPlugin = {
|
||||
version: "3.14.2",
|
||||
name: "text",
|
||||
init: function init(target, value, tween) {
|
||||
typeof value !== "object" && (value = {
|
||||
value: value
|
||||
});
|
||||
|
||||
var i = target.nodeName.toUpperCase(),
|
||||
data = this,
|
||||
_value = value,
|
||||
newClass = _value.newClass,
|
||||
oldClass = _value.oldClass,
|
||||
preserveSpaces = _value.preserveSpaces,
|
||||
rtl = _value.rtl,
|
||||
delimiter = data.delimiter = value.delimiter || "",
|
||||
fillChar = data.fillChar = value.fillChar || (value.padSpace ? " " : ""),
|
||||
_short,
|
||||
text,
|
||||
original,
|
||||
j,
|
||||
condensedText,
|
||||
condensedOriginal,
|
||||
aggregate,
|
||||
s;
|
||||
|
||||
data.svg = target.getBBox && (i === "TEXT" || i === "TSPAN");
|
||||
|
||||
if (!("innerHTML" in target) && !data.svg) {
|
||||
return false;
|
||||
}
|
||||
|
||||
data.target = target;
|
||||
|
||||
if (!("value" in value)) {
|
||||
data.text = data.original = [""];
|
||||
return;
|
||||
}
|
||||
|
||||
original = splitInnerHTML(target, delimiter, false, preserveSpaces, data.svg);
|
||||
_tempDiv || (_tempDiv = document.createElement("div"));
|
||||
_tempDiv.innerHTML = value.value;
|
||||
text = splitInnerHTML(_tempDiv, delimiter, false, preserveSpaces, data.svg);
|
||||
data.from = tween._from;
|
||||
|
||||
if ((data.from || rtl) && !(rtl && data.from)) {
|
||||
i = original;
|
||||
original = text;
|
||||
text = i;
|
||||
}
|
||||
|
||||
data.hasClass = !!(newClass || oldClass);
|
||||
data.newClass = rtl ? oldClass : newClass;
|
||||
data.oldClass = rtl ? newClass : oldClass;
|
||||
i = original.length - text.length;
|
||||
_short = i < 0 ? original : text;
|
||||
|
||||
if (i < 0) {
|
||||
i = -i;
|
||||
}
|
||||
|
||||
while (--i > -1) {
|
||||
_short.push(fillChar);
|
||||
}
|
||||
|
||||
if (value.type === "diff") {
|
||||
j = 0;
|
||||
condensedText = [];
|
||||
condensedOriginal = [];
|
||||
aggregate = "";
|
||||
|
||||
for (i = 0; i < text.length; i++) {
|
||||
s = text[i];
|
||||
|
||||
if (s === original[i]) {
|
||||
aggregate += s;
|
||||
} else {
|
||||
condensedText[j] = aggregate + s;
|
||||
condensedOriginal[j++] = aggregate + original[i];
|
||||
aggregate = "";
|
||||
}
|
||||
}
|
||||
|
||||
text = condensedText;
|
||||
original = condensedOriginal;
|
||||
|
||||
if (aggregate) {
|
||||
text.push(aggregate);
|
||||
original.push(aggregate);
|
||||
}
|
||||
}
|
||||
|
||||
value.speed && tween.duration(Math.min(0.05 / value.speed * _short.length, value.maxDuration || 9999));
|
||||
data.rtl = rtl;
|
||||
data.original = original;
|
||||
data.text = text;
|
||||
|
||||
data._props.push("text");
|
||||
},
|
||||
render: function render(ratio, data) {
|
||||
if (ratio > 1) {
|
||||
ratio = 1;
|
||||
} else if (ratio < 0) {
|
||||
ratio = 0;
|
||||
}
|
||||
|
||||
if (data.from) {
|
||||
ratio = 1 - ratio;
|
||||
}
|
||||
|
||||
var text = data.text,
|
||||
hasClass = data.hasClass,
|
||||
newClass = data.newClass,
|
||||
oldClass = data.oldClass,
|
||||
delimiter = data.delimiter,
|
||||
target = data.target,
|
||||
fillChar = data.fillChar,
|
||||
original = data.original,
|
||||
rtl = data.rtl,
|
||||
l = text.length,
|
||||
i = (rtl ? 1 - ratio : ratio) * l + 0.5 | 0,
|
||||
applyNew,
|
||||
applyOld,
|
||||
str;
|
||||
|
||||
if (hasClass && ratio) {
|
||||
applyNew = newClass && i;
|
||||
applyOld = oldClass && i !== l;
|
||||
str = (applyNew ? "<span class='" + newClass + "'>" : "") + text.slice(0, i).join(delimiter) + (applyNew ? "</span>" : "") + (applyOld ? "<span class='" + oldClass + "'>" : "") + delimiter + original.slice(i).join(delimiter) + (applyOld ? "</span>" : "");
|
||||
} else {
|
||||
str = text.slice(0, i).join(delimiter) + delimiter + original.slice(i).join(delimiter);
|
||||
}
|
||||
|
||||
if (data.svg) {
|
||||
target.textContent = str;
|
||||
} else {
|
||||
target.innerHTML = fillChar === " " && ~str.indexOf(" ") ? str.split(" ").join(" ") : str;
|
||||
}
|
||||
}
|
||||
};
|
||||
TextPlugin.splitInnerHTML = splitInnerHTML;
|
||||
TextPlugin.emojiSafeSplit = emojiSafeSplit;
|
||||
TextPlugin.getText = getText;
|
||||
_getGSAP() && gsap.registerPlugin(TextPlugin);
|
||||
|
||||
exports.TextPlugin = TextPlugin;
|
||||
exports.default = TextPlugin;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
Reference in new issue
Block a user