animation.rml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <rml>
  2. <head>
  3. <link type="text/template" href="../../../assets/window.rml"/>
  4. <title>Animation Sample</title>
  5. <style>
  6. body.window
  7. {
  8. max-width: 2000px;
  9. max-height: 2000px;
  10. width: 1600px;
  11. height: 750px;
  12. perspective: 3000px;
  13. /*opacity: 0;*/
  14. }
  15. button {
  16. margin-top: 50px;
  17. }
  18. div#title_bar div#icon
  19. {
  20. display: none;
  21. }
  22. spacer
  23. {
  24. display: inline-block;
  25. width: 25px;
  26. }
  27. #start_game
  28. {
  29. opacity: 0.8;
  30. transform: rotate(370deg) translateX(100px) scale(1.2);
  31. transform-origin: 30% 80% 0;
  32. }
  33. #high_scores {
  34. margin-left: -100px;
  35. }
  36. #exit {
  37. transform: rotate(45deg);
  38. transform-origin: 50% 50% 0;
  39. }
  40. div.container
  41. {
  42. margin-top: 15px;
  43. width: 100%;
  44. height: 200px;
  45. background-color: #ae8484aa;
  46. }
  47. div.plain
  48. {
  49. font-size: 1.2em;
  50. padding: 10px;
  51. margin: auto;
  52. width: 130px;
  53. height: 70px;
  54. background-color: #c66;
  55. }
  56. div.plain:hover { background-color: #ddb700; }
  57. /* -- TRANSFORM TESTS */
  58. #generic {
  59. transform: translateX(100px) rotate3d(1.0, 0, 1.0, 0deg);
  60. }
  61. #combine {
  62. transform: rotate(45deg);
  63. }
  64. #decomposition {
  65. /* The scale(1.0) should force a full matrix recomposition when interpolating,
  66. then, the information about multiple turns get lost and it only turns 45deg. */
  67. transform: rotate(45deg) scale(1.0);
  68. }
  69. /* -- MIXED UNITS TESTS */
  70. #abs_rel {
  71. margin: 0;
  72. margin-left: 50px;
  73. }
  74. #abs_rel_transform {
  75. margin: 0;
  76. transform: translateX(100%);
  77. }
  78. #animation_event {
  79. position: relative;
  80. margin: 0;
  81. top: 50px; left: 50px;
  82. }
  83. /* -- TRANSITION TESTS */
  84. #transition_test {
  85. /*transition: padding-left 1.6s elastic-in 1.0, background-color 1.2s quadratic-in 1.0, transform 1.3s exponential-in 1.0;*/
  86. transition: padding-left background-color transform 1.6s elastic-out 0.0;
  87. transform: scale(1.0);
  88. }
  89. #transition_test:hover {
  90. /*transition: padding-left background-color transform 0.8s quadratic-out 1.0;*/
  91. padding-left: 60px;
  92. transform: scale(1.5);
  93. }
  94. #transition_class {
  95. margin-left: 50px;
  96. transition: margin-left background-color 0.5s cubic-out;
  97. }
  98. #transition_class.move_me {
  99. margin-left: -50px;
  100. font-size: 22px;
  101. }
  102. /* -- KEYFRAMES TESTS */
  103. @keyframes hello-world
  104. {
  105. 25% {
  106. transform: rotate(180deg);
  107. }
  108. 40% {
  109. transform: rotate(180deg) translateX(200px);
  110. }
  111. 60% {
  112. transform: rotate(180deg) translateX(-200px);
  113. }
  114. 75% {
  115. transform: rotate(180deg);
  116. }
  117. to {
  118. transform: rotate(360deg);
  119. }
  120. }
  121. #keyframes_test
  122. {
  123. transform: rotate(0);
  124. animation: 5s bounce-out infinite hello-world;
  125. transition: background-color 0.5s exponential-in-out;
  126. }
  127. @keyframes some-missing-keys
  128. {
  129. 0%, 30% {
  130. background-color: #d99;
  131. }
  132. 50% {
  133. background-color: #9d9;
  134. }
  135. to {
  136. background-color: #f9f;
  137. width: 100%;
  138. }
  139. }
  140. #keyframes_missing_keys
  141. {
  142. position: relative;
  143. margin: 0; padding: 0;
  144. top: 0; left: 0;
  145. width: 25px; height: 25px;
  146. animation: 2s cubic-in-out infinite alternate some-missing-keys;
  147. }
  148. #keyevent_response
  149. {
  150. position: relative;
  151. margin: 0; padding: 0;
  152. top: 110px; left: 0;
  153. width: 100px; height: 55px;
  154. }
  155. #performance
  156. {
  157. position: absolute;
  158. bottom: 0;
  159. height: 30%;
  160. width: 20%;
  161. left: -100px;
  162. transform: scale(0.5) rotate(-90deg);
  163. }
  164. </style>
  165. </head>
  166. <body template="window">
  167. <div style="width: 20%; height: 80%; position: absolute;">
  168. <div style="font-size: 0.85em; text-align: left;" id="fps"></div>
  169. <button id="start_game">Start Game</button><br />
  170. <button id="high_scores" onkeydown="hello">High Scores</button><br />
  171. <button id="options">Options</button><br />
  172. <button id="help">Help</button><br />
  173. <button id="exit" onclick="exit">Exit</button>
  174. </div>
  175. <div id="performance"/>
  176. <div style="width: 20%; height: 80%;position: absolute; left: 28%;" id="transform_tests">
  177. <div style="font-size: 1.5em; text-align: left;">Test transform animations</div>
  178. <div class="container"><div class="plain" id="generic">Generic form conversion.</div></div>
  179. <div class="container"><div class="plain" id="combine">Match different transform primitive sizes</div></div>
  180. <div class="container"><div class="plain" id="decomposition">Force full matrix decomposition</div></div>
  181. </div>
  182. <div style="width: 20%; height: 80%;position: absolute; left: 52%;" id="mixed_units_tests">
  183. <div style="font-size: 1.5em; text-align: left;">Mixed units tests</div>
  184. <div class="container"><div class="plain" id="abs_rel">Pixel vs percentage.</div></div>
  185. <div class="container"><div class="plain" id="abs_rel_transform">Pixel vs percentage transform.</div></div>
  186. <div class="container"><div class="plain" id="animation_event">Animation event</div><div class="plain" id="keyevent_response">Events (press arrow keys)</div></div>
  187. </div>
  188. <div style="width: 20%; height: 80%;position: absolute; left: 75%;" id="transition_tests">
  189. <div style="font-size: 1.5em; text-align: left;">Transition tests</div>
  190. <div class="container"><div class="plain" id="transition_test">Transition test (hover)</div></div>
  191. <div class="container"><div class="plain" id="transition_class" onclick="add_class">Transition class (click)</div></div>
  192. <div class="container"><div class="plain" id="keyframes_test">Keyframes test</div><div class="plain" id="keyframes_missing_keys"/></div>
  193. </div>
  194. </body>
  195. </rml>