fca-kaiyo 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fca-kaiyo might be problematic. Click here for more details.
- package/.gitattributes +2 -0
- package/Extra/Database/index.js +469 -0
- package/Extra/ExtraAddons.js +82 -0
- package/Extra/ExtraFindUID.js +62 -0
- package/Extra/ExtraGetThread.js +340 -0
- package/Extra/ExtraScreenShot.js +430 -0
- package/Extra/ExtraUptimeRobot.js +38 -0
- package/Extra/Html/Classic/script.js +833 -0
- package/Extra/Html/Classic/style.css +1222 -0
- package/Extra/Security/Index.js +173 -0
- package/Extra/Security/Step_1.js +6 -0
- package/Extra/Security/Step_2.js +22 -0
- package/Extra/Security/Step_3.js +22 -0
- package/Extra/Src/Change_Environment.js +24 -0
- package/Extra/Src/Check_Update.js +66 -0
- package/Extra/Src/History.js +115 -0
- package/Extra/Src/Instant_Update.js +64 -0
- package/Extra/Src/Last-Run.js +65 -0
- package/Extra/Src/Release_Memory.js +41 -0
- package/Extra/Src/image/checkmate.jpg +0 -0
- package/Extra/Src/uuid.js +137 -0
- package/Func/AcceptAgreement.js +31 -0
- package/Func/ClearCache.js +64 -0
- package/Func/ReportV1.js +54 -0
- package/Index.js +378 -0
- package/LICENSE +21 -0
- package/Language/index.json +224 -0
- package/Main.js +1110 -0
- package/README.md +144 -0
- package/broadcast.js +40 -0
- package/logger.js +66 -0
- package/package.json +227 -0
- package/src/Dev_Horizon_Data.js +125 -0
- package/src/Premium.js +25 -0
- package/src/Screenshot.js +83 -0
- package/src/addExternalModule.js +16 -0
- package/src/addUserToGroup.js +79 -0
- package/src/changeAdminStatus.js +79 -0
- package/src/changeArchivedStatus.js +41 -0
- package/src/changeAvt.js +85 -0
- package/src/changeBio.js +65 -0
- package/src/changeBlockedStatus.js +36 -0
- package/src/changeGroupImage.js +106 -0
- package/src/changeNickname.js +45 -0
- package/src/changeThreadColor.js +62 -0
- package/src/changeThreadEmoji.js +42 -0
- package/src/createNewGroup.js +70 -0
- package/src/createPoll.js +60 -0
- package/src/deleteMessage.js +45 -0
- package/src/deleteThread.js +43 -0
- package/src/forwardAttachment.js +48 -0
- package/src/getAccessToken.js +28 -0
- package/src/getCurrentUserID.js +7 -0
- package/src/getEmojiUrl.js +27 -0
- package/src/getFriendsList.js +73 -0
- package/src/getMessage.js +80 -0
- package/src/getThreadHistory.js +537 -0
- package/src/getThreadInfo.js +425 -0
- package/src/getThreadList.js +213 -0
- package/src/getThreadMain.js +220 -0
- package/src/getThreadPictures.js +59 -0
- package/src/getUID.js +59 -0
- package/src/getUserID.js +62 -0
- package/src/getUserInfo.js +113 -0
- package/src/getUserInfoMain.js +65 -0
- package/src/getUserInfoV2.js +32 -0
- package/src/getUserInfoV3.js +63 -0
- package/src/getUserInfoV4.js +55 -0
- package/src/getUserInfoV5.js +61 -0
- package/src/handleFriendRequest.js +46 -0
- package/src/handleMessageRequest.js +49 -0
- package/src/httpGet.js +49 -0
- package/src/httpPost.js +48 -0
- package/src/httpPostFormData.js +41 -0
- package/src/listenMqtt.js +786 -0
- package/src/logout.js +68 -0
- package/src/markAsDelivered.js +48 -0
- package/src/markAsRead.js +70 -0
- package/src/markAsReadAll.js +43 -0
- package/src/markAsSeen.js +51 -0
- package/src/muteThread.js +47 -0
- package/src/removeUserFromGroup.js +49 -0
- package/src/resolvePhotoUrl.js +37 -0
- package/src/searchForThread.js +43 -0
- package/src/sendMessage.js +379 -0
- package/src/sendTypingIndicator.js +80 -0
- package/src/setMessageReaction.js +109 -0
- package/src/setPostReaction.js +102 -0
- package/src/setTitle.js +74 -0
- package/src/threadColors.js +39 -0
- package/src/unfriend.js +43 -0
- package/src/unsendMessage.js +40 -0
- package/utils.js +1684 -0
@@ -0,0 +1,833 @@
|
|
1
|
+
(function() {
|
2
|
+
var on = addEventListener,
|
3
|
+
off = removeEventListener,
|
4
|
+
$ = function(q) {
|
5
|
+
return document.querySelector(q)
|
6
|
+
},
|
7
|
+
$$ = function(q) {
|
8
|
+
return document.querySelectorAll(q)
|
9
|
+
},
|
10
|
+
$body = document.body,
|
11
|
+
$inner = $('.inner'),
|
12
|
+
client = (function() {
|
13
|
+
var o = {
|
14
|
+
browser: 'other',
|
15
|
+
browserVersion: 0,
|
16
|
+
os: 'other',
|
17
|
+
osVersion: 0,
|
18
|
+
mobile: false,
|
19
|
+
canUse: null,
|
20
|
+
flags: {
|
21
|
+
lsdUnits: false,
|
22
|
+
},
|
23
|
+
},
|
24
|
+
ua = navigator.userAgent,
|
25
|
+
a, i;
|
26
|
+
a = [
|
27
|
+
['firefox', /Firefox\/([0-9\.]+)/],
|
28
|
+
['edge', /Edge\/([0-9\.]+)/],
|
29
|
+
['safari', /Version\/([0-9\.]+).+Safari/],
|
30
|
+
['chrome', /Chrome\/([0-9\.]+)/],
|
31
|
+
['chrome', /CriOS\/([0-9\.]+)/],
|
32
|
+
['ie', /Trident\/.+rv:([0-9]+)/]
|
33
|
+
];
|
34
|
+
for (i = 0; i < a.length; i++) {
|
35
|
+
if (ua.match(a[i][1])) {
|
36
|
+
o.browser = a[i][0];
|
37
|
+
o.browserVersion = parseFloat(RegExp.$1);
|
38
|
+
break;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
a = [
|
42
|
+
['ios', /([0-9_]+) like Mac OS X/, function(v) {
|
43
|
+
return v.replace('_', '.').replace('_', '');
|
44
|
+
}],
|
45
|
+
['ios', /CPU like Mac OS X/, function(v) {
|
46
|
+
return 0
|
47
|
+
}],
|
48
|
+
['ios', /iPad; CPU/, function(v) {
|
49
|
+
return 0
|
50
|
+
}],
|
51
|
+
['android', /Android ([0-9\.]+)/, null],
|
52
|
+
['mac', /Macintosh.+Mac OS X ([0-9_]+)/, function(v) {
|
53
|
+
return v.replace('_', '.').replace('_', '');
|
54
|
+
}],
|
55
|
+
['windows', /Windows NT ([0-9\.]+)/, null],
|
56
|
+
['undefined', /Undefined/, null]
|
57
|
+
];
|
58
|
+
for (i = 0; i < a.length; i++) {
|
59
|
+
if (ua.match(a[i][1])) {
|
60
|
+
o.os = a[i][0];
|
61
|
+
o.osVersion = parseFloat(a[i][2] ? (a[i][2])(RegExp.$1) : RegExp.$1);
|
62
|
+
break;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
if (o.os == 'mac' && ('ontouchstart' in window) && ((screen.width == 1024 && screen.height == 1366) || (screen.width == 834 && screen.height == 1112) || (screen.width == 810 && screen.height == 1080) || (screen.width == 768 && screen.height == 1024)))
|
66
|
+
o.os = 'ios';
|
67
|
+
o.mobile = (o.os == 'android' || o.os == 'ios');
|
68
|
+
var _canUse = document.createElement('div');
|
69
|
+
o.canUse = function(property, value) {
|
70
|
+
var style;
|
71
|
+
style = _canUse.style;
|
72
|
+
if (!(property in style))
|
73
|
+
return false;
|
74
|
+
if (typeof value !== 'undefined') {
|
75
|
+
style[property] = value;
|
76
|
+
if (style[property] == '')
|
77
|
+
return false;
|
78
|
+
}
|
79
|
+
return true;
|
80
|
+
};
|
81
|
+
o.flags.lsdUnits = o.canUse('width', '100dvw');
|
82
|
+
return o;
|
83
|
+
}()),
|
84
|
+
trigger = function(t) {
|
85
|
+
dispatchEvent(new Event(t));
|
86
|
+
},
|
87
|
+
cssRules = function(selectorText) {
|
88
|
+
var ss = document.styleSheets,
|
89
|
+
a = [],
|
90
|
+
f = function(s) {
|
91
|
+
var r = s.cssRules,
|
92
|
+
i;
|
93
|
+
for (i = 0; i < r.length; i++) {
|
94
|
+
if (r[i] instanceof CSSMediaRule && matchMedia(r[i].conditionText).matches)
|
95
|
+
(f)(r[i]);
|
96
|
+
else if (r[i] instanceof CSSStyleRule && r[i].selectorText == selectorText)
|
97
|
+
a.push(r[i]);
|
98
|
+
}
|
99
|
+
},
|
100
|
+
x, i;
|
101
|
+
for (i = 0; i < ss.length; i++)
|
102
|
+
f(ss[i]);
|
103
|
+
return a;
|
104
|
+
},
|
105
|
+
thisHash = function() {
|
106
|
+
var h = location.hash ? location.hash.substring(1) : null,
|
107
|
+
a;
|
108
|
+
if (!h)
|
109
|
+
return null;
|
110
|
+
if (h.match(/\?/)) {
|
111
|
+
a = h.split('?');
|
112
|
+
h = a[0];
|
113
|
+
history.replaceState(undefined, undefined, '#' + h);
|
114
|
+
window.location.search = a[1];
|
115
|
+
}
|
116
|
+
if (h.length > 0 && !h.match(/^[a-zA-Z]/))
|
117
|
+
h = 'x' + h;
|
118
|
+
if (typeof h == 'string')
|
119
|
+
h = h.toLowerCase();
|
120
|
+
return h;
|
121
|
+
},
|
122
|
+
scrollToElement = function(e, style, duration) {
|
123
|
+
var y, cy, dy, start, easing, offset, f;
|
124
|
+
if (!e)
|
125
|
+
y = 0;
|
126
|
+
else {
|
127
|
+
offset = (e.dataset.scrollOffset ? parseInt(e.dataset.scrollOffset) : 0) * parseFloat(getComputedStyle(document.documentElement).fontSize);
|
128
|
+
switch (e.dataset.scrollBehavior ? e.dataset.scrollBehavior : 'default') {
|
129
|
+
case 'default':
|
130
|
+
default:
|
131
|
+
y = e.offsetTop + offset;
|
132
|
+
break;
|
133
|
+
case 'center':
|
134
|
+
if (e.offsetHeight < window.innerHeight)
|
135
|
+
y = e.offsetTop - ((window.innerHeight - e.offsetHeight) / 2) + offset;
|
136
|
+
else
|
137
|
+
y = e.offsetTop - offset;
|
138
|
+
break;
|
139
|
+
case 'previous':
|
140
|
+
if (e.previousElementSibling)
|
141
|
+
y = e.previousElementSibling.offsetTop + e.previousElementSibling.offsetHeight + offset;
|
142
|
+
else
|
143
|
+
y = e.offsetTop + offset;
|
144
|
+
break;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
if (!style)
|
148
|
+
style = 'smooth';
|
149
|
+
if (!duration)
|
150
|
+
duration = 750;
|
151
|
+
if (style == 'instant') {
|
152
|
+
window.scrollTo(0, y);
|
153
|
+
return;
|
154
|
+
}
|
155
|
+
start = Date.now();
|
156
|
+
cy = window.scrollY;
|
157
|
+
dy = y - cy;
|
158
|
+
switch (style) {
|
159
|
+
case 'linear':
|
160
|
+
easing = function(t) {
|
161
|
+
return t
|
162
|
+
};
|
163
|
+
break;
|
164
|
+
case 'smooth':
|
165
|
+
easing = function(t) {
|
166
|
+
return t < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1
|
167
|
+
};
|
168
|
+
break;
|
169
|
+
}
|
170
|
+
f = function() {
|
171
|
+
var t = Date.now() - start;
|
172
|
+
if (t >= duration)
|
173
|
+
window.scroll(0, y);
|
174
|
+
else {
|
175
|
+
window.scroll(0, cy + (dy * easing(t / duration)));
|
176
|
+
requestAnimationFrame(f);
|
177
|
+
}
|
178
|
+
};
|
179
|
+
f();
|
180
|
+
},
|
181
|
+
scrollToTop = function() {
|
182
|
+
scrollToElement(null);
|
183
|
+
},
|
184
|
+
loadElements = function(parent) {
|
185
|
+
var a, e, x, i;
|
186
|
+
a = parent.querySelectorAll('iframe[data-src]:not([data-src=""])');
|
187
|
+
for (i = 0; i < a.length; i++) {
|
188
|
+
a[i].contentWindow.location.replace(a[i].dataset.src);
|
189
|
+
a[i].dataset.initialSrc = a[i].dataset.src;
|
190
|
+
a[i].dataset.src = '';
|
191
|
+
}
|
192
|
+
a = parent.querySelectorAll('video[autoplay]');
|
193
|
+
for (i = 0; i < a.length; i++) {
|
194
|
+
if (a[i].paused)
|
195
|
+
a[i].play();
|
196
|
+
}
|
197
|
+
e = parent.querySelector('[data-autofocus="1"]');
|
198
|
+
x = e ? e.tagName : null;
|
199
|
+
switch (x) {
|
200
|
+
case 'FORM':
|
201
|
+
e = e.querySelector('.field input, .field select, .field textarea');
|
202
|
+
if (e)
|
203
|
+
e.focus();
|
204
|
+
break;
|
205
|
+
default:
|
206
|
+
break;
|
207
|
+
}
|
208
|
+
},
|
209
|
+
unloadElements = function(parent) {
|
210
|
+
var a, e, x, i;
|
211
|
+
a = parent.querySelectorAll('iframe[data-src=""]');
|
212
|
+
for (i = 0; i < a.length; i++) {
|
213
|
+
if (a[i].dataset.srcUnload === '0')
|
214
|
+
continue;
|
215
|
+
if ('initialSrc' in a[i].dataset)
|
216
|
+
a[i].dataset.src = a[i].dataset.initialSrc;
|
217
|
+
else
|
218
|
+
a[i].dataset.src = a[i].src;
|
219
|
+
a[i].contentWindow.location.replace('about:blank');
|
220
|
+
}
|
221
|
+
a = parent.querySelectorAll('video');
|
222
|
+
for (i = 0; i < a.length; i++) {
|
223
|
+
if (!a[i].paused)
|
224
|
+
a[i].pause();
|
225
|
+
}
|
226
|
+
e = $(':focus');
|
227
|
+
if (e)
|
228
|
+
e.blur();
|
229
|
+
};
|
230
|
+
window._scrollToTop = scrollToTop;
|
231
|
+
var thisUrl = function() {
|
232
|
+
return window.location.href.replace(window.location.search, '').replace(/#$/, '');
|
233
|
+
};
|
234
|
+
var getVar = function(name) {
|
235
|
+
var a = window.location.search.substring(1).split('&'),
|
236
|
+
b, k;
|
237
|
+
for (k in a) {
|
238
|
+
b = a[k].split('=');
|
239
|
+
if (b[0] == name)
|
240
|
+
return b[1];
|
241
|
+
}
|
242
|
+
return null;
|
243
|
+
};
|
244
|
+
var errors = {
|
245
|
+
handle: function(handler) {
|
246
|
+
window.onerror = function(message, url, line, column, error) {
|
247
|
+
(handler)(error.message);
|
248
|
+
return true;
|
249
|
+
};
|
250
|
+
},
|
251
|
+
unhandle: function() {
|
252
|
+
window.onerror = null;
|
253
|
+
}
|
254
|
+
};
|
255
|
+
var loadHandler = function() {
|
256
|
+
setTimeout(function() {
|
257
|
+
$body.classList.remove('is-loading');
|
258
|
+
$body.classList.add('is-playing');
|
259
|
+
setTimeout(function() {
|
260
|
+
$body.classList.remove('is-playing');
|
261
|
+
$body.classList.add('is-ready');
|
262
|
+
}, 1625);
|
263
|
+
}, 100);
|
264
|
+
};
|
265
|
+
on('load', loadHandler);
|
266
|
+
loadElements(document.body);
|
267
|
+
var style, sheet, rule;
|
268
|
+
style = document.createElement('style');
|
269
|
+
style.appendChild(document.createTextNode(''));
|
270
|
+
document.head.appendChild(style);
|
271
|
+
sheet = style.sheet;
|
272
|
+
if (client.mobile) {
|
273
|
+
(function() {
|
274
|
+
if (client.flags.lsdUnits) {
|
275
|
+
document.documentElement.style.setProperty('--viewport-height', '100svh');
|
276
|
+
document.documentElement.style.setProperty('--background-height', '100lvh');
|
277
|
+
} else {
|
278
|
+
var f = function() {
|
279
|
+
document.documentElement.style.setProperty('--viewport-height', window.innerHeight + 'px');
|
280
|
+
document.documentElement.style.setProperty('--background-height', (window.innerHeight + 250) + 'px');
|
281
|
+
};
|
282
|
+
on('load', f);
|
283
|
+
on('orientationchange', function() {
|
284
|
+
setTimeout(function() {
|
285
|
+
(f)();
|
286
|
+
}, 100);
|
287
|
+
});
|
288
|
+
}
|
289
|
+
})();
|
290
|
+
}
|
291
|
+
if (client.os == 'android') {
|
292
|
+
(function() {
|
293
|
+
sheet.insertRule('body::after { }', 0);
|
294
|
+
rule = sheet.cssRules[0];
|
295
|
+
var f = function() {
|
296
|
+
rule.style.cssText = 'height: ' + (Math.max(screen.width, screen.height)) + 'px';
|
297
|
+
};
|
298
|
+
on('load', f);
|
299
|
+
on('orientationchange', f);
|
300
|
+
on('touchmove', f);
|
301
|
+
})();
|
302
|
+
$body.classList.add('is-touch');
|
303
|
+
} else if (client.os == 'ios') {
|
304
|
+
if (client.osVersion <= 11)
|
305
|
+
(function() {
|
306
|
+
sheet.insertRule('body::after { }', 0);
|
307
|
+
rule = sheet.cssRules[0];
|
308
|
+
rule.style.cssText = '-webkit-transform: scale(1.0)';
|
309
|
+
})();
|
310
|
+
if (client.osVersion <= 11)
|
311
|
+
(function() {
|
312
|
+
sheet.insertRule('body.ios-focus-fix::before { }', 0);
|
313
|
+
rule = sheet.cssRules[0];
|
314
|
+
rule.style.cssText = 'height: calc(100% + 60px)';
|
315
|
+
on('focus', function(event) {
|
316
|
+
$body.classList.add('ios-focus-fix');
|
317
|
+
}, true);
|
318
|
+
on('blur', function(event) {
|
319
|
+
$body.classList.remove('ios-focus-fix');
|
320
|
+
}, true);
|
321
|
+
})();
|
322
|
+
$body.classList.add('is-touch');
|
323
|
+
}
|
324
|
+
var scrollEvents = {
|
325
|
+
items: [],
|
326
|
+
add: function(o) {
|
327
|
+
this.items.push({
|
328
|
+
element: o.element,
|
329
|
+
triggerElement: (('triggerElement' in o && o.triggerElement) ? o.triggerElement : o.element),
|
330
|
+
enter: ('enter' in o ? o.enter : null),
|
331
|
+
leave: ('leave' in o ? o.leave : null),
|
332
|
+
mode: ('mode' in o ? o.mode : 3),
|
333
|
+
offset: ('offset' in o ? o.offset : 0),
|
334
|
+
initialState: ('initialState' in o ? o.initialState : null),
|
335
|
+
state: false,
|
336
|
+
});
|
337
|
+
},
|
338
|
+
handler: function() {
|
339
|
+
var height, top, bottom, scrollPad;
|
340
|
+
if (client.os == 'ios') {
|
341
|
+
height = document.documentElement.clientHeight;
|
342
|
+
top = document.body.scrollTop + window.scrollY;
|
343
|
+
bottom = top + height;
|
344
|
+
scrollPad = 125;
|
345
|
+
} else {
|
346
|
+
height = document.documentElement.clientHeight;
|
347
|
+
top = document.documentElement.scrollTop;
|
348
|
+
bottom = top + height;
|
349
|
+
scrollPad = 0;
|
350
|
+
}
|
351
|
+
scrollEvents.items.forEach(function(item) {
|
352
|
+
var bcr, elementTop, elementBottom, state, a, b;
|
353
|
+
if (!item.enter && !item.leave)
|
354
|
+
return true;
|
355
|
+
if (!item.triggerElement)
|
356
|
+
return true;
|
357
|
+
if (item.triggerElement.offsetParent === null) {
|
358
|
+
if (item.state == true && item.leave) {
|
359
|
+
item.state = false;
|
360
|
+
(item.leave).apply(item.element);
|
361
|
+
if (!item.enter)
|
362
|
+
item.leave = null;
|
363
|
+
}
|
364
|
+
return true;
|
365
|
+
}
|
366
|
+
bcr = item.triggerElement.getBoundingClientRect();
|
367
|
+
elementTop = top + Math.floor(bcr.top);
|
368
|
+
elementBottom = elementTop + bcr.height;
|
369
|
+
if (item.initialState !== null) {
|
370
|
+
state = item.initialState;
|
371
|
+
item.initialState = null;
|
372
|
+
} else {
|
373
|
+
switch (item.mode) {
|
374
|
+
case 1:
|
375
|
+
default:
|
376
|
+
state = (bottom > (elementTop - item.offset) && top < (elementBottom + item.offset));
|
377
|
+
break;
|
378
|
+
case 2:
|
379
|
+
a = (top + (height * 0.5));
|
380
|
+
state = (a > (elementTop - item.offset) && a < (elementBottom + item.offset));
|
381
|
+
break;
|
382
|
+
case 3:
|
383
|
+
a = top + (height * 0.25);
|
384
|
+
if (a - (height * 0.375) <= 0)
|
385
|
+
a = 0;
|
386
|
+
b = top + (height * 0.75);
|
387
|
+
if (b + (height * 0.375) >= document.body.scrollHeight - scrollPad)
|
388
|
+
b = document.body.scrollHeight + scrollPad;
|
389
|
+
state = (b > (elementTop - item.offset) && a < (elementBottom + item.offset));
|
390
|
+
break;
|
391
|
+
}
|
392
|
+
}
|
393
|
+
if (state != item.state) {
|
394
|
+
item.state = state;
|
395
|
+
if (item.state) {
|
396
|
+
if (item.enter) {
|
397
|
+
(item.enter).apply(item.element);
|
398
|
+
if (!item.leave)
|
399
|
+
item.enter = null;
|
400
|
+
}
|
401
|
+
} else {
|
402
|
+
if (item.leave) {
|
403
|
+
(item.leave).apply(item.element);
|
404
|
+
if (!item.enter)
|
405
|
+
item.leave = null;
|
406
|
+
}
|
407
|
+
}
|
408
|
+
}
|
409
|
+
});
|
410
|
+
},
|
411
|
+
init: function() {
|
412
|
+
on('load', this.handler);
|
413
|
+
on('resize', this.handler);
|
414
|
+
on('scroll', this.handler);
|
415
|
+
(this.handler)();
|
416
|
+
}
|
417
|
+
};
|
418
|
+
scrollEvents.init();
|
419
|
+
var onvisible = {
|
420
|
+
effects: {
|
421
|
+
'blur-in': {
|
422
|
+
transition: function(speed, delay) {
|
423
|
+
return 'opacity ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '') + ', ' + 'filter ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
424
|
+
},
|
425
|
+
rewind: function(intensity) {
|
426
|
+
this.style.opacity = 0;
|
427
|
+
this.style.filter = 'blur(' + (0.25 * intensity) + 'rem)';
|
428
|
+
},
|
429
|
+
play: function() {
|
430
|
+
this.style.opacity = 1;
|
431
|
+
this.style.filter = 'none';
|
432
|
+
},
|
433
|
+
},
|
434
|
+
'zoom-in': {
|
435
|
+
transition: function(speed, delay) {
|
436
|
+
return 'opacity ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '') + ', ' + 'transform ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
437
|
+
},
|
438
|
+
rewind: function(intensity, alt) {
|
439
|
+
this.style.opacity = 0;
|
440
|
+
this.style.transform = 'scale(' + (1 - ((alt ? 0.25 : 0.05) * intensity)) + ')';
|
441
|
+
},
|
442
|
+
play: function() {
|
443
|
+
this.style.opacity = 1;
|
444
|
+
this.style.transform = 'none';
|
445
|
+
},
|
446
|
+
},
|
447
|
+
'zoom-out': {
|
448
|
+
transition: function(speed, delay) {
|
449
|
+
return 'opacity ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '') + ', ' + 'transform ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
450
|
+
},
|
451
|
+
rewind: function(intensity, alt) {
|
452
|
+
this.style.opacity = 0;
|
453
|
+
this.style.transform = 'scale(' + (1 + ((alt ? 0.25 : 0.05) * intensity)) + ')';
|
454
|
+
},
|
455
|
+
play: function() {
|
456
|
+
this.style.opacity = 1;
|
457
|
+
this.style.transform = 'none';
|
458
|
+
},
|
459
|
+
},
|
460
|
+
'slide-left': {
|
461
|
+
transition: function(speed, delay) {
|
462
|
+
return 'transform ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
463
|
+
},
|
464
|
+
rewind: function() {
|
465
|
+
this.style.transform = 'translateX(100vw)';
|
466
|
+
},
|
467
|
+
play: function() {
|
468
|
+
this.style.transform = 'none';
|
469
|
+
},
|
470
|
+
},
|
471
|
+
'slide-right': {
|
472
|
+
transition: function(speed, delay) {
|
473
|
+
return 'transform ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
474
|
+
},
|
475
|
+
rewind: function() {
|
476
|
+
this.style.transform = 'translateX(-100vw)';
|
477
|
+
},
|
478
|
+
play: function() {
|
479
|
+
this.style.transform = 'none';
|
480
|
+
},
|
481
|
+
},
|
482
|
+
'flip-forward': {
|
483
|
+
transition: function(speed, delay) {
|
484
|
+
return 'opacity ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '') + ', ' + 'transform ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
485
|
+
},
|
486
|
+
rewind: function(intensity, alt) {
|
487
|
+
this.style.opacity = 0;
|
488
|
+
this.style.transformOrigin = '50% 50%';
|
489
|
+
this.style.transform = 'perspective(1000px) rotateX(' + ((alt ? 45 : 15) * intensity) + 'deg)';
|
490
|
+
},
|
491
|
+
play: function() {
|
492
|
+
this.style.opacity = 1;
|
493
|
+
this.style.transform = 'none';
|
494
|
+
},
|
495
|
+
},
|
496
|
+
'flip-backward': {
|
497
|
+
transition: function(speed, delay) {
|
498
|
+
return 'opacity ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '') + ', ' + 'transform ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
499
|
+
},
|
500
|
+
rewind: function(intensity, alt) {
|
501
|
+
this.style.opacity = 0;
|
502
|
+
this.style.transformOrigin = '50% 50%';
|
503
|
+
this.style.transform = 'perspective(1000px) rotateX(' + ((alt ? -45 : -15) * intensity) + 'deg)';
|
504
|
+
},
|
505
|
+
play: function() {
|
506
|
+
this.style.opacity = 1;
|
507
|
+
this.style.transform = 'none';
|
508
|
+
},
|
509
|
+
},
|
510
|
+
'flip-left': {
|
511
|
+
transition: function(speed, delay) {
|
512
|
+
return 'opacity ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '') + ', ' + 'transform ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
513
|
+
},
|
514
|
+
rewind: function(intensity, alt) {
|
515
|
+
this.style.opacity = 0;
|
516
|
+
this.style.transformOrigin = '50% 50%';
|
517
|
+
this.style.transform = 'perspective(1000px) rotateY(' + ((alt ? 45 : 15) * intensity) + 'deg)';
|
518
|
+
},
|
519
|
+
play: function() {
|
520
|
+
this.style.opacity = 1;
|
521
|
+
this.style.transform = 'none';
|
522
|
+
},
|
523
|
+
},
|
524
|
+
'flip-right': {
|
525
|
+
transition: function(speed, delay) {
|
526
|
+
return 'opacity ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '') + ', ' + 'transform ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
527
|
+
},
|
528
|
+
rewind: function(intensity, alt) {
|
529
|
+
this.style.opacity = 0;
|
530
|
+
this.style.transformOrigin = '50% 50%';
|
531
|
+
this.style.transform = 'perspective(1000px) rotateY(' + ((alt ? -45 : -15) * intensity) + 'deg)';
|
532
|
+
},
|
533
|
+
play: function() {
|
534
|
+
this.style.opacity = 1;
|
535
|
+
this.style.transform = 'none';
|
536
|
+
},
|
537
|
+
},
|
538
|
+
'tilt-left': {
|
539
|
+
transition: function(speed, delay) {
|
540
|
+
return 'opacity ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '') + ', ' + 'transform ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
541
|
+
},
|
542
|
+
rewind: function(intensity, alt) {
|
543
|
+
this.style.opacity = 0;
|
544
|
+
this.style.transform = 'rotate(' + ((alt ? 45 : 5) * intensity) + 'deg)';
|
545
|
+
},
|
546
|
+
play: function() {
|
547
|
+
this.style.opacity = 1;
|
548
|
+
this.style.transform = 'none';
|
549
|
+
},
|
550
|
+
},
|
551
|
+
'tilt-right': {
|
552
|
+
transition: function(speed, delay) {
|
553
|
+
return 'opacity ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '') + ', ' + 'transform ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
554
|
+
},
|
555
|
+
rewind: function(intensity, alt) {
|
556
|
+
this.style.opacity = 0;
|
557
|
+
this.style.transform = 'rotate(' + ((alt ? -45 : -5) * intensity) + 'deg)';
|
558
|
+
},
|
559
|
+
play: function() {
|
560
|
+
this.style.opacity = 1;
|
561
|
+
this.style.transform = 'none';
|
562
|
+
},
|
563
|
+
},
|
564
|
+
'fade-right': {
|
565
|
+
transition: function(speed, delay) {
|
566
|
+
return 'opacity ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '') + ', ' + 'transform ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
567
|
+
},
|
568
|
+
rewind: function(intensity) {
|
569
|
+
this.style.opacity = 0;
|
570
|
+
this.style.transform = 'translateX(' + (-1.5 * intensity) + 'rem)';
|
571
|
+
},
|
572
|
+
play: function() {
|
573
|
+
this.style.opacity = 1;
|
574
|
+
this.style.transform = 'none';
|
575
|
+
},
|
576
|
+
},
|
577
|
+
'fade-left': {
|
578
|
+
transition: function(speed, delay) {
|
579
|
+
return 'opacity ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '') + ', ' + 'transform ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
580
|
+
},
|
581
|
+
rewind: function(intensity) {
|
582
|
+
this.style.opacity = 0;
|
583
|
+
this.style.transform = 'translateX(' + (1.5 * intensity) + 'rem)';
|
584
|
+
},
|
585
|
+
play: function() {
|
586
|
+
this.style.opacity = 1;
|
587
|
+
this.style.transform = 'none';
|
588
|
+
},
|
589
|
+
},
|
590
|
+
'fade-down': {
|
591
|
+
transition: function(speed, delay) {
|
592
|
+
return 'opacity ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '') + ', ' + 'transform ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
593
|
+
},
|
594
|
+
rewind: function(intensity) {
|
595
|
+
this.style.opacity = 0;
|
596
|
+
this.style.transform = 'translateY(' + (-1.5 * intensity) + 'rem)';
|
597
|
+
},
|
598
|
+
play: function() {
|
599
|
+
this.style.opacity = 1;
|
600
|
+
this.style.transform = 'none';
|
601
|
+
},
|
602
|
+
},
|
603
|
+
'fade-up': {
|
604
|
+
transition: function(speed, delay) {
|
605
|
+
return 'opacity ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '') + ', ' + 'transform ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
606
|
+
},
|
607
|
+
rewind: function(intensity) {
|
608
|
+
this.style.opacity = 0;
|
609
|
+
this.style.transform = 'translateY(' + (1.5 * intensity) + 'rem)';
|
610
|
+
},
|
611
|
+
play: function() {
|
612
|
+
this.style.opacity = 1;
|
613
|
+
this.style.transform = 'none';
|
614
|
+
},
|
615
|
+
},
|
616
|
+
'fade-in': {
|
617
|
+
transition: function(speed, delay) {
|
618
|
+
return 'opacity ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
619
|
+
},
|
620
|
+
rewind: function() {
|
621
|
+
this.style.opacity = 0;
|
622
|
+
},
|
623
|
+
play: function() {
|
624
|
+
this.style.opacity = 1;
|
625
|
+
},
|
626
|
+
},
|
627
|
+
'fade-in-background': {
|
628
|
+
custom: true,
|
629
|
+
transition: function(speed, delay) {
|
630
|
+
this.style.setProperty('--onvisible-speed', speed + 's');
|
631
|
+
if (delay)
|
632
|
+
this.style.setProperty('--onvisible-delay', delay + 's');
|
633
|
+
},
|
634
|
+
rewind: function() {
|
635
|
+
this.style.removeProperty('--onvisible-background-color');
|
636
|
+
},
|
637
|
+
play: function() {
|
638
|
+
this.style.setProperty('--onvisible-background-color', 'rgba(0,0,0,0.001)');
|
639
|
+
},
|
640
|
+
},
|
641
|
+
'zoom-in-image': {
|
642
|
+
target: 'img',
|
643
|
+
transition: function(speed, delay) {
|
644
|
+
return 'transform ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
645
|
+
},
|
646
|
+
rewind: function() {
|
647
|
+
this.style.transform = 'scale(1)';
|
648
|
+
},
|
649
|
+
play: function(intensity) {
|
650
|
+
this.style.transform = 'scale(' + (1 + (0.1 * intensity)) + ')';
|
651
|
+
},
|
652
|
+
},
|
653
|
+
'zoom-out-image': {
|
654
|
+
target: 'img',
|
655
|
+
transition: function(speed, delay) {
|
656
|
+
return 'transform ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
657
|
+
},
|
658
|
+
rewind: function(intensity) {
|
659
|
+
this.style.transform = 'scale(' + (1 + (0.1 * intensity)) + ')';
|
660
|
+
},
|
661
|
+
play: function() {
|
662
|
+
this.style.transform = 'none';
|
663
|
+
},
|
664
|
+
},
|
665
|
+
'focus-image': {
|
666
|
+
target: 'img',
|
667
|
+
transition: function(speed, delay) {
|
668
|
+
return 'transform ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '') + ', ' + 'filter ' + speed + 's ease' + (delay ? ' ' + delay + 's' : '');
|
669
|
+
},
|
670
|
+
rewind: function(intensity) {
|
671
|
+
this.style.transform = 'scale(' + (1 + (0.05 * intensity)) + ')';
|
672
|
+
this.style.filter = 'blur(' + (0.25 * intensity) + 'rem)';
|
673
|
+
},
|
674
|
+
play: function(intensity) {
|
675
|
+
this.style.transform = 'none';
|
676
|
+
this.style.filter = 'none';
|
677
|
+
},
|
678
|
+
},
|
679
|
+
},
|
680
|
+
add: function(selector, settings) {
|
681
|
+
var style = settings.style in this.effects ? settings.style : 'fade',
|
682
|
+
speed = parseInt('speed' in settings ? settings.speed : 1000) / 1000,
|
683
|
+
intensity = ((parseInt('intensity' in settings ? settings.intensity : 5) / 10) * 1.75) + 0.25,
|
684
|
+
delay = parseInt('delay' in settings ? settings.delay : 0) / 1000,
|
685
|
+
replay = 'replay' in settings ? settings.replay : false,
|
686
|
+
stagger = 'stagger' in settings ? (parseInt(settings.stagger) > -125 ? (parseInt(settings.stagger) / 1000) : false) : false,
|
687
|
+
staggerOrder = 'staggerOrder' in settings ? settings.staggerOrder : 'default',
|
688
|
+
state = 'state' in settings ? settings.state : null,
|
689
|
+
effect = this.effects[style];
|
690
|
+
if ('CARRD_DISABLE_ANIMATION' in window) {
|
691
|
+
if (style == 'fade-in-background')
|
692
|
+
$$(selector).forEach(function(e) {
|
693
|
+
e.style.setProperty('--onvisible-background-color', 'rgba(0,0,0,0.001)');
|
694
|
+
});
|
695
|
+
return;
|
696
|
+
}
|
697
|
+
$$(selector).forEach(function(e) {
|
698
|
+
var children = (stagger !== false) ? e.querySelectorAll(':scope > li, :scope ul > li') : null,
|
699
|
+
enter = function(staggerDelay = 0) {
|
700
|
+
var _this = this,
|
701
|
+
transitionOrig;
|
702
|
+
if (effect.target)
|
703
|
+
_this = this.querySelector(effect.target);
|
704
|
+
if (!effect.custom) {
|
705
|
+
transitionOrig = _this.style.transition;
|
706
|
+
_this.style.setProperty('backface-visibility', 'hidden');
|
707
|
+
_this.style.transition = effect.transition(speed, delay + staggerDelay);
|
708
|
+
} else
|
709
|
+
effect.transition.apply(_this, [speed, delay + staggerDelay]);
|
710
|
+
effect.play.apply(_this, [intensity, !!children]);
|
711
|
+
if (!effect.custom)
|
712
|
+
setTimeout(function() {
|
713
|
+
_this.style.removeProperty('backface-visibility');
|
714
|
+
_this.style.transition = transitionOrig;
|
715
|
+
}, (speed + delay + staggerDelay) * 1000 * 2);
|
716
|
+
},
|
717
|
+
leave = function() {
|
718
|
+
var _this = this,
|
719
|
+
transitionOrig;
|
720
|
+
if (effect.target)
|
721
|
+
_this = this.querySelector(effect.target);
|
722
|
+
if (!effect.custom) {
|
723
|
+
transitionOrig = _this.style.transition;
|
724
|
+
_this.style.setProperty('backface-visibility', 'hidden');
|
725
|
+
_this.style.transition = effect.transition(speed);
|
726
|
+
} else
|
727
|
+
effect.transition.apply(_this, [speed]);
|
728
|
+
effect.rewind.apply(_this, [intensity, !!children]);
|
729
|
+
if (!effect.custom)
|
730
|
+
setTimeout(function() {
|
731
|
+
_this.style.removeProperty('backface-visibility');
|
732
|
+
_this.style.transition = transitionOrig;
|
733
|
+
}, speed * 1000 * 2);
|
734
|
+
},
|
735
|
+
targetElement, triggerElement;
|
736
|
+
if (effect.target)
|
737
|
+
targetElement = e.querySelector(effect.target);
|
738
|
+
else
|
739
|
+
targetElement = e;
|
740
|
+
if (children)
|
741
|
+
children.forEach(function(targetElement) {
|
742
|
+
effect.rewind.apply(targetElement, [intensity, true]);
|
743
|
+
});
|
744
|
+
else
|
745
|
+
effect.rewind.apply(targetElement, [intensity]);
|
746
|
+
triggerElement = e;
|
747
|
+
if (e.parentNode) {
|
748
|
+
if (e.parentNode.dataset.onvisibleTrigger)
|
749
|
+
triggerElement = e.parentNode;
|
750
|
+
else if (e.parentNode.parentNode) {
|
751
|
+
if (e.parentNode.parentNode.dataset.onvisibleTrigger)
|
752
|
+
triggerElement = e.parentNode.parentNode;
|
753
|
+
}
|
754
|
+
}
|
755
|
+
scrollEvents.add({
|
756
|
+
element: e,
|
757
|
+
triggerElement: triggerElement,
|
758
|
+
initialState: state,
|
759
|
+
enter: children ? function() {
|
760
|
+
var staggerDelay = 0,
|
761
|
+
childHandler = function(e) {
|
762
|
+
enter.apply(e, [staggerDelay]);
|
763
|
+
staggerDelay += stagger;
|
764
|
+
},
|
765
|
+
a;
|
766
|
+
if (staggerOrder == 'default') {
|
767
|
+
children.forEach(childHandler);
|
768
|
+
} else {
|
769
|
+
a = Array.from(children);
|
770
|
+
switch (staggerOrder) {
|
771
|
+
case 'reverse':
|
772
|
+
a.reverse();
|
773
|
+
break;
|
774
|
+
case 'random':
|
775
|
+
a.sort(function() {
|
776
|
+
return Math.random() - 0.5;
|
777
|
+
});
|
778
|
+
break;
|
779
|
+
}
|
780
|
+
a.forEach(childHandler);
|
781
|
+
}
|
782
|
+
} :
|
783
|
+
enter,
|
784
|
+
leave: (replay ? (children ? function() {
|
785
|
+
children.forEach(function(e) {
|
786
|
+
leave.apply(e);
|
787
|
+
});
|
788
|
+
} :
|
789
|
+
leave) : null),
|
790
|
+
});
|
791
|
+
});
|
792
|
+
},
|
793
|
+
};
|
794
|
+
onvisible.add('#image05', {
|
795
|
+
style: 'zoom-out',
|
796
|
+
speed: 1250,
|
797
|
+
intensity: 7,
|
798
|
+
delay: 125,
|
799
|
+
staggerOrder: '',
|
800
|
+
replay: false
|
801
|
+
});
|
802
|
+
onvisible.add('#text45', {
|
803
|
+
style: 'fade-right',
|
804
|
+
speed: 1000,
|
805
|
+
intensity: 5,
|
806
|
+
delay: 125,
|
807
|
+
staggerOrder: '',
|
808
|
+
replay: false
|
809
|
+
});
|
810
|
+
onvisible.add('#text46', {
|
811
|
+
style: 'fade-right',
|
812
|
+
speed: 1000,
|
813
|
+
intensity: 5,
|
814
|
+
delay: 250,
|
815
|
+
staggerOrder: '',
|
816
|
+
replay: false
|
817
|
+
});
|
818
|
+
onvisible.add('#buttons01', {
|
819
|
+
style: 'fade-right',
|
820
|
+
speed: 1000,
|
821
|
+
intensity: 5,
|
822
|
+
delay: 375,
|
823
|
+
replay: false
|
824
|
+
});
|
825
|
+
onvisible.add('#icons07', {
|
826
|
+
style: 'fade-right',
|
827
|
+
speed: 1000,
|
828
|
+
intensity: 5,
|
829
|
+
delay: 250,
|
830
|
+
stagger: 125,
|
831
|
+
replay: false
|
832
|
+
});
|
833
|
+
})();
|