-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
70 lines (61 loc) · 2.01 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
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
<!DOCTYPE html>
<html lang="es" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Responsive Examples</title>
<link rel="stylesheet" href="css/vendor/reset.css">
<link rel="stylesheet" href="css/main.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,200;0,300;0,400;0,600;0,800;1,300;1,400;1,600&display=swap" rel="stylesheet">
<style type="text/css">
body {
background: white;
}
button {
position: absolute;
top: 0;
left: 0;
background: bisque;
border-radius: 50px;
height: 25px;
}
iframe {
-webkit-transition: width 3s; /* For Safari 3.1 to 6.0 */
transition: width 3s;
border: 1px solid grey;
}
.minimized {
width: 320px;
}
</style>
</head>
<body>
<button onclick="animation()">Change device size</button>
<iframe src="" width="100%" height="1020px"></iframe>
<script type="text/javascript">
const iframeElt = document.getElementsByTagName("iframe")[0]
const urlSearchParams = new URLSearchParams(window.location.search);
const params = Object.fromEntries(urlSearchParams.entries());
iframeElt.src = window.location.origin + "/notion_responsive/section-" + params.demo + ".html"
iframeElt.height = params.height
let animated = false;
function animation() {
if (!animated) {
animated = true
iframeElt.classList.add("minimized")
setTimeout(function() {
iframeElt.classList.remove("minimized");
setTimeout(function() {
animated = false
}, 3000)
}, 3500);
} else {
animated = false
iframeElt.classList.remove("minimized");
}
}
</script>
</body>
</html>