spinningcube/src/main/webapp/pages/index.html
author Jaroslav Tulach <jtulach@netbeans.org>
Tue, 13 Aug 2013 15:17:28 +0200
changeset 39 43c71f709cc8
permissions -rw-r--r--
Spinning Cube Demo
jtulach@39
     1
<!--
jtulach@39
     2
jtulach@39
     3
    The MIT License (MIT)
jtulach@39
     4
jtulach@39
     5
    Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jtulach@39
     6
jtulach@39
     7
    Permission is hereby granted, free of charge, to any person obtaining a copy
jtulach@39
     8
    of this software and associated documentation files (the "Software"), to deal
jtulach@39
     9
    in the Software without restriction, including without limitation the rights
jtulach@39
    10
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
jtulach@39
    11
    copies of the Software, and to permit persons to whom the Software is
jtulach@39
    12
    furnished to do so, subject to the following conditions:
jtulach@39
    13
jtulach@39
    14
    The above copyright notice and this permission notice shall be included in
jtulach@39
    15
    all copies or substantial portions of the Software.
jtulach@39
    16
jtulach@39
    17
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
jtulach@39
    18
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
jtulach@39
    19
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
jtulach@39
    20
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
jtulach@39
    21
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
jtulach@39
    22
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
jtulach@39
    23
    THE SOFTWARE.
jtulach@39
    24
jtulach@39
    25
-->
jtulach@39
    26
<!DOCTYPE html>
jtulach@39
    27
<html>
jtulach@39
    28
    <head>
jtulach@39
    29
        <title></title>
jtulach@39
    30
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
jtulach@39
    31
jtulach@39
    32
        <style type="text/css">
jtulach@39
    33
jtulach@39
    34
            #stage {
jtulach@39
    35
                margin: 1em auto;
jtulach@39
    36
                -webkit-perspective: 1200px;
jtulach@39
    37
                -moz-perspective: 1200px;   
jtulach@39
    38
                    
jtulach@39
    39
            }
jtulach@39
    40
jtulach@39
    41
            #spinner div {
jtulach@39
    42
                position: absolute;
jtulach@39
    43
                width: 300px;
jtulach@39
    44
                height: 300px;
jtulach@39
    45
                border: 1px solid #ccc;
jtulach@39
    46
                background: rgba(255,255,155,0.8);
jtulach@39
    47
                text-align: center;
jtulach@39
    48
                line-height: 300px;
jtulach@39
    49
                font-size: 80px;                
jtulach@39
    50
                -webkit-box-shadow: inset 0 0 40px rgba(0,0,0,0.4);
jtulach@39
    51
            }
jtulach@39
    52
jtulach@39
    53
            #spinner div:nth-child(1) { -webkit-transform: translateZ(150px);                                }
jtulach@39
    54
            #spinner div:nth-child(2) { -webkit-transform: rotateY(90deg) translateZ(150px);                 }
jtulach@39
    55
            #spinner div:nth-child(3) { -webkit-transform: rotateY(90deg) rotateX(90deg) translateZ(150px);  }
jtulach@39
    56
            #spinner div:nth-child(4) { -webkit-transform: rotateY(180deg) rotateZ(90deg) translateZ(150px); }
jtulach@39
    57
            #spinner div:nth-child(5) { -webkit-transform: rotateY(-90deg) rotateZ(90deg) translateZ(150px); }
jtulach@39
    58
            #spinner div:nth-child(6) { -webkit-transform: rotateX(-90deg) translateZ(150px);                }
jtulach@39
    59
jtulach@39
    60
            @-webkit-keyframes spincube {
jtulach@39
    61
                from,to  {                                                    }            
jtulach@39
    62
            16%      { -webkit-transform: rotateY(-90deg);                }
jtulach@39
    63
            33%      { -webkit-transform: rotateY(-90deg) rotateZ(90deg); }
jtulach@39
    64
            50%      { -webkit-transform: rotateY(180deg) rotateZ(90deg); }
jtulach@39
    65
            66%      { -webkit-transform: rotateY(90deg) rotateX(90deg);  }
jtulach@39
    66
            83%      { -webkit-transform: rotateX(90deg);                 }
jtulach@39
    67
            }
jtulach@39
    68
jtulach@39
    69
            #spinner {
jtulach@39
    70
                -webkit-animation-name: spincube;
jtulach@39
    71
                -webkit-animation-timing-function: ease-in-out;
jtulach@39
    72
                -webkit-animation-iteration-count: infinite;
jtulach@39
    73
                -webkit-animation-duration: 12s;
jtulach@39
    74
                -webkit-transform-style: preserve-3d;
jtulach@39
    75
                -webkit-transform-origin: 150px 150px 0;
jtulach@39
    76
            }
jtulach@39
    77
jtulach@39
    78
        </style>
jtulach@39
    79
jtulach@39
    80
    </head>
jtulach@39
    81
    <body>
jtulach@39
    82
        <h1>Spinning Cube Demo</h1>
jtulach@39
    83
        <input data-bind="value: message, valueUpdate: 'afterkeydown'" size="100">
jtulach@39
    84
        <div style="position: relative;   top:62px;">
jtulach@39
    85
            <div id="stage" style="width: 300px; height: 300px;">
jtulach@39
    86
                <div id="spinner" data-bind="foreach: sides ">
jtulach@39
    87
                    <div data-bind="text: $data"></div>
jtulach@39
    88
                </div>
jtulach@39
    89
            </div>
jtulach@39
    90
        </div>
jtulach@39
    91
    </body>
jtulach@39
    92
</html>