-
Notifications
You must be signed in to change notification settings - Fork 3.9k
/
amp-twitter.css
124 lines (108 loc) · 3.13 KB
/
amp-twitter.css
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
/**
* Copyright 2018 The AMP HTML Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS-IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
amp-twitter {
transition-property: height;
transition-duration: 250ms;
}
/**
* [placeholder] is need for specificity over the base placeholder rules
*/
.i-amphtml-twitter-placeholder[placeholder] {
display: flex;
align-items: center;
justify-content: center;
max-width: 500px;
min-width: 220px;
margin: 0 auto;
border-radius: 5px;
border: 1px solid #e1e8ed;
overflow: hidden;
pointer-events: none;
}
/**
* Need a separate element for this so that we can have the pulse animation
* as well as the start/end transitions.
*/
.i-amphtml-twitter-placeholder-logo {
width: 100%;
height: 100%;
max-width: 200px;
max-height: 200px;
}
.i-amphtml-twitter-pulse .i-amphtml-twitter-placeholder-logo {
animation: amp-twitter-pulse 750ms infinite alternate-reverse ease-in-out;
}
.i-amphtml-twitter-placeholder-svg {
width: 100%;
height: 100%;
}
.i-amphtml-twitter-pulse:not([i-amphtml-loading]) .i-amphtml-twitter-placeholder-svg {
transition-property: transform, opacity;
transition-duration: 100ms;
transition-timing-function: ease-in;
/*
* The initial state. Rather than start straight from the fullsize pulsing
* state, we start off a bit smaller so there is some sense of progress.
*/
transform: scale(0.4);
opacity: 0.6;
}
.i-amphtml-twitter-fade .i-amphtml-twitter-placeholder-svg {
transition-property: opacity;
transition-duration: 100ms;
}
.i-amphtml-twitter-iframe {
opacity: 0;
}
.i-amphtml-twitter-fade .i-amphtml-twitter-iframe,
.i-amphtml-twitter-pulse .i-amphtml-twitter-iframe {
transition-property: opacity;
transition-duration: 200ms;
transition-timing-function: ease-in;
}
.i-amphtml-twitter-pulse[i-amphtml-loading="start"] .i-amphtml-twitter-placeholder-svg {
transition-duration: 250ms;
transform: scale(1);
opacity: 1;
}
amp-twitter[i-amphtml-loading="done"] .i-amphtml-twitter-placeholder {
border: none;
}
amp-twitter[i-amphtml-loading="done"] .i-amphtml-twitter-placeholder-svg {
opacity: 0;
}
.i-amphtml-twitter-burst[i-amphtml-loading="done"] .i-amphtml-twitter-placeholder-svg {
transition-duration: 250ms;
transition-timing-function: ease-out;
transform: scale(12);
}
.i-amphtml-twitter-fade[i-amphtml-loading="done"] .i-amphtml-twitter-placeholder-svg {
transition-duration: 250ms;
transition-timing-function: ease-out;
}
amp-twitter[i-amphtml-loading="done"] .i-amphtml-twitter-iframe {
opacity: 1;
}
@keyframes amp-twitter-pulse {
0% {
transform: scale(0.85);
opacity: 0.9;
}
100% {
transform: scale(1);
opacity: 1;
}
}