-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
43 lines (38 loc) · 1.24 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Easy Peasy</title>
<base href="/">
<meta content="width=device-width, initial-scale=1" name="viewport">
<link href="favicon.ico" rel="icon" type="image/x-icon">
<!-- ManyChat -->
<script>window.MANYCHAT_WIDGET_ID = 15311250;</script>
<script src="//widget.manychat.com/102695008695454.js" defer="defer"></script>
<script src="https://mccdn.me/assets/js/widget.js" defer="defer"></script>
<script>
document.addEventListener('DOMContentLoaded', (event) => {
const clickHandler = (e) => {
if (window.MC) {
e.preventDefault();
}
const chatWindow = document.querySelector('[data-testid="dialog_iframe"]');
const isVisible = !!chatWindow && chatWindow.offsetHeight > 0;
if (isVisible) {
MC.getWidget(window.MANYCHAT_WIDGET_ID).close();
} else {
MC.getWidget(window.MANYCHAT_WIDGET_ID).open(true);
}
};
const elemList = [];
elemList.push(...document.querySelectorAll('#solver'));
for (let i = 0; i < elemList.length; i++) {
elemList[i].addEventListener('click', clickHandler);
}
});
</script>
</head>
<body>
<a id="solver" href="https://m.me/solverchat">Solver chat</a>
</body>
</html>