forked from ampproject/amphtml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
article-with-lightbox-2.0-gallery.amp.html
521 lines (454 loc) · 16.3 KB
/
article-with-lightbox-2.0-gallery.amp.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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<title>Lorem Ipsum | PublisherName</title>
<link rel="canonical" href="https://medium.com/p/cb7f223fad86">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<style amp-custom>
body {
margin: 0;
font-family: 'Georgia', Serif;
background: white;
}
.grid {
margin: auto;
padding: 15px 0px;
width: 80vw;
max-width: 80vh;
}
.row {
display: flex;
}
.box {
background: tomato;
margin: 5px;
color: white;
font-weight: bold;
flex: 1 0 auto;
position: relative;
}
.box:after {
content: "";
float: left;
display: block;
padding-top: 100%;
}
.box .inner {
position: absolute;
left: 0;
right: 0;
bottom: 0;
top: 0;
overflow: hidden
}
.grid amp-img img {
object-fit: cover;
object-position: center center;
}
main {
max-width: 960px;
margin: auto;
}
.brand-logo {
font-family: 'Roboto', Arial, Helvetica, sans-serif;
}
.ad-container {
display: flex;
justify-content: center;
}
.content-container p {
line-height: 24px;
}
/* In the shadow-doc mode, the parent shell already has header and nav. */
.amp-shadow header {
display: none;
}
.lightbox-only-description {
display: none;
}
figure {
margin: 0;
}
figcaption {
font-family: 'Roboto', Arial, Helvetica, sans-serif;
border-bottom: 1px solid #e2e2e2;
color: #6d6d6d;
margin-left: 20px;
margin-right: 20px;
font-size: .9em;
padding: 15px;
}
figcaption::before {
content: '';
width: 24px;
height: 24px;
display: inline-block;
vertical-align: middle;
margin-right: 5px;
}
figcaption.image::before {
background-image: url('data:image/svg+xml,<svg fill="#a9a9a9" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="3.2"/><path d="M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
}
figcaption.video::before {
background-image: url('data:image/svg+xml,<svg fill="#a9a9a9" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11l-4 4z"/></svg>');
}
.author {
display: flex;
align-items: center;
background: #f4f4f4;
padding: 0 15px;
font-size: .8em;
border: solid #dcdcdc;
border-width: 1px 0;
}
.header-time,
.header-author {
color: #a8a3ae;
font-family: 'Roboto', Arial, Helvetica, sans-serif;
font-size: 12px;
}
.header-author {
border-right: 1px solid #d5d5d5;
padding-right: 10px;
margin-right: 10px;
display: inline-block;
}
.header-author b {
color: #2294dd;
font-weight: normal;
}
.author p {
margin: 5px;
}
.byline {
font-family: 'Roboto', Arial, Helvetica, sans-serif;
display: inline-block;
}
.byline p {
line-height: normal;
}
.byline .brand {
color: #6f757a;
}
.mailto {
text-decoration: none;
}
#author-avatar {
width: 16px;
height: 16px;
border-radius: 50%;
display: inline-block;
vertical-align: middle;
margin-right: 5px;
}
h1 {
margin: 5px 0;
font-weight: normal;
}
footer {
display: flex;
align-items: center;
justify-content: center;
height: 226px;
background: #f4f4f4;
}
hr {
margin: 0;
}
.article-body p,
h3 {
padding-right: 15px;
padding-left: 15px;
}
header {
padding: 15px;
}
button.menu {
background: transparent;
border: none;
padding: 10px;
padding-right: 20px;
}
header#top-bar {
background: white;
border-bottom: 1px solid #e2e2e2;
}
header#article-desc {
background: rgb(250, 250, 250);
padding: 20px;
}
header#article-desc h1 {
margin-top: 0px;
padding-top: 0px;
}
amp-img#cover>img {
object-fit: cover;
object-position: bottom;
}
.see-gallery {
position: absolute;
bottom: 10px;
left: 10px;
z-index: 1;
pointer-events: none;
color: white;
font-family: sans-serif;
font-size: 0.8em;
}
</style>
<link href='https://fonts.googleapis.com/css?family=Georgia|Open+Sans|Roboto' rel='stylesheet' type='text/css'>
<script async custom-element="amp-lightbox-viewer" src="https://cdn.ampproject.org/v0/amp-lightbox-viewer-0.1.js"></script>
<script async custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.1.js"></script>
<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>
<script>
// Enable amp-lightbox-viewer experiment automatically if it is not enabled.
setTimeout(function () {
if (!AMP.isExperimentOn('amp-lightbox-viewer')) {
AMP.toggleExperiment('amp-lightbox-viewer');
location.reload();
}
}, 1000);
</script>
</head>
<body>
<header id="top-bar">
<button class="menu" title="Toggle Sidebar">
☰
</button>
<span class="brand-logo">
PublisherLogo
</span>
</header>
<main role="main">
<article>
<header id="article-desc">
<h1>Experimental Lightbox 2.0</h1>
<div class="header-author">
by
<span itemscope itemtype="http://schema.org/Person">
<b>Lorem Ipsum</b>
</span>
</span>
</div>
<time class="header-time" datetime="2015-09-14 13:00">September 14, 2015</time>
</header>
<figure>
<amp-img id="hero-img" lightbox="toronto" src="https://picsum.photos/1600/900?image=1075" layout="responsive" width="1600"
height="900" alt="Picture of CN tower.">
<span class="see-gallery">See all 4 skyscraper photos</span>
</amp-img>
<figcaption class='image'>
Toronto's CN tower was built in 1976 and was the tallest free-standing structure until 2007.
</figcaption>
</figure>
<!-- toronto image gallery -->
<div hidden>
<figure>
<amp-img lightbox="toronto" src="https://picsum.photos/1600/900?image=972" layout="responsive" width="1600" height="900"
alt="Picture of four tall buildings">
</amp-img>
<figcaption>
Toronto's financial district it a metropolis of glass and steel.
</figcaption>
</figure>
<amp-img lightbox="toronto" src="https://picsum.photos/900/1600?image=948" layout="responsive" width="900" height="1600"
alt="Picture of a tall building" aria-describedby="img2desc">
<span id=img2desc>The brutalist architecture of this building is obvious from its small windows and raw concrete look.</span>
<amp-img lightbox="toronto" src="https://picsum.photos/1600/1600?image=430" layout="responsive" width="1600" height="1600"
alt="Picture of new york city skyline" aria-describedby="img3desc">
<p id=img3desc>Compared to New York Cities skyline, Toronto falls short on density. Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Curabitur ullamcorper turpis vel commodo scelerisque. Phasellus luctus nunc ut elit cursus,
et imperdiet diam vehicula. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ullamcorper
turpis vel commodo scelerisque. Phasellus luctus nunc ut elit cursus, et imperdiet diam vehicula. Lorem ipsum
dolor sit amet, consectetur adipiscing elit. Curabitur ullamcorper turpis vel commodo scelerisque. Phasellus
luctus nunc ut elit cursus, et imperdiet diam vehicula.</p>
</amp-img>
</amp-img>
</div>
<div class="content-container">
<div class="article-body">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ullamcorper turpis vel commodo scelerisque. Phasellus
luctus nunc ut elit cursus, et imperdiet diam vehicula. Duis et nisi sed urna blandit bibendum et sit amet erat.
Suspendisse potenti. Curabitur consequat volutpat arcu nec elementum. Etiam a turpis ac libero varius condimentum.
Maecenas sollicitudin felis aliquam tortor vulputate, ac posuere velit semper.
</p>
<h3>Other Modern Architectures</h3>
<amp-carousel lightbox width=1600 height=900 layout=responsive type=slides>
<amp-img src="https://picsum.photos/1600/900?image=898" layout="responsive" width="1600" height="900" aria-describedby="desc1">
<div id="desc1" class="lightbox-only-description">
<p>Short - Sed pharetra semper fringilla. Nulla fringilla, neque eget</p>
</div>
</amp-img>
<amp-img src="https://picsum.photos/1600/900?image=864" layout="responsive" width="1600" height="900" aria-describedby="desc2">
<div id="desc2" class="lightbox-only-description">
<p> Medium - Sed pharetra semper fringilla. Nulla fringilla, neque eget varius suscipit, mi turpis congue odio,
quis dignissim nisi nulla at erat. Duis non nibh vel erat vehicula hendrerit eget vel velit. Donec congue
augue magna, nec eleifend dui porttitor
</p>
</div>
</amp-img>
<amp-img src="https://picsum.photos/1600/900?image=870" layout="responsive" width="1600" height="900" aria-describedby="desc3">
<div id="desc3" class="lightbox-only-description">
<p> Long - Sed pharetra semper fringilla. Nulla fringilla, neque eget varius suscipit, mi turpis congue odio,
quis dignissim nisi nulla at erat. Duis non nibh vel erat vehicula hendrerit eget vel velit. Donec congue
augue magna, nec eleifend dui porttitor Sed pharetra semper fringilla. Nulla fringilla, neque eget varius
suscipit, mi turpis congue odio, quis dignissim nisi nulla at erat. Duis non nibh vel erat vehicula hendrerit
eget vel velit. Donec congue augue magna, nec eleifend dui porttitor Sed pharetra semper fringilla. Nulla
fringilla, neque eget varius suscipit, mi turpis congue odio, quis dignissim nisi nulla at erat. Duis non
nibh vel erat vehicula hendrerit eget vel velit. Donec congue augue magna, nec eleifend dui porttitor
</p>
</div>
</amp-img>
<amp-img src="https://picsum.photos/1600/400?image=857" layout="responsive" width="1600" height="400"
alt="Wide image">
</amp-img>
<amp-img src="https://picsum.photos/400/1600?image=682" layout="responsive" width="400" height="1600" alt="Tall image">
</amp-img>
<amp-img id="cover" src="https://picsum.photos/900/1600?image=629" layout="responsive" width="900" height="1600" alt="Tall image with fit:cover">
</amp-img>
</amp-carousel>
<p>
Sed pharetra semper fringilla. Nulla fringilla, neque eget varius suscipit, mi turpis congue odio, quis dignissim nisi nulla
at erat. Duis non nibh vel erat vehicula hendrerit eget vel velit. Donec congue augue magna, nec eleifend dui
porttitor
</p>
<p>
Sed pharetra semper fringilla. Nulla fringilla, neque eget varius suscipit, mi turpis congue odio, quis dignissim nisi nulla
at erat. Duis non nibh vel erat vehicula hendrerit eget vel velit. Donec congue augue magna, nec eleifend dui
porttitor
</p>
<div class="grid">
<div class="row">
<div class="box">
<div class="inner">
<amp-img lightbox="gallery" src="https://picsum.photos/1600/900?image=857" layout="fill" alt="Sed pharetra semper fringilla. Nulla">
</amp-img>
</div>
</div>
<div class="box">
<div class="inner">
<amp-img lightbox="gallery" src="https://picsum.photos/1600/1600?image=1081" layout="fill" alt="Sed pharetra semper fringilla. Nulla">
</amp-img>
</div>
</div>
<div class="box">
<div class="inner">
<amp-img lightbox="gallery" src="https://picsum.photos/900/1600?image=1076" layout="fill" alt="Sed pharetra semper fringilla. Nulla">
</amp-img>
</div>
</div>
</div>
<div class="row">
<div class="box">
<div class="inner">
<amp-img lightbox="gallery" src="https://picsum.photos/1600/900?image=1067" layout="fill" alt="Sed pharetra semper fringilla. Nulla">
</amp-img>
</div>
</div>
<div class="box">
<div class="inner">
<amp-img lightbox="gallery" src="https://picsum.photos/1600/1600?image=1048" layout="fill" alt="Sed pharetra semper fringilla. Nulla">
</amp-img>
</div>
</div>
<div class="box">
<div class="inner">
<amp-img lightbox="gallery" src="https://picsum.photos/900/1600?image=868" layout="fill" alt="Sed pharetra semper fringilla. Nulla">
</amp-img>
</div>
</div>
</div>
<div class="row">
<div class="box">
<div class="inner">
<amp-img lightbox="gallery" src="https://picsum.photos/1600/900?image=864" layout="fill" alt="Sed pharetra semper fringilla. Nulla">
</amp-img>
</div>
</div>
<div class="box">
<div class="inner">
<amp-img lightbox="gallery" src="https://picsum.photos/1600/1600?image=740" layout="fill" alt="Sed pharetra semper fringilla. Nulla">
</amp-img>
</div>
</div>
<div class="box">
<div class="inner">
<amp-img lightbox="gallery" src="https://picsum.photos/900/1600?image=736" layout="fill" alt="Sed pharetra semper fringilla. Nulla">
</amp-img>
</div>
</div>
</div>
</div>
<p>
Sed pharetra semper fringilla. Nulla fringilla, neque eget varius suscipit, mi turpis congue odio, quis dignissim nisi nulla
at erat. Duis non nibh vel erat vehicula hendrerit eget vel velit. Donec congue augue magna, nec eleifend dui
porttitor
</p>
</div>
</article>
</main>
<footer>
<div class="brand-logo">Footer - Bye!</div>
</footer>
</body>
</html>