@tsparticles/all 4.3.1 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/index.js +1 -1
- package/browser/index.lazy.js +1 -1
- package/cjs/index.js +1 -1
- package/cjs/index.lazy.js +1 -1
- package/esm/index.js +1 -1
- package/esm/index.lazy.js +1 -1
- package/package.json +80 -80
- package/report.html +1 -1
- package/tsparticles.all.bundle.js +497 -273
- package/tsparticles.all.bundle.min.js +1 -1
- package/tsparticles.all.js +2 -2
- package/tsparticles.all.min.js +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
-
/* tsParticles v4.
|
|
2
|
+
/* tsParticles v4.4.0 */
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
5
5
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
@@ -332,6 +332,9 @@
|
|
|
332
332
|
})(exports.PixelMode || (exports.PixelMode = {}));
|
|
333
333
|
|
|
334
334
|
const minRadius$7 = 0;
|
|
335
|
+
function isForbiddenKey(key) {
|
|
336
|
+
return key === "__proto__" || key === "constructor" || key === "prototype";
|
|
337
|
+
}
|
|
335
338
|
function hasMatchMedia() {
|
|
336
339
|
return typeof matchMedia !== "undefined";
|
|
337
340
|
}
|
|
@@ -407,7 +410,7 @@
|
|
|
407
410
|
if (!hasNested) {
|
|
408
411
|
const sourceDict = source, destDict = destination;
|
|
409
412
|
for (const key of sourceKeys) {
|
|
410
|
-
if (key
|
|
413
|
+
if (isForbiddenKey(key)) {
|
|
411
414
|
continue;
|
|
412
415
|
}
|
|
413
416
|
const v = sourceDict[key];
|
|
@@ -418,7 +421,7 @@
|
|
|
418
421
|
continue;
|
|
419
422
|
}
|
|
420
423
|
for (const key of sourceKeys) {
|
|
421
|
-
if (key
|
|
424
|
+
if (isForbiddenKey(key)) {
|
|
422
425
|
continue;
|
|
423
426
|
}
|
|
424
427
|
const sourceDict = source, destDict = destination, value = sourceDict[key];
|
|
@@ -877,7 +880,7 @@
|
|
|
877
880
|
return this.#domArray;
|
|
878
881
|
}
|
|
879
882
|
get version() {
|
|
880
|
-
return "4.
|
|
883
|
+
return "4.4.0";
|
|
881
884
|
}
|
|
882
885
|
addEventListener(type, listener) {
|
|
883
886
|
this.#eventDispatcher.addEventListener(type, listener);
|
|
@@ -958,6 +961,10 @@
|
|
|
958
961
|
}
|
|
959
962
|
|
|
960
963
|
function initEngine() {
|
|
964
|
+
const existing = globalThis.tsParticles;
|
|
965
|
+
if (existing?.pluginManager) {
|
|
966
|
+
return existing;
|
|
967
|
+
}
|
|
961
968
|
return new Engine();
|
|
962
969
|
}
|
|
963
970
|
|
|
@@ -1055,6 +1062,15 @@
|
|
|
1055
1062
|
AnimationMode["random"] = "random";
|
|
1056
1063
|
})(exports.AnimationMode || (exports.AnimationMode = {}));
|
|
1057
1064
|
|
|
1065
|
+
exports.HdrMode = void 0;
|
|
1066
|
+
(function (HdrMode) {
|
|
1067
|
+
HdrMode["standard"] = "standard";
|
|
1068
|
+
HdrMode["natural"] = "natural";
|
|
1069
|
+
HdrMode["vivid"] = "vivid";
|
|
1070
|
+
HdrMode["cinematic"] = "cinematic";
|
|
1071
|
+
HdrMode["dynamic"] = "dynamic";
|
|
1072
|
+
})(exports.HdrMode || (exports.HdrMode = {}));
|
|
1073
|
+
|
|
1058
1074
|
exports.LimitMode = void 0;
|
|
1059
1075
|
(function (LimitMode) {
|
|
1060
1076
|
LimitMode["delete"] = "delete";
|
|
@@ -1160,7 +1176,12 @@
|
|
|
1160
1176
|
}
|
|
1161
1177
|
function loadExtendProperty(obj, key, value) {
|
|
1162
1178
|
if (value !== undefined) {
|
|
1163
|
-
|
|
1179
|
+
const keyStr = key;
|
|
1180
|
+
if (keyStr === "__proto__" || keyStr === "constructor" || keyStr === "prototype") {
|
|
1181
|
+
return;
|
|
1182
|
+
}
|
|
1183
|
+
const objRecord = obj, currentValue = Object.prototype.hasOwnProperty.call(objRecord, keyStr) ? objRecord[keyStr] : {};
|
|
1184
|
+
objRecord[keyStr] = deepExtend(currentValue, value);
|
|
1164
1185
|
}
|
|
1165
1186
|
}
|
|
1166
1187
|
function loadOptionProperty(obj, key, optionClass, ...sources) {
|
|
@@ -1315,6 +1336,29 @@
|
|
|
1315
1336
|
}
|
|
1316
1337
|
}
|
|
1317
1338
|
|
|
1339
|
+
const defaultPeakNits = 400, minPeakNits = 0, toStringValue = (value) => String(value);
|
|
1340
|
+
class HDROptions extends OptionLoader {
|
|
1341
|
+
enable = true;
|
|
1342
|
+
mode = exports.HdrMode.standard;
|
|
1343
|
+
peakNits = defaultPeakNits;
|
|
1344
|
+
doLoad(data) {
|
|
1345
|
+
if (data.enable !== undefined && !isBoolean(data.enable)) {
|
|
1346
|
+
throw new Error(`Invalid HDR "enable" value: expected a boolean, got "${String(data.enable)}"`);
|
|
1347
|
+
}
|
|
1348
|
+
if (data.mode !== undefined &&
|
|
1349
|
+
(typeof data.mode !== "string" || !Object.values(exports.HdrMode).includes(data.mode))) {
|
|
1350
|
+
throw new Error(`Invalid HDR "mode" value: expected one of ${Object.values(exports.HdrMode).join(", ")}, got "${toStringValue(data.mode)}"`);
|
|
1351
|
+
}
|
|
1352
|
+
if (data.peakNits !== undefined &&
|
|
1353
|
+
(!isNumber(data.peakNits) || !Number.isFinite(data.peakNits) || data.peakNits <= minPeakNits)) {
|
|
1354
|
+
throw new Error(`Invalid HDR "peakNits" value: expected a positive number, got "${String(data.peakNits)}"`);
|
|
1355
|
+
}
|
|
1356
|
+
loadProperty(this, "enable", data.enable);
|
|
1357
|
+
loadProperty(this, "mode", data.mode);
|
|
1358
|
+
loadProperty(this, "peakNits", data.peakNits);
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1318
1362
|
class ResizeEvent extends OptionLoader {
|
|
1319
1363
|
delay = 0.5;
|
|
1320
1364
|
enable = true;
|
|
@@ -1758,7 +1802,7 @@
|
|
|
1758
1802
|
duration = 0;
|
|
1759
1803
|
fpsLimit = 120;
|
|
1760
1804
|
fullScreen;
|
|
1761
|
-
hdr
|
|
1805
|
+
hdr;
|
|
1762
1806
|
key;
|
|
1763
1807
|
name;
|
|
1764
1808
|
palette;
|
|
@@ -1778,6 +1822,7 @@
|
|
|
1778
1822
|
this.#container = container;
|
|
1779
1823
|
this.background = new Background();
|
|
1780
1824
|
this.fullScreen = new FullScreen();
|
|
1825
|
+
this.hdr = new HDROptions();
|
|
1781
1826
|
this.particles = loadParticlesOptions(this.#pluginManager, this.#container);
|
|
1782
1827
|
this.resize = new ResizeEvent();
|
|
1783
1828
|
}
|
|
@@ -1800,7 +1845,15 @@
|
|
|
1800
1845
|
loadProperty(this, "detectRetina", data.detectRetina);
|
|
1801
1846
|
loadRangeProperty(this, "duration", data.duration);
|
|
1802
1847
|
loadProperty(this, "fpsLimit", data.fpsLimit);
|
|
1803
|
-
|
|
1848
|
+
const hdrData = data.hdr;
|
|
1849
|
+
if (isBoolean(hdrData)) {
|
|
1850
|
+
this.hdr.enable = hdrData;
|
|
1851
|
+
this.hdr.mode = exports.HdrMode.standard;
|
|
1852
|
+
this.hdr.peakNits = 400;
|
|
1853
|
+
}
|
|
1854
|
+
else {
|
|
1855
|
+
this.hdr.load(hdrData);
|
|
1856
|
+
}
|
|
1804
1857
|
loadProperty(this, "pauseOnBlur", data.pauseOnBlur);
|
|
1805
1858
|
loadProperty(this, "pauseOnOutsideViewport", data.pauseOnOutsideViewport);
|
|
1806
1859
|
loadProperty(this, "zLayers", data.zLayers);
|
|
@@ -1843,7 +1896,7 @@
|
|
|
1843
1896
|
}
|
|
1844
1897
|
}
|
|
1845
1898
|
|
|
1846
|
-
const styleCache = new Map(), maxStyleCacheSize = 2000, rgbFixedPrecision = 2, hslFixedPrecision = 2, hdrRgbFixedPrecision = 4, hdrHslFixedPrecision = 4, sdrReferenceWhiteNits = 203,
|
|
1899
|
+
const styleCache = new Map(), maxStyleCacheSize = 2000, rgbFixedPrecision = 2, hslFixedPrecision = 2, hdrRgbFixedPrecision = 4, hdrHslFixedPrecision = 4, sdrReferenceWhiteNits = 203, acesA = 2.51, acesB = 0.03, acesC = 2.43, acesD = 0.59, acesE = 0.14, saturationBoost = 1.15, lightnessBoost = 1.05, temperatureR = 1.05, temperatureB = 0.95, contrastFactor = 1.1, luminanceR = 0.2126, luminanceG = 0.7152, luminanceB = 0.0722, dynamicLuminanceFactor = 2, channelCount = 3, srgbThreshold = 0.04045, srgbDivisor = 12.92, srgbOffset = 0.055, srgbScale = 1.055, srgbExponent = 2.4, linearThreshold = 0.0031308, linearScale = 12.92;
|
|
1847
1900
|
function getCachedStyle(key, generator) {
|
|
1848
1901
|
let cached = styleCache.get(key);
|
|
1849
1902
|
if (!cached) {
|
|
@@ -1855,6 +1908,48 @@
|
|
|
1855
1908
|
}
|
|
1856
1909
|
return cached;
|
|
1857
1910
|
}
|
|
1911
|
+
function acesFilmic(x) {
|
|
1912
|
+
return clamp((x * (acesA * x + acesB)) / (x * (acesC * x + acesD) + acesE), none, one);
|
|
1913
|
+
}
|
|
1914
|
+
function srgbToLinear(c) {
|
|
1915
|
+
return c <= srgbThreshold ? c / srgbDivisor : Math.pow((c + srgbOffset) / srgbScale, srgbExponent);
|
|
1916
|
+
}
|
|
1917
|
+
function linearToSrgb(c) {
|
|
1918
|
+
return c <= linearThreshold ? c * linearScale : srgbScale * Math.pow(c, one / srgbExponent) - srgbOffset;
|
|
1919
|
+
}
|
|
1920
|
+
function applyHdrModeAdjustments(r, g, b, mode, maxChannel) {
|
|
1921
|
+
switch (mode) {
|
|
1922
|
+
case exports.HdrMode.vivid: {
|
|
1923
|
+
const avg = (r + g + b) / channelCount;
|
|
1924
|
+
return {
|
|
1925
|
+
b: clamp(clamp(avg + (b - avg) * saturationBoost, none, maxChannel) * lightnessBoost, none, maxChannel),
|
|
1926
|
+
g: clamp(clamp(avg + (g - avg) * saturationBoost, none, maxChannel) * lightnessBoost, none, maxChannel),
|
|
1927
|
+
r: clamp(clamp(avg + (r - avg) * saturationBoost, none, maxChannel) * lightnessBoost, none, maxChannel),
|
|
1928
|
+
};
|
|
1929
|
+
}
|
|
1930
|
+
case exports.HdrMode.cinematic: {
|
|
1931
|
+
const tempR = r * temperatureR, tempB = b * temperatureB, avg = (tempR + g + tempB) / channelCount;
|
|
1932
|
+
return {
|
|
1933
|
+
b: clamp(avg + (tempB - avg) * contrastFactor, none, maxChannel),
|
|
1934
|
+
g: clamp(avg + (g - avg) * contrastFactor, none, maxChannel),
|
|
1935
|
+
r: clamp(avg + (tempR - avg) * contrastFactor, none, maxChannel),
|
|
1936
|
+
};
|
|
1937
|
+
}
|
|
1938
|
+
case exports.HdrMode.dynamic: {
|
|
1939
|
+
const luminance = luminanceR * r + luminanceG * g + luminanceB * b, vividWeight = Math.min(one, luminance * dynamicLuminanceFactor), naturalWeight = one - vividWeight, avg = (r + g + b) / channelCount, vividR = clamp(avg + (r - avg) * saturationBoost, none, maxChannel) * lightnessBoost, vividG = clamp(avg + (g - avg) * saturationBoost, none, maxChannel) * lightnessBoost, vividB = clamp(avg + (b - avg) * saturationBoost, none, maxChannel) * lightnessBoost;
|
|
1940
|
+
return {
|
|
1941
|
+
b: clamp(b * naturalWeight + vividB * vividWeight, none, maxChannel),
|
|
1942
|
+
g: clamp(g * naturalWeight + vividG * vividWeight, none, maxChannel),
|
|
1943
|
+
r: clamp(r * naturalWeight + vividR * vividWeight, none, maxChannel),
|
|
1944
|
+
};
|
|
1945
|
+
}
|
|
1946
|
+
case exports.HdrMode.standard:
|
|
1947
|
+
return { b, g, r };
|
|
1948
|
+
case exports.HdrMode.natural:
|
|
1949
|
+
default:
|
|
1950
|
+
return { b, g, r };
|
|
1951
|
+
}
|
|
1952
|
+
}
|
|
1858
1953
|
function stringToRgba(pluginManager, input) {
|
|
1859
1954
|
if (!input) {
|
|
1860
1955
|
return;
|
|
@@ -2022,30 +2117,65 @@
|
|
|
2022
2117
|
r: getRgbInRangeValue(),
|
|
2023
2118
|
};
|
|
2024
2119
|
}
|
|
2025
|
-
function getStyleFromRgb(color, hdr, opacity) {
|
|
2026
|
-
const rgbPrecision = hdr ? hdrRgbFixedPrecision : rgbFixedPrecision, op = opacity ?? defaultOpacity$3, key =
|
|
2027
|
-
|
|
2120
|
+
function getStyleFromRgb(color, hdr, opacity, peakNits, mode) {
|
|
2121
|
+
const rgbPrecision = hdr ? hdrRgbFixedPrecision : rgbFixedPrecision, op = opacity ?? defaultOpacity$3, key = hdr
|
|
2122
|
+
? `rgb-${color.r.toFixed(rgbPrecision)}-${color.g.toFixed(rgbPrecision)}-${color.b.toFixed(rgbPrecision)}-hdr-${op.toString()}-${(peakNits ?? maxNits).toString()}-${mode ?? exports.HdrMode.standard}`
|
|
2123
|
+
: `rgb-${color.r.toFixed(rgbPrecision)}-${color.g.toFixed(rgbPrecision)}-${color.b.toFixed(rgbPrecision)}-sdr-${op.toString()}`;
|
|
2124
|
+
return getCachedStyle(key, () => hdr ? getHdrStyleFromRgb(color, opacity, peakNits, mode) : getSdrStyleFromRgb(color, opacity));
|
|
2125
|
+
}
|
|
2126
|
+
function getHdrStyleFromRgb(color, opacity, peakNits = maxNits, mode = exports.HdrMode.standard) {
|
|
2127
|
+
const headroom = peakNits / sdrReferenceWhiteNits, middleGray = 0.18, mapped = hdrToneMapColor(color, headroom, middleGray, mode);
|
|
2128
|
+
return `color(display-p3 ${mapped.r.toString()} ${mapped.g.toString()} ${mapped.b.toString()} / ${(opacity ?? defaultOpacity$3).toString()})`;
|
|
2129
|
+
}
|
|
2130
|
+
function hdrToneMapColor(color, headroom, middleGray, mode) {
|
|
2131
|
+
const rNorm = color.r / rgbMax, gNorm = color.g / rgbMax, bNorm = color.b / rgbMax;
|
|
2132
|
+
if (mode !== exports.HdrMode.natural && mode !== exports.HdrMode.vivid && mode !== exports.HdrMode.cinematic && mode !== exports.HdrMode.dynamic) {
|
|
2133
|
+
return { b: bNorm, g: gNorm, r: rNorm };
|
|
2134
|
+
}
|
|
2135
|
+
const maxChannel = Math.max(one, headroom), luminance = luminanceR * rNorm + luminanceG * gNorm + luminanceB * bNorm, mappedLuminance = hdrToneMap(luminance, headroom, middleGray), scale = luminance > none ? mappedLuminance / luminance : one;
|
|
2136
|
+
return applyHdrModeAdjustments(clamp(rNorm * scale, none, maxChannel), clamp(gNorm * scale, none, maxChannel), clamp(bNorm * scale, none, maxChannel), mode, maxChannel);
|
|
2028
2137
|
}
|
|
2029
|
-
function
|
|
2030
|
-
|
|
2031
|
-
|
|
2138
|
+
function hdrToneMap(normalized, headroom, middleGray) {
|
|
2139
|
+
if (normalized <= middleGray) {
|
|
2140
|
+
return acesFilmic(normalized);
|
|
2141
|
+
}
|
|
2142
|
+
const expanded = normalized + (normalized - middleGray) * (headroom - one);
|
|
2143
|
+
return acesFilmic(expanded);
|
|
2032
2144
|
}
|
|
2033
2145
|
function getSdrStyleFromRgb(color, opacity) {
|
|
2034
2146
|
return `rgba(${color.r.toString()}, ${color.g.toString()}, ${color.b.toString()}, ${(opacity ?? defaultOpacity$3).toString()})`;
|
|
2035
2147
|
}
|
|
2036
|
-
function getStyleFromHsl(color, hdr, opacity) {
|
|
2037
|
-
const hslPrecision = hdr ? hdrHslFixedPrecision : hslFixedPrecision, op = opacity ?? defaultOpacity$3, key =
|
|
2148
|
+
function getStyleFromHsl(color, hdr, opacity, peakNits, mode) {
|
|
2149
|
+
const hslPrecision = hdr ? hdrHslFixedPrecision : hslFixedPrecision, op = opacity ?? defaultOpacity$3, key = hdr
|
|
2150
|
+
? `hsl-${color.h.toFixed(hslPrecision)}-${color.s.toFixed(hslPrecision)}-${color.l.toFixed(hslPrecision)}-hdr-${op.toString()}-${(peakNits ?? maxNits).toString()}-${mode ?? exports.HdrMode.standard}`
|
|
2151
|
+
: `hsl-${color.h.toFixed(hslPrecision)}-${color.s.toFixed(hslPrecision)}-${color.l.toFixed(hslPrecision)}-sdr-${op.toString()}`;
|
|
2038
2152
|
return getCachedStyle(key, () => hdr
|
|
2039
|
-
? getStyleFromRgb(hslToRgbFloat(color), true, opacity)
|
|
2153
|
+
? getStyleFromRgb(hslToRgbFloat(color), true, opacity, peakNits, mode)
|
|
2040
2154
|
: `hsla(${color.h.toString()}, ${color.s.toString()}%, ${color.l.toString()}%, ${op.toString()})`);
|
|
2041
2155
|
}
|
|
2042
|
-
function colorMix(color1, color2, size1, size2) {
|
|
2156
|
+
function colorMix(color1, color2, size1, size2, hdr) {
|
|
2043
2157
|
let rgb1 = color1, rgb2 = color2;
|
|
2044
2158
|
if (!("r" in rgb1)) {
|
|
2045
|
-
rgb1 = hslToRgb(color1);
|
|
2159
|
+
rgb1 = hdr ? hslToRgbFloat(color1) : hslToRgb(color1);
|
|
2046
2160
|
}
|
|
2047
2161
|
if (!("r" in rgb2)) {
|
|
2048
|
-
rgb2 = hslToRgb(color2);
|
|
2162
|
+
rgb2 = hdr ? hslToRgbFloat(color2) : hslToRgb(color2);
|
|
2163
|
+
}
|
|
2164
|
+
if (hdr) {
|
|
2165
|
+
const lin1 = {
|
|
2166
|
+
b: srgbToLinear(rgb1.b / rgbMax),
|
|
2167
|
+
g: srgbToLinear(rgb1.g / rgbMax),
|
|
2168
|
+
r: srgbToLinear(rgb1.r / rgbMax),
|
|
2169
|
+
}, lin2 = {
|
|
2170
|
+
b: srgbToLinear(rgb2.b / rgbMax),
|
|
2171
|
+
g: srgbToLinear(rgb2.g / rgbMax),
|
|
2172
|
+
r: srgbToLinear(rgb2.r / rgbMax),
|
|
2173
|
+
}, totalWeight = size1 + size2;
|
|
2174
|
+
return {
|
|
2175
|
+
b: linearToSrgb((lin1.b * size1 + lin2.b * size2) / totalWeight) * rgbMax,
|
|
2176
|
+
g: linearToSrgb((lin1.g * size1 + lin2.g * size2) / totalWeight) * rgbMax,
|
|
2177
|
+
r: linearToSrgb((lin1.r * size1 + lin2.r * size2) / totalWeight) * rgbMax,
|
|
2178
|
+
};
|
|
2049
2179
|
}
|
|
2050
2180
|
return {
|
|
2051
2181
|
b: mix(rgb1.b, rgb2.b, size1, size2),
|
|
@@ -2053,14 +2183,14 @@
|
|
|
2053
2183
|
r: mix(rgb1.r, rgb2.r, size1, size2),
|
|
2054
2184
|
};
|
|
2055
2185
|
}
|
|
2056
|
-
function getLinkColor(p1, p2, linkColor) {
|
|
2186
|
+
function getLinkColor(p1, p2, linkColor, hdr) {
|
|
2057
2187
|
if (linkColor === randomColorValue) {
|
|
2058
2188
|
return getRandomRgbColor();
|
|
2059
2189
|
}
|
|
2060
2190
|
else if (linkColor === midColorValue) {
|
|
2061
2191
|
const sourceColor = p1.getFillColor() ?? p1.getStrokeColor(), destColor = p2?.getFillColor() ?? p2?.getStrokeColor();
|
|
2062
2192
|
if (sourceColor && destColor && p2) {
|
|
2063
|
-
return colorMix(sourceColor, destColor, p1.getRadius(), p2.getRadius());
|
|
2193
|
+
return colorMix(sourceColor, destColor, p1.getRadius(), p2.getRadius(), hdr);
|
|
2064
2194
|
}
|
|
2065
2195
|
else {
|
|
2066
2196
|
const hslColor = sourceColor ?? destColor;
|
|
@@ -2156,7 +2286,7 @@
|
|
|
2156
2286
|
colorValue.velocity = defaultVelocity;
|
|
2157
2287
|
}
|
|
2158
2288
|
}
|
|
2159
|
-
function updateColorValue(data, decrease, delta,
|
|
2289
|
+
function updateColorValue(data, decrease, delta, _hdr) {
|
|
2160
2290
|
const minLoops = 0, minDelay = 0, identity = 1, minVelocity = 0, minOffset = 0, velocityFactor = 3.6;
|
|
2161
2291
|
if (!data.enable ||
|
|
2162
2292
|
((data.maxLoops ?? minLoops) > minLoops && (data.loops ?? minLoops) > (data.maxLoops ?? minLoops))) {
|
|
@@ -2169,7 +2299,7 @@
|
|
|
2169
2299
|
if ((data.delayTime ?? minDelay) > minDelay && data.time < (data.delayTime ?? minDelay)) {
|
|
2170
2300
|
return;
|
|
2171
2301
|
}
|
|
2172
|
-
const offset = data.offset ? randomInRangeValue(data.offset) : minOffset, velocity = (
|
|
2302
|
+
const offset = data.offset ? randomInRangeValue(data.offset) : minOffset, velocity = (data.velocity ?? minVelocity) * delta.factor + offset * velocityFactor, decay = data.decay ?? identity, max = data.max, min = data.min;
|
|
2173
2303
|
if (!decrease || data.status === exports.AnimationStatus.increasing) {
|
|
2174
2304
|
data.value += velocity;
|
|
2175
2305
|
if (data.value > max) {
|
|
@@ -2201,9 +2331,9 @@
|
|
|
2201
2331
|
return;
|
|
2202
2332
|
}
|
|
2203
2333
|
const { h, s, l } = color;
|
|
2204
|
-
updateColorValue(h, false, delta
|
|
2205
|
-
updateColorValue(s, true, delta
|
|
2206
|
-
updateColorValue(l, true, delta
|
|
2334
|
+
updateColorValue(h, false, delta);
|
|
2335
|
+
updateColorValue(s, true, delta);
|
|
2336
|
+
updateColorValue(l, true, delta);
|
|
2207
2337
|
}
|
|
2208
2338
|
function alterHsl(color, type, value) {
|
|
2209
2339
|
return {
|
|
@@ -2243,7 +2373,7 @@
|
|
|
2243
2373
|
}
|
|
2244
2374
|
|
|
2245
2375
|
async function loadArrowShape(engine) {
|
|
2246
|
-
engine.checkVersion("4.
|
|
2376
|
+
engine.checkVersion("4.4.0");
|
|
2247
2377
|
await engine.pluginManager.register(e => {
|
|
2248
2378
|
e.pluginManager.addShape(["arrow"], () => Promise.resolve(new ArrowDrawer()));
|
|
2249
2379
|
});
|
|
@@ -2317,7 +2447,7 @@
|
|
|
2317
2447
|
}
|
|
2318
2448
|
|
|
2319
2449
|
async function loadBackgroundMaskPlugin(engine) {
|
|
2320
|
-
engine.checkVersion("4.
|
|
2450
|
+
engine.checkVersion("4.4.0");
|
|
2321
2451
|
await engine.pluginManager.register(e => {
|
|
2322
2452
|
e.pluginManager.addPlugin(new BackgroundMaskPlugin(e.pluginManager));
|
|
2323
2453
|
});
|
|
@@ -2341,7 +2471,7 @@
|
|
|
2341
2471
|
}
|
|
2342
2472
|
|
|
2343
2473
|
async function loadMovePlugin(engine) {
|
|
2344
|
-
engine.checkVersion("4.
|
|
2474
|
+
engine.checkVersion("4.4.0");
|
|
2345
2475
|
await engine.pluginManager.register(e => {
|
|
2346
2476
|
const moveEngine = e, movePluginManager = moveEngine.pluginManager;
|
|
2347
2477
|
movePluginManager.initializers.pathGenerators ??= new Map();
|
|
@@ -2442,7 +2572,7 @@
|
|
|
2442
2572
|
|
|
2443
2573
|
const branchingPathName = "branchesPathGenerator";
|
|
2444
2574
|
async function loadBranchesPath(engine) {
|
|
2445
|
-
engine.checkVersion("4.
|
|
2575
|
+
engine.checkVersion("4.4.0");
|
|
2446
2576
|
await engine.pluginManager.register((e) => {
|
|
2447
2577
|
ensureBaseMoverLoaded(e);
|
|
2448
2578
|
e.pluginManager.addPathGenerator?.(branchingPathName, container => {
|
|
@@ -2491,7 +2621,7 @@
|
|
|
2491
2621
|
|
|
2492
2622
|
const brownianPathName = "brownianPathGenerator";
|
|
2493
2623
|
async function loadBrownianPath(engine) {
|
|
2494
|
-
engine.checkVersion("4.
|
|
2624
|
+
engine.checkVersion("4.4.0");
|
|
2495
2625
|
await engine.pluginManager.register((e) => {
|
|
2496
2626
|
ensureBaseMoverLoaded(e);
|
|
2497
2627
|
e.pluginManager.addPathGenerator?.(brownianPathName, container => {
|
|
@@ -2513,7 +2643,7 @@
|
|
|
2513
2643
|
}
|
|
2514
2644
|
|
|
2515
2645
|
async function loadBubbleEffect(engine) {
|
|
2516
|
-
engine.checkVersion("4.
|
|
2646
|
+
engine.checkVersion("4.4.0");
|
|
2517
2647
|
await engine.pluginManager.register(e => {
|
|
2518
2648
|
e.pluginManager.addEffect("bubble", () => {
|
|
2519
2649
|
return Promise.resolve(new BubbleDrawer());
|
|
@@ -2683,7 +2813,7 @@
|
|
|
2683
2813
|
}
|
|
2684
2814
|
|
|
2685
2815
|
async function loadCanvasMaskPlugin(engine) {
|
|
2686
|
-
engine.checkVersion("4.
|
|
2816
|
+
engine.checkVersion("4.4.0");
|
|
2687
2817
|
await engine.pluginManager.register(e => {
|
|
2688
2818
|
e.pluginManager.addPlugin(new CanvasMaskPlugin());
|
|
2689
2819
|
});
|
|
@@ -2972,7 +3102,7 @@
|
|
|
2972
3102
|
}
|
|
2973
3103
|
|
|
2974
3104
|
async function loadClubsSuitShape(engine) {
|
|
2975
|
-
engine.checkVersion("4.
|
|
3105
|
+
engine.checkVersion("4.4.0");
|
|
2976
3106
|
await engine.pluginManager.register(e => {
|
|
2977
3107
|
e.pluginManager.addShape(["club", "clubs"], () => Promise.resolve(new ClubDrawer()));
|
|
2978
3108
|
});
|
|
@@ -2986,7 +3116,7 @@
|
|
|
2986
3116
|
}
|
|
2987
3117
|
|
|
2988
3118
|
async function loadDiamondsSuitShape(engine) {
|
|
2989
|
-
engine.checkVersion("4.
|
|
3119
|
+
engine.checkVersion("4.4.0");
|
|
2990
3120
|
await engine.pluginManager.register(e => {
|
|
2991
3121
|
e.pluginManager.addShape(["diamond", "diamonds"], () => Promise.resolve(new DiamondDrawer()));
|
|
2992
3122
|
});
|
|
@@ -3000,7 +3130,7 @@
|
|
|
3000
3130
|
};
|
|
3001
3131
|
|
|
3002
3132
|
async function loadHeartsSuitShape(engine) {
|
|
3003
|
-
engine.checkVersion("4.
|
|
3133
|
+
engine.checkVersion("4.4.0");
|
|
3004
3134
|
await engine.pluginManager.register(e => {
|
|
3005
3135
|
e.pluginManager.addShape(["heart", "hearts"], () => Promise.resolve(new HeartDrawer$1()));
|
|
3006
3136
|
});
|
|
@@ -3014,14 +3144,14 @@
|
|
|
3014
3144
|
}
|
|
3015
3145
|
|
|
3016
3146
|
async function loadSpadesSuitShape(engine) {
|
|
3017
|
-
engine.checkVersion("4.
|
|
3147
|
+
engine.checkVersion("4.4.0");
|
|
3018
3148
|
await engine.pluginManager.register(e => {
|
|
3019
3149
|
e.pluginManager.addShape(["spade", "spades"], () => Promise.resolve(new SpadeDrawer()));
|
|
3020
3150
|
});
|
|
3021
3151
|
}
|
|
3022
3152
|
|
|
3023
3153
|
async function loadCardSuitsShape(engine) {
|
|
3024
|
-
engine.checkVersion("4.
|
|
3154
|
+
engine.checkVersion("4.4.0");
|
|
3025
3155
|
await Promise.all([
|
|
3026
3156
|
loadClubsSuitShape(engine),
|
|
3027
3157
|
loadDiamondsSuitShape(engine),
|
|
@@ -3031,18 +3161,18 @@
|
|
|
3031
3161
|
}
|
|
3032
3162
|
|
|
3033
3163
|
const cardWidthRatio = (double * double) / triple, cardHeightRatio = double, cornerRadiusRatio = 0.2, cornerFontRatio = 0.4, cornerSuitRatio = 0.3, centerSuitRatio = 0.7, cornerPaddingRatio = 0.2, textHorizontalOffsetRatio = 0.25, minRadius$6 = 0, minAngle$5 = 0, suitEdgeBufferFactor = 0.1, fixedCacheKey = 2, cardsCache = new Map(), redSuitColor = { r: 215, g: 20, b: 20 }, blackSuitColor = { r: 18, g: 18, b: 18 };
|
|
3034
|
-
function drawRoundedCard(ctx, radius, cardData, hdr, flipped, canvasSettings) {
|
|
3164
|
+
function drawRoundedCard(ctx, radius, cardData, hdr, flipped, canvasSettings, peakNits, mode) {
|
|
3035
3165
|
if (flipped) {
|
|
3036
3166
|
drawRoundedCardBack(ctx, radius);
|
|
3037
3167
|
}
|
|
3038
3168
|
else {
|
|
3039
|
-
const cacheKey = getCacheKey(radius, hdr, cardData), cardWidth = radius * cardWidthRatio, cardHeight = radius * cardHeightRatio, halfWidth = cardWidth * half$2, halfHeight = cardHeight * half$2;
|
|
3169
|
+
const cacheKey = getCacheKey(radius, hdr, cardData, peakNits, mode), cardWidth = radius * cardWidthRatio, cardHeight = radius * cardHeightRatio, halfWidth = cardWidth * half$2, halfHeight = cardHeight * half$2;
|
|
3040
3170
|
let cachedData = cardsCache.get(cacheKey);
|
|
3041
3171
|
if (!cachedData) {
|
|
3042
3172
|
const cacheCanvas = new OffscreenCanvas(cardWidth, cardHeight), cacheCtx = cacheCanvas.getContext("2d", canvasSettings);
|
|
3043
3173
|
if (cacheCtx) {
|
|
3044
3174
|
cacheCtx.translate(halfWidth, halfHeight);
|
|
3045
|
-
drawRoundedCardFront(cacheCtx, radius, cardData, hdr);
|
|
3175
|
+
drawRoundedCardFront(cacheCtx, radius, cardData, hdr, peakNits, mode);
|
|
3046
3176
|
cachedData = cacheCanvas instanceof HTMLCanvasElement ? cacheCanvas : cacheCanvas.transferToImageBitmap();
|
|
3047
3177
|
cardsCache.set(cacheKey, cachedData);
|
|
3048
3178
|
}
|
|
@@ -3051,23 +3181,25 @@
|
|
|
3051
3181
|
ctx.drawImage(cachedData, -halfWidth, -halfHeight, cardWidth, cardHeight);
|
|
3052
3182
|
}
|
|
3053
3183
|
else {
|
|
3054
|
-
drawRoundedCardFront(ctx, radius, cardData, hdr);
|
|
3184
|
+
drawRoundedCardFront(ctx, radius, cardData, hdr, peakNits, mode);
|
|
3055
3185
|
}
|
|
3056
3186
|
}
|
|
3057
3187
|
}
|
|
3058
|
-
function getCacheKey(radius, hdr, cardData) {
|
|
3059
|
-
return `${radius.toFixed(fixedCacheKey)}-${hdr ? "hdr" : "sdr"}-${cardData.suit}-${cardData.value}`;
|
|
3188
|
+
function getCacheKey(radius, hdr, cardData, peakNits, mode) {
|
|
3189
|
+
return `${radius.toFixed(fixedCacheKey)}-${hdr ? "hdr" : "sdr"}-${peakNits !== undefined ? peakNits.toFixed(fixedCacheKey) : "default"}-${mode ?? "default"}-${cardData.suit}-${cardData.value}`;
|
|
3060
3190
|
}
|
|
3061
3191
|
function drawRoundedCardBack(ctx, radius) {
|
|
3062
3192
|
drawCardBody(ctx, radius);
|
|
3063
3193
|
}
|
|
3064
|
-
function drawRoundedCardFront(ctx, radius, cardData, hdr) {
|
|
3065
|
-
const { suit, value } = cardData, cardWidth = radius * cardWidthRatio, cardHeight = radius * cardHeightRatio, halfWidth = cardWidth * half$2, halfHeight = cardHeight * half$2, cornerPadding = radius * cornerPaddingRatio, cornerFontSize = radius * cornerFontRatio, cornerSuitSize = radius * cornerSuitRatio, centerSuitSize = radius * centerSuitRatio, textOffset = radius * textHorizontalOffsetRatio, suitEdgeBuffer = radius * suitEdgeBufferFactor, isRed = suit === SuitType.hearts || suit === SuitType.diamonds, color = isRed
|
|
3194
|
+
function drawRoundedCardFront(ctx, radius, cardData, hdr, peakNits, mode) {
|
|
3195
|
+
const { suit, value } = cardData, cardWidth = radius * cardWidthRatio, cardHeight = radius * cardHeightRatio, halfWidth = cardWidth * half$2, halfHeight = cardHeight * half$2, cornerPadding = radius * cornerPaddingRatio, cornerFontSize = radius * cornerFontRatio, cornerSuitSize = radius * cornerSuitRatio, centerSuitSize = radius * centerSuitRatio, textOffset = radius * textHorizontalOffsetRatio, suitEdgeBuffer = radius * suitEdgeBufferFactor, isRed = suit === SuitType.hearts || suit === SuitType.diamonds, color = isRed
|
|
3196
|
+
? getStyleFromRgb(redSuitColor, hdr, undefined, peakNits, mode)
|
|
3197
|
+
: getStyleFromRgb(blackSuitColor, hdr, undefined, peakNits, mode);
|
|
3066
3198
|
ctx.save();
|
|
3067
3199
|
drawCardBody(ctx, radius);
|
|
3068
|
-
ctx.fillStyle = getStyleFromRgb({ r: 255, g: 255, b: 255 }, hdr);
|
|
3200
|
+
ctx.fillStyle = getStyleFromRgb({ r: 255, g: 255, b: 255 }, hdr, undefined, peakNits, mode);
|
|
3069
3201
|
ctx.fill();
|
|
3070
|
-
ctx.strokeStyle = getStyleFromRgb({ r: 0, g: 0, b: 0 }, hdr);
|
|
3202
|
+
ctx.strokeStyle = getStyleFromRgb({ r: 0, g: 0, b: 0 }, hdr, undefined, peakNits, mode);
|
|
3071
3203
|
ctx.stroke();
|
|
3072
3204
|
ctx.fillStyle = color;
|
|
3073
3205
|
ctx.font = `bold ${cornerFontSize.toString()}px Arial, serif`;
|
|
@@ -3129,7 +3261,7 @@
|
|
|
3129
3261
|
}
|
|
3130
3262
|
const defaultOpacity = context.globalAlpha, container = this.#container;
|
|
3131
3263
|
context.globalAlpha = opacity;
|
|
3132
|
-
drawRoundedCard(context, radius, particle.cardData, container.hdr, particle.isShowingBack(), container.canvas.render.settings);
|
|
3264
|
+
drawRoundedCard(context, radius, particle.cardData, container.hdr, particle.isShowingBack(), container.canvas.render.settings, container.peakNits, container.hdrMode);
|
|
3133
3265
|
context.globalAlpha = defaultOpacity;
|
|
3134
3266
|
}
|
|
3135
3267
|
particleInit(_container, particle) {
|
|
@@ -3142,14 +3274,14 @@
|
|
|
3142
3274
|
}
|
|
3143
3275
|
|
|
3144
3276
|
async function loadFullCardsShape(engine) {
|
|
3145
|
-
engine.checkVersion("4.
|
|
3277
|
+
engine.checkVersion("4.4.0");
|
|
3146
3278
|
await engine.pluginManager.register(e => {
|
|
3147
3279
|
e.pluginManager.addShape(["card"], container => Promise.resolve(new CardDrawer(container)));
|
|
3148
3280
|
});
|
|
3149
3281
|
}
|
|
3150
3282
|
|
|
3151
3283
|
async function loadCardsShape(engine) {
|
|
3152
|
-
engine.checkVersion("4.
|
|
3284
|
+
engine.checkVersion("4.4.0");
|
|
3153
3285
|
await Promise.all([
|
|
3154
3286
|
loadFullCardsShape(engine),
|
|
3155
3287
|
loadCardSuitsShape(engine),
|
|
@@ -3219,7 +3351,7 @@
|
|
|
3219
3351
|
}
|
|
3220
3352
|
|
|
3221
3353
|
async function loadCogShape(engine) {
|
|
3222
|
-
engine.checkVersion("4.
|
|
3354
|
+
engine.checkVersion("4.4.0");
|
|
3223
3355
|
await engine.pluginManager.register(e => {
|
|
3224
3356
|
e.pluginManager.addShape(["cog"], () => Promise.resolve(new CogDrawer()));
|
|
3225
3357
|
});
|
|
@@ -6859,7 +6991,7 @@
|
|
|
6859
6991
|
|
|
6860
6992
|
const curlNoisePathName = "curlNoise";
|
|
6861
6993
|
async function loadCurlNoisePath(engine) {
|
|
6862
|
-
engine.checkVersion("4.
|
|
6994
|
+
engine.checkVersion("4.4.0");
|
|
6863
6995
|
await engine.pluginManager.register((e) => {
|
|
6864
6996
|
ensureBaseMoverLoaded(e);
|
|
6865
6997
|
e.pluginManager.addPathGenerator?.(curlNoisePathName, container => {
|
|
@@ -6962,7 +7094,7 @@
|
|
|
6962
7094
|
|
|
6963
7095
|
const curvesPathName = "curvesPathGenerator";
|
|
6964
7096
|
async function loadCurvesPath(engine) {
|
|
6965
|
-
engine.checkVersion("4.
|
|
7097
|
+
engine.checkVersion("4.4.0");
|
|
6966
7098
|
await engine.pluginManager.register((e) => {
|
|
6967
7099
|
ensureBaseMoverLoaded(e);
|
|
6968
7100
|
e.pluginManager.addPathGenerator?.(curvesPathName, container => {
|
|
@@ -6988,7 +7120,7 @@
|
|
|
6988
7120
|
});
|
|
6989
7121
|
|
|
6990
7122
|
async function loadEasingBackPlugin(engine) {
|
|
6991
|
-
engine.checkVersion("4.
|
|
7123
|
+
engine.checkVersion("4.4.0");
|
|
6992
7124
|
await engine.pluginManager.register(e => {
|
|
6993
7125
|
for (const [easing, easingFn] of easingsFunctions$d) {
|
|
6994
7126
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7019,7 +7151,7 @@
|
|
|
7019
7151
|
easingsFunctions$c.set("ease-in-out-bounce", value => value < 0.5 ? (1 - bounceOut(1 - value * 2)) / 2 : (1 + bounceOut(value * 2 - 1)) / 2);
|
|
7020
7152
|
|
|
7021
7153
|
async function loadEasingBouncePlugin(engine) {
|
|
7022
|
-
engine.checkVersion("4.
|
|
7154
|
+
engine.checkVersion("4.4.0");
|
|
7023
7155
|
await engine.pluginManager.register(e => {
|
|
7024
7156
|
for (const [easing, easingFn] of easingsFunctions$c) {
|
|
7025
7157
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7033,7 +7165,7 @@
|
|
|
7033
7165
|
easingsFunctions$b.set("ease-in-out-circ", value => value < 0.5 ? (1 - Math.sqrt(1 - (2 * value) ** 2)) / 2 : (Math.sqrt(1 - (-2 * value + 2) ** 2) + 1) / 2);
|
|
7034
7166
|
|
|
7035
7167
|
async function loadEasingCircPlugin(engine) {
|
|
7036
|
-
engine.checkVersion("4.
|
|
7168
|
+
engine.checkVersion("4.4.0");
|
|
7037
7169
|
await engine.pluginManager.register(e => {
|
|
7038
7170
|
for (const [easing, easingFn] of easingsFunctions$b) {
|
|
7039
7171
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7047,7 +7179,7 @@
|
|
|
7047
7179
|
easingsFunctions$a.set("ease-in-out-cubic", value => (value < 0.5 ? 4 * value ** 3 : 1 - (-2 * value + 2) ** 3 / 2));
|
|
7048
7180
|
|
|
7049
7181
|
async function loadEasingCubicPlugin(engine) {
|
|
7050
|
-
engine.checkVersion("4.
|
|
7182
|
+
engine.checkVersion("4.4.0");
|
|
7051
7183
|
await engine.pluginManager.register(e => {
|
|
7052
7184
|
for (const [easing, easingFn] of easingsFunctions$a) {
|
|
7053
7185
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7080,7 +7212,7 @@
|
|
|
7080
7212
|
});
|
|
7081
7213
|
|
|
7082
7214
|
async function loadEasingElasticPlugin(engine) {
|
|
7083
|
-
engine.checkVersion("4.
|
|
7215
|
+
engine.checkVersion("4.4.0");
|
|
7084
7216
|
await engine.pluginManager.register(e => {
|
|
7085
7217
|
for (const [easing, easingFn] of easingsFunctions$9) {
|
|
7086
7218
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7104,7 +7236,7 @@
|
|
|
7104
7236
|
});
|
|
7105
7237
|
|
|
7106
7238
|
async function loadEasingExpoPlugin(engine) {
|
|
7107
|
-
engine.checkVersion("4.
|
|
7239
|
+
engine.checkVersion("4.4.0");
|
|
7108
7240
|
await engine.pluginManager.register(e => {
|
|
7109
7241
|
for (const [easing, easingFn] of easingsFunctions$8) {
|
|
7110
7242
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7118,7 +7250,7 @@
|
|
|
7118
7250
|
easingsFunctions$7.set("ease-in-out-gaussian", value => gaussian(value));
|
|
7119
7251
|
|
|
7120
7252
|
async function loadEasingGaussianPlugin(engine) {
|
|
7121
|
-
engine.checkVersion("4.
|
|
7253
|
+
engine.checkVersion("4.4.0");
|
|
7122
7254
|
await engine.pluginManager.register(e => {
|
|
7123
7255
|
for (const [easing, easingFn] of easingsFunctions$7) {
|
|
7124
7256
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7132,7 +7264,7 @@
|
|
|
7132
7264
|
easingsFunctions$6.set("ease-in-out-linear", value => value);
|
|
7133
7265
|
|
|
7134
7266
|
async function loadEasingLinearPlugin(engine) {
|
|
7135
|
-
engine.checkVersion("4.
|
|
7267
|
+
engine.checkVersion("4.4.0");
|
|
7136
7268
|
await engine.pluginManager.register(e => {
|
|
7137
7269
|
for (const [easing, easingFn] of easingsFunctions$6) {
|
|
7138
7270
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7146,7 +7278,7 @@
|
|
|
7146
7278
|
easingsFunctions$5.set("ease-in-out-quart", value => (value < 0.5 ? 8 * value ** 4 : 1 - (-2 * value + 2) ** 4 / 2));
|
|
7147
7279
|
|
|
7148
7280
|
async function loadEasingQuartPlugin(engine) {
|
|
7149
|
-
engine.checkVersion("4.
|
|
7281
|
+
engine.checkVersion("4.4.0");
|
|
7150
7282
|
await engine.pluginManager.register(e => {
|
|
7151
7283
|
for (const [easing, easingFn] of easingsFunctions$5) {
|
|
7152
7284
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7160,7 +7292,7 @@
|
|
|
7160
7292
|
easingsFunctions$4.set("ease-in-out-quint", value => (value < 0.5 ? 16 * value ** 5 : 1 - (-2 * value + 2) ** 5 / 2));
|
|
7161
7293
|
|
|
7162
7294
|
async function loadEasingQuintPlugin(engine) {
|
|
7163
|
-
engine.checkVersion("4.
|
|
7295
|
+
engine.checkVersion("4.4.0");
|
|
7164
7296
|
await engine.pluginManager.register(e => {
|
|
7165
7297
|
for (const [easing, easingFn] of easingsFunctions$4) {
|
|
7166
7298
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7174,7 +7306,7 @@
|
|
|
7174
7306
|
easingsFunctions$3.set("ease-in-out-sigmoid", value => sigmoid(value));
|
|
7175
7307
|
|
|
7176
7308
|
async function loadEasingSigmoidPlugin(engine) {
|
|
7177
|
-
engine.checkVersion("4.
|
|
7309
|
+
engine.checkVersion("4.4.0");
|
|
7178
7310
|
await engine.pluginManager.register(e => {
|
|
7179
7311
|
for (const [easing, easingFn] of easingsFunctions$3) {
|
|
7180
7312
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7188,7 +7320,7 @@
|
|
|
7188
7320
|
easingsFunctions$2.set("ease-in-out-sine", value => -(Math.cos(Math.PI * value) - 1) / 2);
|
|
7189
7321
|
|
|
7190
7322
|
async function loadEasingSinePlugin(engine) {
|
|
7191
|
-
engine.checkVersion("4.
|
|
7323
|
+
engine.checkVersion("4.4.0");
|
|
7192
7324
|
await engine.pluginManager.register(e => {
|
|
7193
7325
|
for (const [easing, easingFn] of easingsFunctions$2) {
|
|
7194
7326
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7202,7 +7334,7 @@
|
|
|
7202
7334
|
easingsFunctions$1.set("ease-in-out-smoothstep", value => smoothstep$1(value));
|
|
7203
7335
|
|
|
7204
7336
|
async function loadEasingSmoothstepPlugin(engine) {
|
|
7205
|
-
engine.checkVersion("4.
|
|
7337
|
+
engine.checkVersion("4.4.0");
|
|
7206
7338
|
await engine.pluginManager.register(e => {
|
|
7207
7339
|
for (const [easing, easingFn] of easingsFunctions$1) {
|
|
7208
7340
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -7441,7 +7573,7 @@
|
|
|
7441
7573
|
}
|
|
7442
7574
|
|
|
7443
7575
|
async function loadInteractivityPlugin(engine) {
|
|
7444
|
-
engine.checkVersion("4.
|
|
7576
|
+
engine.checkVersion("4.4.0");
|
|
7445
7577
|
await engine.pluginManager.register(e => {
|
|
7446
7578
|
const interactivityEngine = e, interactivityPluginManager = interactivityEngine.pluginManager;
|
|
7447
7579
|
interactivityPluginManager.addPlugin(new InteractivityPlugin(interactivityPluginManager));
|
|
@@ -7784,7 +7916,7 @@
|
|
|
7784
7916
|
})(EmitterClickMode || (EmitterClickMode = {}));
|
|
7785
7917
|
|
|
7786
7918
|
async function loadEmittersInteraction(engine) {
|
|
7787
|
-
engine.checkVersion("4.
|
|
7919
|
+
engine.checkVersion("4.4.0");
|
|
7788
7920
|
await engine.pluginManager.register(async (e) => {
|
|
7789
7921
|
const instancesManager = await getEmittersInstancesManager(e);
|
|
7790
7922
|
ensureInteractivityPluginLoaded(e);
|
|
@@ -7827,7 +7959,7 @@
|
|
|
7827
7959
|
}
|
|
7828
7960
|
|
|
7829
7961
|
async function loadEmittersPluginSimple(engine) {
|
|
7830
|
-
engine.checkVersion("4.
|
|
7962
|
+
engine.checkVersion("4.4.0");
|
|
7831
7963
|
await engine.pluginManager.register(async (e) => {
|
|
7832
7964
|
const instancesManager = await getEmittersInstancesManager(e);
|
|
7833
7965
|
await addEmittersShapesManager(e);
|
|
@@ -8167,7 +8299,7 @@
|
|
|
8167
8299
|
}
|
|
8168
8300
|
|
|
8169
8301
|
async function loadEmittersShapeCanvas(engine) {
|
|
8170
|
-
engine.checkVersion("4.
|
|
8302
|
+
engine.checkVersion("4.4.0");
|
|
8171
8303
|
await engine.pluginManager.register((e) => {
|
|
8172
8304
|
ensureEmittersPluginLoaded(e);
|
|
8173
8305
|
e.pluginManager.addEmitterShapeGenerator?.("canvas", new EmittersCanvasShapeGenerator());
|
|
@@ -8304,7 +8436,7 @@
|
|
|
8304
8436
|
}
|
|
8305
8437
|
|
|
8306
8438
|
async function loadEmittersShapePath(engine) {
|
|
8307
|
-
engine.checkVersion("4.
|
|
8439
|
+
engine.checkVersion("4.4.0");
|
|
8308
8440
|
await engine.pluginManager.register((e) => {
|
|
8309
8441
|
ensureEmittersPluginLoaded(e);
|
|
8310
8442
|
e.pluginManager.addEmitterShapeGenerator?.("path", new EmittersPathShapeGenerator());
|
|
@@ -8431,7 +8563,7 @@
|
|
|
8431
8563
|
}
|
|
8432
8564
|
|
|
8433
8565
|
async function loadEmittersShapePolygon(engine) {
|
|
8434
|
-
engine.checkVersion("4.
|
|
8566
|
+
engine.checkVersion("4.4.0");
|
|
8435
8567
|
await engine.pluginManager.register((e) => {
|
|
8436
8568
|
ensureEmittersPluginLoaded(e);
|
|
8437
8569
|
e.pluginManager.addEmitterShapeGenerator?.("polygon", new EmittersPolygonShapeGenerator());
|
|
@@ -8452,7 +8584,7 @@
|
|
|
8452
8584
|
}
|
|
8453
8585
|
|
|
8454
8586
|
async function loadExportImagePlugin(engine) {
|
|
8455
|
-
engine.checkVersion("4.
|
|
8587
|
+
engine.checkVersion("4.4.0");
|
|
8456
8588
|
await engine.pluginManager.register(e => {
|
|
8457
8589
|
e.pluginManager.addPlugin(new ExportImagePlugin());
|
|
8458
8590
|
});
|
|
@@ -8472,7 +8604,7 @@
|
|
|
8472
8604
|
}
|
|
8473
8605
|
|
|
8474
8606
|
async function loadExportJSONPlugin(engine) {
|
|
8475
|
-
engine.checkVersion("4.
|
|
8607
|
+
engine.checkVersion("4.4.0");
|
|
8476
8608
|
await engine.pluginManager.register(e => {
|
|
8477
8609
|
e.pluginManager.addPlugin(new ExportJSONPlugin());
|
|
8478
8610
|
});
|
|
@@ -8492,7 +8624,7 @@
|
|
|
8492
8624
|
}
|
|
8493
8625
|
|
|
8494
8626
|
async function loadExportVideoPlugin(engine) {
|
|
8495
|
-
engine.checkVersion("4.
|
|
8627
|
+
engine.checkVersion("4.4.0");
|
|
8496
8628
|
await engine.pluginManager.register(e => {
|
|
8497
8629
|
e.pluginManager.addPlugin(new ExportVideoPlugin());
|
|
8498
8630
|
});
|
|
@@ -8644,7 +8776,7 @@
|
|
|
8644
8776
|
}
|
|
8645
8777
|
|
|
8646
8778
|
async function loadExternalCannonInteraction(engine) {
|
|
8647
|
-
engine.checkVersion("4.
|
|
8779
|
+
engine.checkVersion("4.4.0");
|
|
8648
8780
|
await engine.pluginManager.register((e) => {
|
|
8649
8781
|
ensureInteractivityPluginLoaded(e);
|
|
8650
8782
|
e.pluginManager.addInteractor?.("externalCannon", container => {
|
|
@@ -8773,7 +8905,7 @@
|
|
|
8773
8905
|
}
|
|
8774
8906
|
|
|
8775
8907
|
async function loadExternalParticleInteraction(engine) {
|
|
8776
|
-
engine.checkVersion("4.
|
|
8908
|
+
engine.checkVersion("4.4.0");
|
|
8777
8909
|
await engine.pluginManager.register((e) => {
|
|
8778
8910
|
ensureInteractivityPluginLoaded(e);
|
|
8779
8911
|
e.pluginManager.addInteractor?.("externalParticle", container => {
|
|
@@ -8821,7 +8953,7 @@
|
|
|
8821
8953
|
}
|
|
8822
8954
|
|
|
8823
8955
|
async function loadExternalPopInteraction(engine) {
|
|
8824
|
-
engine.checkVersion("4.
|
|
8956
|
+
engine.checkVersion("4.4.0");
|
|
8825
8957
|
await engine.pluginManager.register((e) => {
|
|
8826
8958
|
ensureInteractivityPluginLoaded(e);
|
|
8827
8959
|
e.pluginManager.addInteractor?.("externalPop", container => {
|
|
@@ -8862,7 +8994,7 @@
|
|
|
8862
8994
|
}
|
|
8863
8995
|
|
|
8864
8996
|
async function loadFilterEffect(engine) {
|
|
8865
|
-
engine.checkVersion("4.
|
|
8997
|
+
engine.checkVersion("4.4.0");
|
|
8866
8998
|
await engine.pluginManager.register(e => {
|
|
8867
8999
|
e.pluginManager.addEffect("filter", () => {
|
|
8868
9000
|
return Promise.resolve(new FilterDrawer());
|
|
@@ -9144,7 +9276,7 @@
|
|
|
9144
9276
|
|
|
9145
9277
|
const fractalNoisePathName = "fractalNoise";
|
|
9146
9278
|
async function loadFractalNoisePath(engine) {
|
|
9147
|
-
engine.checkVersion("4.
|
|
9279
|
+
engine.checkVersion("4.4.0");
|
|
9148
9280
|
await engine.pluginManager.register((e) => {
|
|
9149
9281
|
ensureBaseMoverLoaded(e);
|
|
9150
9282
|
e.pluginManager.addPathGenerator?.(fractalNoisePathName, container => {
|
|
@@ -9360,7 +9492,7 @@
|
|
|
9360
9492
|
}
|
|
9361
9493
|
|
|
9362
9494
|
async function loadAbsorbersInteraction(engine) {
|
|
9363
|
-
engine.checkVersion("4.
|
|
9495
|
+
engine.checkVersion("4.4.0");
|
|
9364
9496
|
await engine.pluginManager.register(async (e) => {
|
|
9365
9497
|
const pluginManager = e.pluginManager, instancesManager = await getAbsorbersInstancesManager(e);
|
|
9366
9498
|
ensureInteractivityPluginLoaded(e);
|
|
@@ -9408,7 +9540,7 @@
|
|
|
9408
9540
|
}
|
|
9409
9541
|
|
|
9410
9542
|
async function loadAbsorbersPluginSimple(engine) {
|
|
9411
|
-
engine.checkVersion("4.
|
|
9543
|
+
engine.checkVersion("4.4.0");
|
|
9412
9544
|
await engine.pluginManager.register(async (e) => {
|
|
9413
9545
|
const pluginManager = e.pluginManager, instancesManager = await getAbsorbersInstancesManager(e);
|
|
9414
9546
|
pluginManager.addPlugin(new AbsorbersPlugin(instancesManager));
|
|
@@ -9734,7 +9866,7 @@
|
|
|
9734
9866
|
}
|
|
9735
9867
|
|
|
9736
9868
|
async function loadDestroyUpdater(engine) {
|
|
9737
|
-
engine.checkVersion("4.
|
|
9869
|
+
engine.checkVersion("4.4.0");
|
|
9738
9870
|
await engine.pluginManager.register(e => {
|
|
9739
9871
|
e.pluginManager.addParticleUpdater("destroy", container => {
|
|
9740
9872
|
return Promise.resolve(new DestroyUpdater(e.pluginManager, container));
|
|
@@ -9780,7 +9912,7 @@
|
|
|
9780
9912
|
}
|
|
9781
9913
|
|
|
9782
9914
|
async function loadEmittersShapeCircle(engine) {
|
|
9783
|
-
engine.checkVersion("4.
|
|
9915
|
+
engine.checkVersion("4.4.0");
|
|
9784
9916
|
await engine.pluginManager.register((e) => {
|
|
9785
9917
|
ensureEmittersPluginLoaded(e);
|
|
9786
9918
|
e.pluginManager.addEmitterShapeGenerator?.("circle", new EmittersCircleShapeGenerator());
|
|
@@ -9861,7 +9993,7 @@
|
|
|
9861
9993
|
}
|
|
9862
9994
|
|
|
9863
9995
|
async function loadEmittersShapeSquare(engine) {
|
|
9864
|
-
engine.checkVersion("4.
|
|
9996
|
+
engine.checkVersion("4.4.0");
|
|
9865
9997
|
await engine.pluginManager.register((e) => {
|
|
9866
9998
|
ensureEmittersPluginLoaded(e);
|
|
9867
9999
|
e.pluginManager.addEmitterShapeGenerator?.("square", new EmittersSquareShapeGenerator());
|
|
@@ -10043,7 +10175,7 @@
|
|
|
10043
10175
|
}
|
|
10044
10176
|
|
|
10045
10177
|
async function loadExternalDragInteraction(engine) {
|
|
10046
|
-
engine.checkVersion("4.
|
|
10178
|
+
engine.checkVersion("4.4.0");
|
|
10047
10179
|
await engine.pluginManager.register((e) => {
|
|
10048
10180
|
ensureInteractivityPluginLoaded(e);
|
|
10049
10181
|
e.pluginManager.addInteractor?.("externalDrag", container => {
|
|
@@ -10216,7 +10348,7 @@
|
|
|
10216
10348
|
}
|
|
10217
10349
|
|
|
10218
10350
|
async function loadExternalTrailInteraction(engine) {
|
|
10219
|
-
engine.checkVersion("4.
|
|
10351
|
+
engine.checkVersion("4.4.0");
|
|
10220
10352
|
await engine.pluginManager.register((e) => {
|
|
10221
10353
|
ensureInteractivityPluginLoaded(e);
|
|
10222
10354
|
e.pluginManager.addInteractor?.("externalTrail", container => {
|
|
@@ -10352,7 +10484,7 @@
|
|
|
10352
10484
|
}
|
|
10353
10485
|
|
|
10354
10486
|
async function loadRollUpdater(engine) {
|
|
10355
|
-
engine.checkVersion("4.
|
|
10487
|
+
engine.checkVersion("4.4.0");
|
|
10356
10488
|
await engine.pluginManager.register(e => {
|
|
10357
10489
|
e.pluginManager.addParticleUpdater("roll", () => {
|
|
10358
10490
|
return Promise.resolve(new RollUpdater(e.pluginManager));
|
|
@@ -10398,7 +10530,7 @@
|
|
|
10398
10530
|
}
|
|
10399
10531
|
|
|
10400
10532
|
async function loadBlendPlugin(engine) {
|
|
10401
|
-
engine.checkVersion("4.
|
|
10533
|
+
engine.checkVersion("4.4.0");
|
|
10402
10534
|
await engine.pluginManager.register(e => {
|
|
10403
10535
|
e.pluginManager.addPlugin(new BlendPlugin());
|
|
10404
10536
|
});
|
|
@@ -10435,7 +10567,7 @@
|
|
|
10435
10567
|
}
|
|
10436
10568
|
|
|
10437
10569
|
async function loadCircleShape(engine) {
|
|
10438
|
-
engine.checkVersion("4.
|
|
10570
|
+
engine.checkVersion("4.4.0");
|
|
10439
10571
|
await engine.pluginManager.register(e => {
|
|
10440
10572
|
e.pluginManager.addShape(["circle"], () => {
|
|
10441
10573
|
return Promise.resolve(new CircleDrawer());
|
|
@@ -10483,7 +10615,7 @@
|
|
|
10483
10615
|
}
|
|
10484
10616
|
|
|
10485
10617
|
async function loadHexColorPlugin(engine) {
|
|
10486
|
-
engine.checkVersion("4.
|
|
10618
|
+
engine.checkVersion("4.4.0");
|
|
10487
10619
|
await engine.pluginManager.register(e => {
|
|
10488
10620
|
e.pluginManager.addColorManager("hex", new HexColorManager());
|
|
10489
10621
|
});
|
|
@@ -10536,7 +10668,7 @@
|
|
|
10536
10668
|
}
|
|
10537
10669
|
|
|
10538
10670
|
async function loadHslColorPlugin(engine) {
|
|
10539
|
-
engine.checkVersion("4.
|
|
10671
|
+
engine.checkVersion("4.4.0");
|
|
10540
10672
|
await engine.pluginManager.register(e => {
|
|
10541
10673
|
e.pluginManager.addColorManager("hsl", new HslColorManager());
|
|
10542
10674
|
});
|
|
@@ -10740,7 +10872,7 @@
|
|
|
10740
10872
|
}
|
|
10741
10873
|
|
|
10742
10874
|
async function loadOpacityUpdater(engine) {
|
|
10743
|
-
engine.checkVersion("4.
|
|
10875
|
+
engine.checkVersion("4.4.0");
|
|
10744
10876
|
await engine.pluginManager.register(e => {
|
|
10745
10877
|
e.pluginManager.addParticleUpdater("opacity", container => {
|
|
10746
10878
|
return Promise.resolve(new OpacityUpdater(container));
|
|
@@ -11085,7 +11217,7 @@
|
|
|
11085
11217
|
}
|
|
11086
11218
|
|
|
11087
11219
|
async function loadOutModesUpdater(engine) {
|
|
11088
|
-
engine.checkVersion("4.
|
|
11220
|
+
engine.checkVersion("4.4.0");
|
|
11089
11221
|
await engine.pluginManager.register(e => {
|
|
11090
11222
|
e.pluginManager.addParticleUpdater("outModes", container => {
|
|
11091
11223
|
return Promise.resolve(new OutOfCanvasUpdater(container));
|
|
@@ -11156,7 +11288,7 @@
|
|
|
11156
11288
|
}
|
|
11157
11289
|
|
|
11158
11290
|
async function loadPaintUpdater(engine) {
|
|
11159
|
-
engine.checkVersion("4.
|
|
11291
|
+
engine.checkVersion("4.4.0");
|
|
11160
11292
|
await engine.pluginManager.register(e => {
|
|
11161
11293
|
e.pluginManager.addParticleUpdater("paint", container => {
|
|
11162
11294
|
return Promise.resolve(new PaintUpdater(e.pluginManager, container));
|
|
@@ -11211,7 +11343,7 @@
|
|
|
11211
11343
|
}
|
|
11212
11344
|
|
|
11213
11345
|
async function loadRgbColorPlugin(engine) {
|
|
11214
|
-
engine.checkVersion("4.
|
|
11346
|
+
engine.checkVersion("4.4.0");
|
|
11215
11347
|
await engine.pluginManager.register(e => {
|
|
11216
11348
|
e.pluginManager.addColorManager("rgb", new RgbColorManager());
|
|
11217
11349
|
});
|
|
@@ -11296,7 +11428,7 @@
|
|
|
11296
11428
|
}
|
|
11297
11429
|
|
|
11298
11430
|
async function loadSizeUpdater(engine) {
|
|
11299
|
-
engine.checkVersion("4.
|
|
11431
|
+
engine.checkVersion("4.4.0");
|
|
11300
11432
|
await engine.pluginManager.register(e => {
|
|
11301
11433
|
e.pluginManager.addParticleUpdater("size", container => {
|
|
11302
11434
|
return Promise.resolve(new SizeUpdater(container));
|
|
@@ -11305,7 +11437,7 @@
|
|
|
11305
11437
|
}
|
|
11306
11438
|
|
|
11307
11439
|
async function loadBasic(engine) {
|
|
11308
|
-
engine.checkVersion("4.
|
|
11440
|
+
engine.checkVersion("4.4.0");
|
|
11309
11441
|
await engine.pluginManager.register(async (e) => {
|
|
11310
11442
|
await Promise.all([
|
|
11311
11443
|
loadBlendPlugin(e),
|
|
@@ -11328,7 +11460,7 @@
|
|
|
11328
11460
|
easingsFunctions.set("ease-in-out-quad", value => (value < 0.5 ? 2 * value ** 2 : 1 - (-2 * value + 2) ** 2 / 2));
|
|
11329
11461
|
|
|
11330
11462
|
async function loadEasingQuadPlugin(engine) {
|
|
11331
|
-
engine.checkVersion("4.
|
|
11463
|
+
engine.checkVersion("4.4.0");
|
|
11332
11464
|
await engine.pluginManager.register(e => {
|
|
11333
11465
|
for (const [easing, easingFn] of easingsFunctions) {
|
|
11334
11466
|
e.pluginManager.addEasing(easing, easingFn);
|
|
@@ -11422,7 +11554,7 @@
|
|
|
11422
11554
|
}
|
|
11423
11555
|
|
|
11424
11556
|
async function loadEmojiShape(engine) {
|
|
11425
|
-
engine.checkVersion("4.
|
|
11557
|
+
engine.checkVersion("4.4.0");
|
|
11426
11558
|
await engine.pluginManager.register(e => {
|
|
11427
11559
|
e.pluginManager.addShape(validTypes$1, () => Promise.resolve(new EmojiDrawer()));
|
|
11428
11560
|
});
|
|
@@ -11655,7 +11787,7 @@
|
|
|
11655
11787
|
};
|
|
11656
11788
|
|
|
11657
11789
|
async function loadExternalAttractInteraction(engine) {
|
|
11658
|
-
engine.checkVersion("4.
|
|
11790
|
+
engine.checkVersion("4.4.0");
|
|
11659
11791
|
await engine.pluginManager.register((e) => {
|
|
11660
11792
|
ensureInteractivityPluginLoaded(e);
|
|
11661
11793
|
e.pluginManager.addInteractor?.("externalAttract", container => {
|
|
@@ -11844,7 +11976,7 @@
|
|
|
11844
11976
|
}
|
|
11845
11977
|
|
|
11846
11978
|
async function loadExternalBounceInteraction(engine) {
|
|
11847
|
-
engine.checkVersion("4.
|
|
11979
|
+
engine.checkVersion("4.4.0");
|
|
11848
11980
|
await engine.pluginManager.register((e) => {
|
|
11849
11981
|
ensureInteractivityPluginLoaded(e);
|
|
11850
11982
|
e.pluginManager.addInteractor?.("externalBounce", container => {
|
|
@@ -12131,7 +12263,7 @@
|
|
|
12131
12263
|
mod.strokeColor = undefined;
|
|
12132
12264
|
const pColor = particle.getFillColor();
|
|
12133
12265
|
if (pColor) {
|
|
12134
|
-
const mixedColor = rgbToHsl(colorMix(pColor, mod.finalColor, ratioOffset - ratio, ratio));
|
|
12266
|
+
const mixedColor = rgbToHsl(colorMix(pColor, mod.finalColor, ratioOffset - ratio, ratio, this.container.hdr));
|
|
12135
12267
|
mod.fillColor = mixedColor;
|
|
12136
12268
|
mod.strokeColor = mixedColor;
|
|
12137
12269
|
}
|
|
@@ -12244,7 +12376,7 @@
|
|
|
12244
12376
|
}
|
|
12245
12377
|
|
|
12246
12378
|
async function loadExternalBubbleInteraction(engine) {
|
|
12247
|
-
engine.checkVersion("4.
|
|
12379
|
+
engine.checkVersion("4.4.0");
|
|
12248
12380
|
await engine.pluginManager.register((e) => {
|
|
12249
12381
|
ensureInteractivityPluginLoaded(e);
|
|
12250
12382
|
e.pluginManager.addInteractor?.("externalBubble", container => {
|
|
@@ -12283,10 +12415,10 @@
|
|
|
12283
12415
|
if (!color1 || !color2) {
|
|
12284
12416
|
return;
|
|
12285
12417
|
}
|
|
12286
|
-
const sourcePos = p1.getPosition(), destPos = p2.getPosition(), midRgb = colorMix(color1, color2, p1.getRadius(), p2.getRadius()), grad = context.createLinearGradient(sourcePos.x, sourcePos.y, destPos.x, destPos.y);
|
|
12287
|
-
grad.addColorStop(gradientMin, getStyleFromHsl(color1, container.hdr, opacity));
|
|
12288
|
-
grad.addColorStop(clamp(gradStop, gradientMin, gradientMax), getStyleFromRgb(midRgb, container.hdr, opacity));
|
|
12289
|
-
grad.addColorStop(gradientMax, getStyleFromHsl(color2, container.hdr, opacity));
|
|
12418
|
+
const sourcePos = p1.getPosition(), destPos = p2.getPosition(), midRgb = colorMix(color1, color2, p1.getRadius(), p2.getRadius(), container.hdr), grad = context.createLinearGradient(sourcePos.x, sourcePos.y, destPos.x, destPos.y);
|
|
12419
|
+
grad.addColorStop(gradientMin, getStyleFromHsl(color1, container.hdr, opacity, container.peakNits, container.hdrMode));
|
|
12420
|
+
grad.addColorStop(clamp(gradStop, gradientMin, gradientMax), getStyleFromRgb(midRgb, container.hdr, opacity, container.peakNits, container.hdrMode));
|
|
12421
|
+
grad.addColorStop(gradientMax, getStyleFromHsl(color2, container.hdr, opacity, container.peakNits, container.hdrMode));
|
|
12290
12422
|
return grad;
|
|
12291
12423
|
}
|
|
12292
12424
|
function drawConnectLine(context, width, lineStyle, begin, end) {
|
|
@@ -12372,7 +12504,7 @@
|
|
|
12372
12504
|
}
|
|
12373
12505
|
|
|
12374
12506
|
async function loadExternalConnectInteraction(engine) {
|
|
12375
|
-
engine.checkVersion("4.
|
|
12507
|
+
engine.checkVersion("4.4.0");
|
|
12376
12508
|
await engine.pluginManager.register((e) => {
|
|
12377
12509
|
ensureInteractivityPluginLoaded(e);
|
|
12378
12510
|
e.pluginManager.addInteractor?.("externalConnect", container => {
|
|
@@ -12476,7 +12608,7 @@
|
|
|
12476
12608
|
}
|
|
12477
12609
|
|
|
12478
12610
|
async function loadExternalDestroyInteraction(engine) {
|
|
12479
|
-
engine.checkVersion("4.
|
|
12611
|
+
engine.checkVersion("4.4.0");
|
|
12480
12612
|
await engine.pluginManager.register((e) => {
|
|
12481
12613
|
ensureInteractivityPluginLoaded(e);
|
|
12482
12614
|
e.pluginManager.addInteractor?.("externalDestroy", async (container) => {
|
|
@@ -12516,16 +12648,16 @@
|
|
|
12516
12648
|
}
|
|
12517
12649
|
|
|
12518
12650
|
const defaultWidth$2 = 0;
|
|
12519
|
-
function drawGrabLine(context, width, begin, end, colorLine, opacity, hdr = false) {
|
|
12651
|
+
function drawGrabLine(context, width, begin, end, colorLine, opacity, hdr = false, peakNits, mode) {
|
|
12520
12652
|
drawLine$1(context, begin, end);
|
|
12521
|
-
context.strokeStyle = getStyleFromRgb(colorLine, hdr, opacity);
|
|
12653
|
+
context.strokeStyle = getStyleFromRgb(colorLine, hdr, opacity, peakNits, mode);
|
|
12522
12654
|
context.lineWidth = width;
|
|
12523
12655
|
context.stroke();
|
|
12524
12656
|
}
|
|
12525
12657
|
function drawGrab(container, particle, lineColor, opacity, mousePos) {
|
|
12526
12658
|
container.canvas.render.draw(ctx => {
|
|
12527
12659
|
const beginPos = particle.getPosition();
|
|
12528
|
-
drawGrabLine(ctx, particle.retina.linksWidth ?? defaultWidth$2, beginPos, mousePos, lineColor, opacity, container.hdr);
|
|
12660
|
+
drawGrabLine(ctx, particle.retina.linksWidth ?? defaultWidth$2, beginPos, mousePos, lineColor, opacity, container.hdr, container.peakNits, container.hdrMode);
|
|
12529
12661
|
});
|
|
12530
12662
|
}
|
|
12531
12663
|
|
|
@@ -12581,7 +12713,7 @@
|
|
|
12581
12713
|
const linksOptions = interactivity.modes.grab.links;
|
|
12582
12714
|
container.particles.grabLineColor = getLinkRandomColor(this.#pluginManager, optColor, linksOptions.blink, linksOptions.consent);
|
|
12583
12715
|
}
|
|
12584
|
-
const colorLine = getLinkColor(particle, undefined, container.particles.grabLineColor);
|
|
12716
|
+
const colorLine = getLinkColor(particle, undefined, container.particles.grabLineColor, container.hdr);
|
|
12585
12717
|
if (!colorLine) {
|
|
12586
12718
|
continue;
|
|
12587
12719
|
}
|
|
@@ -12600,7 +12732,7 @@
|
|
|
12600
12732
|
}
|
|
12601
12733
|
|
|
12602
12734
|
async function loadExternalGrabInteraction(engine) {
|
|
12603
|
-
engine.checkVersion("4.
|
|
12735
|
+
engine.checkVersion("4.4.0");
|
|
12604
12736
|
await engine.pluginManager.register((e) => {
|
|
12605
12737
|
ensureInteractivityPluginLoaded(e);
|
|
12606
12738
|
e.pluginManager.addInteractor?.("externalGrab", container => {
|
|
@@ -12670,7 +12802,7 @@
|
|
|
12670
12802
|
}
|
|
12671
12803
|
|
|
12672
12804
|
async function loadExternalParallaxInteraction(engine) {
|
|
12673
|
-
engine.checkVersion("4.
|
|
12805
|
+
engine.checkVersion("4.4.0");
|
|
12674
12806
|
await engine.pluginManager.register((e) => {
|
|
12675
12807
|
ensureInteractivityPluginLoaded(e);
|
|
12676
12808
|
e.pluginManager.addInteractor?.("externalParallax", container => {
|
|
@@ -12713,7 +12845,7 @@
|
|
|
12713
12845
|
}
|
|
12714
12846
|
|
|
12715
12847
|
async function loadExternalPauseInteraction(engine) {
|
|
12716
|
-
engine.checkVersion("4.
|
|
12848
|
+
engine.checkVersion("4.4.0");
|
|
12717
12849
|
await engine.pluginManager.register((e) => {
|
|
12718
12850
|
ensureInteractivityPluginLoaded(e);
|
|
12719
12851
|
e.pluginManager.addInteractor?.("externalPause", container => {
|
|
@@ -12785,7 +12917,7 @@
|
|
|
12785
12917
|
}
|
|
12786
12918
|
|
|
12787
12919
|
async function loadExternalPushInteraction(engine) {
|
|
12788
|
-
engine.checkVersion("4.
|
|
12920
|
+
engine.checkVersion("4.4.0");
|
|
12789
12921
|
await engine.pluginManager.register((e) => {
|
|
12790
12922
|
ensureInteractivityPluginLoaded(e);
|
|
12791
12923
|
e.pluginManager.addInteractor?.("externalPush", container => {
|
|
@@ -12839,7 +12971,7 @@
|
|
|
12839
12971
|
}
|
|
12840
12972
|
|
|
12841
12973
|
async function loadExternalRemoveInteraction(engine) {
|
|
12842
|
-
engine.checkVersion("4.
|
|
12974
|
+
engine.checkVersion("4.4.0");
|
|
12843
12975
|
await engine.pluginManager.register((e) => {
|
|
12844
12976
|
ensureInteractivityPluginLoaded(e);
|
|
12845
12977
|
e.pluginManager.addInteractor?.("externalRemove", container => {
|
|
@@ -13145,7 +13277,7 @@
|
|
|
13145
13277
|
};
|
|
13146
13278
|
|
|
13147
13279
|
async function loadExternalRepulseInteraction(engine) {
|
|
13148
|
-
engine.checkVersion("4.
|
|
13280
|
+
engine.checkVersion("4.4.0");
|
|
13149
13281
|
await engine.pluginManager.register((e) => {
|
|
13150
13282
|
ensureInteractivityPluginLoaded(e);
|
|
13151
13283
|
const pluginManager = e.pluginManager;
|
|
@@ -13239,7 +13371,7 @@
|
|
|
13239
13371
|
}
|
|
13240
13372
|
|
|
13241
13373
|
async function loadExternalSlowInteraction(engine) {
|
|
13242
|
-
engine.checkVersion("4.
|
|
13374
|
+
engine.checkVersion("4.4.0");
|
|
13243
13375
|
await engine.pluginManager.register((e) => {
|
|
13244
13376
|
ensureInteractivityPluginLoaded(e);
|
|
13245
13377
|
e.pluginManager.addInteractor?.("externalSlow", container => {
|
|
@@ -13251,12 +13383,12 @@
|
|
|
13251
13383
|
const shapeTypes = ["image", "images"];
|
|
13252
13384
|
const stringStart = 0, defaultOpacity = 1;
|
|
13253
13385
|
const currentColorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d.]+%?\))|currentcolor/gi;
|
|
13254
|
-
function replaceColorSvg(imageShape, color, opacity, hdr = false) {
|
|
13386
|
+
function replaceColorSvg(imageShape, color, opacity, hdr = false, peakNits, mode) {
|
|
13255
13387
|
const { svgData } = imageShape;
|
|
13256
13388
|
if (!svgData) {
|
|
13257
13389
|
return "";
|
|
13258
13390
|
}
|
|
13259
|
-
const colorStyle = getStyleFromHsl(color, hdr, opacity);
|
|
13391
|
+
const colorStyle = getStyleFromHsl(color, hdr, opacity, peakNits, mode);
|
|
13260
13392
|
if (svgData.includes("fill")) {
|
|
13261
13393
|
return svgData.replaceAll(currentColorRegex, () => colorStyle);
|
|
13262
13394
|
}
|
|
@@ -13298,8 +13430,8 @@
|
|
|
13298
13430
|
}
|
|
13299
13431
|
image.loading = false;
|
|
13300
13432
|
}
|
|
13301
|
-
function replaceImageColor(image, imageData, color, particle, hdr = false) {
|
|
13302
|
-
const svgColoredData = replaceColorSvg(image, color, particle.opacity?.value ?? defaultOpacity, hdr), imageRes = {
|
|
13433
|
+
function replaceImageColor(image, imageData, color, particle, hdr = false, peakNits, mode) {
|
|
13434
|
+
const svgColoredData = replaceColorSvg(image, color, particle.opacity?.value ?? defaultOpacity, hdr, peakNits, mode), imageRes = {
|
|
13303
13435
|
color,
|
|
13304
13436
|
data: {
|
|
13305
13437
|
...image,
|
|
@@ -13411,7 +13543,7 @@
|
|
|
13411
13543
|
void (async () => {
|
|
13412
13544
|
let imageRes;
|
|
13413
13545
|
if (image.svgData && color) {
|
|
13414
|
-
imageRes = await replaceImageColor(image, imageData, color, particle, container.hdr);
|
|
13546
|
+
imageRes = await replaceImageColor(image, imageData, color, particle, container.hdr, container.peakNits, container.hdrMode);
|
|
13415
13547
|
}
|
|
13416
13548
|
else {
|
|
13417
13549
|
imageRes = {
|
|
@@ -13548,7 +13680,7 @@
|
|
|
13548
13680
|
};
|
|
13549
13681
|
}
|
|
13550
13682
|
async function loadImageShape(engine) {
|
|
13551
|
-
engine.checkVersion("4.
|
|
13683
|
+
engine.checkVersion("4.4.0");
|
|
13552
13684
|
await engine.pluginManager.register(e => {
|
|
13553
13685
|
addLoadImageToEngine(e);
|
|
13554
13686
|
e.pluginManager.addPlugin(new ImagePreloaderPlugin(e));
|
|
@@ -13693,7 +13825,7 @@
|
|
|
13693
13825
|
}
|
|
13694
13826
|
|
|
13695
13827
|
async function loadLifeUpdater(engine) {
|
|
13696
|
-
engine.checkVersion("4.
|
|
13828
|
+
engine.checkVersion("4.4.0");
|
|
13697
13829
|
await engine.pluginManager.register(e => {
|
|
13698
13830
|
e.pluginManager.addParticleUpdater("life", container => {
|
|
13699
13831
|
return Promise.resolve(new LifeUpdater(container));
|
|
@@ -13719,7 +13851,7 @@
|
|
|
13719
13851
|
}
|
|
13720
13852
|
|
|
13721
13853
|
async function loadLineShape(engine) {
|
|
13722
|
-
engine.checkVersion("4.
|
|
13854
|
+
engine.checkVersion("4.4.0");
|
|
13723
13855
|
await engine.pluginManager.register(e => {
|
|
13724
13856
|
e.pluginManager.addShape(["line"], () => Promise.resolve(new LineDrawer()));
|
|
13725
13857
|
});
|
|
@@ -13803,7 +13935,7 @@
|
|
|
13803
13935
|
}
|
|
13804
13936
|
|
|
13805
13937
|
async function loadParticlesAttractInteraction(engine) {
|
|
13806
|
-
engine.checkVersion("4.
|
|
13938
|
+
engine.checkVersion("4.4.0");
|
|
13807
13939
|
await engine.pluginManager.register((e) => {
|
|
13808
13940
|
ensureInteractivityPluginLoaded(e);
|
|
13809
13941
|
e.pluginManager.addInteractor?.("particlesAttract", container => {
|
|
@@ -14013,7 +14145,7 @@
|
|
|
14013
14145
|
}
|
|
14014
14146
|
|
|
14015
14147
|
async function loadParticlesCollisionsInteraction(engine) {
|
|
14016
|
-
engine.checkVersion("4.
|
|
14148
|
+
engine.checkVersion("4.4.0");
|
|
14017
14149
|
await engine.pluginManager.register((e) => {
|
|
14018
14150
|
ensureInteractivityPluginLoaded(e);
|
|
14019
14151
|
e.pluginManager.addPlugin(new OverlapPlugin());
|
|
@@ -14226,7 +14358,7 @@
|
|
|
14226
14358
|
const linkColor = linksOptions.id !== undefined
|
|
14227
14359
|
? container.particles.linksColors.get(linksOptions.id)
|
|
14228
14360
|
: container.particles.linksColor;
|
|
14229
|
-
return getLinkColor(p1, p2, linkColor);
|
|
14361
|
+
return getLinkColor(p1, p2, linkColor, container.hdr);
|
|
14230
14362
|
}
|
|
14231
14363
|
#setColor(p1) {
|
|
14232
14364
|
if (!p1.options.links) {
|
|
@@ -14267,7 +14399,7 @@
|
|
|
14267
14399
|
}
|
|
14268
14400
|
|
|
14269
14401
|
async function loadParticlesLinksInteraction(engine) {
|
|
14270
|
-
engine.checkVersion("4.
|
|
14402
|
+
engine.checkVersion("4.4.0");
|
|
14271
14403
|
await engine.pluginManager.register((e) => {
|
|
14272
14404
|
const pluginManager = e.pluginManager;
|
|
14273
14405
|
ensureInteractivityPluginLoaded(e);
|
|
@@ -14357,19 +14489,19 @@
|
|
|
14357
14489
|
}
|
|
14358
14490
|
|
|
14359
14491
|
async function loadGenericPolygonShape(engine) {
|
|
14360
|
-
engine.checkVersion("4.
|
|
14492
|
+
engine.checkVersion("4.4.0");
|
|
14361
14493
|
await engine.pluginManager.register(e => {
|
|
14362
14494
|
e.pluginManager.addShape(["polygon"], () => Promise.resolve(new PolygonDrawer()));
|
|
14363
14495
|
});
|
|
14364
14496
|
}
|
|
14365
14497
|
async function loadTriangleShape(engine) {
|
|
14366
|
-
engine.checkVersion("4.
|
|
14498
|
+
engine.checkVersion("4.4.0");
|
|
14367
14499
|
await engine.pluginManager.register(e => {
|
|
14368
14500
|
e.pluginManager.addShape(["triangle"], () => Promise.resolve(new TriangleDrawer()));
|
|
14369
14501
|
});
|
|
14370
14502
|
}
|
|
14371
14503
|
async function loadPolygonShape(engine) {
|
|
14372
|
-
engine.checkVersion("4.
|
|
14504
|
+
engine.checkVersion("4.4.0");
|
|
14373
14505
|
await Promise.all([
|
|
14374
14506
|
loadGenericPolygonShape(engine),
|
|
14375
14507
|
loadTriangleShape(engine),
|
|
@@ -14474,7 +14606,7 @@
|
|
|
14474
14606
|
}
|
|
14475
14607
|
|
|
14476
14608
|
async function loadRotateUpdater(engine) {
|
|
14477
|
-
engine.checkVersion("4.
|
|
14609
|
+
engine.checkVersion("4.4.0");
|
|
14478
14610
|
await engine.pluginManager.register(e => {
|
|
14479
14611
|
e.pluginManager.addParticleUpdater("rotate", container => {
|
|
14480
14612
|
return Promise.resolve(new RotateUpdater(container));
|
|
@@ -14498,7 +14630,7 @@
|
|
|
14498
14630
|
}
|
|
14499
14631
|
|
|
14500
14632
|
async function loadSquareShape(engine) {
|
|
14501
|
-
engine.checkVersion("4.
|
|
14633
|
+
engine.checkVersion("4.4.0");
|
|
14502
14634
|
await engine.pluginManager.register(e => {
|
|
14503
14635
|
e.pluginManager.addShape(["edge", "square"], () => Promise.resolve(new SquareDrawer()));
|
|
14504
14636
|
});
|
|
@@ -14532,14 +14664,14 @@
|
|
|
14532
14664
|
}
|
|
14533
14665
|
|
|
14534
14666
|
async function loadStarShape(engine) {
|
|
14535
|
-
engine.checkVersion("4.
|
|
14667
|
+
engine.checkVersion("4.4.0");
|
|
14536
14668
|
await engine.pluginManager.register(e => {
|
|
14537
14669
|
e.pluginManager.addShape(["star"], () => Promise.resolve(new StarDrawer()));
|
|
14538
14670
|
});
|
|
14539
14671
|
}
|
|
14540
14672
|
|
|
14541
14673
|
async function loadSlim(engine) {
|
|
14542
|
-
engine.checkVersion("4.
|
|
14674
|
+
engine.checkVersion("4.4.0");
|
|
14543
14675
|
await engine.pluginManager.register(async (e) => {
|
|
14544
14676
|
const loadInteractivityForSlim = async (e) => {
|
|
14545
14677
|
await loadInteractivityPlugin(e);
|
|
@@ -14656,7 +14788,7 @@
|
|
|
14656
14788
|
}
|
|
14657
14789
|
|
|
14658
14790
|
async function loadTextShape(engine) {
|
|
14659
|
-
engine.checkVersion("4.
|
|
14791
|
+
engine.checkVersion("4.4.0");
|
|
14660
14792
|
await engine.pluginManager.register(e => {
|
|
14661
14793
|
e.pluginManager.addShape(validTypes, () => Promise.resolve(new TextDrawer()));
|
|
14662
14794
|
});
|
|
@@ -14765,7 +14897,7 @@
|
|
|
14765
14897
|
}
|
|
14766
14898
|
|
|
14767
14899
|
async function loadTiltUpdater(engine) {
|
|
14768
|
-
engine.checkVersion("4.
|
|
14900
|
+
engine.checkVersion("4.4.0");
|
|
14769
14901
|
await engine.pluginManager.register(e => {
|
|
14770
14902
|
e.pluginManager.addParticleUpdater("tilt", container => {
|
|
14771
14903
|
return Promise.resolve(new TiltUpdater(container));
|
|
@@ -14841,12 +14973,12 @@
|
|
|
14841
14973
|
if (!twinkleFillRgb) {
|
|
14842
14974
|
return undefined;
|
|
14843
14975
|
}
|
|
14844
|
-
return getStyleFromHsl(twinkleFillRgb, container.hdr, twinklingOpacity);
|
|
14976
|
+
return getStyleFromHsl(twinkleFillRgb, container.hdr, twinklingOpacity, container.peakNits, container.hdrMode);
|
|
14845
14977
|
}, getTwinkleStrokeStyle = () => {
|
|
14846
14978
|
if (!twinkleStrokeRgb) {
|
|
14847
14979
|
return undefined;
|
|
14848
14980
|
}
|
|
14849
|
-
return getStyleFromHsl(twinkleStrokeRgb, container.hdr, twinklingOpacity);
|
|
14981
|
+
return getStyleFromHsl(twinkleStrokeRgb, container.hdr, twinklingOpacity, container.peakNits, container.hdrMode);
|
|
14850
14982
|
}, twinkleFillStyle = getTwinkleFillStyle(), twinkleStrokeStyle = getTwinkleStrokeStyle(), res = {}, needsTwinkle = twinkling && (!!twinkleFillStyle || !!twinkleStrokeStyle);
|
|
14851
14983
|
res.fill = needsTwinkle ? twinkleFillStyle : undefined;
|
|
14852
14984
|
res.stroke = needsTwinkle ? twinkleStrokeStyle : undefined;
|
|
@@ -14869,7 +15001,7 @@
|
|
|
14869
15001
|
}
|
|
14870
15002
|
|
|
14871
15003
|
async function loadTwinkleUpdater(engine) {
|
|
14872
|
-
engine.checkVersion("4.
|
|
15004
|
+
engine.checkVersion("4.4.0");
|
|
14873
15005
|
await engine.pluginManager.register(e => {
|
|
14874
15006
|
e.pluginManager.addParticleUpdater("twinkle", container => {
|
|
14875
15007
|
return Promise.resolve(new TwinkleUpdater(e.pluginManager, container));
|
|
@@ -14971,7 +15103,7 @@
|
|
|
14971
15103
|
}
|
|
14972
15104
|
|
|
14973
15105
|
async function loadWobbleUpdater(engine) {
|
|
14974
|
-
engine.checkVersion("4.
|
|
15106
|
+
engine.checkVersion("4.4.0");
|
|
14975
15107
|
await engine.pluginManager.register(e => {
|
|
14976
15108
|
e.pluginManager.addParticleUpdater("wobble", container => {
|
|
14977
15109
|
return Promise.resolve(new WobbleUpdater(container));
|
|
@@ -14980,7 +15112,7 @@
|
|
|
14980
15112
|
}
|
|
14981
15113
|
|
|
14982
15114
|
async function loadFull(engine) {
|
|
14983
|
-
engine.checkVersion("4.
|
|
15115
|
+
engine.checkVersion("4.4.0");
|
|
14984
15116
|
await engine.pluginManager.register(async (e) => {
|
|
14985
15117
|
const loadEmittersPluginBundle = async (e) => {
|
|
14986
15118
|
await loadEmittersPlugin(e);
|
|
@@ -15532,7 +15664,7 @@
|
|
|
15532
15664
|
}
|
|
15533
15665
|
|
|
15534
15666
|
async function loadGifShape(engine) {
|
|
15535
|
-
engine.checkVersion("4.
|
|
15667
|
+
engine.checkVersion("4.4.0");
|
|
15536
15668
|
await engine.pluginManager.register(e => {
|
|
15537
15669
|
e.pluginManager.addShape(["gif", "gifs"], container => Promise.resolve(new GifDrawer(container)));
|
|
15538
15670
|
});
|
|
@@ -15655,7 +15787,7 @@
|
|
|
15655
15787
|
}
|
|
15656
15788
|
updateAnimation(particle, gradient.angle, false, exports.DestroyType.none, delta);
|
|
15657
15789
|
for (const color of gradient.colors) {
|
|
15658
|
-
updateColor(color.value, delta
|
|
15790
|
+
updateColor(color.value, delta);
|
|
15659
15791
|
if (color.opacity) {
|
|
15660
15792
|
updateAnimation(particle, color.opacity, true, exports.DestroyType.none, delta);
|
|
15661
15793
|
}
|
|
@@ -15683,7 +15815,7 @@
|
|
|
15683
15815
|
s: value.s.value,
|
|
15684
15816
|
l: value.l.value,
|
|
15685
15817
|
};
|
|
15686
|
-
fillGradient.addColorStop(stop, getStyleFromHsl(hsl, container.hdr, cOpacity?.value ?? opacity));
|
|
15818
|
+
fillGradient.addColorStop(stop, getStyleFromHsl(hsl, container.hdr, cOpacity?.value ?? opacity, container.peakNits, container.hdrMode));
|
|
15687
15819
|
}
|
|
15688
15820
|
return { fill: fillGradient };
|
|
15689
15821
|
}
|
|
@@ -15792,7 +15924,7 @@
|
|
|
15792
15924
|
}
|
|
15793
15925
|
|
|
15794
15926
|
async function loadGradientUpdater(engine) {
|
|
15795
|
-
engine.checkVersion("4.
|
|
15927
|
+
engine.checkVersion("4.4.0");
|
|
15796
15928
|
await engine.pluginManager.register(e => {
|
|
15797
15929
|
e.pluginManager.addParticleUpdater("gradient", container => {
|
|
15798
15930
|
return Promise.resolve(new GradientUpdater(e.pluginManager, container));
|
|
@@ -15912,7 +16044,7 @@
|
|
|
15912
16044
|
|
|
15913
16045
|
const gridPathName = "gridPathGenerator";
|
|
15914
16046
|
async function loadGridPath(engine) {
|
|
15915
|
-
engine.checkVersion("4.
|
|
16047
|
+
engine.checkVersion("4.4.0");
|
|
15916
16048
|
await engine.pluginManager.register((e) => {
|
|
15917
16049
|
ensureBaseMoverLoaded(e);
|
|
15918
16050
|
e.pluginManager.addPathGenerator?.(gridPathName, container => {
|
|
@@ -15941,7 +16073,7 @@
|
|
|
15941
16073
|
}
|
|
15942
16074
|
|
|
15943
16075
|
async function loadHeartShape(engine) {
|
|
15944
|
-
engine.checkVersion("4.
|
|
16076
|
+
engine.checkVersion("4.4.0");
|
|
15945
16077
|
await engine.pluginManager.register(e => {
|
|
15946
16078
|
e.pluginManager.addShape(["heart"], () => Promise.resolve(new HeartDrawer()));
|
|
15947
16079
|
});
|
|
@@ -16057,7 +16189,7 @@
|
|
|
16057
16189
|
}
|
|
16058
16190
|
|
|
16059
16191
|
async function loadHsvColorPlugin(engine) {
|
|
16060
|
-
engine.checkVersion("4.
|
|
16192
|
+
engine.checkVersion("4.4.0");
|
|
16061
16193
|
await engine.pluginManager.register(e => {
|
|
16062
16194
|
e.pluginManager.addColorManager("hsv", new HsvColorManager());
|
|
16063
16195
|
});
|
|
@@ -16142,7 +16274,7 @@
|
|
|
16142
16274
|
}
|
|
16143
16275
|
|
|
16144
16276
|
async function loadHwbColorPlugin(engine) {
|
|
16145
|
-
engine.checkVersion("4.
|
|
16277
|
+
engine.checkVersion("4.4.0");
|
|
16146
16278
|
await engine.pluginManager.register(e => {
|
|
16147
16279
|
e.pluginManager.addColorManager("hwb", new HwbColorManager());
|
|
16148
16280
|
});
|
|
@@ -16290,7 +16422,7 @@
|
|
|
16290
16422
|
}
|
|
16291
16423
|
|
|
16292
16424
|
async function loadInfectionPlugin(engine) {
|
|
16293
|
-
engine.checkVersion("4.
|
|
16425
|
+
engine.checkVersion("4.4.0");
|
|
16294
16426
|
await engine.pluginManager.register((e) => {
|
|
16295
16427
|
ensureInteractivityPluginLoaded(e);
|
|
16296
16428
|
e.pluginManager.addPlugin(new InfectionPlugin());
|
|
@@ -16316,7 +16448,7 @@
|
|
|
16316
16448
|
}
|
|
16317
16449
|
|
|
16318
16450
|
async function loadInfinityShape(engine) {
|
|
16319
|
-
engine.checkVersion("4.
|
|
16451
|
+
engine.checkVersion("4.4.0");
|
|
16320
16452
|
await engine.pluginManager.register(e => {
|
|
16321
16453
|
e.pluginManager.addShape(["infinity"], () => Promise.resolve(new InfinityDrawer()));
|
|
16322
16454
|
});
|
|
@@ -16417,7 +16549,7 @@
|
|
|
16417
16549
|
}
|
|
16418
16550
|
|
|
16419
16551
|
async function loadLabColorPlugin(engine) {
|
|
16420
|
-
engine.checkVersion("4.
|
|
16552
|
+
engine.checkVersion("4.4.0");
|
|
16421
16553
|
await engine.pluginManager.register(e => {
|
|
16422
16554
|
e.pluginManager.addColorManager("lab", new LabColorManager());
|
|
16423
16555
|
});
|
|
@@ -16518,7 +16650,7 @@
|
|
|
16518
16650
|
}
|
|
16519
16651
|
|
|
16520
16652
|
async function loadLchColorPlugin(engine) {
|
|
16521
|
-
engine.checkVersion("4.
|
|
16653
|
+
engine.checkVersion("4.4.0");
|
|
16522
16654
|
await engine.pluginManager.register(e => {
|
|
16523
16655
|
e.pluginManager.addColorManager("lch", new LchColorManager());
|
|
16524
16656
|
});
|
|
@@ -16572,7 +16704,7 @@
|
|
|
16572
16704
|
|
|
16573
16705
|
const levyPathName = "levyPathGenerator";
|
|
16574
16706
|
async function loadLevyPath(engine) {
|
|
16575
|
-
engine.checkVersion("4.
|
|
16707
|
+
engine.checkVersion("4.4.0");
|
|
16576
16708
|
await engine.pluginManager.register((e) => {
|
|
16577
16709
|
ensureBaseMoverLoaded(e);
|
|
16578
16710
|
e.pluginManager.addPathGenerator?.(levyPathName, container => {
|
|
@@ -16597,8 +16729,8 @@
|
|
|
16597
16729
|
if (!gradientRgb?.start || !gradientRgb.stop) {
|
|
16598
16730
|
return;
|
|
16599
16731
|
}
|
|
16600
|
-
gradientAmbientLight.addColorStop(gradientPos.min, getStyleFromRgb(gradientRgb.start, container.hdr));
|
|
16601
|
-
gradientAmbientLight.addColorStop(gradientPos.max, getStyleFromRgb(gradientRgb.stop, container.hdr));
|
|
16732
|
+
gradientAmbientLight.addColorStop(gradientPos.min, getStyleFromRgb(gradientRgb.start, container.hdr, undefined, container.peakNits, container.hdrMode));
|
|
16733
|
+
gradientAmbientLight.addColorStop(gradientPos.max, getStyleFromRgb(gradientRgb.stop, container.hdr, undefined, container.peakNits, container.hdrMode));
|
|
16602
16734
|
context.fillStyle = gradientAmbientLight;
|
|
16603
16735
|
context.fill();
|
|
16604
16736
|
}
|
|
@@ -16629,7 +16761,7 @@
|
|
|
16629
16761
|
start: dot,
|
|
16630
16762
|
});
|
|
16631
16763
|
}
|
|
16632
|
-
const shadowColor = getStyleFromRgb(shadowRgb, container.hdr), lastOffset = 1, firstPos = 0, last = points.length - lastOffset;
|
|
16764
|
+
const shadowColor = getStyleFromRgb(shadowRgb, container.hdr, undefined, container.peakNits, container.hdrMode), lastOffset = 1, firstPos = 0, last = points.length - lastOffset;
|
|
16633
16765
|
for (let i = last, n = 0; i >= firstPos; n = i--) {
|
|
16634
16766
|
context.beginPath();
|
|
16635
16767
|
const iPoint = points[i], nPoint = points[n];
|
|
@@ -16788,7 +16920,7 @@
|
|
|
16788
16920
|
}
|
|
16789
16921
|
|
|
16790
16922
|
async function loadLightInteraction(engine) {
|
|
16791
|
-
engine.checkVersion("4.
|
|
16923
|
+
engine.checkVersion("4.4.0");
|
|
16792
16924
|
await engine.pluginManager.register((e) => {
|
|
16793
16925
|
ensureInteractivityPluginLoaded(e);
|
|
16794
16926
|
e.pluginManager.addInteractor?.("externalLight", container => {
|
|
@@ -16846,7 +16978,7 @@
|
|
|
16846
16978
|
}
|
|
16847
16979
|
|
|
16848
16980
|
async function loadManualParticlesPlugin(engine) {
|
|
16849
|
-
engine.checkVersion("4.
|
|
16981
|
+
engine.checkVersion("4.4.0");
|
|
16850
16982
|
await engine.pluginManager.register(e => {
|
|
16851
16983
|
e.pluginManager.addPlugin(new ManualParticlesPlugin());
|
|
16852
16984
|
});
|
|
@@ -17067,7 +17199,7 @@
|
|
|
17067
17199
|
}
|
|
17068
17200
|
|
|
17069
17201
|
async function loadMatrixShape(engine) {
|
|
17070
|
-
engine.checkVersion("4.
|
|
17202
|
+
engine.checkVersion("4.4.0");
|
|
17071
17203
|
await engine.pluginManager.register(e => {
|
|
17072
17204
|
e.pluginManager.addShape(["matrix"], () => Promise.resolve(new MatrixDrawer()));
|
|
17073
17205
|
});
|
|
@@ -17119,7 +17251,7 @@
|
|
|
17119
17251
|
}
|
|
17120
17252
|
|
|
17121
17253
|
async function loadMotionPlugin(engine) {
|
|
17122
|
-
engine.checkVersion("4.
|
|
17254
|
+
engine.checkVersion("4.4.0");
|
|
17123
17255
|
await engine.pluginManager.register(e => {
|
|
17124
17256
|
e.pluginManager.addPlugin(new MotionPlugin());
|
|
17125
17257
|
});
|
|
@@ -17302,7 +17434,7 @@
|
|
|
17302
17434
|
}
|
|
17303
17435
|
|
|
17304
17436
|
async function loadNamedColorPlugin(engine) {
|
|
17305
|
-
engine.checkVersion("4.
|
|
17437
|
+
engine.checkVersion("4.4.0");
|
|
17306
17438
|
await engine.pluginManager.register(e => {
|
|
17307
17439
|
e.pluginManager.addColorManager("named", new NamedColorManager());
|
|
17308
17440
|
});
|
|
@@ -17398,7 +17530,7 @@
|
|
|
17398
17530
|
}
|
|
17399
17531
|
|
|
17400
17532
|
async function loadOklabColorPlugin(engine) {
|
|
17401
|
-
engine.checkVersion("4.
|
|
17533
|
+
engine.checkVersion("4.4.0");
|
|
17402
17534
|
await engine.pluginManager.register(e => {
|
|
17403
17535
|
e.pluginManager.addColorManager("oklab", new OklabColorManager());
|
|
17404
17536
|
});
|
|
@@ -17494,7 +17626,7 @@
|
|
|
17494
17626
|
}
|
|
17495
17627
|
|
|
17496
17628
|
async function loadOklchColorPlugin(engine) {
|
|
17497
|
-
engine.checkVersion("4.
|
|
17629
|
+
engine.checkVersion("4.4.0");
|
|
17498
17630
|
await engine.pluginManager.register(e => {
|
|
17499
17631
|
e.pluginManager.addColorManager("oklch", new OklchColorManager());
|
|
17500
17632
|
});
|
|
@@ -17547,7 +17679,7 @@
|
|
|
17547
17679
|
}
|
|
17548
17680
|
const pos = particle.getPosition();
|
|
17549
17681
|
if (fillColorValue) {
|
|
17550
|
-
context.strokeStyle = getStyleFromHsl(fillColorValue, container.hdr, opacity);
|
|
17682
|
+
context.strokeStyle = getStyleFromHsl(fillColorValue, container.hdr, opacity, container.peakNits, container.hdrMode);
|
|
17551
17683
|
}
|
|
17552
17684
|
context.lineWidth = width;
|
|
17553
17685
|
const rotationRadian = degToRad(rotation);
|
|
@@ -17629,7 +17761,7 @@
|
|
|
17629
17761
|
}
|
|
17630
17762
|
|
|
17631
17763
|
async function loadOrbitUpdater(engine) {
|
|
17632
|
-
engine.checkVersion("4.
|
|
17764
|
+
engine.checkVersion("4.4.0");
|
|
17633
17765
|
await engine.pluginManager.register(e => {
|
|
17634
17766
|
e.pluginManager.addParticleUpdater("orbit", container => {
|
|
17635
17767
|
return Promise.resolve(new OrbitUpdater(e.pluginManager, container));
|
|
@@ -17669,7 +17801,7 @@
|
|
|
17669
17801
|
}
|
|
17670
17802
|
|
|
17671
17803
|
async function loadParticlesEffect(engine) {
|
|
17672
|
-
engine.checkVersion("4.
|
|
17804
|
+
engine.checkVersion("4.4.0");
|
|
17673
17805
|
await engine.pluginManager.register(e => {
|
|
17674
17806
|
e.pluginManager.addEffect("particles", container => {
|
|
17675
17807
|
return Promise.resolve(new ParticlesDrawer(container));
|
|
@@ -17761,7 +17893,7 @@
|
|
|
17761
17893
|
}
|
|
17762
17894
|
|
|
17763
17895
|
async function loadParticlesRepulseInteraction(engine) {
|
|
17764
|
-
engine.checkVersion("4.
|
|
17896
|
+
engine.checkVersion("4.4.0");
|
|
17765
17897
|
await engine.pluginManager.register((e) => {
|
|
17766
17898
|
ensureInteractivityPluginLoaded(e);
|
|
17767
17899
|
e.pluginManager.addInteractor?.("particlesRepulse", container => {
|
|
@@ -17788,7 +17920,7 @@
|
|
|
17788
17920
|
}
|
|
17789
17921
|
|
|
17790
17922
|
async function loadPathShape(engine) {
|
|
17791
|
-
engine.checkVersion("4.
|
|
17923
|
+
engine.checkVersion("4.4.0");
|
|
17792
17924
|
await engine.pluginManager.register(e => {
|
|
17793
17925
|
e.pluginManager.addShape(["path"], () => Promise.resolve(new PathDrawer()));
|
|
17794
17926
|
});
|
|
@@ -18192,7 +18324,7 @@
|
|
|
18192
18324
|
|
|
18193
18325
|
const perlinNoisePathName = "perlinNoise";
|
|
18194
18326
|
async function loadPerlinNoisePath(engine) {
|
|
18195
|
-
engine.checkVersion("4.
|
|
18327
|
+
engine.checkVersion("4.4.0");
|
|
18196
18328
|
await engine.pluginManager.register((e) => {
|
|
18197
18329
|
ensureBaseMoverLoaded(e);
|
|
18198
18330
|
e.pluginManager.addPathGenerator?.(perlinNoisePathName, container => {
|
|
@@ -18240,7 +18372,7 @@
|
|
|
18240
18372
|
}
|
|
18241
18373
|
|
|
18242
18374
|
async function loadPoissonDiscPlugin(engine) {
|
|
18243
|
-
engine.checkVersion("4.
|
|
18375
|
+
engine.checkVersion("4.4.0");
|
|
18244
18376
|
await engine.pluginManager.register(e => {
|
|
18245
18377
|
e.pluginManager.addPlugin(new PoissonDiscPlugin());
|
|
18246
18378
|
});
|
|
@@ -18427,7 +18559,7 @@
|
|
|
18427
18559
|
}
|
|
18428
18560
|
|
|
18429
18561
|
async function loadPolygonMaskPlugin(engine) {
|
|
18430
|
-
engine.checkVersion("4.
|
|
18562
|
+
engine.checkVersion("4.4.0");
|
|
18431
18563
|
await engine.pluginManager.register(e => {
|
|
18432
18564
|
e.pluginManager.addPlugin(new PolygonMaskPlugin(e.pluginManager));
|
|
18433
18565
|
});
|
|
@@ -18493,7 +18625,7 @@
|
|
|
18493
18625
|
|
|
18494
18626
|
const polygonPathName = "polygonPathGenerator";
|
|
18495
18627
|
async function loadPolygonPath(engine) {
|
|
18496
|
-
engine.checkVersion("4.
|
|
18628
|
+
engine.checkVersion("4.4.0");
|
|
18497
18629
|
await engine.pluginManager.register((e) => {
|
|
18498
18630
|
ensureBaseMoverLoaded(e);
|
|
18499
18631
|
e.pluginManager.addPathGenerator?.(polygonPathName, container => {
|
|
@@ -18523,7 +18655,7 @@
|
|
|
18523
18655
|
|
|
18524
18656
|
const randomPathName = "randomPathGenerator";
|
|
18525
18657
|
async function loadRandomPath(engine) {
|
|
18526
|
-
engine.checkVersion("4.
|
|
18658
|
+
engine.checkVersion("4.4.0");
|
|
18527
18659
|
await engine.pluginManager.register((e) => {
|
|
18528
18660
|
ensureBaseMoverLoaded(e);
|
|
18529
18661
|
e.pluginManager.addPathGenerator?.(randomPathName, () => {
|
|
@@ -18603,7 +18735,7 @@
|
|
|
18603
18735
|
}
|
|
18604
18736
|
|
|
18605
18737
|
async function loadResponsivePlugin(engine) {
|
|
18606
|
-
engine.checkVersion("4.
|
|
18738
|
+
engine.checkVersion("4.4.0");
|
|
18607
18739
|
await engine.pluginManager.register(e => {
|
|
18608
18740
|
e.pluginManager.addPlugin(new ResponsivePlugin());
|
|
18609
18741
|
});
|
|
@@ -18811,12 +18943,7 @@
|
|
|
18811
18943
|
context.fill();
|
|
18812
18944
|
}
|
|
18813
18945
|
}
|
|
18814
|
-
function
|
|
18815
|
-
const { context, particle, radius } = data, points = particle.ribbonPoints, offsets = particle.ribbonOffsets, bounds = particle.ribbonBounds, hasFill = data.fill, hasStroke = data.stroke;
|
|
18816
|
-
if (!points || !offsets || !bounds || points.length < minPointCount || (!hasFill && !hasStroke)) {
|
|
18817
|
-
return;
|
|
18818
|
-
}
|
|
18819
|
-
const drawOffsets = offsets.mult(radius), center = particle.position, frontFill = typeof context.fillStyle === "string" ? context.fillStyle : "", frontStroke = typeof context.strokeStyle === "string" ? context.strokeStyle : "", shapeData = particle.shapeData;
|
|
18946
|
+
function resolveBackFill(hasStroke, frontFill, frontStroke, shapeData, particle, hdr, peakNits, mode) {
|
|
18820
18947
|
let backFill = hasStroke ? frontStroke : frontFill;
|
|
18821
18948
|
if (shapeData?.backColor) {
|
|
18822
18949
|
backFill = shapeData.backColor;
|
|
@@ -18825,16 +18952,68 @@
|
|
|
18825
18952
|
const frontHsl = getHslFromAnimation(particle.fillColor);
|
|
18826
18953
|
if (frontHsl) {
|
|
18827
18954
|
const altered = alterHsl(frontHsl, exports.AlterType.darken, getRangeValue(shapeData.darken.value));
|
|
18828
|
-
backFill = getStyleFromHsl(altered, hdr);
|
|
18955
|
+
backFill = getStyleFromHsl(altered, hdr, undefined, peakNits, mode);
|
|
18829
18956
|
}
|
|
18830
18957
|
}
|
|
18831
18958
|
else if (shapeData?.enlighten?.enable) {
|
|
18832
18959
|
const frontHsl = getHslFromAnimation(particle.fillColor);
|
|
18833
18960
|
if (frontHsl) {
|
|
18834
18961
|
const altered = alterHsl(frontHsl, exports.AlterType.enlighten, getRangeValue(shapeData.enlighten.value));
|
|
18835
|
-
backFill = getStyleFromHsl(altered, hdr);
|
|
18962
|
+
backFill = getStyleFromHsl(altered, hdr, undefined, peakNits, mode);
|
|
18836
18963
|
}
|
|
18837
18964
|
}
|
|
18965
|
+
return backFill;
|
|
18966
|
+
}
|
|
18967
|
+
function drawEdgeSegments(context, currentBase, nextBase, currentSide, nextSide, isFirst, isLast, hasFill, hasStroke) {
|
|
18968
|
+
if (isFirst) {
|
|
18969
|
+
drawPolygonSegment(context, {
|
|
18970
|
+
a: currentBase,
|
|
18971
|
+
b: nextBase,
|
|
18972
|
+
c: getMidpoint(nextBase, nextSide),
|
|
18973
|
+
fill: hasFill,
|
|
18974
|
+
stroke: hasStroke,
|
|
18975
|
+
});
|
|
18976
|
+
drawPolygonSegment(context, {
|
|
18977
|
+
a: nextSide,
|
|
18978
|
+
b: currentSide,
|
|
18979
|
+
c: getMidpoint(nextBase, nextSide),
|
|
18980
|
+
fill: hasFill,
|
|
18981
|
+
stroke: hasStroke,
|
|
18982
|
+
});
|
|
18983
|
+
}
|
|
18984
|
+
else if (isLast) {
|
|
18985
|
+
drawPolygonSegment(context, {
|
|
18986
|
+
a: currentBase,
|
|
18987
|
+
b: nextBase,
|
|
18988
|
+
c: getMidpoint(currentBase, currentSide),
|
|
18989
|
+
fill: hasFill,
|
|
18990
|
+
stroke: hasStroke,
|
|
18991
|
+
});
|
|
18992
|
+
drawPolygonSegment(context, {
|
|
18993
|
+
a: nextSide,
|
|
18994
|
+
b: currentSide,
|
|
18995
|
+
c: getMidpoint(currentBase, currentSide),
|
|
18996
|
+
fill: hasFill,
|
|
18997
|
+
stroke: hasStroke,
|
|
18998
|
+
});
|
|
18999
|
+
}
|
|
19000
|
+
else {
|
|
19001
|
+
drawPolygonSegment(context, {
|
|
19002
|
+
a: currentBase,
|
|
19003
|
+
b: nextBase,
|
|
19004
|
+
c: nextSide,
|
|
19005
|
+
d: currentSide,
|
|
19006
|
+
fill: hasFill,
|
|
19007
|
+
stroke: hasStroke,
|
|
19008
|
+
});
|
|
19009
|
+
}
|
|
19010
|
+
}
|
|
19011
|
+
function drawRibbon(data, hdr, peakNits, mode) {
|
|
19012
|
+
const { context, particle, radius } = data, points = particle.ribbonPoints, offsets = particle.ribbonOffsets, bounds = particle.ribbonBounds, hasFill = data.fill, hasStroke = data.stroke;
|
|
19013
|
+
if (!points || !offsets || !bounds || points.length < minPointCount || (!hasFill && !hasStroke)) {
|
|
19014
|
+
return;
|
|
19015
|
+
}
|
|
19016
|
+
const drawOffsets = offsets.mult(radius), center = particle.position, frontFill = typeof context.fillStyle === "string" ? context.fillStyle : "", frontStroke = typeof context.strokeStyle === "string" ? context.strokeStyle : "", shapeData = particle.shapeData, backFill = resolveBackFill(hasStroke, frontFill, frontStroke, shapeData, particle, hdr, peakNits, mode);
|
|
18838
19017
|
context.lineWidth = lineWidth;
|
|
18839
19018
|
context.lineJoin = "round";
|
|
18840
19019
|
context.lineCap = "round";
|
|
@@ -18852,46 +19031,13 @@
|
|
|
18852
19031
|
context.strokeStyle = segmentStyle;
|
|
18853
19032
|
}
|
|
18854
19033
|
if (i === noPoint) {
|
|
18855
|
-
|
|
18856
|
-
a: currentBase,
|
|
18857
|
-
b: nextBase,
|
|
18858
|
-
c: getMidpoint(nextBase, nextSide),
|
|
18859
|
-
fill: hasFill,
|
|
18860
|
-
stroke: hasStroke,
|
|
18861
|
-
});
|
|
18862
|
-
drawPolygonSegment(context, {
|
|
18863
|
-
a: nextSide,
|
|
18864
|
-
b: currentSide,
|
|
18865
|
-
c: getMidpoint(nextBase, nextSide),
|
|
18866
|
-
fill: hasFill,
|
|
18867
|
-
stroke: hasStroke,
|
|
18868
|
-
});
|
|
19034
|
+
drawEdgeSegments(context, currentBase, nextBase, currentSide, nextSide, true, false, hasFill, hasStroke);
|
|
18869
19035
|
}
|
|
18870
19036
|
else if (i === points.length - secondPoint) {
|
|
18871
|
-
|
|
18872
|
-
a: currentBase,
|
|
18873
|
-
b: nextBase,
|
|
18874
|
-
c: getMidpoint(currentBase, currentSide),
|
|
18875
|
-
fill: hasFill,
|
|
18876
|
-
stroke: hasStroke,
|
|
18877
|
-
});
|
|
18878
|
-
drawPolygonSegment(context, {
|
|
18879
|
-
a: nextSide,
|
|
18880
|
-
b: currentSide,
|
|
18881
|
-
c: getMidpoint(currentBase, currentSide),
|
|
18882
|
-
fill: hasFill,
|
|
18883
|
-
stroke: hasStroke,
|
|
18884
|
-
});
|
|
19037
|
+
drawEdgeSegments(context, currentBase, nextBase, currentSide, nextSide, false, true, hasFill, hasStroke);
|
|
18885
19038
|
}
|
|
18886
19039
|
else {
|
|
18887
|
-
|
|
18888
|
-
a: currentBase,
|
|
18889
|
-
b: nextBase,
|
|
18890
|
-
c: nextSide,
|
|
18891
|
-
d: currentSide,
|
|
18892
|
-
fill: hasFill,
|
|
18893
|
-
stroke: hasStroke,
|
|
18894
|
-
});
|
|
19040
|
+
drawEdgeSegments(context, currentBase, nextBase, currentSide, nextSide, false, false, hasFill, hasStroke);
|
|
18895
19041
|
}
|
|
18896
19042
|
}
|
|
18897
19043
|
context.fillStyle = frontFill;
|
|
@@ -18939,7 +19085,7 @@
|
|
|
18939
19085
|
createRibbonState(data.particle);
|
|
18940
19086
|
}
|
|
18941
19087
|
updateRibbon(data);
|
|
18942
|
-
drawRibbon(data, this.#container.hdr);
|
|
19088
|
+
drawRibbon(data, this.#container.hdr, this.#container.peakNits, this.#container.hdrMode);
|
|
18943
19089
|
}
|
|
18944
19090
|
getSidesCount(particle) {
|
|
18945
19091
|
const pointsLen = particle.ribbonPoints?.length;
|
|
@@ -19001,7 +19147,7 @@
|
|
|
19001
19147
|
}
|
|
19002
19148
|
|
|
19003
19149
|
async function loadRibbonShape(engine) {
|
|
19004
|
-
engine.checkVersion("4.
|
|
19150
|
+
engine.checkVersion("4.4.0");
|
|
19005
19151
|
await engine.pluginManager.register(e => {
|
|
19006
19152
|
e.pluginManager.addShape(["ribbon"], (container) => Promise.resolve(new RibbonDrawer(container)));
|
|
19007
19153
|
});
|
|
@@ -19050,7 +19196,7 @@
|
|
|
19050
19196
|
}
|
|
19051
19197
|
|
|
19052
19198
|
async function loadRoundedPolygonShape(engine) {
|
|
19053
|
-
engine.checkVersion("4.
|
|
19199
|
+
engine.checkVersion("4.4.0");
|
|
19054
19200
|
await engine.pluginManager.register(e => {
|
|
19055
19201
|
e.pluginManager.addShape(["rounded-polygon"], () => Promise.resolve(new RoundedPolygonDrawer()));
|
|
19056
19202
|
});
|
|
@@ -19097,7 +19243,7 @@
|
|
|
19097
19243
|
}
|
|
19098
19244
|
|
|
19099
19245
|
async function loadRoundedRectShape(engine) {
|
|
19100
|
-
engine.checkVersion("4.
|
|
19246
|
+
engine.checkVersion("4.4.0");
|
|
19101
19247
|
await engine.pluginManager.register(e => {
|
|
19102
19248
|
e.pluginManager.addShape(["rounded-rect"], () => Promise.resolve(new RoundedRectDrawer()));
|
|
19103
19249
|
});
|
|
@@ -19255,7 +19401,7 @@
|
|
|
19255
19401
|
|
|
19256
19402
|
const svgPathName = "svgPathGenerator";
|
|
19257
19403
|
async function loadSVGPath(engine) {
|
|
19258
|
-
engine.checkVersion("4.
|
|
19404
|
+
engine.checkVersion("4.4.0");
|
|
19259
19405
|
await engine.pluginManager.register((e) => {
|
|
19260
19406
|
ensureBaseMoverLoaded(e);
|
|
19261
19407
|
e.pluginManager.addPathGenerator?.(svgPathName, container => {
|
|
@@ -19283,7 +19429,7 @@
|
|
|
19283
19429
|
}
|
|
19284
19430
|
context.save();
|
|
19285
19431
|
context.shadowBlur = shadowParticle.shadowBlur ?? defaultShadowBlur;
|
|
19286
|
-
context.shadowColor = getStyleFromRgb(shadowColor, container.hdr);
|
|
19432
|
+
context.shadowColor = getStyleFromRgb(shadowColor, container.hdr, undefined, container.peakNits, container.hdrMode);
|
|
19287
19433
|
context.shadowOffsetX = shadowOffset?.x ?? defaultShadowOffsetValue;
|
|
19288
19434
|
context.shadowOffsetY = shadowOffset?.y ?? defaultShadowOffsetValue;
|
|
19289
19435
|
}
|
|
@@ -19296,7 +19442,7 @@
|
|
|
19296
19442
|
}
|
|
19297
19443
|
|
|
19298
19444
|
async function loadShadowEffect(engine) {
|
|
19299
|
-
engine.checkVersion("4.
|
|
19445
|
+
engine.checkVersion("4.4.0");
|
|
19300
19446
|
await engine.pluginManager.register(e => {
|
|
19301
19447
|
e.pluginManager.addEffect("shadow", container => {
|
|
19302
19448
|
return Promise.resolve(new ShadowDrawer(e.pluginManager, container));
|
|
@@ -19318,7 +19464,7 @@
|
|
|
19318
19464
|
|
|
19319
19465
|
const simplexNoisePathName = "simplexNoise";
|
|
19320
19466
|
async function loadSimplexNoisePath(engine) {
|
|
19321
|
-
engine.checkVersion("4.
|
|
19467
|
+
engine.checkVersion("4.4.0");
|
|
19322
19468
|
await engine.pluginManager.register((e) => {
|
|
19323
19469
|
ensureBaseMoverLoaded(e);
|
|
19324
19470
|
e.pluginManager.addPathGenerator?.(simplexNoisePathName, container => {
|
|
@@ -19635,7 +19781,7 @@
|
|
|
19635
19781
|
}
|
|
19636
19782
|
|
|
19637
19783
|
async function loadSoundsPlugin(engine) {
|
|
19638
|
-
engine.checkVersion("4.
|
|
19784
|
+
engine.checkVersion("4.4.0");
|
|
19639
19785
|
await engine.pluginManager.register(e => {
|
|
19640
19786
|
e.pluginManager.addPlugin(new SoundsPlugin(e));
|
|
19641
19787
|
});
|
|
@@ -19704,7 +19850,7 @@
|
|
|
19704
19850
|
|
|
19705
19851
|
const spiralPathName = "spiralPathGenerator";
|
|
19706
19852
|
async function loadSpiralPath(engine) {
|
|
19707
|
-
engine.checkVersion("4.
|
|
19853
|
+
engine.checkVersion("4.4.0");
|
|
19708
19854
|
await engine.pluginManager.register((e) => {
|
|
19709
19855
|
ensureBaseMoverLoaded(e);
|
|
19710
19856
|
e.pluginManager.addPathGenerator?.(spiralPathName, container => {
|
|
@@ -19744,7 +19890,7 @@
|
|
|
19744
19890
|
}
|
|
19745
19891
|
|
|
19746
19892
|
async function loadSpiralShape(engine) {
|
|
19747
|
-
engine.checkVersion("4.
|
|
19893
|
+
engine.checkVersion("4.4.0");
|
|
19748
19894
|
await engine.pluginManager.register(e => {
|
|
19749
19895
|
e.pluginManager.addShape(["spiral"], () => Promise.resolve(new SpiralDrawer()));
|
|
19750
19896
|
});
|
|
@@ -19788,7 +19934,7 @@
|
|
|
19788
19934
|
}
|
|
19789
19935
|
|
|
19790
19936
|
async function loadSquircleShape(engine) {
|
|
19791
|
-
engine.checkVersion("4.
|
|
19937
|
+
engine.checkVersion("4.4.0");
|
|
19792
19938
|
await engine.pluginManager.register(e => {
|
|
19793
19939
|
e.pluginManager.addShape(["squircle"], () => Promise.resolve(new SquircleDrawer()));
|
|
19794
19940
|
});
|
|
@@ -19892,7 +20038,7 @@
|
|
|
19892
20038
|
}
|
|
19893
20039
|
|
|
19894
20040
|
async function loadThemesPlugin(engine) {
|
|
19895
|
-
engine.checkVersion("4.
|
|
20041
|
+
engine.checkVersion("4.4.0");
|
|
19896
20042
|
await engine.pluginManager.register(e => {
|
|
19897
20043
|
e.pluginManager.addPlugin(new ThemesPlugin());
|
|
19898
20044
|
});
|
|
@@ -20008,7 +20154,7 @@
|
|
|
20008
20154
|
}
|
|
20009
20155
|
|
|
20010
20156
|
async function loadTrailEffect(engine) {
|
|
20011
|
-
engine.checkVersion("4.
|
|
20157
|
+
engine.checkVersion("4.4.0");
|
|
20012
20158
|
await engine.pluginManager.register(e => {
|
|
20013
20159
|
e.pluginManager.addEffect("trail", container => {
|
|
20014
20160
|
return Promise.resolve(new TrailDrawer(container));
|
|
@@ -20072,7 +20218,7 @@
|
|
|
20072
20218
|
}
|
|
20073
20219
|
|
|
20074
20220
|
async function loadTrailPlugin(engine) {
|
|
20075
|
-
engine.checkVersion("4.
|
|
20221
|
+
engine.checkVersion("4.4.0");
|
|
20076
20222
|
await engine.pluginManager.register(e => {
|
|
20077
20223
|
e.pluginManager.addPlugin(new TrailPlugin(e.pluginManager));
|
|
20078
20224
|
});
|
|
@@ -20121,7 +20267,7 @@
|
|
|
20121
20267
|
|
|
20122
20268
|
const zigZagPathName = "zigZagPathGenerator";
|
|
20123
20269
|
async function loadZigZagPath(engine) {
|
|
20124
|
-
engine.checkVersion("4.
|
|
20270
|
+
engine.checkVersion("4.4.0");
|
|
20125
20271
|
await engine.pluginManager.register((e) => {
|
|
20126
20272
|
ensureBaseMoverLoaded(e);
|
|
20127
20273
|
e.pluginManager.addPathGenerator?.(zigZagPathName, container => {
|
|
@@ -20178,14 +20324,14 @@
|
|
|
20178
20324
|
}
|
|
20179
20325
|
|
|
20180
20326
|
async function loadZoomPlugin(engine) {
|
|
20181
|
-
engine.checkVersion("4.
|
|
20327
|
+
engine.checkVersion("4.4.0");
|
|
20182
20328
|
await engine.pluginManager.register(e => {
|
|
20183
20329
|
e.pluginManager.addPlugin(new ZoomPlugin());
|
|
20184
20330
|
});
|
|
20185
20331
|
}
|
|
20186
20332
|
|
|
20187
20333
|
async function loadAll(engine) {
|
|
20188
|
-
engine.checkVersion("4.
|
|
20334
|
+
engine.checkVersion("4.4.0");
|
|
20189
20335
|
await engine.pluginManager.register(async (e) => {
|
|
20190
20336
|
const loadInteractionsForAll = async (e) => {
|
|
20191
20337
|
await loadFull(e);
|
|
@@ -20397,7 +20543,11 @@
|
|
|
20397
20543
|
if (!fColor && !sColor) {
|
|
20398
20544
|
return;
|
|
20399
20545
|
}
|
|
20400
|
-
const container = this.#container, zIndexOptions = particle.options.zIndex, zIndexFactor = zIndexFactorOffset - particle.zIndexFactor, { fillOpacity, opacity, strokeOpacity } = particle.getOpacity(), transform = this.#reusableTransform, colorStyles = this.#reusableColorStyles, fill = fColor
|
|
20546
|
+
const container = this.#container, zIndexOptions = particle.options.zIndex, zIndexFactor = zIndexFactorOffset - particle.zIndexFactor, { fillOpacity, opacity, strokeOpacity } = particle.getOpacity(), transform = this.#reusableTransform, colorStyles = this.#reusableColorStyles, fill = fColor
|
|
20547
|
+
? getStyleFromHsl(fColor, container.hdr, fillOpacity * opacity, container.peakNits, container.hdrMode)
|
|
20548
|
+
: undefined, stroke = sColor
|
|
20549
|
+
? getStyleFromHsl(sColor, container.hdr, strokeOpacity * opacity, container.peakNits, container.hdrMode)
|
|
20550
|
+
: fill;
|
|
20401
20551
|
transform.a = transform.b = transform.c = transform.d = undefined;
|
|
20402
20552
|
colorStyles.fill = fill;
|
|
20403
20553
|
colorStyles.stroke = stroke;
|
|
@@ -20731,7 +20881,9 @@
|
|
|
20731
20881
|
if (typeof background.element === "string") {
|
|
20732
20882
|
if (typeof document !== "undefined") {
|
|
20733
20883
|
const node = document.querySelector(background.element);
|
|
20734
|
-
if (
|
|
20884
|
+
if ((typeof HTMLCanvasElement !== "undefined" && node instanceof HTMLCanvasElement) ||
|
|
20885
|
+
(typeof HTMLVideoElement !== "undefined" && node instanceof HTMLVideoElement) ||
|
|
20886
|
+
(typeof HTMLImageElement !== "undefined" && node instanceof HTMLImageElement)) {
|
|
20735
20887
|
this.#backgroundElement = node;
|
|
20736
20888
|
}
|
|
20737
20889
|
else if (node) {
|
|
@@ -20742,10 +20894,10 @@
|
|
|
20742
20894
|
}
|
|
20743
20895
|
}
|
|
20744
20896
|
}
|
|
20745
|
-
else if (background.element instanceof HTMLCanvasElement ||
|
|
20746
|
-
background.element instanceof OffscreenCanvas ||
|
|
20747
|
-
background.element instanceof HTMLVideoElement ||
|
|
20748
|
-
background.element instanceof HTMLImageElement) {
|
|
20897
|
+
else if ((typeof HTMLCanvasElement !== "undefined" && background.element instanceof HTMLCanvasElement) ||
|
|
20898
|
+
(typeof OffscreenCanvas !== "undefined" && background.element instanceof OffscreenCanvas) ||
|
|
20899
|
+
(typeof HTMLVideoElement !== "undefined" && background.element instanceof HTMLVideoElement) ||
|
|
20900
|
+
(typeof HTMLImageElement !== "undefined" && background.element instanceof HTMLImageElement)) {
|
|
20749
20901
|
this.#backgroundElement = background.element;
|
|
20750
20902
|
}
|
|
20751
20903
|
}
|
|
@@ -20813,6 +20965,7 @@
|
|
|
20813
20965
|
zoom = defaultZoom;
|
|
20814
20966
|
#container;
|
|
20815
20967
|
#generated;
|
|
20968
|
+
#hdrMediaListeners;
|
|
20816
20969
|
#mutationObserver;
|
|
20817
20970
|
#originalStyle;
|
|
20818
20971
|
#pluginManager;
|
|
@@ -20877,7 +21030,6 @@
|
|
|
20877
21030
|
});
|
|
20878
21031
|
this.resize();
|
|
20879
21032
|
this.#initStyle();
|
|
20880
|
-
this.initBackground();
|
|
20881
21033
|
this.#safeMutationObserver(obs => {
|
|
20882
21034
|
const element = this.domElement;
|
|
20883
21035
|
if (!element || !(element instanceof Node)) {
|
|
@@ -20887,6 +21039,8 @@
|
|
|
20887
21039
|
});
|
|
20888
21040
|
this.initPlugins();
|
|
20889
21041
|
this.#initContext();
|
|
21042
|
+
this.initBackground();
|
|
21043
|
+
this.#initHdrListeners();
|
|
20890
21044
|
this.render.init();
|
|
20891
21045
|
}
|
|
20892
21046
|
initBackground() {
|
|
@@ -20896,7 +21050,8 @@
|
|
|
20896
21050
|
}
|
|
20897
21051
|
const elementStyle = element.style, color = rangeColorToRgb(this.#pluginManager, background.color);
|
|
20898
21052
|
if (color) {
|
|
20899
|
-
|
|
21053
|
+
const hdrOptions = container.actualOptions.hdr;
|
|
21054
|
+
elementStyle.backgroundColor = getStyleFromRgb(color, container.hdr, background.opacity, hdrOptions.peakNits, hdrOptions.mode);
|
|
20900
21055
|
}
|
|
20901
21056
|
else {
|
|
20902
21057
|
elementStyle.backgroundColor = "";
|
|
@@ -20993,6 +21148,7 @@
|
|
|
20993
21148
|
obs.disconnect();
|
|
20994
21149
|
});
|
|
20995
21150
|
this.#mutationObserver = undefined;
|
|
21151
|
+
this.#removeHdrListeners();
|
|
20996
21152
|
this.render.stop();
|
|
20997
21153
|
}
|
|
20998
21154
|
async windowResize() {
|
|
@@ -21012,9 +21168,16 @@
|
|
|
21012
21168
|
}
|
|
21013
21169
|
}
|
|
21014
21170
|
#initContext() {
|
|
21015
|
-
const container = this.#container, canSupportHdr = container.actualOptions.hdr &&
|
|
21171
|
+
const container = this.#container, canSupportHdr = container.actualOptions.hdr.enable &&
|
|
21016
21172
|
safeMatchMedia("(color-gamut: p3)")?.matches &&
|
|
21017
21173
|
safeMatchMedia("(dynamic-range: high)")?.matches;
|
|
21174
|
+
container.hdr = canSupportHdr ?? false;
|
|
21175
|
+
container.hdrMode = container.actualOptions.hdr.mode;
|
|
21176
|
+
container.peakNits = container.actualOptions.hdr.peakNits;
|
|
21177
|
+
const renderCanvas = this.renderCanvas;
|
|
21178
|
+
if (!renderCanvas) {
|
|
21179
|
+
return;
|
|
21180
|
+
}
|
|
21018
21181
|
this.render.setContextSettings({
|
|
21019
21182
|
alpha: true,
|
|
21020
21183
|
desynchronized: true,
|
|
@@ -21023,11 +21186,47 @@
|
|
|
21023
21186
|
? { colorSpace: "display-p3", colorType: "float16" }
|
|
21024
21187
|
: { colorSpace: "srgb" }),
|
|
21025
21188
|
});
|
|
21026
|
-
|
|
21027
|
-
|
|
21028
|
-
|
|
21189
|
+
let context;
|
|
21190
|
+
try {
|
|
21191
|
+
context = renderCanvas.getContext("2d", this.render.settings);
|
|
21192
|
+
}
|
|
21193
|
+
catch {
|
|
21194
|
+
context = null;
|
|
21195
|
+
}
|
|
21196
|
+
if (canSupportHdr && !context) {
|
|
21197
|
+
container.hdr = false;
|
|
21198
|
+
const sdrSettings = {
|
|
21199
|
+
alpha: true,
|
|
21200
|
+
desynchronized: true,
|
|
21201
|
+
willReadFrequently: false,
|
|
21202
|
+
colorSpace: "srgb",
|
|
21203
|
+
};
|
|
21204
|
+
this.render.setContextSettings(sdrSettings);
|
|
21205
|
+
try {
|
|
21206
|
+
context = renderCanvas.getContext("2d", sdrSettings);
|
|
21207
|
+
}
|
|
21208
|
+
catch {
|
|
21209
|
+
context = null;
|
|
21210
|
+
}
|
|
21211
|
+
}
|
|
21212
|
+
this.render.setContext(context);
|
|
21213
|
+
}
|
|
21214
|
+
#initHdrListeners() {
|
|
21215
|
+
this.#removeHdrListeners();
|
|
21216
|
+
const p3Query = safeMatchMedia("(color-gamut: p3)"), hdrQuery = safeMatchMedia("(dynamic-range: high)"), handleChange = () => {
|
|
21217
|
+
this.#recreateRenderCanvas();
|
|
21218
|
+
this.#initContext();
|
|
21219
|
+
this.initBackground();
|
|
21220
|
+
}, listeners = [];
|
|
21221
|
+
if (p3Query) {
|
|
21222
|
+
p3Query.addEventListener("change", handleChange);
|
|
21223
|
+
listeners.push({ handler: handleChange, mql: p3Query });
|
|
21029
21224
|
}
|
|
21030
|
-
|
|
21225
|
+
if (hdrQuery) {
|
|
21226
|
+
hdrQuery.addEventListener("change", handleChange);
|
|
21227
|
+
listeners.push({ handler: handleChange, mql: hdrQuery });
|
|
21228
|
+
}
|
|
21229
|
+
this.#hdrMediaListeners = listeners;
|
|
21031
21230
|
}
|
|
21032
21231
|
#initStyle() {
|
|
21033
21232
|
const element = this.domElement, options = this.#container.actualOptions;
|
|
@@ -21051,6 +21250,25 @@
|
|
|
21051
21250
|
element.style.setProperty(key, value, "important");
|
|
21052
21251
|
}
|
|
21053
21252
|
}
|
|
21253
|
+
#recreateRenderCanvas() {
|
|
21254
|
+
const renderCanvas = this.renderCanvas;
|
|
21255
|
+
if (!renderCanvas) {
|
|
21256
|
+
return;
|
|
21257
|
+
}
|
|
21258
|
+
if (this.domElement) {
|
|
21259
|
+
return;
|
|
21260
|
+
}
|
|
21261
|
+
this.renderCanvas = new OffscreenCanvas(renderCanvas.width, renderCanvas.height);
|
|
21262
|
+
}
|
|
21263
|
+
#removeHdrListeners() {
|
|
21264
|
+
if (!this.#hdrMediaListeners) {
|
|
21265
|
+
return;
|
|
21266
|
+
}
|
|
21267
|
+
for (const { handler, mql } of this.#hdrMediaListeners) {
|
|
21268
|
+
mql.removeEventListener("change", handler);
|
|
21269
|
+
}
|
|
21270
|
+
this.#hdrMediaListeners = undefined;
|
|
21271
|
+
}
|
|
21054
21272
|
#repairStyle() {
|
|
21055
21273
|
const element = this.domElement;
|
|
21056
21274
|
if (!element) {
|
|
@@ -21435,9 +21653,9 @@
|
|
|
21435
21653
|
}
|
|
21436
21654
|
getOpacity() {
|
|
21437
21655
|
const zIndexOptions = this.options.zIndex, zIndexFactor = zIndexFactorOffset - this.zIndexFactor, zOpacityFactor = zIndexFactor ** zIndexOptions.opacityRate, baseOpacity = getRangeValue(this.opacity?.value ?? defaultOpacity$3), modifierOpacity = this.#applyModifiers(undefined, m => m.opacity), opacity = modifierOpacity ?? baseOpacity, fillOpacity = this.fillOpacity ?? defaultOpacity$3, strokeOpacity = this.strokeOpacity ?? defaultOpacity$3;
|
|
21438
|
-
this.#cachedOpacityData.fillOpacity =
|
|
21656
|
+
this.#cachedOpacityData.fillOpacity = fillOpacity;
|
|
21439
21657
|
this.#cachedOpacityData.opacity = opacity * zOpacityFactor;
|
|
21440
|
-
this.#cachedOpacityData.strokeOpacity =
|
|
21658
|
+
this.#cachedOpacityData.strokeOpacity = strokeOpacity;
|
|
21441
21659
|
return this.#cachedOpacityData;
|
|
21442
21660
|
}
|
|
21443
21661
|
getPosition() {
|
|
@@ -22292,6 +22510,7 @@
|
|
|
22292
22510
|
effectDrawers;
|
|
22293
22511
|
fpsLimit;
|
|
22294
22512
|
hdr;
|
|
22513
|
+
hdrMode;
|
|
22295
22514
|
id;
|
|
22296
22515
|
pageHidden;
|
|
22297
22516
|
particleCreatedPlugins;
|
|
@@ -22299,6 +22518,7 @@
|
|
|
22299
22518
|
particlePositionPlugins;
|
|
22300
22519
|
particleUpdaters;
|
|
22301
22520
|
particles;
|
|
22521
|
+
peakNits;
|
|
22302
22522
|
plugins;
|
|
22303
22523
|
retina;
|
|
22304
22524
|
shapeDrawers;
|
|
@@ -22329,6 +22549,8 @@
|
|
|
22329
22549
|
this.id = Symbol(id);
|
|
22330
22550
|
this.fpsLimit = 120;
|
|
22331
22551
|
this.hdr = false;
|
|
22552
|
+
this.hdrMode = exports.HdrMode.standard;
|
|
22553
|
+
this.peakNits = 400;
|
|
22332
22554
|
this.#smooth = false;
|
|
22333
22555
|
this.#delay = 0;
|
|
22334
22556
|
this.#duration = 0;
|
|
@@ -22468,8 +22690,9 @@
|
|
|
22468
22690
|
this.updateActualOptions();
|
|
22469
22691
|
this.canvas.initBackground();
|
|
22470
22692
|
this.canvas.resize();
|
|
22471
|
-
const { delay, duration, fpsLimit,
|
|
22472
|
-
this.
|
|
22693
|
+
const { delay, duration, fpsLimit, smooth, zLayers } = this.actualOptions, hdrOptions = this.actualOptions.hdr;
|
|
22694
|
+
this.hdrMode = hdrOptions.mode;
|
|
22695
|
+
this.peakNits = hdrOptions.peakNits;
|
|
22473
22696
|
this.zLayers = zLayers;
|
|
22474
22697
|
this.#duration = getRangeValue(duration) * millisecondsToSeconds$1;
|
|
22475
22698
|
this.#delay = getRangeValue(delay) * millisecondsToSeconds$1;
|
|
@@ -22730,7 +22953,7 @@
|
|
|
22730
22953
|
...coverRgb,
|
|
22731
22954
|
a: cover.opacity,
|
|
22732
22955
|
};
|
|
22733
|
-
this.#coverColorStyle = getStyleFromRgb(coverColor, this.#container.hdr, coverColor.a);
|
|
22956
|
+
this.#coverColorStyle = getStyleFromRgb(coverColor, this.#container.hdr, coverColor.a, this.#container.peakNits, this.#container.hdrMode);
|
|
22734
22957
|
}
|
|
22735
22958
|
}
|
|
22736
22959
|
else if (cover?.image) {
|
|
@@ -24312,10 +24535,10 @@
|
|
|
24312
24535
|
}
|
|
24313
24536
|
}
|
|
24314
24537
|
#getCachedStyle(rgb) {
|
|
24315
|
-
const key = `${rgb.r},${rgb.g},${rgb.b}`;
|
|
24538
|
+
const key = `${rgb.r},${rgb.g},${rgb.b}-${this.#container.hdr}-${this.#container.peakNits}-${this.#container.hdrMode}`;
|
|
24316
24539
|
let style = this.#colorCache.get(key);
|
|
24317
24540
|
if (!style) {
|
|
24318
|
-
style = getStyleFromRgb(rgb, this.#container.hdr);
|
|
24541
|
+
style = getStyleFromRgb(rgb, this.#container.hdr, undefined, this.#container.peakNits, this.#container.hdrMode);
|
|
24319
24542
|
this.#colorCache.set(key, style);
|
|
24320
24543
|
}
|
|
24321
24544
|
return style;
|
|
@@ -26104,7 +26327,7 @@
|
|
|
26104
26327
|
min: 0,
|
|
26105
26328
|
max: 1,
|
|
26106
26329
|
};
|
|
26107
|
-
function drawPolygonMask(pluginManager, context, rawData, stroke, hdr = false) {
|
|
26330
|
+
function drawPolygonMask(pluginManager, context, rawData, stroke, hdr = false, peakNits, mode) {
|
|
26108
26331
|
const color = rangeColorToRgb(pluginManager, stroke.color);
|
|
26109
26332
|
if (!color) {
|
|
26110
26333
|
return;
|
|
@@ -26119,11 +26342,11 @@
|
|
|
26119
26342
|
context.lineTo(item.x, item.y);
|
|
26120
26343
|
}
|
|
26121
26344
|
context.closePath();
|
|
26122
|
-
context.strokeStyle = getStyleFromRgb(color, hdr);
|
|
26345
|
+
context.strokeStyle = getStyleFromRgb(color, hdr, undefined, peakNits, mode);
|
|
26123
26346
|
context.lineWidth = stroke.width;
|
|
26124
26347
|
context.stroke();
|
|
26125
26348
|
}
|
|
26126
|
-
function drawPolygonMaskPath(pluginManager, context, path, stroke, position, hdr = false) {
|
|
26349
|
+
function drawPolygonMaskPath(pluginManager, context, path, stroke, position, hdr = false, peakNits, mode) {
|
|
26127
26350
|
const defaultTransform = {
|
|
26128
26351
|
a: 1,
|
|
26129
26352
|
b: 0,
|
|
@@ -26135,7 +26358,7 @@
|
|
|
26135
26358
|
if (!color) {
|
|
26136
26359
|
return;
|
|
26137
26360
|
}
|
|
26138
|
-
context.strokeStyle = getStyleFromRgb(color, hdr, stroke.opacity);
|
|
26361
|
+
context.strokeStyle = getStyleFromRgb(color, hdr, stroke.opacity, peakNits, mode);
|
|
26139
26362
|
context.lineWidth = stroke.width;
|
|
26140
26363
|
context.stroke(path);
|
|
26141
26364
|
context.resetTransform();
|
|
@@ -26266,10 +26489,10 @@
|
|
|
26266
26489
|
for (const path of this.paths) {
|
|
26267
26490
|
const path2d = path.path2d;
|
|
26268
26491
|
if (path2d && this.offset) {
|
|
26269
|
-
drawPolygonMaskPath(this.#pluginManager, context, path2d, polygonDraw.stroke, this.offset, this.#container.hdr);
|
|
26492
|
+
drawPolygonMaskPath(this.#pluginManager, context, path2d, polygonDraw.stroke, this.offset, this.#container.hdr, this.#container.peakNits, this.#container.hdrMode);
|
|
26270
26493
|
}
|
|
26271
26494
|
else if (rawData) {
|
|
26272
|
-
drawPolygonMask(this.#pluginManager, context, rawData, polygonDraw.stroke, this.#container.hdr);
|
|
26495
|
+
drawPolygonMask(this.#pluginManager, context, rawData, polygonDraw.stroke, this.#container.hdr, this.#container.peakNits, this.#container.hdrMode);
|
|
26273
26496
|
}
|
|
26274
26497
|
}
|
|
26275
26498
|
}
|
|
@@ -27187,7 +27410,7 @@
|
|
|
27187
27410
|
let handled = false;
|
|
27188
27411
|
const canvas = container.canvas;
|
|
27189
27412
|
if (trailFill.color) {
|
|
27190
|
-
canvas.render.paintBase(getStyleFromRgb(trailFill.color, container.hdr, trailFill.opacity));
|
|
27413
|
+
canvas.render.paintBase(getStyleFromRgb(trailFill.color, container.hdr, trailFill.opacity, container.peakNits, container.hdrMode));
|
|
27191
27414
|
handled = true;
|
|
27192
27415
|
}
|
|
27193
27416
|
else if (trailFill.image) {
|
|
@@ -27934,7 +28157,7 @@
|
|
|
27934
28157
|
context.beginPath();
|
|
27935
28158
|
context.arc(originPoint.x, originPoint.y, this.size, minAngle, maxAngle, false);
|
|
27936
28159
|
context.closePath();
|
|
27937
|
-
context.fillStyle = getStyleFromRgb(this.color, this.#container.hdr, this.opacity);
|
|
28160
|
+
context.fillStyle = getStyleFromRgb(this.color, this.#container.hdr, this.opacity, this.#container.peakNits, this.#container.hdrMode);
|
|
27938
28161
|
context.fill();
|
|
27939
28162
|
}
|
|
27940
28163
|
resize() {
|
|
@@ -28232,6 +28455,7 @@
|
|
|
28232
28455
|
exports.ColorAnimation = ColorAnimation;
|
|
28233
28456
|
exports.Fill = Fill;
|
|
28234
28457
|
exports.FullScreen = FullScreen;
|
|
28458
|
+
exports.HDROptions = HDROptions;
|
|
28235
28459
|
exports.HslAnimation = HslAnimation;
|
|
28236
28460
|
exports.Move = Move;
|
|
28237
28461
|
exports.MoveAngle = MoveAngle;
|