Advertisement
Guest User

Untitled

a guest
Jul 15th, 2015
645
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. <html>
  2. <head>
  3.  
  4. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  5. <script>
  6. $(document).ready(function(){
  7. $("#button_left").click(function(){
  8. $("section").toggleClass("rotate-left");
  9. });
  10. });
  11. </script>
  12. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
  13. <script>
  14. $(document).ready(function(){
  15. $("#button_right").click(function(){
  16. $("section").toggleClass("rotate-right");
  17. });
  18. });
  19. </script>
  20. <style>
  21.  
  22. .wrap {
  23. perspective: 800px;
  24. perspective-origin: 50% 100px;
  25. }
  26. .cube {
  27. margin: 0 auto;
  28. position: relative;
  29. width: 200px;
  30. transform-style: preserve-3d;
  31. }
  32. .cube div {
  33. box-shadow: inset 0 0 20px rgba(125,125,125,0.9);
  34. position: absolute;
  35. width: 200px;
  36. height: 200px;
  37. }
  38. .back {
  39. background: rgba(40,40,40,0.8);
  40. transform: translateZ(-100px) rotateY(180deg);
  41. }
  42. .right {
  43. background: rgba(189,25,400,0.3);
  44. transform: rotateY(-270deg) translateX(100px);
  45. transform-origin: top right;
  46. }
  47. .left {
  48. background: rgba(189,25,400,0.3);
  49. transform: rotateY(270deg) translateX(-100px);
  50. transform-origin: center left;
  51. }
  52. .top {
  53. background: rgba(189,25,400,0.3);
  54. transform: rotateX(-90deg) translateY(-100px);
  55. transform-origin: top center;
  56. }
  57. .bottom {
  58. background: rgba(189,25,400,0.3);
  59. transform: rotateX(90deg) translateY(100px);
  60. transform-origin: bottom center;
  61. }
  62. .front {
  63. background: rgba(189,25,400,0.3);
  64. transform: translateZ(100px);
  65. }
  66. @keyframes spin_left {
  67. from { transform: rotateY(0); }
  68. to { transform: rotateY(-90deg); }
  69. }
  70. .rotate-left {
  71. animation: spin_left 1s 1 linear;
  72. }
  73. @keyframes spin_right {
  74. from { transform: rotateY(0); }
  75. to { transform: rotateY(90deg); }
  76. }
  77. .rotate-right {
  78. animation: spin_right 1s 1 linear;
  79. }
  80. </style>
  81.  
  82. </head>
  83.  
  84. <body>
  85. <br><br><br><br><br><br><br><br><br><br>
  86. <div class="wrap">
  87. <section class="cube">
  88. <div class="front">Hello</div>
  89. <div class="back"></div>
  90. <div class="top"></div>
  91. <div class="bottom"></div>
  92. <div class="left"></div>
  93. <div class="right"></div>
  94. </section>
  95. </div>
  96. <input type="button" value="<--" id="button_left">
  97. <input type="button" value="-->" id="button_right">
  98.  
  99. </body>
  100. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement