-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstyle.css
135 lines (116 loc) · 2.75 KB
/
style.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
125
126
127
128
129
130
131
132
133
134
135
/**
* Button state:
* 1. normal (class name: [none])
* 2. opening (class name: opening)
* 3. opened (class name: opened)
* 4. closing (class name: closing)
* 5. closed (class name: closed)
* 6. hiding (class name: hiding)
* 8. flying (class name: flying)
**/
/**
* Normal:
* open: closed -> opening -> opened
* close: opened -> closing -> closed
* hide: current state -> hiding -> closed
* flyOpen: flying -> closed -> opening -> opened
**/
smart-banner {
outline: 0;
display: inline-block;
height: 7rem;
/* Same as closed state */
padding-left: 11rem;
padding-right: 0;
padding-top: 2rem;
padding-bottom: 2rem;
opacity: 1;
/* we need to set border to none to remove the button border */
border: none;
/* the radius is still make button as round even if we don't have border */
border-radius: 5.5rem;
background-color: rgba(0, 0, 0, 0.5);
background-repeat: no-repeat;
background-size: 5.4rem auto;
background-position: 2.8rem 50%;
word-break: keep-all;
white-space: nowrap;
overflow: hidden;
position: relative;
font-size: 2.8rem;
line-height: 7rem;
transition-property: none;
transition-timing-function: cubic-bezier(0.25, 0, 0, 1.0);
transition-duration: 0s;
}
smart-banner:before {
content: " ";
background-repeat: no-repeat;
background-size: 5.4rem auto;
background-position: center;
width: 5.4rem;
height: 7rem;
display: inline-block;
position: absolute;
left: 2.8rem;
transition-property: all;
transition-timing-function: cubic-bezier(0.25, 0, 0, 1.0);
transition-duration: 0.42s;
}
smart-banner.closed:before {
width: 11rem;
left: 0;
}
smart-banner[data-icon]:before {
width: 5.4rem;
left: 4.4rem;
font-size: 5.4rem;
line-height: 11rem;
text-align: center;
color: #5f6368;
white-space: normal;
top: 0;
}
smart-banner[data-icon].closed:before {
left: 2.8rem;
}
smart-banner.closed {
padding-left: 11rem;
padding-right: 0;
transition-duration: 0.5s;
background-color: rgba(0, 0, 0, 0.5);
}
smart-banner.closed > * {
display: none;
}
smart-banner.opened {
padding-right: 4.4rem;
}
smart-banner.opening {
transition-property: all;
transition-duration: 0.72s;
/* add the same padding-right of normal to make it run transition */
padding-right: 4.4rem;
}
smart-banner.opening:before {
transition-duration: 0.72s;
}
smart-banner.closing {
transition-property: all;
transition-duration: 0.5s;
padding-left: 11rem;
padding-right: 0;
background-color: rgba(0, 0, 0, 0.5);
}
smart-banner.hiding {
opacity: 0;
transition-property: opacity;
transition-duration: 1s;
}
smart-banner.flying {
animation: flyAnimation 1s;
}
@keyframes flyAnimation {
from {transform: translateY(20rem);}
to {transform: translateY(0);}
}