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