forked from ampproject/amphtml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexperiment.amp.html
80 lines (78 loc) · 3.26 KB
/
experiment.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
<!doctype html>
<html ⚡>
<head>
<meta charset="utf-8">
<title>amp-experiment</title>
<link rel="canonical" href="amps.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>
<script async custom-element="amp-analytics" src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js"></script>
<script async custom-element="amp-experiment" src="https://cdn.ampproject.org/v0/amp-experiment-0.1.js"></script>
<script async custom-element="amp-user-notification" src="https://cdn.ampproject.org/v0/amp-user-notification-0.1.js"></script>
<script async src="https://cdn.ampproject.org/v0.js"></script>
<style amp-custom>
body[amp-x-background-color-test=yellow] {
background-color: yellow;
}
body[amp-x-background-color-test=green] {
background-color: green;
}
body[amp-x-font-color-test=red] {
color: red;
}
body[amp-x-font-color-test=blue] {
color: blue;
}
body[amp-x-border-test=solid] h1 {
border: 1px solid black;
}
body[amp-x-border-test=dashed] h1 {
border: 1px dashed black;
}
amp-user-notification {
background-color: darkgray;
padding: 5px;
}
</style>
</head>
<body>
<h1>Background color is user sticky; text color may change on a refresh</h1>
<ul>
<li><a href="#amp-x-background-color-test=yellow" target="_blank">#amp-x-background-color-test=yellow</a></li>
<li><a href="#amp-x-background-color-test=green" target="_blank">#amp-x-background-color-test=green</a></li>
</ul>
<amp-experiment>
<script type="application/json">
{
"background-color-test": {
"variants": {
"yellow": 50,
"green": 50
}
},
"font-color-test": {
"sticky": false,
"variants": {
"blue": 20,
"red": 20
}
},
"border-test": {
"consentNotificationId": "amp-user-notification",
"variants": {
"solid": 50,
"dashed": 50
}
}
}
</script>
</amp-experiment>
<amp-pixel src="https://donot.worry/?background-color-test=VARIANT(background-color-test)&font-color-test=VARIANT(font-color-test)&variants=VARIANTS"></amp-pixel>
<amp-user-notification
layout=nodisplay
id="amp-user-notification">
Dismiss this notification to see a border around title on your next visit.
<button on="tap:amp-user-notification.dismiss" role="button">I accept</button>
</amp-user-notification>
</body>
</html>