This repository was archived by the owner on Aug 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
85 lines (84 loc) · 2.14 KB
/
index.html
File metadata and controls
85 lines (84 loc) · 2.14 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<html>
<meta charset="UTF-8">
<style>
body {
margin: 0;
}
iframe {
border-width: 0;
}
#headerContainer {
position: absolute;
}
#header {
font-family: "Roboto", "Helvetica", "Arial", sans-serif;
color: white;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
background-color: #3a21ce;
padding: 5px;
display: block;
width: 170px;
height: 25px;
line-height: 25px;
text-align: center;
}
#header::before {
content: ' ';
}
#header:hover::after {
content: '⮕';
}
#header:hover {
cursor: pointer;
background-color: #5d4bc6;
}
#headerContainer.center {
left: 50%;
}
#headerContainer.center #header:hover::before {
content: '⬅';
}
#headerContainer.center #header::after {
content: ' ';
}
#headerContainer.center #header {
position: relative;
left: -50%;
}
</style>
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,700" rel="stylesheet">
<head>
</head>
<body>
<div id="headerContainer" class="center">
<a id="header">
Testing Usersnap
</a>
</div>
<iframe id="testframe" src="" width="100%", height="100%">
</iframe>
<script>
const urlObj = new URL(window.location);
const url = urlObj.searchParams.get("url");
const headerContainer = document.getElementById("headerContainer");
const header = document.getElementById("header");
header.onclick = function(event) {
if (headerContainer.classList.contains("center")) {
headerContainer.classList.remove("center");
} else {
headerContainer.classList.add("center");
}
}
const frame = document.getElementById("testframe");
frame.src = url;
window.onUsersnapCXLoad = function(api) {
api.init();
}
var script = document.createElement('script');
script.defer = 1;
script.src = 'https://widget.usersnap.com/global/load/72bf4e29-1c53-4a90-9972-d075ff914451?onload=onUsersnapCXLoad';
document.getElementsByTagName('head')[0].appendChild(script);
</script>
</body>
</html>