forked from aemsite/ampdemo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
amp-img-not-showing-on-lightbox.html
154 lines (138 loc) · 4.28 KB
/
amp-img-not-showing-on-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
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<script async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-bind" src="https://cdn.ampproject.org/v0/amp-bind-0.1.js"></script>
<script async custom-element="amp-list" src="https://cdn.ampproject.org/v0/amp-list-0.1.js"></script>
<script async custom-element="amp-form" src="https://cdn.ampproject.org/v0/amp-form-0.1.js"></script>
<script async custom-template="amp-mustache" src="https://cdn.ampproject.org/v0/amp-mustache-0.1.js"></script>
<script async custom-element="amp-lightbox" src="https://cdn.ampproject.org/v0/amp-lightbox-0.1.js"></script>
<script async custom-element="amp-carousel" src="https://cdn.ampproject.org/v0/amp-carousel-0.1.js"></script>
<title>Hello AMP world</title>
<link rel="canonical" href="hello-world.html">
<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-lightbox {
background-color: aliceblue;
}
.box {
box-sizing: border-box;
width: 100%;
position: relative;
border: 1px solid #000;
}
.box span {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
img {
object-fit: cover;
}
.box::after {
content: '';
display: block;
padding-bottom: 100%;
}
#lb3 {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1000;
background-color: antiquewhite;
overflow: auto;
}
</style>
</head>
<body>
<h1 on="tap:lb">Click here to show scrollable amp-lightbox, amp-img is not showing</h1>
<amp-lightbox id="lb" layout="nodisplay" scrollable>
<h1>other content</h1>
<h1>other content</h1>
<h1>other content</h1>
<h1>other content</h1>
<h1>other content</h1>
<h1>other content</h1>
<h1>other content</h1>
<h1>other content</h1>
<h1>other content</h1>
<h1>other content</h1>
<h1>other content</h1>
<h1>other content</h1>
<amp-list width="auto" height="100" layout="fixed-height" src="https://jsonplaceholder.typicode.com/photos?albumId=1"
items=".">
<template type="amp-mustache">
<div class="box">
<span>
<amp-img src="{{thumbnailUrl}}" layout="responsive" width="300" height="300">
</amp-img>
</span>
</div>
</template>
</amp-list>
</amp-lightbox>
</body>
</html>