This repository was archived by the owner on Jan 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample.scss
169 lines (154 loc) · 3.61 KB
/
example.scss
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
@import '../sass-mixins/transition-height/index';
@import '../sass-mixins/transition-element-movement/index';
.sample {
border: 2px solid black;
background-color: #fff;
width: 200px;
height: 50px;
line-height: 50px;
margin: 20px auto;
text-align: center;
&.is-green {
background-color: green;
color: white;
}
}
.demo {
background-color: #d4d4d4;
padding: 20px;
border: 3px solid black;
margin-bottom: -3px;
min-height: 400px;
box-sizing: border-box;
}
.transitions-are-enabled {
// persist-class sample
.sample-persist-class {
transition: background-color 500ms ease-in-out, color 500ms ease-in-out;
}
// rdd sample
.sample-add-remove.example-add-remove-enter {
opacity: 0;
transform: rotate(180deg);
transition: transform 1000ms ease-in-out, opacity 1000ms ease-in-out;
}
.sample-add-remove.example-add-remove-enter-active {
opacity: 1;
transform: rotate(0);
}
// remove sample
.sample-add-remove.example-add-remove-leave {
opacity: 1;
transform: 0;
transition: transform 1000ms ease-in-out, opacity 1000ms ease-in-out
}
.sample-add-remove.example-add-remove-leave-active {
opacity: 0;
transform: rotate(180deg);
}
// height-on-added sample
.sample-height-on-added {
@include maxHeightOnAddedTransitions();
}
// move sample
.sample-movable {
@include transitionElementMovement("transition-motion", 500ms cubic-bezier(0.78, 0.28, 0.45, 1.64));
}
.sample-advanced {
&.advanced-enter {
transition: transform 400ms cubic-bezier(0,0,.64,1.38), opacity 500ms ease-in-out;
opacity: 0;
transform: scale3d(0.7, 0.7, 1) translate3d(0, -150%, 0);
}
&.advanced-enter-active {
opacity: 1;
transform: none;
}
&.advanced-leave {
transition: opacity 500ms ease, transform 500ms ease;
opacity: 1;
transform: none;
}
&.advanced-leave-active {
opacity: 0;
transform: scale3d(1.5, 1.5, 1) translate3d(0, 150%, 0);
}
}
.sample-2-advanced {
&.left-enter {
transition: transform 400ms cubic-bezier(0,0,.64,1.38), opacity 500ms ease-in-out;
opacity: 0;
transform: scale3d(0.7, 0.7, 1) translate3d(100%, 0, 0);
}
&.left-enter-active {
opacity: 1;
transform: none;
}
&.right-enter {
transition: transform 400ms cubic-bezier(0,0,.64,1.38), opacity 500ms ease-in-out;
opacity: 0;
transform: scale3d(0.7, 0.7, 1) translate3d(-100%, 0, 0);
}
&.right-enter-active {
opacity: 1;
transform: none;
}
&.left-leave {
transition: opacity 500ms ease, transform 500ms ease;
opacity: 1;
transform: none;
}
&.left-leave-active {
opacity: 0;
transform: scale3d(0.5, 0.5, 1) translate3d(100%, 0, 0);
}
&.right-leave {
transition: opacity 500ms ease, transform 500ms ease;
opacity: 1;
transform: none;
}
&.right-leave-active {
opacity: 0;
transform: scale3d(0.5, 0.5, 1) translate3d(-100%, 0, 0);
}
}
}
// height toggle sample
.sample-height {
@include maxHeightTransitions();
}
// additional styles for move demo
.sample-movable {
position: relative;
border: 2px solid black;
line-height: 50px;
margin: 20px auto;
text-align: center;
// via a redux state change, this class is added to
// the node when its position should change. It is this
// positional/size change that ends up getting animated
&.moved {
top: -100px;
right: 20px;
width: 300px;
height: 150px;
}
}
.advanced-demo {
min-height: 500px;
.sample {
color: #FFF;
}
#advanced-1, #advanced-2-1 {
background-color: #034f7d;
}
#advanced-2, #advanced-2-2 {
background-color: #8e2222;
}
#advanced-3, #advanced-2-3 {
background-color: #51179a;
}
#advanced-4, #advanced-2-4 {
background-color: #10754c;
}
}