blob: 58d87646eb1cb43b502b8f6550dd0f528f00ec0a [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001/**
2 * Copyright 2015 Google Inc. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17.demo-animation {
18 height: 200px;
19 width: 300px;
20 padding: 0;
21 background: none;
22}
23
24.demo-animation__container {
25 position: relative;
26 overflow: hidden;
27 margin: 0;
28 padding: 0;
29 width: 100%;
30 height: 100%;
31 text-align: center;
32 background-color: #ddd;
33}
34
35.demo-animation__container-foreground {
36 width: 100%;
37 height: 100%;
38 position: absolute;
39 left: 0;
40 top: 0;
41 z-index: 100;
42}
43
44.demo-animation__container-background {
45 line-height: 200px;
46 z-index: -100;
47}
48
49/* Outside the view, on the left.
50 We leave the view when moving to this state, so we use fast-out-linear-in. */
51.demo-animation--position-0 {
52 left: -102px;
53}
54
55/* Left side.
56 We enter the view when moving to this state, so we use linear-out-slow-in. */
57.demo-animation--position-1 {
58 left: 20px;
59}
60
61/* Right side.
62 We're always visible when moving to this state, so we use default. */
63.demo-animation--position-2 {
64 left: 180px;
65}
66
67/* Outside the view, on the right.
68 We leave the view when moving to this state, so we use fast-out-linear-in. */
69.demo-animation--position-3 {
70 left: 302px;
71}
72
73/* Right side.
74 We enter the view when moving to this state, so we use linear-out-slow-in. */
75.demo-animation--position-4 {
76 left: 180px;
77}
78
79/* Left side.
80 We're always visible when moving to this state, so we use default. */
81.demo-animation--position-5 {
82 left: 20px;
83}
84
85.demo-animation__movable {
86 background-color: red;
87 border-radius: 2px;
88 display: block;
89 height: 100px;
90 width: 100px;
91 position: absolute;
92 top: 50px;
93 transition-property: left;
94 transition-duration: 0.2s;
95}