speed.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <title></title>
  8. <style>
  9. html, body{
  10. color: #223;
  11. font-size: 21pt;
  12. margin: 0; padding: 0;
  13. }
  14. nav{
  15. font-size: 21pt;
  16. line-height: 1.5em;
  17. position: fixed;
  18. bottom: 0; left: 0;
  19. }
  20. nav a{ color: inherit; }
  21. .col{
  22. text-align: center;
  23. width: 50%;
  24. float: left;
  25. box-sizing: border-box;
  26. }
  27. h4{ text-align: center;}
  28. .container{
  29. outline: 1px solid #eed;
  30. font-size: 42pt;
  31. padding: 37.5vh 12.5vw;
  32. }
  33. .block{
  34. background: #223;
  35. color: #eed;
  36. line-height: 25vh;
  37. text-align: right;
  38. padding: 0 42pt;
  39. position: relative;
  40. }
  41. span{
  42. background: #eed;
  43. color: #223;
  44. line-height: 25vh;
  45. text-align: left;
  46. padding: 0 42pt;
  47. display: block;
  48. width: 50%;
  49. position: absolute;
  50. top: 0; left: 0;
  51. box-sizing: border-box;
  52. }
  53. </style>
  54. </head>
  55. <body>
  56. <h4>speed = -1000 / speed = -10</h4>
  57. <section>
  58. <div class="col">
  59. <div class="container"><div class="block">#1<span class="rellax" data-rellax-speed="-1000">#1</span></div></div>
  60. </div>
  61. <div class="col">
  62. <div class="container"><div class="block">#1<span class="rellax" data-rellax-speed="-10">#1</span></div></div>
  63. </div>
  64. </section>
  65. <h4>speed = 1000 / speed = 10</h4>
  66. <section>
  67. <div class="col">
  68. <div class="container"><div class="block">#2<span class="rellax" data-rellax-speed="1000">#2</span></div></div>
  69. </div>
  70. <div class="col">
  71. <div class="container"><div class="block">#2<span class="rellax" data-rellax-speed="10">#2</span></div></div>
  72. </div>
  73. </section>
  74. <h4>percentage = 0.5</h4>
  75. <h4>speed = -1000 / speed = -5</h4>
  76. <section>
  77. <div class="col">
  78. <div class="container"><div class="block">#3<span class="rellax" data-rellax-speed="-1000" data-rellax-percentage="0.5">#3</span></div></div>
  79. </div>
  80. <div class="col">
  81. <div class="container"><div class="block">#3<span class="rellax" data-rellax-speed="-5" data-rellax-percentage="0.5">#3</span></div></div>
  82. </div>
  83. </section>
  84. <h4>percentage = 0.5</h4>
  85. <h4>speed = 1000 / speed = 5</h4>
  86. <section>
  87. <div class="col">
  88. <div class="container"><div class="block">#4<span class="rellax" data-rellax-speed="1000" data-rellax-percentage="0.5">#4</span></div></div>
  89. </div>
  90. <div class="col">
  91. <div class="container"><div class="block">#4<span class="rellax" data-rellax-speed="5" data-rellax-percentage="0.5">#4</span></div></div>
  92. </div>
  93. </section>
  94. <!-- Scripts -->
  95. <script src="../rellax.js"></script>
  96. <script>
  97. var rellax = new Rellax();
  98. </script>
  99. </body>
  100. </html>