/** * Copyright 2015 Google Inc. 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. */ .demo-animation { height: 200px; width: 300px; padding: 0; background: none; } .demo-animation__container { position: relative; overflow: hidden; margin: 0; padding: 0; width: 100%; height: 100%; text-align: center; background-color: #ddd; } .demo-animation__container-foreground { width: 100%; height: 100%; position: absolute; left: 0; top: 0; z-index: 100; } .demo-animation__container-background { line-height: 200px; z-index: -100; } /* Outside the view, on the left. We leave the view when moving to this state, so we use fast-out-linear-in. */ .demo-animation--position-0 { left: -102px; } /* Left side. We enter the view when moving to this state, so we use linear-out-slow-in. */ .demo-animation--position-1 { left: 20px; } /* Right side. We're always visible when moving to this state, so we use default. */ .demo-animation--position-2 { left: 180px; } /* Outside the view, on the right. We leave the view when moving to this state, so we use fast-out-linear-in. */ .demo-animation--position-3 { left: 302px; } /* Right side. We enter the view when moving to this state, so we use linear-out-slow-in. */ .demo-animation--position-4 { left: 180px; } /* Left side. We're always visible when moving to this state, so we use default. */ .demo-animation--position-5 { left: 20px; } .demo-animation__movable { background-color: red; border-radius: 2px; display: block; height: 100px; width: 100px; position: absolute; top: 50px; transition-property: left; transition-duration: 0.2s; }