chess/src/main/webapp/pages/css/spinner.css
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Tue, 24 Sep 2013 22:20:24 +0200
branchchess
changeset 49 945fbfff28f3
permissions -rw-r--r--
Advanced version of the chess game
     1 /**
     2  * The MIT License (MIT)
     3  *
     4  * Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
     5  *
     6  * Permission is hereby granted, free of charge, to any person obtaining a copy
     7  * of this software and associated documentation files (the "Software"), to deal
     8  * in the Software without restriction, including without limitation the rights
     9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    10  * copies of the Software, and to permit persons to whom the Software is
    11  * furnished to do so, subject to the following conditions:
    12  *
    13  * The above copyright notice and this permission notice shall be included in
    14  * all copies or substantial portions of the Software.
    15  *
    16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    22  * THE SOFTWARE.
    23  */
    24 /** chess cube style **/
    25 
    26 #chesscube {
    27     margin: 1em auto;
    28     -webkit-perspective: 1200px;
    29     perspective: 1200px;
    30     position: fixed; 
    31     z-index: -100;
    32     bottom:100px;
    33     right: 100px; 
    34     width: 160px; 
    35     height: 160px;    
    36     transition: opacity 1s;
    37 }
    38 
    39 #spinner div {
    40     position: fixed;
    41     width: 160px;
    42     height: 160px;
    43     border: 1px solid #ccc;
    44     background: rgba(255,255,155,0.8);
    45     text-align: center;
    46     line-height: 160px;
    47     font-size: 120px;                
    48     -webkit-box-shadow: inset 0 0 40px rgba(0,0,0,0.4);
    49     box-shadow: inset 0 0 40px rgba(0,0,0,0.4);
    50 }
    51 
    52 #spinner div:nth-child(1) {
    53     -webkit-transform: translateZ(80px);
    54     transform: translateZ(80px);
    55 }
    56 #spinner div:nth-child(2) {
    57     -webkit-transform: rotateY(90deg) translateZ(80px);
    58     transform: rotateY(90deg) translateZ(80px);
    59 }
    60 #spinner div:nth-child(3) {
    61     -webkit-transform: rotateY(90deg) rotateX(90deg) translateZ(80px);
    62     transform: rotateY(90deg) rotateX(90deg) translateZ(80px);
    63 }
    64 #spinner div:nth-child(4) {
    65     -webkit-transform: rotateY(180deg) rotateZ(90deg) translateZ(80px);
    66     transform: rotateY(180deg) rotateZ(90deg) translateZ(80px);
    67 }
    68 #spinner div:nth-child(5) {
    69     -webkit-transform: rotateY(-90deg) rotateZ(90deg) translateZ(80px);
    70     transform: rotateY(-90deg) rotateZ(90deg) translateZ(80px);
    71 }
    72 #spinner div:nth-child(6) {
    73     -webkit-transform: rotateX(-90deg) translateZ(80px);
    74     transform: rotateX(-90deg) translateZ(80px);
    75 }
    76 
    77 @-webkit-keyframes spincube {
    78     from,to  {                                                    }            
    79     16%      { -webkit-transform: rotateY(-90deg);                }
    80     33%      { -webkit-transform: rotateY(-90deg) rotateZ(90deg); }
    81     50%      { -webkit-transform: rotateY(180deg) rotateZ(90deg); }
    82     66%      { -webkit-transform: rotateY(90deg) rotateX(90deg);  }
    83     83%      { -webkit-transform: rotateX(90deg);                 }
    84 }
    85 
    86 @keyframes spincube {
    87     from,to  {                                                    }            
    88     16%      { transform: rotateY(-90deg);                }
    89     33%      { transform: rotateY(-90deg) rotateZ(90deg); }
    90     50%      { transform: rotateY(180deg) rotateZ(90deg); }
    91     66%      { transform: rotateY(90deg) rotateX(90deg);  }
    92     83%      { transform: rotateX(90deg);                 }
    93 }
    94 
    95 #spinner {
    96     -webkit-animation-name: spincube;
    97     -webkit-animation-timing-function: ease-in-out;
    98     -webkit-animation-iteration-count: infinite;
    99     -webkit-animation-duration: 12s;
   100     -webkit-transform-style: preserve-3d;
   101     -webkit-transform-origin: 80px 80px 0;
   102     animation-name: spincube;
   103     animation-timing-function: ease-in-out;
   104     animation-iteration-count: infinite;
   105     animation-duration: 12s;
   106     transform-style: preserve-3d;
   107     transform-origin: 80px 80px 0;
   108 }
   109 
   110 @media (max-width: 767px) {
   111     #chesscube {
   112         opacity: 0;
   113     }
   114 }