-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcant-close-lightbox.html
210 lines (187 loc) · 4.95 KB
/
cant-close-lightbox.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!--
## Introduction
The amp-lightbox component allows for a “lightbox” or similar experience - where upon user
interaction a component expands to fill the viewport, until it is closed again by the user.
-->
<!-- -->
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>amp-lightbox</title>
<script async src="https://cdn.ampproject.org/v0.js"></script>
<!-- ## Setup -->
<!-- Import the amp-lightbox component in the header -->
<script async custom-element="amp-lightbox" src="https://cdn.ampproject.org/v0/amp-lightbox-0.1.js"></script>
<link rel="canonical" href="https://ampbyexample.com/components/amp-lightbox/">
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<style amp-boilerplate>
body {
-webkit-animation: -amp-start 8s steps(1, end) 0s 1 normal both;
-moz-animation: -amp-start 8s steps(1, end) 0s 1 normal both;
-ms-animation: -amp-start 8s steps(1, end) 0s 1 normal both;
animation: -amp-start 8s steps(1, end) 0s 1 normal both
}
@-webkit-keyframes -amp-start {
from {
visibility: hidden
}
to {
visibility: visible
}
}
@-moz-keyframes -amp-start {
from {
visibility: hidden
}
to {
visibility: visible
}
}
@-ms-keyframes -amp-start {
from {
visibility: hidden
}
to {
visibility: visible
}
}
@-o-keyframes -amp-start {
from {
visibility: hidden
}
to {
visibility: visible
}
}
@keyframes -amp-start {
from {
visibility: hidden
}
to {
visibility: visible
}
}
</style><noscript>
<style amp-boilerplate>
body {
-webkit-animation: none;
-moz-animation: none;
-ms-animation: none;
animation: none
}
</style>
</noscript>
<style amp-custom>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.lightbox {
background: rgba(0, 0, 0, 0.8);
width: 100%;
height: 100%;
position: absolute;
display: flex;
align-items: center;
justify-content: center;
}
.lightbox h1 {
color: white;
}
#container {
width: 100vw;
height: 100vh;
overflow: hidden;
}
#content {
padding: 56px 0;
height: 100%;
overflow: hidden;
}
#main{
height: 100%;
overflow-x: hidden;
overflow-y: scroll;
}
header {
background: red;
height: 56px;
width: 100vw;
position: fixed;
top: 0;
left: 0;
/* z-index: 1; */
}
footer {
background: rebeccapurple;
height: 44px;
width: calc(100vw - 32px);
position: fixed;
bottom: 0;
left: 0;
margin: 16px;
/* z-index: 1; */
}
footer div{
background: #000;
width: 100%;
height: 100%;
}
#my-lightbox{
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: #FFF;
}
</style>
</head>
<body>
<amp-lightbox id="my-lightbox" layout="nodisplay" scrollable>
<header on="tap:my-lightbox.close">
close light box
</header>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<h1>1</h1>
<footer>
<div></div>
</footer>
</amp-lightbox>
<button class="ampstart-btn caps m2" on="tap:my-lightbox" role="button" tabindex="0">
Open lightbox
</button>
</body>
</html>