-
Notifications
You must be signed in to change notification settings - Fork 1
/
style.css
136 lines (117 loc) · 2.87 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
136
/**
* Button state:
* 1. normal (class name: [none])
* 2. enlarging (class name: enlarging)
* 3. shrinking (class name: shrinking)
* 4. opening (class name: opening)
* 5. closing (class name: closing)
* 6. closed (class name: closed)
**/
/**
* focus: closed -> closed + enlarging -> closed + shrinking -> opening -> ''
* close: '' -> closing -> closed;
**/
menu-group {
outline: 0;
display: inline-block;
height: 8rem;
padding-left: 8rem;
padding-right: 4rem;
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: 4rem;
background-color: rgba(0, 0, 0, 0.5);
word-break: keep-all;
white-space: nowrap;
overflow: hidden;
position: relative;
transition-property: all;
transition-timing-function: cubic-bezier(0.25, 0, 0, 1.0);
transition-duration: 0.42s;
}
menu-group:before {
content: " ";
background-repeat: no-repeat;
background-size: 5.4rem auto;
background-position: 1.3rem center;
width: 8rem;
height: 8rem;
display: inline-block;
position: absolute;
left: 0;
transition-property: all;
transition-timing-function: cubic-bezier(0.25, 0, 0, 1.0);
transition-duration: 0.42s;
}
menu-group[rotate]:before {
transform: rotate(360deg);
transition-property: all;
transition-timing-function: cubic-bezier(0.25, 0, 0, 1.0);
transition-duration: 0.42s;
}
menu-group[data-icon]:before {
width: 5.4rem;
left: 1.3rem;
font-size: 5.4rem;
line-height: 8rem;
text-align: center;
color: #ffffff;
white-space: normal;
top: 0;
}
menu-group[data-icon].switching-icon:before {
font-size: 5.4rem;
line-height: 8rem;
text-align: center;
color: #ffffff;
/**
* According to visual spec, we have falling down transition while icon
* change.
*
* The trick is:
* 1. to put the next icon at the top of current and slide icons down.
* 2. to set transition duration to 0 here to elimiate the slide up
* transition.
**/
top: -8rem;
transition: none;
}
menu-group.closed {
padding-right: 0;
transition-duration: 0.5s;
background-color: rgba(0, 0, 0, 0.5);
}
menu-group.closed > * {
display: none;
}
menu-group[rotate].closed:before {
transform: rotate(0deg);
}
menu-group.opening {
transition-duration: 0.72s;
/* add the same padding-right of normal to make it run transition */
padding-right: 4rem;
}
menu-group.opening:before {
transition-duration: 0.72s;
}
menu-group.closing {
transition-duration: 0.5s;
padding-right: 0;
background-color: rgba(0, 0, 0, 0.5);
}
menu-group[rotate].closing:before {
transform: rotate(0deg);
transition-duration: 0.5s;
}
menu-group.enlarging {
opacity: 1;
background-color: #ffffff;
transform: scale(1.2);
transition-duration: 0.2s;
}
menu-group.shrinking {
transition-duration: 0.23s;
}