pagewave 1.0.4 → 1.0.6

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/dist/index.js ADDED
@@ -0,0 +1,579 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ KeyFrameBase: () => KeyFrameBase,
24
+ KeyFrameCustom: () => KeyFrameCustom,
25
+ KeyFramePreset: () => KeyFramePreset,
26
+ MultiElementAnimation: () => MultiElementAnimation,
27
+ OverlayBase: () => OverlayBase,
28
+ OverlayCustom: () => OverlayCustom,
29
+ OverlayPreset: () => OverlayPreset,
30
+ OverlayStyled: () => OverlayStyled,
31
+ PageWave: () => PageWave,
32
+ StyleTransition: () => StyleTransition
33
+ });
34
+ module.exports = __toCommonJS(index_exports);
35
+
36
+ // src/classes/KeyFrameBase.ts
37
+ var KeyFrameBase = class {
38
+ duration;
39
+ timing;
40
+ constructor(duration, timing = "linear") {
41
+ this.duration = duration;
42
+ this.timing = timing;
43
+ }
44
+ handle(direction, mainElement) {
45
+ }
46
+ hidePage(options) {
47
+ for (const ele of document.getElementsByClassName("pagewave-overlay-div")) {
48
+ ele.remove();
49
+ }
50
+ const mainContent = document.getElementById(options.mainContentIdName);
51
+ if (mainContent) {
52
+ mainContent.hidden = true;
53
+ } else {
54
+ this.waitForElementLoad(
55
+ `#${options.mainContentIdName}`,
56
+ (element) => {
57
+ element.hidden = true;
58
+ }
59
+ );
60
+ }
61
+ }
62
+ revealPage(options) {
63
+ const mainContent = document.getElementById(options.mainContentIdName);
64
+ if (mainContent) {
65
+ mainContent.hidden = false;
66
+ } else {
67
+ this.waitForElementLoad(
68
+ `#${options.mainContentIdName}`,
69
+ (element) => {
70
+ element.hidden = false;
71
+ }
72
+ );
73
+ }
74
+ }
75
+ waitForElementLoad(selector, functionToExecute) {
76
+ const existingElement = document.querySelector(selector);
77
+ if (existingElement != null) {
78
+ functionToExecute(existingElement);
79
+ return;
80
+ }
81
+ const observer = new MutationObserver((mutations) => {
82
+ mutations.forEach((mutation) => {
83
+ mutation.addedNodes.forEach((node) => {
84
+ if (node.nodeType === Node.ELEMENT_NODE) {
85
+ const element = node;
86
+ if (element.matches(selector)) {
87
+ observer.disconnect();
88
+ functionToExecute(element);
89
+ }
90
+ }
91
+ });
92
+ });
93
+ });
94
+ observer.observe(document.body, { childList: true, subtree: true });
95
+ }
96
+ ApplyAnimation(element, animationName, duration, timing, direction) {
97
+ element.style.animation = `${animationName} ${duration}ms ${timing} both ${direction}`;
98
+ setTimeout(() => {
99
+ element.style.animation = "";
100
+ if (direction == "normal") {
101
+ element.hidden = true;
102
+ }
103
+ }, duration);
104
+ if (direction == "reverse") {
105
+ let handleAnimation2 = function(event) {
106
+ if (event.animationName == animationName && currentAnimation != null) {
107
+ const animationKeyframes = currentAnimation.effect;
108
+ const kfValues = Object.values(animationKeyframes.getKeyframes()[0]);
109
+ const kfKeys = Object.keys(animationKeyframes.getKeyframes()[0]);
110
+ const animationProperties = kfValues.slice(3, kfValues.length - 1);
111
+ const animationKeys = kfKeys.slice(3, kfValues.length - 1);
112
+ for (let i = 0; i < animationKeys.length; i++) {
113
+ const animationKey = animationKeys[i].toString();
114
+ const animationProperty = animationProperties[i].toString();
115
+ element.style.setProperty(animationKey, animationProperty);
116
+ }
117
+ element.style.animation = "";
118
+ element.removeEventListener("animationend", handleAnimation2);
119
+ }
120
+ };
121
+ var handleAnimation = handleAnimation2;
122
+ let currentAnimation = null;
123
+ element.getAnimations().forEach((animation) => {
124
+ if (currentAnimation == null && animation.id == animationName) {
125
+ currentAnimation = animation;
126
+ }
127
+ });
128
+ element.addEventListener("animationend", handleAnimation2);
129
+ }
130
+ }
131
+ };
132
+
133
+ // src/classes/KeyFrameCustom.ts
134
+ var KeyFrameCustom = class extends KeyFrameBase {
135
+ animationName;
136
+ constructor(animationName, duration, timing = "linear") {
137
+ super(duration, timing);
138
+ this.animationName = animationName;
139
+ }
140
+ handle(direction, mainElement) {
141
+ mainElement.hidden = false;
142
+ this.ApplyAnimation(mainElement, this.animationName, this.duration, this.timing, direction);
143
+ }
144
+ };
145
+
146
+ // src/classes/KeyFramePreset.ts
147
+ var KeyFramePreset = class extends KeyFrameCustom {
148
+ constructor(kfType, duration, timing = "linear") {
149
+ const animationMap = {
150
+ fade: "fade",
151
+ fadeaway: "fadeaway",
152
+ fadetoleft: "fadetoleft",
153
+ fadetoright: "fadetoright"
154
+ };
155
+ super(animationMap[kfType], duration, timing);
156
+ }
157
+ handle(direction, mainElement) {
158
+ super.handle(direction, mainElement);
159
+ }
160
+ };
161
+
162
+ // src/classes/MultiElementAnimation.ts
163
+ var MultiElementAnimation = class extends KeyFrameBase {
164
+ animateableObjects;
165
+ mainElementAnimation;
166
+ constructor(animateableObjects, duration, timing = "linear", mainElementAnimation = "") {
167
+ super(duration, timing);
168
+ this.animateableObjects = animateableObjects;
169
+ this.mainElementAnimation = mainElementAnimation;
170
+ }
171
+ handle(direction, mainElement) {
172
+ let timing = this.timing;
173
+ for (const [selector, animationName] of Object.entries(this.animateableObjects)) {
174
+ mainElement.querySelectorAll(selector).forEach(
175
+ (element) => {
176
+ this.ApplyAnimation(element, animationName, this.duration, timing, direction);
177
+ }
178
+ );
179
+ }
180
+ if (this.mainElementAnimation != "") {
181
+ this.ApplyAnimation(mainElement, this.mainElementAnimation, this.duration, timing, direction);
182
+ }
183
+ }
184
+ };
185
+
186
+ // src/classes/OverlayBase.ts
187
+ var OverlayBase = class {
188
+ duration;
189
+ timing;
190
+ color;
191
+ constructor(duration, color, timing = "linear") {
192
+ this.duration = duration;
193
+ this.color = color;
194
+ this.timing = timing;
195
+ }
196
+ handle(direction, mainElement) {
197
+ }
198
+ hidePage(options) {
199
+ const mainContent = document.getElementById(options.mainContentIdName);
200
+ if (document.getElementById(options.pageBlockerId)) {
201
+ const pageBlockerElement = document.getElementById(options.pageBlockerId);
202
+ pageBlockerElement.style.cssText = `position: absolute; width: 100%; height: 100%; z-index: 100; top: 0; background-color: ${this.color}`;
203
+ return;
204
+ }
205
+ for (const ele of document.getElementsByClassName("pagewave-overlay-div")) {
206
+ ele.remove();
207
+ }
208
+ const pageBlocker = document.createElement("div");
209
+ pageBlocker.id = options.pageBlockerId;
210
+ pageBlocker.style.cssText = `position: absolute; width: 100%; height: 100%; z-index: 100; top: 0; background-color: ${this.color}`;
211
+ mainContent.append(pageBlocker);
212
+ }
213
+ revealPage(options) {
214
+ const pageBlocker = document.getElementById(options.pageBlockerId);
215
+ const mainElement = document.getElementById(options.mainContentIdName);
216
+ if (mainElement) {
217
+ mainElement.hidden = false;
218
+ }
219
+ if (pageBlocker) {
220
+ pageBlocker.style.cssText = "";
221
+ } else {
222
+ this.waitForElementLoad(
223
+ `#${options.pageBlockerId}`,
224
+ (element) => {
225
+ element.style.cssText = "";
226
+ }
227
+ );
228
+ }
229
+ }
230
+ waitForElementLoad(selector, functionToExecute) {
231
+ const existingElement = document.querySelector(selector);
232
+ if (existingElement != null) {
233
+ functionToExecute(existingElement);
234
+ return;
235
+ }
236
+ const observer = new MutationObserver((mutations) => {
237
+ mutations.forEach((mutation) => {
238
+ mutation.addedNodes.forEach((node) => {
239
+ if (node.nodeType === Node.ELEMENT_NODE) {
240
+ const element = node;
241
+ if (element.matches(selector)) {
242
+ observer.disconnect();
243
+ functionToExecute(element);
244
+ }
245
+ }
246
+ });
247
+ });
248
+ });
249
+ observer.observe(document.body, { childList: true, subtree: true });
250
+ }
251
+ };
252
+
253
+ // src/classes/OverlayCustom.ts
254
+ var OverlayCustom = class extends OverlayBase {
255
+ divAnimationObject;
256
+ mainElementAnimation;
257
+ constructor(divAnimationObject, duration, color, timing = "linear", mainElementAnimation = null) {
258
+ super(duration, color, timing);
259
+ this.divAnimationObject = divAnimationObject;
260
+ this.mainElementAnimation = mainElementAnimation;
261
+ }
262
+ handle(direction, mainElement) {
263
+ for (const ele of document.getElementsByClassName("pagewave-overlay-div")) {
264
+ ele.remove();
265
+ }
266
+ const root = document.documentElement;
267
+ root.style.setProperty("--div-color", this.color);
268
+ for (const [className, animationName] of Object.entries(this.divAnimationObject)) {
269
+ const divElement = document.createElement("div");
270
+ divElement.className = className + " pagewave-overlay-div";
271
+ divElement.style.animation = `${animationName} ${this.duration}ms ${this.timing} both ${direction}`;
272
+ divElement.style.backgroundColor = this.color;
273
+ divElement.style.position = "absolute";
274
+ mainElement.appendChild(divElement);
275
+ setTimeout(() => {
276
+ if (divElement.parentElement == mainElement) {
277
+ mainElement.removeChild(divElement);
278
+ }
279
+ }, this.duration);
280
+ }
281
+ if (this.mainElementAnimation !== null) {
282
+ this.mainElementAnimation.handle(direction, mainElement);
283
+ }
284
+ }
285
+ };
286
+
287
+ // src/classes/OverlayPreset.ts
288
+ var OverlayPreset = class extends OverlayCustom {
289
+ constructor(oType, duration, color, timing = "linear") {
290
+ const overlayMap = {
291
+ slide: { firstOverlayElement: "slide" },
292
+ inverseSlide: { firstOverlayElement: "inverseSlide" },
293
+ curtain: { firstOverlayElement: "rightcurtain", secondOverlayElement: "leftcurtain" },
294
+ rise: { firstOverlayElement: "rise" },
295
+ fall: { firstOverlayElement: "fall" },
296
+ bubble: { firstOverlayElement: "bubble" },
297
+ wipe: { firstOverlayElement: "wipe" }
298
+ };
299
+ super(overlayMap[oType], duration, color, timing);
300
+ }
301
+ handle(direction, mainElement) {
302
+ super.handle(direction, mainElement);
303
+ }
304
+ };
305
+
306
+ // src/classes/OverlayStyled.ts
307
+ var OverlayStyled = class extends OverlayBase {
308
+ divAnimationObject;
309
+ mainElementAnimation;
310
+ blockerDesign;
311
+ constructor(divAnimationObject, duration, color, timing = "linear", mainElementAnimation = null, blockerDesign = {}) {
312
+ super(duration, color, timing);
313
+ this.divAnimationObject = divAnimationObject;
314
+ this.mainElementAnimation = mainElementAnimation;
315
+ this.blockerDesign = blockerDesign;
316
+ }
317
+ hidePage(options) {
318
+ const mainContent = document.getElementById(options.mainContentIdName);
319
+ if (document.getElementById(options.pageBlockerId)) {
320
+ const pageBlockerElement = document.getElementById(options.pageBlockerId);
321
+ pageBlockerElement.style.cssText = `position: absolute; width: 100%; height: 100%; z-index: 100; top: 0; background-color: ${this.color}`;
322
+ for (const [styleKey, styleValue] of Object.entries(this.blockerDesign)) {
323
+ pageBlockerElement.style[styleKey] = styleValue;
324
+ }
325
+ return;
326
+ }
327
+ for (const ele of document.getElementsByClassName("pagewave-overlay-div")) {
328
+ ele.remove();
329
+ }
330
+ const pageBlocker = document.createElement("div");
331
+ pageBlocker.id = options.pageBlockerId;
332
+ pageBlocker.style.cssText = `position: absolute; width: 100%; height: 100%; z-index: 100; top: 0; background-color: ${this.color}`;
333
+ for (const [styleKey, styleValue] of Object.entries(this.blockerDesign)) {
334
+ pageBlocker.style[styleKey] = styleValue;
335
+ }
336
+ mainContent.append(pageBlocker);
337
+ }
338
+ handle(direction, mainElement) {
339
+ for (const ele of document.getElementsByClassName("pagewave-overlay-div")) {
340
+ ele.remove();
341
+ }
342
+ const root = document.documentElement;
343
+ root.style.setProperty("--div-color", this.color);
344
+ for (const [className, divProperties] of Object.entries(this.divAnimationObject)) {
345
+ const divElement = document.createElement("div");
346
+ divElement.className = className + " pagewave-overlay-div";
347
+ divElement.style.animation = `${divProperties.animationName} ${this.duration}ms ${this.timing} both ${direction}`;
348
+ divElement.style.backgroundColor = this.color;
349
+ divElement.style.position = "absolute";
350
+ for (const [styleKey, styleValue] of Object.entries(divProperties.cssDesign)) {
351
+ divElement.style[styleKey] = styleValue;
352
+ }
353
+ mainElement.appendChild(divElement);
354
+ setTimeout(() => {
355
+ }, this.duration);
356
+ }
357
+ if (this.mainElementAnimation !== null) {
358
+ this.mainElementAnimation.handle(direction, mainElement);
359
+ }
360
+ }
361
+ };
362
+
363
+ // src/classes/PageWave.ts
364
+ var PageWave = class {
365
+ defaultOptions;
366
+ finalOptions;
367
+ routeTransitions;
368
+ constructor(transitions, options = {}) {
369
+ this.defaultOptions = {
370
+ mainContentIdName: "main-content",
371
+ pageAnimationDelay: 100,
372
+ runAnimationOnPageReload: false,
373
+ runAnimationOnCrossSite: false,
374
+ pageRevealDelay: 0,
375
+ leavePageOnLink: true,
376
+ pageBlockerId: "pageBlocker",
377
+ classToIgnoreLink: "ignore-click",
378
+ animateIgnoredLinks: false,
379
+ animateSelfLink: true,
380
+ loadEvent: "DOMContentLoaded",
381
+ preferIgnore: false
382
+ };
383
+ this.finalOptions = { ...this.defaultOptions, ...options };
384
+ this.routeTransitions = transitions;
385
+ }
386
+ CallHook(hookName, details = {}) {
387
+ const event = new CustomEvent(hookName, {
388
+ detail: details
389
+ });
390
+ window.dispatchEvent(event);
391
+ }
392
+ isNavigationFromSameSite() {
393
+ const referrer = document.referrer;
394
+ if (referrer == "") {
395
+ return false;
396
+ }
397
+ const currentHost = window.location.hostname;
398
+ const referrerHost = new URL(referrer).hostname;
399
+ return referrerHost === currentHost;
400
+ }
401
+ isInternalLink(link) {
402
+ try {
403
+ const url = new URL(link, window.location.href);
404
+ return url.hostname === window.location.hostname;
405
+ } catch (e) {
406
+ return false;
407
+ }
408
+ }
409
+ HandleClickAnimation(e, defaultTransitionStyle, leaveFunction = (link) => {
410
+ window.location.href = link;
411
+ }, externalLeaveFunction = (link) => {
412
+ window.location.href = link;
413
+ }) {
414
+ if (!e.target || !(e.target instanceof HTMLAnchorElement)) {
415
+ return;
416
+ }
417
+ e.preventDefault();
418
+ e.stopPropagation();
419
+ if (e.target.tagName.toLowerCase() == "a") {
420
+ const correctLeaveFunction = this.isInternalLink(e.target.href) ? leaveFunction : externalLeaveFunction;
421
+ const matchedRoute = Array.from(e.target.classList).find((cls) => cls in this.routeTransitions);
422
+ const shouldIgnore = this.finalOptions.preferIgnore && !matchedRoute || e.target.classList.contains(this.finalOptions.classToIgnoreLink);
423
+ if (!shouldIgnore && (e.target.href != window.location.href || this.finalOptions.animateSelfLink)) {
424
+ e.preventDefault();
425
+ let duration = defaultTransitionStyle.duration;
426
+ this.CallHook("animateSSP", { style: defaultTransitionStyle, clickEvent: e });
427
+ if (matchedRoute && matchedRoute in this.routeTransitions) {
428
+ this.SaveAndTransition(matchedRoute, this.routeTransitions[matchedRoute]);
429
+ duration = this.routeTransitions[matchedRoute].duration;
430
+ } else {
431
+ this.SaveAndTransition("animation", defaultTransitionStyle);
432
+ duration = defaultTransitionStyle.duration;
433
+ }
434
+ setTimeout(
435
+ () => {
436
+ this.CallHook("animateESP", { style: defaultTransitionStyle, clickEvent: e });
437
+ if (this.finalOptions.leavePageOnLink) {
438
+ correctLeaveFunction(e.target.href);
439
+ }
440
+ },
441
+ duration
442
+ );
443
+ } else if (e.target.classList.contains(this.finalOptions.classToIgnoreLink) || e.target.href == window.location.href && !this.finalOptions.animateSelfLink) {
444
+ sessionStorage.setItem("animationType", "ignore");
445
+ if (this.finalOptions.leavePageOnLink) {
446
+ correctLeaveFunction(e.target.href);
447
+ }
448
+ }
449
+ }
450
+ }
451
+ ListenForChange(defaultTransitionStyle, leaveFunction = (link) => {
452
+ window.location.href = link;
453
+ }) {
454
+ this.EndPoint(defaultTransitionStyle);
455
+ this.SendPoint(defaultTransitionStyle, leaveFunction);
456
+ }
457
+ SendPoint(defaultTransitionStyle, leaveFunction = (link) => {
458
+ window.location.href = link;
459
+ }, externalLeaveFunction = (link) => {
460
+ window.location.href = link;
461
+ }) {
462
+ const mainElement = document.getElementById(this.finalOptions.mainContentIdName);
463
+ const linkElements = mainElement.getElementsByTagName("a");
464
+ for (let i = 0; i < linkElements.length; i++) {
465
+ const linkElement = linkElements[i];
466
+ linkElement.onclick = null;
467
+ linkElement.addEventListener("click", (e) => {
468
+ this.HandleClickAnimation(e, defaultTransitionStyle, leaveFunction, externalLeaveFunction);
469
+ });
470
+ }
471
+ }
472
+ getStorageRouteTransition(defaultTransitionStyle) {
473
+ const storageKey = sessionStorage.getItem("animationType");
474
+ if (storageKey != null && storageKey != "animation" && storageKey in this.routeTransitions) {
475
+ return this.routeTransitions[storageKey];
476
+ }
477
+ return defaultTransitionStyle;
478
+ }
479
+ EndPoint(defaultTransitionStyle) {
480
+ defaultTransitionStyle = this.getStorageRouteTransition(defaultTransitionStyle);
481
+ defaultTransitionStyle.hidePage(this.finalOptions);
482
+ const mainElement = document.getElementById(this.finalOptions.mainContentIdName);
483
+ mainElement.addEventListener(this.finalOptions.loadEvent, (e) => {
484
+ e.stopPropagation();
485
+ this.CallHook("animateSEP", { style: defaultTransitionStyle });
486
+ const doTransitionOnIgnoredLink = this.finalOptions.animateIgnoredLinks || sessionStorage.getItem("animationType") != "ignore";
487
+ const doAnimateOnReload = window.performance.getEntriesByType("navigation")[0]?.entryType != "reload" || this.finalOptions.runAnimationOnPageReload;
488
+ const doAnimateOnSameSite = this.isNavigationFromSameSite() || this.finalOptions.runAnimationOnCrossSite;
489
+ if (doAnimateOnReload && doAnimateOnSameSite && doTransitionOnIgnoredLink) {
490
+ setTimeout(
491
+ () => {
492
+ this.AnimatePageTransition(defaultTransitionStyle, "reverse");
493
+ setTimeout(
494
+ () => {
495
+ this.CallHook("animateEEP", { style: defaultTransitionStyle });
496
+ defaultTransitionStyle.revealPage(this.finalOptions);
497
+ },
498
+ this.finalOptions.pageRevealDelay
499
+ );
500
+ },
501
+ this.finalOptions.pageAnimationDelay
502
+ );
503
+ } else {
504
+ this.CallHook("animateEPNA", { style: defaultTransitionStyle });
505
+ defaultTransitionStyle.revealPage(this.finalOptions);
506
+ }
507
+ }, { once: true });
508
+ }
509
+ CallEndPoint() {
510
+ const dispatchEvent = new Event(this.finalOptions.loadEvent);
511
+ document.getElementById(this.finalOptions.mainContentIdName).dispatchEvent(dispatchEvent);
512
+ }
513
+ SaveAndTransition(animationName, aStyle, direction = "normal") {
514
+ this.AnimatePageTransition(aStyle, "normal");
515
+ sessionStorage.setItem("animationType", animationName);
516
+ }
517
+ AnimatePageTransition(aStyle, direction = "normal") {
518
+ const mainElement = document.getElementById(this.finalOptions.mainContentIdName);
519
+ if (direction == "normal") {
520
+ this.CallHook("animateSF", { style: aStyle, ele: mainElement });
521
+ } else if (direction == "reverse") {
522
+ this.CallHook("animateSR", { style: aStyle, ele: mainElement });
523
+ }
524
+ aStyle.handle(direction, mainElement);
525
+ setTimeout(
526
+ () => {
527
+ if (direction == "normal") {
528
+ this.CallHook("animateEF", { style: aStyle, ele: mainElement });
529
+ } else if (direction == "reverse") {
530
+ this.CallHook("animateER", { style: aStyle, ele: mainElement });
531
+ }
532
+ },
533
+ aStyle.duration
534
+ );
535
+ }
536
+ };
537
+
538
+ // src/classes/StyleTransition.ts
539
+ var StyleTransition = class extends KeyFrameBase {
540
+ styleString;
541
+ startValue;
542
+ endValue;
543
+ constructor(styleString, duration, startValue, endValue, timing = "linear") {
544
+ super(duration, timing);
545
+ this.styleString = styleString;
546
+ this.startValue = startValue;
547
+ this.endValue = endValue;
548
+ }
549
+ handle(direction, mainElement) {
550
+ if (direction == "normal") {
551
+ mainElement.style[this.styleString] = this.startValue;
552
+ mainElement.style.transition = this.styleString.toString() + " " + this.duration.toString() + "ms " + this.timing;
553
+ mainElement.style[this.styleString] = this.endValue;
554
+ } else if (direction == "reverse") {
555
+ mainElement.style[this.styleString] = this.endValue;
556
+ mainElement.style.transition = this.styleString.toString() + " " + this.duration.toString() + "ms " + this.timing;
557
+ setTimeout(
558
+ () => {
559
+ mainElement.style[this.styleString] = this.startValue;
560
+ },
561
+ 40
562
+ );
563
+ }
564
+ }
565
+ };
566
+ // Annotate the CommonJS export names for ESM import in node:
567
+ 0 && (module.exports = {
568
+ KeyFrameBase,
569
+ KeyFrameCustom,
570
+ KeyFramePreset,
571
+ MultiElementAnimation,
572
+ OverlayBase,
573
+ OverlayCustom,
574
+ OverlayPreset,
575
+ OverlayStyled,
576
+ PageWave,
577
+ StyleTransition
578
+ });
579
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/classes/KeyFrameBase.ts","../src/classes/KeyFrameCustom.ts","../src/classes/KeyFramePreset.ts","../src/classes/MultiElementAnimation.ts","../src/classes/OverlayBase.ts","../src/classes/OverlayCustom.ts","../src/classes/OverlayPreset.ts","../src/classes/OverlayStyled.ts","../src/classes/PageWave.ts","../src/classes/StyleTransition.ts"],"sourcesContent":["// Classes\r\nexport * from \"./classes/KeyFrameBase\";\r\nexport * from \"./classes/KeyFrameCustom\";\r\nexport * from \"./classes/KeyFramePreset\";\r\nexport * from \"./classes/MultiElementAnimation\";\r\nexport * from \"./classes/OverlayBase\";\r\nexport * from \"./classes/OverlayCustom\";\r\nexport * from \"./classes/OverlayPreset\";\r\nexport * from \"./classes/OverlayStyled\";\r\nexport * from \"./classes/PageWave\";\r\nexport * from \"./classes/StyleTransition\";\r\n\r\n// Types\r\nexport * from \"./types/DirectionType\";\r\nexport * from \"./types/KeyFrameType\";\r\nexport * from \"./types/OptionsType\";\r\nexport * from \"./types/OverlayType\";\r\nexport * from \"./types/TimingType\";\r\nexport * from \"./types/TransitionStyleInterface\";\r\n","import type { DirectionType } from '../types/DirectionType';\r\nimport type { OptionsType } from '../types/OptionsType';\r\nimport type { TimingType } from '../types/TimingType';\r\nimport type { TransitionStyle } from '../types/TransitionStyleInterface';\r\n\r\nexport class KeyFrameBase implements TransitionStyle {\r\n duration: number;\r\n timing: TimingType;\r\n constructor(duration: number, timing: TimingType = \"linear\") {\r\n this.duration = duration;\r\n this.timing = timing;\r\n }\r\n\r\n public handle(direction: DirectionType, mainElement: HTMLElement): void {}\r\n\r\n public hidePage(options: OptionsType): void {\r\n for(const ele of document.getElementsByClassName(\"pagewave-overlay-div\")){\r\n ele.remove();\r\n }\r\n const mainContent = document.getElementById(options.mainContentIdName);\r\n if(mainContent){\r\n mainContent.hidden = true;\r\n }else{\r\n this.waitForElementLoad(\r\n `#${options.mainContentIdName}`, (element: HTMLElement) => {\r\n element.hidden = true;\r\n }\r\n )\r\n }\r\n }\r\n\r\n public revealPage(options: OptionsType): void {\r\n const mainContent = document.getElementById(options.mainContentIdName);\r\n if(mainContent){\r\n mainContent.hidden = false;\r\n }else{\r\n this.waitForElementLoad(\r\n `#${options.mainContentIdName}`, (element: HTMLElement) => {\r\n element.hidden = false;\r\n }\r\n )\r\n }\r\n }\r\n\r\n protected waitForElementLoad(selector: string, functionToExecute: (element: HTMLElement) => void) {\r\n const existingElement = document.querySelector(selector);\r\n if (existingElement != null) {\r\n functionToExecute(existingElement as HTMLElement);\r\n return;\r\n }\r\n \r\n const observer = new MutationObserver((mutations) => {\r\n mutations.forEach((mutation) => {\r\n mutation.addedNodes.forEach((node) => {\r\n if (node.nodeType === Node.ELEMENT_NODE) {\r\n const element = node as HTMLElement;\r\n if (element.matches(selector)) {\r\n observer.disconnect();\r\n functionToExecute(element);\r\n }\r\n }\r\n });\r\n });\r\n });\r\n \r\n observer.observe(document.body, { childList: true, subtree: true });\r\n }\r\n\r\n protected ApplyAnimation(element: HTMLElement, animationName: string, duration: number, timing: TimingType, direction: DirectionType) {\r\n element.style.animation = `${animationName} ${duration}ms ${timing} both ${direction}`;\r\n setTimeout(() => {\r\n element.style.animation = \"\";\r\n if (direction == \"normal\") {\r\n element.hidden = true;\r\n }\r\n }, duration);\r\n if (direction == \"reverse\") {\r\n let currentAnimation: Animation | null = null;\r\n element.getAnimations().forEach((animation) => {\r\n if (currentAnimation == null && animation.id == animationName) {\r\n currentAnimation = animation;\r\n }\r\n });\r\n\r\n function handleAnimation(event: AnimationEvent) {\r\n if (event.animationName == animationName && currentAnimation != null) {\r\n const animationKeyframes = currentAnimation.effect! as KeyframeEffect;\r\n const kfValues = Object.values(animationKeyframes.getKeyframes()[0]!);\r\n const kfKeys = Object.keys(animationKeyframes.getKeyframes()[0]!);\r\n const animationProperties = kfValues.slice(3, kfValues.length - 1);\r\n const animationKeys = kfKeys.slice(3, kfValues.length - 1);\r\n for (let i = 0; i < animationKeys.length; i++) {\r\n const animationKey: string = animationKeys[i]!.toString();\r\n const animationProperty: string = animationProperties[i]!.toString();\r\n element.style.setProperty(animationKey, animationProperty);\r\n }\r\n element.style.animation = \"\";\r\n element.removeEventListener(\"animationend\", handleAnimation);\r\n }\r\n }\r\n element.addEventListener(\"animationend\", handleAnimation);\r\n }\r\n }\r\n}","import type { DirectionType } from '../types/DirectionType';\r\nimport type { OptionsType } from '../types/OptionsType';\r\nimport type { TimingType } from '../types/TimingType';\r\nimport type { TransitionStyle } from '../types/TransitionStyleInterface';\r\nimport { KeyFrameBase } from './KeyFrameBase';\r\n\r\nexport class KeyFrameCustom extends KeyFrameBase {\r\n animationName: string;\r\n constructor(animationName: string, duration: number, timing: TimingType = \"linear\") {\r\n super(duration, timing);\r\n this.animationName = animationName;\r\n }\r\n\r\n public handle(direction: DirectionType, mainElement: HTMLElement): void {\r\n mainElement.hidden = false;\r\n this.ApplyAnimation(mainElement, this.animationName, this.duration, this.timing, direction);\r\n }\r\n}","import type { DirectionType } from \"../types/DirectionType\";\r\nimport type { KeyFrameType } from \"../types/KeyFrameType\";\r\nimport type { TimingType } from \"../types/TimingType\";\r\nimport { KeyFrameCustom } from \"./KeyFrameCustom\";\r\n\r\nexport class KeyFramePreset extends KeyFrameCustom {\r\n constructor(kfType: KeyFrameType, duration: number, timing: TimingType = \"linear\") {\r\n const animationMap: Record<KeyFrameType, string> = {\r\n fade: \"fade\",\r\n fadeaway: \"fadeaway\",\r\n fadetoleft: \"fadetoleft\",\r\n fadetoright: \"fadetoright\",\r\n };\r\n super(animationMap[kfType], duration, timing);\r\n }\r\n handle(direction: DirectionType, mainElement: HTMLElement): void {\r\n super.handle(direction, mainElement);\r\n }\r\n}","import type { DirectionType } from \"../types/DirectionType\";\r\nimport type { TimingType } from \"../types/TimingType\";\r\nimport { KeyFrameBase } from \"./KeyFrameBase\";\r\n\r\nexport class MultiElementAnimation extends KeyFrameBase {\r\n animateableObjects: { [selector: string]: string };\r\n mainElementAnimation: string;\r\n\r\n constructor(animateableObjects: { [selector: string]: string }, duration: number, timing: TimingType = \"linear\", mainElementAnimation = \"\") {\r\n super(duration, timing);\r\n this.animateableObjects = animateableObjects;\r\n this.mainElementAnimation = mainElementAnimation;\r\n }\r\n public handle(direction: DirectionType, mainElement: HTMLElement): void {\r\n let timing = this.timing;\r\n for (const [selector, animationName] of Object.entries(this.animateableObjects)) {\r\n mainElement.querySelectorAll(selector).forEach(\r\n (element) => {\r\n this.ApplyAnimation(element as HTMLElement, animationName, this.duration, timing, direction);\r\n }\r\n );\r\n }\r\n if (this.mainElementAnimation != \"\") {\r\n this.ApplyAnimation(mainElement, this.mainElementAnimation, this.duration, timing, direction);\r\n }\r\n }\r\n}","import type { DirectionType } from '../types/DirectionType';\r\nimport type { OptionsType } from '../types/OptionsType';\r\nimport type { TimingType } from '../types/TimingType';\r\nimport type { TransitionStyle } from '../types/TransitionStyleInterface';\r\n\r\nexport class OverlayBase implements TransitionStyle {\r\n duration: number;\r\n timing: TimingType;\r\n color: string;\r\n\r\n constructor(duration: number, color: string, timing: TimingType = \"linear\") {\r\n this.duration = duration;\r\n this.color = color;\r\n this.timing = timing;\r\n }\r\n\r\n public handle(direction: DirectionType, mainElement: HTMLElement): void {}\r\n\r\n public hidePage(options: OptionsType): void {\r\n const mainContent = document.getElementById(options.mainContentIdName)!;\r\n if (document.getElementById(options.pageBlockerId)) {\r\n const pageBlockerElement = document.getElementById(options.pageBlockerId)!;\r\n pageBlockerElement.style.cssText = `position: absolute; width: 100%; height: 100%; z-index: 100; top: 0; background-color: ${this.color}`\r\n return;\r\n }\r\n for(const ele of document.getElementsByClassName(\"pagewave-overlay-div\")){\r\n ele.remove();\r\n }\r\n const pageBlocker = document.createElement('div');\r\n pageBlocker.id = options.pageBlockerId;\r\n pageBlocker.style.cssText = `position: absolute; width: 100%; height: 100%; z-index: 100; top: 0; background-color: ${this.color}`\r\n mainContent.append(pageBlocker);\r\n }\r\n\r\n public revealPage(options: OptionsType): void {\r\n const pageBlocker = document.getElementById(options.pageBlockerId);\r\n const mainElement = document.getElementById(options.mainContentIdName);\r\n if(mainElement){\r\n mainElement.hidden = false;\r\n }\r\n if (pageBlocker) {\r\n pageBlocker.style.cssText = '';\r\n //pageBlocker.remove();\r\n }else{\r\n this.waitForElementLoad(\r\n `#${options.pageBlockerId}`, (element: HTMLElement) => {\r\n element.style.cssText = '';\r\n //element.remove();\r\n }\r\n )\r\n }\r\n }\r\n\r\n private waitForElementLoad(selector: string, functionToExecute: (element: HTMLElement) => void) {\r\n const existingElement = document.querySelector(selector);\r\n if (existingElement != null) {\r\n functionToExecute(existingElement as HTMLElement);\r\n return;\r\n }\r\n \r\n const observer = new MutationObserver((mutations) => {\r\n mutations.forEach((mutation) => {\r\n mutation.addedNodes.forEach((node) => {\r\n if (node.nodeType === Node.ELEMENT_NODE) {\r\n const element = node as HTMLElement;\r\n if (element.matches(selector)) {\r\n observer.disconnect();\r\n functionToExecute(element);\r\n }\r\n }\r\n });\r\n });\r\n });\r\n \r\n observer.observe(document.body, { childList: true, subtree: true });\r\n }\r\n}","import type { DirectionType } from '../types/DirectionType';\r\nimport type { TimingType } from '../types/TimingType';\r\nimport type { KeyFrameBase } from './KeyFrameBase';\r\nimport { OverlayBase } from './OverlayBase';\r\n\r\n// ...existing code...\r\nexport class OverlayCustom extends OverlayBase {\r\n divAnimationObject: Record<string, string>;\r\n mainElementAnimation: KeyFrameBase | null;\r\n\r\n constructor(divAnimationObject: Record<string, string>, duration: number, color: string, timing: TimingType = \"linear\", mainElementAnimation: KeyFrameBase | null = null) {\r\n super(duration, color, timing);\r\n this.divAnimationObject = divAnimationObject;\r\n this.mainElementAnimation = mainElementAnimation;\r\n }\r\n\r\n handle(direction: DirectionType, mainElement: HTMLElement): void {\r\n for(const ele of document.getElementsByClassName(\"pagewave-overlay-div\")){\r\n ele.remove();\r\n }\r\n const root = document.documentElement;\r\n root.style.setProperty(\"--div-color\", this.color);\r\n for (const [className, animationName] of Object.entries(this.divAnimationObject)) {\r\n const divElement = document.createElement(\"div\");\r\n divElement.className = className + \" pagewave-overlay-div\";\r\n divElement.style.animation = `${animationName} ${this.duration}ms ${this.timing} both ${direction}`;\r\n divElement.style.backgroundColor = this.color;\r\n \r\n divElement.style.position = \"absolute\";\r\n mainElement.appendChild(divElement);\r\n setTimeout(() => {\r\n if(divElement.parentElement == mainElement){\r\n mainElement.removeChild(divElement);\r\n }\r\n }, this.duration);\r\n }\r\n\r\n if (this.mainElementAnimation !== null) {\r\n this.mainElementAnimation.handle(direction, mainElement);\r\n }\r\n }\r\n}","import type { DirectionType } from \"../types/DirectionType\";\r\nimport type { OverlayType } from \"../types/OverlayType\";\r\nimport type { TimingType } from \"../types/TimingType\";\r\nimport { OverlayCustom } from \"./OverlayCustom\";\r\n\r\nexport class OverlayPreset extends OverlayCustom{\r\n constructor(oType: OverlayType, duration: number, color: string, timing: TimingType = \"linear\") {\r\n const overlayMap: Record<OverlayType, Record<string, string>> = {\r\n slide: { firstOverlayElement: \"slide\" },\r\n inverseSlide: { firstOverlayElement: \"inverseSlide\" },\r\n curtain: { firstOverlayElement: \"rightcurtain\", secondOverlayElement: \"leftcurtain\" },\r\n rise: { firstOverlayElement: \"rise\" },\r\n fall: { firstOverlayElement: \"fall\" },\r\n bubble: { firstOverlayElement: \"bubble\" },\r\n wipe: { firstOverlayElement: \"wipe\" }\r\n\r\n };\r\n super(overlayMap[oType], duration, color, timing);\r\n }\r\n handle(direction: DirectionType, mainElement: HTMLElement): void {\r\n super.handle(direction, mainElement);\r\n }\r\n}","import type { DirectionType } from '../types/DirectionType';\r\nimport type { OptionsType } from '../types/OptionsType';\r\nimport type { TimingType } from '../types/TimingType';\r\nimport type { KeyFrameBase } from './KeyFrameBase';\r\nimport { OverlayBase } from './OverlayBase';\r\n\r\nexport type OverlayStyledDiv = {\r\n animationName: string;\r\n cssDesign: Partial<Record<keyof CSSStyleDeclaration, string>>;\r\n}\r\n\r\nexport class OverlayStyled extends OverlayBase {\r\n divAnimationObject: Record<string, OverlayStyledDiv>;\r\n mainElementAnimation: KeyFrameBase | null;\r\n blockerDesign: Partial<Record<keyof CSSStyleDeclaration, string>>;\r\n\r\n constructor(divAnimationObject: Record<string, OverlayStyledDiv>, duration: number, color: string, timing: TimingType = \"linear\", mainElementAnimation: KeyFrameBase | null = null, blockerDesign: Partial<Record<keyof CSSStyleDeclaration, string>> = {}) {\r\n super(duration, color, timing);\r\n this.divAnimationObject = divAnimationObject;\r\n this.mainElementAnimation = mainElementAnimation;\r\n this.blockerDesign = blockerDesign;\r\n }\r\n\r\n public hidePage(options: OptionsType): void {\r\n const mainContent = document.getElementById(options.mainContentIdName)!;\r\n if (document.getElementById(options.pageBlockerId)) {\r\n const pageBlockerElement = document.getElementById(options.pageBlockerId)!;\r\n pageBlockerElement.style.cssText = `position: absolute; width: 100%; height: 100%; z-index: 100; top: 0; background-color: ${this.color}`\r\n for (const [styleKey, styleValue] of Object.entries(this.blockerDesign)) {\r\n (pageBlockerElement.style as any)[styleKey] = styleValue;\r\n }\r\n return;\r\n }\r\n for(const ele of document.getElementsByClassName(\"pagewave-overlay-div\")){\r\n ele.remove();\r\n }\r\n const pageBlocker = document.createElement('div');\r\n pageBlocker.id = options.pageBlockerId;\r\n pageBlocker.style.cssText = `position: absolute; width: 100%; height: 100%; z-index: 100; top: 0; background-color: ${this.color}`\r\n for (const [styleKey, styleValue] of Object.entries(this.blockerDesign)) {\r\n (pageBlocker.style as any)[styleKey] = styleValue;\r\n }\r\n mainContent.append(pageBlocker);\r\n }\r\n\r\n handle(direction: DirectionType, mainElement: HTMLElement): void {\r\n for(const ele of document.getElementsByClassName(\"pagewave-overlay-div\")){\r\n ele.remove();\r\n }\r\n const root = document.documentElement;\r\n root.style.setProperty(\"--div-color\", this.color);\r\n\r\n for (const [className, divProperties] of Object.entries(this.divAnimationObject)) {\r\n const divElement = document.createElement(\"div\");\r\n divElement.className = className + \" pagewave-overlay-div\";\r\n divElement.style.animation = `${divProperties.animationName} ${this.duration}ms ${this.timing} both ${direction}`;\r\n divElement.style.backgroundColor = this.color;\r\n divElement.style.position = \"absolute\";\r\n\r\n for (const [styleKey, styleValue] of Object.entries(divProperties.cssDesign)) {\r\n (divElement.style as any)[styleKey] = styleValue;\r\n }\r\n\r\n mainElement.appendChild(divElement);\r\n\r\n //TODO: Remove code possibly in all areas\r\n setTimeout(() => {\r\n //mainElement.removeChild(divElement);\r\n }, this.duration);\r\n }\r\n\r\n if (this.mainElementAnimation !== null) {\r\n this.mainElementAnimation.handle(direction, mainElement);\r\n }\r\n }\r\n}","import type { DirectionType } from \"../types/DirectionType.ts\";\r\nimport type { OptionsType } from \"../types/OptionsType.ts\";\r\nimport type { TransitionStyle } from \"../types/TransitionStyleInterface.ts\";\r\n\r\nexport class PageWave{\r\n public defaultOptions: OptionsType;\r\n public finalOptions: OptionsType;\r\n public routeTransitions: Record<string, TransitionStyle>\r\n constructor(transitions: Record<string, TransitionStyle>, options: Partial<OptionsType> = {}){\r\n this.defaultOptions = {\r\n mainContentIdName: \"main-content\",\r\n pageAnimationDelay: 100,\r\n runAnimationOnPageReload: false,\r\n runAnimationOnCrossSite: false,\r\n pageRevealDelay: 0,\r\n leavePageOnLink: true,\r\n pageBlockerId: \"pageBlocker\",\r\n classToIgnoreLink: \"ignore-click\",\r\n animateIgnoredLinks: false,\r\n animateSelfLink: true,\r\n loadEvent: \"DOMContentLoaded\",\r\n preferIgnore: false,\r\n }\r\n this.finalOptions = { ...this.defaultOptions, ...options };\r\n this.routeTransitions = transitions;\r\n }\r\n\r\n\r\n private CallHook(hookName: string, details: Record<string, unknown> = {}) {\r\n const event = new CustomEvent(hookName, {\r\n detail: details\r\n });\r\n window.dispatchEvent(event);\r\n }\r\n\r\n private isNavigationFromSameSite() {\r\n const referrer = document.referrer;\r\n if (referrer == \"\") {\r\n return false;\r\n }\r\n const currentHost = window.location.hostname;\r\n const referrerHost = new URL(referrer).hostname;\r\n\r\n return referrerHost === currentHost;\r\n }\r\n\r\n private isInternalLink(link: string): boolean {\r\n try {\r\n const url = new URL(link, window.location.href); // handles relative URLs\r\n return url.hostname === window.location.hostname;\r\n } catch (e) {\r\n // invalid URLs are considered external\r\n return false;\r\n }\r\n }\r\n\r\n private HandleClickAnimation(e: MouseEvent, defaultTransitionStyle: TransitionStyle, leaveFunction = (link: string) => {window.location.href = link;}, externalLeaveFunction = (link: string) => {window.location.href = link;}) {\r\n if(!e.target || !(e.target instanceof HTMLAnchorElement)) {\r\n return;\r\n }\r\n\r\n e.preventDefault();\r\n e.stopPropagation();\r\n \r\n if (e.target.tagName.toLowerCase() == \"a\") {\r\n const correctLeaveFunction = this.isInternalLink(e.target.href) ? leaveFunction : externalLeaveFunction;\r\n const matchedRoute = Array.from(e.target.classList).find(cls => cls in this.routeTransitions);\r\n const shouldIgnore = (this.finalOptions.preferIgnore && !matchedRoute) || e.target.classList.contains(this.finalOptions.classToIgnoreLink)\r\n if(!shouldIgnore && (e.target.href != window.location.href || this.finalOptions.animateSelfLink)){\r\n e.preventDefault();\r\n let duration = defaultTransitionStyle.duration;\r\n this.CallHook(\"animateSSP\", { style: defaultTransitionStyle, clickEvent: e });\r\n if (matchedRoute && matchedRoute in this.routeTransitions) {\r\n this.SaveAndTransition(matchedRoute, this.routeTransitions[matchedRoute]!);\r\n duration = this.routeTransitions[matchedRoute]!.duration;\r\n } else {\r\n this.SaveAndTransition(\"animation\", defaultTransitionStyle);\r\n duration = defaultTransitionStyle.duration;\r\n }\r\n setTimeout(\r\n () => {\r\n this.CallHook(\"animateESP\", { style: defaultTransitionStyle, clickEvent: e });\r\n if (this.finalOptions.leavePageOnLink) {\r\n correctLeaveFunction((e.target as HTMLAnchorElement).href);\r\n }\r\n }, duration\r\n );\r\n }\r\n else if (e.target.classList.contains(this.finalOptions.classToIgnoreLink) || (e.target.href == window.location.href && !this.finalOptions.animateSelfLink)) {\r\n sessionStorage.setItem(\"animationType\", \"ignore\");\r\n if (this.finalOptions.leavePageOnLink) {\r\n correctLeaveFunction((e.target as HTMLAnchorElement).href);\r\n }\r\n }\r\n } \r\n\r\n }\r\n\r\n public ListenForChange(defaultTransitionStyle: TransitionStyle, leaveFunction: (link: string) => void = (link) => {window.location.href = link;}) {\r\n this.EndPoint(defaultTransitionStyle);\r\n this.SendPoint(defaultTransitionStyle, leaveFunction);\r\n }\r\n\r\n public SendPoint(defaultTransitionStyle: TransitionStyle, leaveFunction = (link: string) => {window.location.href = link;}, externalLeaveFunction = (link: string) => {window.location.href = link;}) {\r\n const mainElement = document.getElementById(this.finalOptions.mainContentIdName)!;\r\n\r\n const linkElements = mainElement.getElementsByTagName(\"a\");\r\n for (let i = 0; i < linkElements.length; i++) {\r\n const linkElement = linkElements[i]!;\r\n linkElement.onclick = null;\r\n linkElement.addEventListener(\"click\", (e) => {this.HandleClickAnimation(e, defaultTransitionStyle, leaveFunction, externalLeaveFunction)});\r\n }\r\n }\r\n\r\n public getStorageRouteTransition(defaultTransitionStyle: TransitionStyle): TransitionStyle {\r\n const storageKey = sessionStorage.getItem(\"animationType\")\r\n if (storageKey != null && storageKey != \"animation\" && storageKey in this.routeTransitions) {\r\n return this.routeTransitions[storageKey]!;\r\n }\r\n return defaultTransitionStyle; \r\n }\r\n\r\n public EndPoint(defaultTransitionStyle: TransitionStyle) {\r\n defaultTransitionStyle = this.getStorageRouteTransition(defaultTransitionStyle);\r\n defaultTransitionStyle.hidePage(this.finalOptions);\r\n const mainElement = document.getElementById(this.finalOptions.mainContentIdName)!;\r\n mainElement.addEventListener(this.finalOptions.loadEvent, (e) => {\r\n e.stopPropagation();\r\n this.CallHook(\"animateSEP\", { style: defaultTransitionStyle });\r\n const doTransitionOnIgnoredLink = (this.finalOptions.animateIgnoredLinks || sessionStorage.getItem(\"animationType\") != \"ignore\");\r\n const doAnimateOnReload = (window.performance.getEntriesByType(\"navigation\")[0]?.entryType != \"reload\" || this.finalOptions.runAnimationOnPageReload);\r\n const doAnimateOnSameSite = this.isNavigationFromSameSite() || this.finalOptions.runAnimationOnCrossSite;\r\n if (doAnimateOnReload && doAnimateOnSameSite && doTransitionOnIgnoredLink) {\r\n setTimeout(\r\n () => {\r\n this.AnimatePageTransition(defaultTransitionStyle, \"reverse\");\r\n setTimeout(\r\n () => {\r\n this.CallHook(\"animateEEP\", { style: defaultTransitionStyle });\r\n defaultTransitionStyle.revealPage(this.finalOptions);\r\n }, this.finalOptions.pageRevealDelay\r\n );\r\n }, this.finalOptions.pageAnimationDelay\r\n );\r\n } else {\r\n this.CallHook(\"animateEPNA\", { style: defaultTransitionStyle })\r\n defaultTransitionStyle.revealPage(this.finalOptions);\r\n }\r\n }, { once: true });\r\n }\r\n\r\n public CallEndPoint(){\r\n const dispatchEvent = new Event(this.finalOptions.loadEvent);\r\n document.getElementById(this.finalOptions.mainContentIdName)!.dispatchEvent(dispatchEvent);\r\n }\r\n\r\n public SaveAndTransition(animationName: string, aStyle: TransitionStyle, direction: DirectionType = \"normal\") {\r\n this.AnimatePageTransition(aStyle, \"normal\");\r\n sessionStorage.setItem(\"animationType\", animationName);\r\n }\r\n\r\n public AnimatePageTransition(aStyle: TransitionStyle, direction: DirectionType = \"normal\") {\r\n const mainElement = document.getElementById(this.finalOptions.mainContentIdName)!;\r\n\r\n if (direction == \"normal\") {\r\n this.CallHook(\"animateSF\", { style: aStyle, ele: mainElement, });\r\n } else if (direction == \"reverse\") {\r\n this.CallHook(\"animateSR\", { style: aStyle, ele: mainElement, });\r\n }\r\n\r\n aStyle.handle(direction, mainElement);\r\n\r\n setTimeout(\r\n () => {\r\n if (direction == \"normal\") {\r\n this.CallHook(\"animateEF\", { style: aStyle, ele: mainElement, });\r\n } else if (direction == \"reverse\") {\r\n this.CallHook(\"animateER\", { style: aStyle, ele: mainElement, });\r\n }\r\n }, aStyle.duration\r\n );\r\n\r\n }\r\n}","import type { DirectionType } from \"../types/DirectionType\";\r\nimport type { TimingType } from \"../types/TimingType\";\r\nimport type { TransitionStyle } from \"../types/TransitionStyleInterface\";\r\nimport { KeyFrameBase } from \"./KeyFrameBase\";\r\n\r\nexport class StyleTransition extends KeyFrameBase {\r\n styleString: keyof CSSStyleDeclaration;\r\n startValue: string;\r\n endValue: string;\r\n constructor(styleString: keyof CSSStyleDeclaration, duration: number, startValue: string, endValue: string, timing: TimingType = \"linear\") {\r\n super(duration, timing);\r\n this.styleString = styleString;\r\n this.startValue = startValue\r\n this.endValue = endValue;\r\n }\r\n\r\n handle(direction: DirectionType, mainElement: HTMLElement): void {\r\n if (direction == \"normal\") {\r\n (mainElement.style as any)[this.styleString] = this.startValue;\r\n mainElement.style.transition = this.styleString.toString() + \" \" + this.duration.toString() + \"ms \" + this.timing;\r\n (mainElement.style as any)[this.styleString] = this.endValue;\r\n } else if (direction == \"reverse\") {\r\n (mainElement.style as any)[this.styleString] = this.endValue;\r\n mainElement.style.transition = this.styleString.toString() + \" \" + this.duration.toString() + \"ms \" + this.timing;\r\n setTimeout(\r\n () => {\r\n (mainElement.style as any)[this.styleString] = this.startValue;\r\n }, 40\r\n );\r\n\r\n }\r\n }\r\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,IAAM,eAAN,MAA8C;AAAA,EACjD;AAAA,EACA;AAAA,EACA,YAAY,UAAkB,SAAqB,UAAU;AACzD,SAAK,WAAW;AAChB,SAAK,SAAS;AAAA,EAClB;AAAA,EAEO,OAAO,WAA0B,aAAgC;AAAA,E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