reveal.js-appearance 1.3.4 → 1.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/LICENSE +1 -1
- package/README.md +107 -85
- package/package.json +72 -61
- package/plugin/appearance/appearance.css +9 -247
- package/plugin/appearance/appearance.js +1 -15
- package/plugin/appearance/appearance.mjs +673 -0
- package/CHANGELOG.md +0 -125
- package/plugin/appearance/appearance.esm.js +0 -15
|
@@ -0,0 +1,673 @@
|
|
|
1
|
+
/*****************************************************************
|
|
2
|
+
*
|
|
3
|
+
* reveal.js-appearance for Reveal.js
|
|
4
|
+
* Version 1.4.0
|
|
5
|
+
*
|
|
6
|
+
* @link
|
|
7
|
+
* https://github.com/martinomagnifico/reveal.js-appearance
|
|
8
|
+
*
|
|
9
|
+
* @author: Martijn De Jongh (Martino), martijn.de.jongh@gmail.com
|
|
10
|
+
* https://github.com/martinomagnifico
|
|
11
|
+
*
|
|
12
|
+
* @license
|
|
13
|
+
* MIT
|
|
14
|
+
*
|
|
15
|
+
* Copyright (C) 2026 Martijn De Jongh (Martino)
|
|
16
|
+
*
|
|
17
|
+
******************************************************************/
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
function k(e) {
|
|
21
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
22
|
+
}
|
|
23
|
+
var D, O;
|
|
24
|
+
function q() {
|
|
25
|
+
if (O) return D;
|
|
26
|
+
O = 1;
|
|
27
|
+
var e = function(o) {
|
|
28
|
+
return t(o) && !n(o);
|
|
29
|
+
};
|
|
30
|
+
function t(r) {
|
|
31
|
+
return !!r && typeof r == "object";
|
|
32
|
+
}
|
|
33
|
+
function n(r) {
|
|
34
|
+
var o = Object.prototype.toString.call(r);
|
|
35
|
+
return o === "[object RegExp]" || o === "[object Date]" || c(r);
|
|
36
|
+
}
|
|
37
|
+
var a = typeof Symbol == "function" && Symbol.for, i = a ? /* @__PURE__ */ Symbol.for("react.element") : 60103;
|
|
38
|
+
function c(r) {
|
|
39
|
+
return r.$$typeof === i;
|
|
40
|
+
}
|
|
41
|
+
function u(r) {
|
|
42
|
+
return Array.isArray(r) ? [] : {};
|
|
43
|
+
}
|
|
44
|
+
function s(r, o) {
|
|
45
|
+
return o.clone !== !1 && o.isMergeableObject(r) ? p(u(r), r, o) : r;
|
|
46
|
+
}
|
|
47
|
+
function l(r, o, f) {
|
|
48
|
+
return r.concat(o).map(function(h) {
|
|
49
|
+
return s(h, f);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function g(r, o) {
|
|
53
|
+
if (!o.customMerge)
|
|
54
|
+
return p;
|
|
55
|
+
var f = o.customMerge(r);
|
|
56
|
+
return typeof f == "function" ? f : p;
|
|
57
|
+
}
|
|
58
|
+
function b(r) {
|
|
59
|
+
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(r).filter(function(o) {
|
|
60
|
+
return Object.propertyIsEnumerable.call(r, o);
|
|
61
|
+
}) : [];
|
|
62
|
+
}
|
|
63
|
+
function y(r) {
|
|
64
|
+
return Object.keys(r).concat(b(r));
|
|
65
|
+
}
|
|
66
|
+
function d(r, o) {
|
|
67
|
+
try {
|
|
68
|
+
return o in r;
|
|
69
|
+
} catch {
|
|
70
|
+
return !1;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function C(r, o) {
|
|
74
|
+
return d(r, o) && !(Object.hasOwnProperty.call(r, o) && Object.propertyIsEnumerable.call(r, o));
|
|
75
|
+
}
|
|
76
|
+
function I(r, o, f) {
|
|
77
|
+
var h = {};
|
|
78
|
+
return f.isMergeableObject(r) && y(r).forEach(function(m) {
|
|
79
|
+
h[m] = s(r[m], f);
|
|
80
|
+
}), y(o).forEach(function(m) {
|
|
81
|
+
C(r, m) || (d(r, m) && f.isMergeableObject(o[m]) ? h[m] = g(m, f)(r[m], o[m], f) : h[m] = s(o[m], f));
|
|
82
|
+
}), h;
|
|
83
|
+
}
|
|
84
|
+
function p(r, o, f) {
|
|
85
|
+
f = f || {}, f.arrayMerge = f.arrayMerge || l, f.isMergeableObject = f.isMergeableObject || e, f.cloneUnlessOtherwiseSpecified = s;
|
|
86
|
+
var h = Array.isArray(o), m = Array.isArray(r), U = h === m;
|
|
87
|
+
return U ? h ? f.arrayMerge(r, o, f) : I(r, o, f) : s(o, f);
|
|
88
|
+
}
|
|
89
|
+
p.all = function(o, f) {
|
|
90
|
+
if (!Array.isArray(o))
|
|
91
|
+
throw new Error("first argument should be an array");
|
|
92
|
+
return o.reduce(function(h, m) {
|
|
93
|
+
return p(h, m, f);
|
|
94
|
+
}, {});
|
|
95
|
+
};
|
|
96
|
+
var S = p;
|
|
97
|
+
return D = S, D;
|
|
98
|
+
}
|
|
99
|
+
var B = q();
|
|
100
|
+
const V = /* @__PURE__ */ k(B);
|
|
101
|
+
let L = null;
|
|
102
|
+
const F = () => {
|
|
103
|
+
if (L) return L;
|
|
104
|
+
const e = typeof window < "u", t = typeof document < "u";
|
|
105
|
+
let n = !1;
|
|
106
|
+
try {
|
|
107
|
+
const i = new Function('return typeof module !== "undefined" && !!module.hot')(), c = new Function('return typeof import.meta !== "undefined" && !!import.meta.hot')();
|
|
108
|
+
n = i || c;
|
|
109
|
+
} catch {
|
|
110
|
+
}
|
|
111
|
+
let a = !1;
|
|
112
|
+
try {
|
|
113
|
+
a = new Function('return typeof import.meta !== "undefined" && import.meta.env?.DEV === true')();
|
|
114
|
+
} catch {
|
|
115
|
+
}
|
|
116
|
+
return L = {
|
|
117
|
+
isDevelopment: n || a,
|
|
118
|
+
hasHMR: n,
|
|
119
|
+
isViteDev: a,
|
|
120
|
+
hasWindow: e,
|
|
121
|
+
hasDocument: t
|
|
122
|
+
}, L;
|
|
123
|
+
};
|
|
124
|
+
class J {
|
|
125
|
+
defaultConfig;
|
|
126
|
+
pluginInit;
|
|
127
|
+
pluginId;
|
|
128
|
+
mergedConfig = null;
|
|
129
|
+
userConfigData = null;
|
|
130
|
+
/** Public data storage for plugin state */
|
|
131
|
+
data = {};
|
|
132
|
+
// Create a new plugin instance
|
|
133
|
+
constructor(t, n, a) {
|
|
134
|
+
typeof t == "string" ? (this.pluginId = t, this.pluginInit = n, this.defaultConfig = a || {}) : (this.pluginId = t.id, this.pluginInit = t.init, this.defaultConfig = t.defaultConfig || {});
|
|
135
|
+
}
|
|
136
|
+
// Initialize plugin configuration by merging default and user settings
|
|
137
|
+
initializeConfig(t) {
|
|
138
|
+
const n = this.defaultConfig, a = t.getConfig()[this.pluginId] || {};
|
|
139
|
+
this.userConfigData = a, this.mergedConfig = V(n, a, {
|
|
140
|
+
arrayMerge: (i, c) => c,
|
|
141
|
+
clone: !0
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
// Get the current plugin configuration
|
|
145
|
+
getCurrentConfig() {
|
|
146
|
+
if (!this.mergedConfig)
|
|
147
|
+
throw new Error("Plugin configuration has not been initialized");
|
|
148
|
+
return this.mergedConfig;
|
|
149
|
+
}
|
|
150
|
+
// Get plugin data if any exists
|
|
151
|
+
getData() {
|
|
152
|
+
return Object.keys(this.data).length > 0 ? this.data : void 0;
|
|
153
|
+
}
|
|
154
|
+
get userConfig() {
|
|
155
|
+
return this.userConfigData || {};
|
|
156
|
+
}
|
|
157
|
+
// Gets information about the current JavaScript environment
|
|
158
|
+
getEnvironmentInfo = () => F();
|
|
159
|
+
// Initialize the plugin
|
|
160
|
+
init(t) {
|
|
161
|
+
if (this.initializeConfig(t), this.pluginInit)
|
|
162
|
+
return this.pluginInit(this, t, this.getCurrentConfig());
|
|
163
|
+
}
|
|
164
|
+
// Create the plugin interface containing all exports
|
|
165
|
+
createInterface(t = {}) {
|
|
166
|
+
return {
|
|
167
|
+
id: this.pluginId,
|
|
168
|
+
init: (n) => this.init(n),
|
|
169
|
+
getConfig: () => this.getCurrentConfig(),
|
|
170
|
+
getData: () => this.getData(),
|
|
171
|
+
...t
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const G = (e) => {
|
|
176
|
+
const t = document.querySelector(
|
|
177
|
+
`script[src$="${e}.js"], script[src$="${e}.min.js"], script[src$="${e}.mjs"]`
|
|
178
|
+
);
|
|
179
|
+
if (t?.src) {
|
|
180
|
+
const n = t.getAttribute("src") || "", a = n.lastIndexOf("/");
|
|
181
|
+
if (a !== -1)
|
|
182
|
+
return n.substring(0, a + 1);
|
|
183
|
+
}
|
|
184
|
+
try {
|
|
185
|
+
if (typeof import.meta < "u" && import.meta.url)
|
|
186
|
+
return import.meta.url.slice(0, import.meta.url.lastIndexOf("/") + 1);
|
|
187
|
+
} catch {
|
|
188
|
+
}
|
|
189
|
+
return `plugin/${e}/`;
|
|
190
|
+
}, R = "data-css-id", W = (e, t) => new Promise((n, a) => {
|
|
191
|
+
const i = document.createElement("link");
|
|
192
|
+
i.rel = "stylesheet", i.href = t, i.setAttribute(R, e);
|
|
193
|
+
const c = setTimeout(() => {
|
|
194
|
+
i.parentNode && i.parentNode.removeChild(i), a(new Error(`[${e}] Timeout loading CSS from: ${t}`));
|
|
195
|
+
}, 5e3);
|
|
196
|
+
i.onload = () => {
|
|
197
|
+
clearTimeout(c), n();
|
|
198
|
+
}, i.onerror = () => {
|
|
199
|
+
clearTimeout(c), i.parentNode && i.parentNode.removeChild(i), a(new Error(`[${e}] Failed to load CSS from: ${t}`));
|
|
200
|
+
}, document.head.appendChild(i);
|
|
201
|
+
}), T = (e) => document.querySelectorAll(`[${R}="${e}"]`).length > 0, K = (e) => new Promise((t) => {
|
|
202
|
+
if (n())
|
|
203
|
+
return t(!0);
|
|
204
|
+
setTimeout(() => {
|
|
205
|
+
t(n());
|
|
206
|
+
}, 50);
|
|
207
|
+
function n() {
|
|
208
|
+
if (T(e)) return !0;
|
|
209
|
+
try {
|
|
210
|
+
return window.getComputedStyle(document.documentElement).getPropertyValue(`--cssimported-${e}`).trim() !== "";
|
|
211
|
+
} catch {
|
|
212
|
+
return !1;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}), j = async (e) => {
|
|
216
|
+
const { id: t, cssautoload: n = !0, csspath: a = "", debug: i = !1 } = e;
|
|
217
|
+
if (n === !1 || a === !1) return;
|
|
218
|
+
if (T(t) && !(typeof a == "string" && a.trim() !== "")) {
|
|
219
|
+
i && console.log(`[${t}] CSS is already loaded, skipping`);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
T(t) && typeof a == "string" && a.trim() !== "" && i && console.log(`[${t}] CSS is already loaded, also loading user-specified path: ${a}`);
|
|
223
|
+
const c = [];
|
|
224
|
+
typeof a == "string" && a.trim() !== "" && c.push(a);
|
|
225
|
+
const u = G(t);
|
|
226
|
+
if (u) {
|
|
227
|
+
const l = `${u}${t}.css`;
|
|
228
|
+
c.push(l);
|
|
229
|
+
}
|
|
230
|
+
const s = `plugin/${t}/${t}.css`;
|
|
231
|
+
c.push(s);
|
|
232
|
+
for (const l of c)
|
|
233
|
+
try {
|
|
234
|
+
await W(t, l);
|
|
235
|
+
let g = "CSS";
|
|
236
|
+
a && l === a ? g = "user-specified CSS" : u && l === `${u}${t}.css` ? g = "CSS (auto-detected from script location)" : g = "CSS (standard fallback)", i && console.log(`[${t}] ${g} loaded successfully from: ${l}`);
|
|
237
|
+
return;
|
|
238
|
+
} catch {
|
|
239
|
+
i && console.log(`[${t}] Failed to load CSS from: ${l}`);
|
|
240
|
+
}
|
|
241
|
+
console.warn(`[${t}] Could not load CSS from any location`);
|
|
242
|
+
};
|
|
243
|
+
async function Y(e, t) {
|
|
244
|
+
if ("getEnvironmentInfo" in e && t) {
|
|
245
|
+
const n = e, a = n.getEnvironmentInfo();
|
|
246
|
+
if (await K(n.pluginId) && !(typeof t.csspath == "string" && t.csspath.trim() !== "")) {
|
|
247
|
+
t.debug && console.log(`[${n.pluginId}] CSS is already imported, skipping`);
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
if ("cssautoload" in n.userConfig ? t.cssautoload : !a.isDevelopment)
|
|
251
|
+
return j({
|
|
252
|
+
id: n.pluginId,
|
|
253
|
+
cssautoload: !0,
|
|
254
|
+
csspath: t.csspath,
|
|
255
|
+
debug: t.debug
|
|
256
|
+
});
|
|
257
|
+
a.isDevelopment && console.warn(
|
|
258
|
+
`[${n.pluginId}] CSS autoloading is disabled in bundler environments. Please import the CSS manually, using import.`
|
|
259
|
+
);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
return j(e);
|
|
263
|
+
}
|
|
264
|
+
class Q {
|
|
265
|
+
// Flag to enable/disable all debugging output
|
|
266
|
+
debugMode = !1;
|
|
267
|
+
// Label to prefix all debug messages with
|
|
268
|
+
label = "DEBUG";
|
|
269
|
+
// Tracks the current depth of console groups for proper formatting
|
|
270
|
+
groupDepth = 0;
|
|
271
|
+
// Initializes the debug utility with custom settings.
|
|
272
|
+
initialize(t, n = "DEBUG") {
|
|
273
|
+
this.debugMode = t, this.label = n;
|
|
274
|
+
}
|
|
275
|
+
// Creates a new console group and tracks the group depth.
|
|
276
|
+
// Groups will always display the label prefix in their header.
|
|
277
|
+
group = (...t) => {
|
|
278
|
+
this.debugLog("group", ...t), this.groupDepth++;
|
|
279
|
+
};
|
|
280
|
+
// Creates a new collapsed console group and tracks the group depth.
|
|
281
|
+
groupCollapsed = (...t) => {
|
|
282
|
+
this.debugLog("groupCollapsed", ...t), this.groupDepth++;
|
|
283
|
+
};
|
|
284
|
+
// Ends the current console group and updates the group depth tracker.
|
|
285
|
+
groupEnd = () => {
|
|
286
|
+
this.groupDepth > 0 && (this.groupDepth--, this.debugLog("groupEnd"));
|
|
287
|
+
};
|
|
288
|
+
// Formats and logs an error message with the debug label.
|
|
289
|
+
// Error messages are always shown, even when debug mode is disabled.
|
|
290
|
+
error = (...t) => {
|
|
291
|
+
const n = this.debugMode;
|
|
292
|
+
this.debugMode = !0, this.formatAndLog(console.error, t), this.debugMode = n;
|
|
293
|
+
};
|
|
294
|
+
// Displays a table in the console with the pluginDebug label.
|
|
295
|
+
// Special implementation for console.table to handle tabular data properly.
|
|
296
|
+
// @param messageOrData - Either a message string or the tabular data
|
|
297
|
+
// @param propertiesOrData - Either property names or tabular data (if first param was message)
|
|
298
|
+
// @param optionalProperties - Optional property names (if first param was message)
|
|
299
|
+
table = (t, n, a) => {
|
|
300
|
+
if (this.debugMode)
|
|
301
|
+
try {
|
|
302
|
+
typeof t == "string" && n !== void 0 && typeof n != "string" ? (this.groupDepth === 0 ? console.log(`[${this.label}]: ${t}`) : console.log(t), a ? console.table(n, a) : console.table(n)) : (this.groupDepth === 0 && console.log(`[${this.label}]: Table data`), typeof n == "object" && Array.isArray(n) ? console.table(t, n) : console.table(t));
|
|
303
|
+
} catch (i) {
|
|
304
|
+
console.error(`[${this.label}]: Error showing table:`, i), console.log(`[${this.label}]: Raw data:`, t);
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
// Helper method that formats and logs messages with the pluginDebug label.
|
|
308
|
+
// @param logMethod - The console method to use for logging
|
|
309
|
+
// @param args - Arguments to pass to the console method
|
|
310
|
+
formatAndLog = (t, n) => {
|
|
311
|
+
if (this.debugMode)
|
|
312
|
+
try {
|
|
313
|
+
this.groupDepth > 0 ? t.call(console, ...n) : n.length > 0 && typeof n[0] == "string" ? t.call(console, `[${this.label}]: ${n[0]}`, ...n.slice(1)) : t.call(console, `[${this.label}]:`, ...n);
|
|
314
|
+
} catch (a) {
|
|
315
|
+
console.error(`[${this.label}]: Error in logging:`, a), console.log(`[${this.label}]: Original log data:`, ...n);
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
// Core method that handles calling console methods with proper formatting.
|
|
319
|
+
// - Adds label prefix to messages outside of groups
|
|
320
|
+
// - Skips label prefix for messages inside groups to avoid redundancy
|
|
321
|
+
// - Always adds label prefix to group headers
|
|
322
|
+
// - Error messages are always shown regardless of debug mode
|
|
323
|
+
// @param methodName - Name of the console method to call
|
|
324
|
+
// @param args - Arguments to pass to the console method
|
|
325
|
+
debugLog(t, ...n) {
|
|
326
|
+
const a = console[t];
|
|
327
|
+
if (!this.debugMode && t !== "error" || typeof a != "function") return;
|
|
328
|
+
const i = a;
|
|
329
|
+
if (t === "group" || t === "groupCollapsed") {
|
|
330
|
+
n.length > 0 && typeof n[0] == "string" ? i.call(console, `[${this.label}]: ${n[0]}`, ...n.slice(1)) : i.call(console, `[${this.label}]:`, ...n);
|
|
331
|
+
return;
|
|
332
|
+
}
|
|
333
|
+
if (t === "groupEnd") {
|
|
334
|
+
i.call(console);
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
if (t === "table") {
|
|
338
|
+
n.length === 1 ? this.table(n[0]) : n.length === 2 ? typeof n[0] == "string" ? this.table(n[0], n[1]) : this.table(n[0], n[1]) : n.length >= 3 && this.table(
|
|
339
|
+
n[0],
|
|
340
|
+
n[1],
|
|
341
|
+
n[2]
|
|
342
|
+
);
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
this.groupDepth > 0 ? i.call(console, ...n) : n.length > 0 && typeof n[0] == "string" ? i.call(console, `[${this.label}]: ${n[0]}`, ...n.slice(1)) : i.call(console, `[${this.label}]:`, ...n);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
const X = (e) => new Proxy(e, {
|
|
349
|
+
get: (t, n) => {
|
|
350
|
+
if (n in t)
|
|
351
|
+
return t[n];
|
|
352
|
+
const a = n.toString();
|
|
353
|
+
if (typeof console[a] == "function")
|
|
354
|
+
return (...i) => {
|
|
355
|
+
t.debugLog(a, ...i);
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
}), v = X(new Q());
|
|
359
|
+
var P = /* @__PURE__ */ ((e) => (e.HORIZONTAL = "horizontal", e.STACK = "stack", e.VERTICAL = "vertical", e.INVALID = "invalid", e))(P || {});
|
|
360
|
+
const A = (e) => e instanceof HTMLElement && e.tagName === "SECTION", w = (e) => A(e) ? Array.from(e.children).some(
|
|
361
|
+
(t) => t instanceof HTMLElement && t.tagName === "SECTION"
|
|
362
|
+
) : !1, $ = (e) => A(e) ? e.parentElement instanceof HTMLElement && e.parentElement.tagName === "SECTION" : !1, Z = (e) => A(e) && !$(e) && !w(e), ee = (e) => {
|
|
363
|
+
if (!A(e)) return null;
|
|
364
|
+
if ($(e)) {
|
|
365
|
+
const t = e.parentElement;
|
|
366
|
+
if (t instanceof HTMLElement && w(t))
|
|
367
|
+
return t;
|
|
368
|
+
}
|
|
369
|
+
return null;
|
|
370
|
+
}, te = (e) => A(e) ? $(e) ? "vertical" : w(e) ? "stack" : "horizontal" : "invalid", ne = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
371
|
+
__proto__: null,
|
|
372
|
+
SectionType: P,
|
|
373
|
+
getSectionType: te,
|
|
374
|
+
getStack: ee,
|
|
375
|
+
isHorizontal: Z,
|
|
376
|
+
isSection: A,
|
|
377
|
+
isStack: w,
|
|
378
|
+
isVertical: $
|
|
379
|
+
}, Symbol.toStringTag, { value: "Module" })), ae = {
|
|
380
|
+
baseclass: "animate__animated",
|
|
381
|
+
hideagain: !0,
|
|
382
|
+
delay: 300,
|
|
383
|
+
appearevent: "slidetransitionend",
|
|
384
|
+
autoappear: !1,
|
|
385
|
+
autoelements: !1,
|
|
386
|
+
appearparents: !1,
|
|
387
|
+
initdelay: 0,
|
|
388
|
+
cssautoload: !0,
|
|
389
|
+
csspath: "",
|
|
390
|
+
compatibility: !1,
|
|
391
|
+
compatibilitybaseclass: "animated"
|
|
392
|
+
};
|
|
393
|
+
function ie(e, t, n) {
|
|
394
|
+
const a = {
|
|
395
|
+
baseclass: e,
|
|
396
|
+
compatibilitybaseclass: t,
|
|
397
|
+
fragmentSelector: ".fragment",
|
|
398
|
+
fragmentClass: "fragment",
|
|
399
|
+
speedClasses: ["slower", "slow", "fast", "faster"],
|
|
400
|
+
animatecss: '[class^="animate__"],[class*=" animate__"]',
|
|
401
|
+
eventnames: [
|
|
402
|
+
"ready",
|
|
403
|
+
"slidechanged",
|
|
404
|
+
"slidetransitionend",
|
|
405
|
+
"autoanimate",
|
|
406
|
+
"overviewhidden"
|
|
407
|
+
]
|
|
408
|
+
};
|
|
409
|
+
return a.speedClasses = [
|
|
410
|
+
...a.speedClasses,
|
|
411
|
+
...a.speedClasses.map((i) => `animate__${i}`)
|
|
412
|
+
], n && (a.animatecss = ".backInDown, .backInLeft, .backInRight, .backInUp, .bounceIn, .bounceInDown, .bounceInLeft, .bounceInRight, .bounceInUp, .fadeIn, .fadeInDown, .fadeInDownBig, .fadeInLeft, .fadeInLeftBig, .fadeInRight, .fadeInRightBig, .fadeInUp, .fadeInUpBig, .fadeInTopLeft, .fadeInTopRight, .fadeInBottomLeft, .fadeInBottomRight, .flipInX, .flipInY, .lightSpeedInRight, .lightSpeedInLeft, .rotateIn, .rotateInDownLeft, .rotateInDownRight, .rotateInUpLeft, .rotateInUpRight, .jackInTheBox, .rollIn, .zoomIn, .zoomInDown, .zoomInLeft, .zoomInRight, .zoomInUp, .slideInDown, .slideInLeft, .slideInRight, .slideInUp, .skidLeft, .skidLeftBig, .skidRight, .skidRightBig, .shrinkIn, .shrinkInBlur", a.baseclass = t), a;
|
|
413
|
+
}
|
|
414
|
+
const re = (e) => {
|
|
415
|
+
try {
|
|
416
|
+
return JSON.parse(e) && !!e;
|
|
417
|
+
} catch {
|
|
418
|
+
return !1;
|
|
419
|
+
}
|
|
420
|
+
}, x = (e) => {
|
|
421
|
+
if (e == null)
|
|
422
|
+
return "";
|
|
423
|
+
let t = "", n = e;
|
|
424
|
+
return typeof n == "string" && (n = n.replace(/[“”]/g, '"').replace(/[‘’]/g, "'")), re(e) ? t = e : typeof e == "object" ? t = JSON.stringify(e, null, 2) : typeof e == "string" && (t = e.trim().replace(/'/g, '"').charAt(0) === "{" ? e.trim().replace(/'/g, '"') : `{${e.trim().replace(/'/g, '"')}}`), t;
|
|
425
|
+
}, se = (e, t, n) => {
|
|
426
|
+
for (const a of Array.from(e.attributes))
|
|
427
|
+
a.nodeName.startsWith("data") && a.nodeName !== n && t.setAttribute(a.nodeName, a.nodeValue || "");
|
|
428
|
+
}, oe = (e) => {
|
|
429
|
+
const t = document.createElement("textarea");
|
|
430
|
+
return t.innerHTML = e, t.value;
|
|
431
|
+
}, le = (e) => e.replace(/[\u2018\u2019]/g, "'").replace(/[\u201C\u201D]/g, '"'), N = (e, t = !1) => {
|
|
432
|
+
if (!e) return null;
|
|
433
|
+
if (typeof e == "object" && e !== null && !Array.isArray(e))
|
|
434
|
+
return e;
|
|
435
|
+
if (typeof e == "boolean")
|
|
436
|
+
return null;
|
|
437
|
+
if (typeof e == "string")
|
|
438
|
+
try {
|
|
439
|
+
let n = e;
|
|
440
|
+
return t && (n = le(oe(e))), JSON.parse(x(n));
|
|
441
|
+
} catch (n) {
|
|
442
|
+
return v.log(`Error parsing autoelements: ${n} (${e})`), null;
|
|
443
|
+
}
|
|
444
|
+
return null;
|
|
445
|
+
}, ce = (e) => typeof e == "object" && e !== null, fe = (e, t, n) => {
|
|
446
|
+
let a = null, i = null;
|
|
447
|
+
if (t.autoappear && t.autoelements && (i = N(t.autoelements, !1)), e instanceof HTMLElement && e.hasAttribute("data-autoappear")) {
|
|
448
|
+
const c = e.dataset.autoappear;
|
|
449
|
+
if (c === "auto" || c === "" || c === "true")
|
|
450
|
+
a = i;
|
|
451
|
+
else {
|
|
452
|
+
const s = N(c || "", !0);
|
|
453
|
+
i && s ? a = { ...i, ...s } : s ? a = s : a = i;
|
|
454
|
+
}
|
|
455
|
+
} else i && (a = i);
|
|
456
|
+
if (a)
|
|
457
|
+
try {
|
|
458
|
+
const c = JSON.parse(x(a));
|
|
459
|
+
for (const [u, s] of Object.entries(c)) {
|
|
460
|
+
const l = Array.from(e.querySelectorAll(u)).filter((y) => {
|
|
461
|
+
if (n.includes(y)) return !1;
|
|
462
|
+
for (const d of n)
|
|
463
|
+
if (d.contains(y) && d !== y)
|
|
464
|
+
return !1;
|
|
465
|
+
return !0;
|
|
466
|
+
});
|
|
467
|
+
if (l.length === 0) continue;
|
|
468
|
+
let g = null, b = 0;
|
|
469
|
+
for (let y = 0; y < l.length; y++) {
|
|
470
|
+
const d = l[y], C = d.parentElement;
|
|
471
|
+
C !== g && (g = C, b = 0), n.push(d);
|
|
472
|
+
let I = [], p = null, S = !1, r = null, o = null;
|
|
473
|
+
if (Array.isArray(s))
|
|
474
|
+
I = String(s[0]).split(/[ ,]+/), p = s[1] !== void 0 ? String(s[1]) : null;
|
|
475
|
+
else if (typeof s == "string")
|
|
476
|
+
I = s.split(/[ ,]+/);
|
|
477
|
+
else if (ce(s)) {
|
|
478
|
+
if (s.class || s.animation) {
|
|
479
|
+
const f = s.animation || s.class;
|
|
480
|
+
I = String(f).split(/[ ,]+/);
|
|
481
|
+
}
|
|
482
|
+
s.speed && (S = String(s.speed), S.includes("animate__") || (S = `animate__${S}`)), s.delay !== void 0 && (p = String(s.delay)), s.split !== void 0 && (r = String(s.split)), s["container-delay"] !== void 0 && (o = String(s["container-delay"]));
|
|
483
|
+
}
|
|
484
|
+
I.length > 0 && d.classList.add(...I), S && d.classList.add(S), d instanceof HTMLElement && (r ? (p && (d.dataset.delay = p), o && (d.dataset.containerDelay = o), d.dataset.split = r) : o && b === 0 ? d.dataset.delay = o : p && b > 0 && !d.dataset.delay && (d.dataset.delay = p)), b++;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
} catch (c) {
|
|
488
|
+
v.log(t, `Error processing auto animations: ${c}`);
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
function ue(e, t) {
|
|
492
|
+
e.classList.contains(t.baseclass) || e.classList.add(t.baseclass), e.classList.contains(t.fragmentClass) && e.classList.add("custom");
|
|
493
|
+
}
|
|
494
|
+
function de(e, t) {
|
|
495
|
+
let n = 0;
|
|
496
|
+
e.forEach((a, i) => {
|
|
497
|
+
if (!(a instanceof HTMLElement && a.style.animationDelay) && (i === 0 && a instanceof HTMLElement && a.dataset.delay || i !== 0)) {
|
|
498
|
+
let c = t.delay;
|
|
499
|
+
if (a instanceof HTMLElement && a.dataset && a.dataset.delay) {
|
|
500
|
+
const u = Number.parseInt(a.dataset.delay, 10);
|
|
501
|
+
Number.isNaN(u) || (c = u);
|
|
502
|
+
}
|
|
503
|
+
n = n + c, a instanceof HTMLElement && (a.style.setProperty("animation-delay", `${n}ms`), a.removeAttribute("data-delay"));
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
function ge(e, t) {
|
|
508
|
+
let n = !1, a = " ";
|
|
509
|
+
if (e.textContent?.trim() && (t === "words" ? n = e.textContent.trim().split(/\s+/) || [] : t === "letters" && (n = e.textContent.trim().split("") || [], a = ""), n && n.length > 0)) {
|
|
510
|
+
const i = Array.from(e.classList).filter(
|
|
511
|
+
(u) => u.startsWith("animate__")
|
|
512
|
+
), c = n.map((u, s) => {
|
|
513
|
+
const l = document.createElement("span");
|
|
514
|
+
l.textContent = u === " " ? " " : u, e.dataset.delay && s !== 0 && (l.dataset.delay = e.dataset.delay), e.dataset.containerDelay && s === 0 && (l.dataset.delay = e.dataset.containerDelay);
|
|
515
|
+
for (let g = 0; g < i.length; g++)
|
|
516
|
+
l.classList.add(i[g]);
|
|
517
|
+
return l.outerHTML;
|
|
518
|
+
}).join(a);
|
|
519
|
+
e.classList.add("wordchargroup");
|
|
520
|
+
for (let u = 0; u < i.length; u++)
|
|
521
|
+
e.classList.remove(i[u]);
|
|
522
|
+
e.removeAttribute("data-delay"), e.removeAttribute("data-split"), e.removeAttribute("data-container-delay"), e.innerHTML = c;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
function _(e, t) {
|
|
526
|
+
const n = e.parentNode;
|
|
527
|
+
if (n) {
|
|
528
|
+
for (const a of Array.from(n.children))
|
|
529
|
+
if (a !== e && a.dataset.appearParent) return;
|
|
530
|
+
n instanceof Element && (n.classList.value = e.classList.value, se(e, n, "data-appear-parent"), n.innerHTML = e.innerHTML, t && n.classList.add(t));
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
function me(e, t, n) {
|
|
534
|
+
const a = n.baseclass;
|
|
535
|
+
if (e.hasAttribute("data-appear-parent") && _(e, a), t.appearparents && e.parentNode && e.parentNode instanceof Element && e.tagName === "SPAN" && e.parentNode.tagName === "LI") {
|
|
536
|
+
const i = e.outerHTML.length, c = e.parentNode.innerHTML.length;
|
|
537
|
+
i === c && _(e);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
const pe = (e, t, n) => Array.from(n.querySelectorAll(`.${e}`)).filter(
|
|
541
|
+
(a) => !a.closest(`.${t}`)
|
|
542
|
+
), he = (e, t, n) => Array.from(n.querySelectorAll(`.${e}`)).filter(
|
|
543
|
+
(a) => a.closest(`.${t}`) === n
|
|
544
|
+
), ye = (e, t, n) => {
|
|
545
|
+
if (!t) return !1;
|
|
546
|
+
const a = [
|
|
547
|
+
pe(t, n, e),
|
|
548
|
+
...Array.from(e.querySelectorAll(`.${n}`)).map(
|
|
549
|
+
(i) => he(t, n, i)
|
|
550
|
+
)
|
|
551
|
+
];
|
|
552
|
+
return a.some((i) => i.length > 0) ? a : !1;
|
|
553
|
+
};
|
|
554
|
+
function be(e) {
|
|
555
|
+
return {
|
|
556
|
+
from: e.fromSlide || e.previousSlide || null,
|
|
557
|
+
to: e.toSlide || e.currentSlide || null
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
function Se(e, t) {
|
|
561
|
+
e.dataset.appearevent && e.dataset.appearevent === "auto" && (e.dataset.appearevent = "autoanimate");
|
|
562
|
+
let n = t.appearevent;
|
|
563
|
+
return n === "auto" && (n = "autoanimate"), e.dataset.appearevent || n;
|
|
564
|
+
}
|
|
565
|
+
function E(e, t) {
|
|
566
|
+
t.hideagain && e.from && e.from.dataset.appearanceCanStart && e.from.removeAttribute("data-appearance-can-start");
|
|
567
|
+
}
|
|
568
|
+
function H(e, t, n) {
|
|
569
|
+
if (t.hideagain && e && e.from) {
|
|
570
|
+
const a = e.from.querySelectorAll(n.animatecss);
|
|
571
|
+
if (a)
|
|
572
|
+
for (const c of a)
|
|
573
|
+
c.classList.remove("animationended");
|
|
574
|
+
const i = e.from.querySelectorAll(".fragment.visible");
|
|
575
|
+
if (i)
|
|
576
|
+
for (const c of i)
|
|
577
|
+
c.classList.remove("animationended");
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
function ve(e, t, n, a, i) {
|
|
581
|
+
const u = a.getViewportElement().classList.contains("reveal-scroll"), s = e.type, l = be(e);
|
|
582
|
+
if (l.to) {
|
|
583
|
+
if (s === "ready") {
|
|
584
|
+
const b = l.to.dataset.initdelay ? parseInt(l.to.dataset.initdelay, 10) : t.initdelay || 0;
|
|
585
|
+
i.value && b > 0 ? setTimeout(() => {
|
|
586
|
+
l.to && (l.to.dataset.appearanceCanStart = "true"), i.value = !1;
|
|
587
|
+
}, b) : (l.to.dataset.appearanceCanStart = "true", i.value = !1);
|
|
588
|
+
}
|
|
589
|
+
const g = Se(l.to, t);
|
|
590
|
+
(s === g || s === "slidetransitionend" && g === "autoanimate") && (l.to.dataset.appearanceCanStart = "true"), u && s === "slidechanged" && (E(l, t), H(l, t, n), setTimeout(() => {
|
|
591
|
+
l.to && (l.to.dataset.appearanceCanStart = "true");
|
|
592
|
+
}, t.delay)), s === "slidetransitionend" && (E(l, t), H(l, t, n)), s === "slidechanged" && document.body.dataset.exitoverview ? (E(l, t), l.to.dataset.appearanceCanStart = "true") : s === "overviewhidden" && (document.body.dataset.exitoverview = "true", setTimeout(() => {
|
|
593
|
+
document.body.removeAttribute("data-exitoverview");
|
|
594
|
+
}, 500), e.currentSlide && (E(l, t), l.to.dataset.appearanceCanStart = "true"));
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
class M {
|
|
598
|
+
deck;
|
|
599
|
+
viewport;
|
|
600
|
+
slides;
|
|
601
|
+
options;
|
|
602
|
+
consts;
|
|
603
|
+
sections;
|
|
604
|
+
regularSections;
|
|
605
|
+
appearances;
|
|
606
|
+
isInitialLoad;
|
|
607
|
+
constructor(t, n) {
|
|
608
|
+
this.deck = t, this.options = n, this.isInitialLoad = !0, this.viewport = t.getViewportElement(), this.slides = t.getSlidesElement(), this.consts = ie(
|
|
609
|
+
n.baseclass,
|
|
610
|
+
n.compatibilitybaseclass,
|
|
611
|
+
n.compatibility
|
|
612
|
+
), this.sections = this.slides.querySelectorAll("section"), this.regularSections = Array.from(this.sections).filter(
|
|
613
|
+
(a) => !ne.isStack(a)
|
|
614
|
+
), this.appearances = [], /receiver/i.test(window.location.search) && this.viewport.classList.add("sv");
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* Prepare appearance elements
|
|
618
|
+
*/
|
|
619
|
+
async prepareElements() {
|
|
620
|
+
this.appearances = Array.from(this.slides.querySelectorAll(this.consts.animatecss));
|
|
621
|
+
for (const t of this.regularSections)
|
|
622
|
+
fe(t, this.options, this.appearances);
|
|
623
|
+
for (const t of this.appearances)
|
|
624
|
+
me(t, this.options, this.consts), ue(t, this.consts), t instanceof HTMLElement && t.dataset.split && ge(t, t.dataset.split);
|
|
625
|
+
for (const t of this.regularSections) {
|
|
626
|
+
const n = ye(
|
|
627
|
+
t,
|
|
628
|
+
this.consts.baseclass,
|
|
629
|
+
this.consts.fragmentClass
|
|
630
|
+
);
|
|
631
|
+
if (n)
|
|
632
|
+
for (const a of n)
|
|
633
|
+
de(a, this.options);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Set up event listeners
|
|
638
|
+
*/
|
|
639
|
+
setupEventListeners() {
|
|
640
|
+
v.log("Options:", this.options), v.log("Setting up event listeners");
|
|
641
|
+
const t = { value: this.isInitialLoad };
|
|
642
|
+
for (const n of this.consts.eventnames)
|
|
643
|
+
v.log(`Adding listener for ${n} event`), this.deck.on(n, (a) => {
|
|
644
|
+
ve(a, this.options, this.consts, this.deck, t), this.isInitialLoad = t.value;
|
|
645
|
+
});
|
|
646
|
+
this.viewport.addEventListener("animationend", (n) => {
|
|
647
|
+
n.target.classList.add("animationended");
|
|
648
|
+
}), this.viewport.addEventListener("autoanimate", (n) => {
|
|
649
|
+
v.log("Autoanimate event triggered:", n);
|
|
650
|
+
}), this.viewport.addEventListener("fragmenthidden", (n) => {
|
|
651
|
+
const a = n;
|
|
652
|
+
if (a.fragment) {
|
|
653
|
+
a.fragment.classList.remove("animationended");
|
|
654
|
+
const i = a.fragment.querySelectorAll(".animationended");
|
|
655
|
+
for (const c of i)
|
|
656
|
+
c.classList.remove("animationended");
|
|
657
|
+
}
|
|
658
|
+
});
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* Create a new Appearance instance
|
|
662
|
+
*/
|
|
663
|
+
static async create(t, n) {
|
|
664
|
+
const a = new M(t, n);
|
|
665
|
+
return await a.prepareElements(), a.setupEventListeners(), a;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
const z = "appearance", Ie = async (e, t, n) => {
|
|
669
|
+
v && n.debug && v.initialize(!0, z), await Y(e, n), await M.create(t, n);
|
|
670
|
+
}, Ae = () => new J(z, Ie, ae).createInterface();
|
|
671
|
+
export {
|
|
672
|
+
Ae as default
|
|
673
|
+
};
|