/* JSPWiki - a JSP-based WikiWiki clone. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); fyou 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. */ /* Style: Flip Animation style to support vertical and horizontal flipping. Wiki-markup: (start) %%flip-h300-w500-red-blue Front ---- Back /% (end) DOM structure: (start) div.flip-container div.flip|.flop div.face ..front face.. div.face ..back face (end) Credit: http://desandro.github.io/3dtransforms/docs/card-flip.html http://davidwalsh.name/css-flip */ .flip-container { width: 100%; height: 150px; position: relative; .perspective(800px); .flip, .flop { width: 100%; height: 100%; position: absolute; transform-style: preserve-3d; .transition( transform 1s; ); .face { display: block; position: absolute; width: 100%; height: 100%; overflow: scroll; .backface-visibility(hidden); &:first-child { z-index: 2; //above back panel } &:last-child { //background: @blue; } } } .flip { .transform-origin(right center); //slide flip .face:last-child { .rotateY( 180deg ); } } &:hover .flip, .flip.flipped { //.rotateY( -180deg ); transform: translateX( -100% ) rotateY( -180deg ); //slide flip } .flop { .transform-origin( center top ); //slide flip .face:last-child { .rotateX( 180deg ); } } &:hover .flop, .flop.flipped { //.rotateX( -180deg ); transform: translateY( 100% ) rotateX( -180deg ); //slide flip } }