-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
amp-consent-iframe.amp.html
98 lines (87 loc) · 3.66 KB
/
amp-consent-iframe.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
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<title>AMP Consent CMP Vendors</title>
<link rel="canonical" href="amp-consent-iframe.amp.html" >
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<style amp-custom>
amp-consent {
min-height: 30px;
font-family: 'Roboto';
font-weight: 500;
line-height: 30px;
padding: 8px;
background: #46b6ac;
}
amp-consent button {
border: none;
border-radius: 2px;
color: #fafafa;
height: 26px;
min-width: 32px;
padding: 0 16px;
margin: 0 16px;
text-transform: uppercase;
letter-spacing: 0;
cursor: pointer;
vertical-align: middle;
line-height: 26px;
text-align: center;
background: #3f51b5;
}
</style>
<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 async src="https://cdn.ampproject.org/v0.js"></script>
<script async custom-element="amp-consent" src="https://cdn.ampproject.org/v0/amp-consent-0.1.js"></script>
<script async custom-element="amp-iframe" src="https://cdn.ampproject.org/v0/amp-iframe-0.1.js"></script>
</head>
<body>
<h1 id="top">AMP Consent Iframe</h1>
<h2>Iframe blocked until responded</h2>
<amp-iframe
data-block-on-consent="_till_responded"
src="http://iframe.localhost:8000/examples/amp-consent/amp-consent-iframe.embed.html"
sandbox="allow-scripts allow-same-origin allow-popups"
allow="autoplay *; fullscreen *"
frameborder="0"
width="16"
height="9"
style="max-width:700px;"
layout="responsive">
<amp-img layout="fill" src="https://lh3.googleusercontent.com/pSECrJ82R7-AqeBCOEPGPM9iG9OEIQ_QXcbubWIOdkY=w300-h200-no-n" placeholder></amp-img>
</amp-iframe>
<h2>Iframe never blocked</h2>
<amp-iframe
src="http://iframe.localhost:8000/examples/amp-consent/amp-consent-iframe.embed.html"
sandbox="allow-scripts allow-same-origin allow-popups"
allow="autoplay *; fullscreen *"
frameborder="0"
width="16"
height="9"
style="max-width:700px;"
layout="responsive">
<amp-img layout="fill" src="https://lh3.googleusercontent.com/pSECrJ82R7-AqeBCOEPGPM9iG9OEIQ_QXcbubWIOdkY=w300-h200-no-n" placeholder></amp-img>
</amp-iframe>
<div id="container">
<!-- This should be in alphabetical order. _ping_ should be the first -->
<!-- _ping_ example -->
<amp-consent id='ABC' layout='nodisplay' type='_ping_'>
<script type="application/json">
{
"postPromptUI": "postPromptUI",
"clientConfig": {
"CMP_id": "test_id",
"other_info": "test_info"
}
}
</script>
<div id="postPromptUI">
Post Prompt UI
<button on="tap:ABC.prompt(consent=_ping_)">Manage</button>
</div>
</amp-consent>
<!-- End _ping_ example -->
</div>
</body>
</html>