center.html 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. display: flex;
  30. align-items: center;
  31. outline: 1px solid #eed;
  32. font-size: 42pt;
  33. /*padding: 37.5vh 12.5vw;*/
  34. padding: 0 12.5vw;
  35. height: 200vh;
  36. }
  37. .block{
  38. background: #223;
  39. color: #eed;
  40. line-height: 25vh;
  41. text-align: right;
  42. /*padding: 0 42pt;*/
  43. margin-top: 20vh;
  44. height: 200px;
  45. width: 400px;
  46. position: relative;
  47. }
  48. span{
  49. background: #eed;
  50. color: #223;
  51. line-height: 25vh;
  52. text-align: left;
  53. padding: 0 42pt;
  54. display: block;
  55. width: 50%;
  56. position: absolute;
  57. top: 0; left: 0;
  58. box-sizing: border-box;
  59. }
  60. </style>
  61. </head>
  62. <body>
  63. <h4>data-rellax-speed = default</h4>
  64. <section>
  65. <div class="col">
  66. <br>With Percentage (0.5) <br><br>
  67. <div id="21" class="container"><div class="block">#1<span class="rellax" data-rellax-percentage="0.5">#1</span></div></div>
  68. <div id="22" class="container"><div class="block">#2<span class="rellax" data-rellax-percentage="0.5">#2</span></div></div>
  69. <div id="23" class="container"><div class="block">#3<span class="rellax" data-rellax-percentage="0.5">#3</span></div></div>
  70. <div id="24" class="container"><div class="block">#4<span class="rellax" data-rellax-percentage="0.5" style="transition: transform 10s cubic-bezier(0,1,.5,1);">#4</span></div></div>
  71. <div id="25" class="container"><div class="block">#5<span class="rellax" data-rellax-percentage="0.5" style="transition: transform 10s cubic-bezier(0,1,.5,1);">#5</span></div></div>
  72. <div id="26" class="container"><div class="block">#6<span class="rellax" data-rellax-percentage="0.5" style="transition: transform 10s cubic-bezier(0,1,.5,1);">#6</span></div></div>
  73. </div>
  74. <div class="col">
  75. <br>Without Percentage <br><br>
  76. <div id="21" class="container"><div class="block">#1<span class="rellax" style="transition: transform 10s cubic-bezier(0,1,.5,1);">#1</span></div></div>
  77. <div id="22" class="container"><div class="block">#2<span class="rellax" style="transition: transform 10s cubic-bezier(0,1,.5,1);">#2</span></div></div>
  78. <div id="23" class="container"><div class="block">#3<span class="rellax" style="transition: transform 10s cubic-bezier(0,1,.5,1);">#3</span></div></div>
  79. <div id="24" class="container"><div class="block">#4<span class="rellax">#4</span></div></div>
  80. <div id="25" class="container"><div class="block">#5<span class="rellax">#5</span></div></div>
  81. <div id="26" class="container"><div class="block">#6<span class="rellax">#6</span></div></div>
  82. </div>
  83. </section>
  84. <!-- Scripts -->
  85. <script src="../rellax.js"></script>
  86. <script>
  87. var rellax = new Rellax('.rellax', {center: true});
  88. </script>
  89. </body>
  90. </html>