wrapper.html 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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;
  13. padding: 0;
  14. width: 100%;
  15. height: 100%;
  16. min-height: 100%;
  17. position: relative;
  18. }
  19. .Layout__wrapper-container {
  20. position: absolute;
  21. width: 100%;
  22. height: 100%;
  23. }
  24. .Layout__wrapper {
  25. width: 100%;
  26. height: 100%;
  27. display: flex;
  28. flex-direction: column;
  29. overflow-y: auto;
  30. overflow-x: hidden;
  31. position: relative;
  32. }
  33. .Layout__main {
  34. padding: 0;
  35. margin: 0;
  36. display: flex;
  37. flex-wrap: wrap;
  38. align-content: space-between;
  39. position: relative;
  40. overflow-x: hidden;
  41. overflow-y: auto;
  42. flex-grow: 1;
  43. z-index: 1;
  44. }
  45. .page-content {
  46. max-width: 100vw;
  47. flex: 100%;
  48. }
  49. .col {
  50. text-align: center;
  51. width: 50%;
  52. float: left;
  53. box-sizing: border-box;
  54. }
  55. h4 {
  56. text-align: center;
  57. }
  58. .container {
  59. display: flex;
  60. align-items: center;
  61. outline: 1px solid #eed;
  62. font-size: 42pt;
  63. padding: 0 12.5vw;
  64. height: 200vh;
  65. }
  66. .block {
  67. background: #223;
  68. color: #eed;
  69. line-height: 25vh;
  70. text-align: right;
  71. margin-top: 20vh;
  72. height: 200px;
  73. width: 400px;
  74. position: relative;
  75. }
  76. span {
  77. background: #eed;
  78. color: #223;
  79. line-height: 25vh;
  80. text-align: left;
  81. padding: 0 42pt;
  82. display: block;
  83. width: 50%;
  84. position: absolute;
  85. top: 0;
  86. left: 0;
  87. box-sizing: border-box;
  88. }
  89. </style>
  90. </head>
  91. <body>
  92. <div class="Layout__wrapper-container">
  93. <div class="Layout__wrapper">
  94. <!-- Here can be fixed header -->
  95. <main class="Layout__main">
  96. <div class="page-content">
  97. <h4>data-rellax-speed = default</h4>
  98. <section>
  99. <div class="col">
  100. <br>With Percentage (0.5) <br><br>
  101. <div class="container">
  102. <div class="block">
  103. #1<span class="rellax" data-rellax-percentage="0.5">#1</span>
  104. </div>
  105. </div>
  106. <div class="container">
  107. <div class="block">
  108. #2<span class="rellax" data-rellax-percentage="0.5">#2</span>
  109. </div>
  110. </div>
  111. <div class="container">
  112. <div class="block">
  113. #3<span class="rellax" data-rellax-percentage="0.5">#3</span>
  114. </div>
  115. </div>
  116. <div class="container">
  117. <div class="block">
  118. #4<span class="rellax" data-rellax-percentage="0.5" style="transition: transform 10s cubic-bezier(0,1,.5,1);">#4</span>
  119. </div>
  120. </div>
  121. <div class="container">
  122. <div class="block">
  123. #5<span class="rellax" data-rellax-percentage="0.5" style="transition: transform 10s cubic-bezier(0,1,.5,1);">#5</span>
  124. </div>
  125. </div>
  126. <div class="container">
  127. <div class="block">
  128. #6<span class="rellax" data-rellax-percentage="0.5" style="transition: transform 10s cubic-bezier(0,1,.5,1);">#6</span>
  129. </div>
  130. </div>
  131. </div>
  132. <div class="col">
  133. <br>Without Percentage <br><br>
  134. <div class="container">
  135. <div class="block">
  136. #1<span class="rellax" style="transition: transform 10s cubic-bezier(0,1,.5,1);">#1</span>
  137. </div>
  138. </div>
  139. <div class="container">
  140. <div class="block">
  141. #2<span class="rellax" style="transition: transform 10s cubic-bezier(0,1,.5,1);">#2</span>
  142. </div>
  143. </div>
  144. <div class="container">
  145. <div class="block">
  146. #3<span class="rellax" style="transition: transform 10s cubic-bezier(0,1,.5,1);">#3</span>
  147. </div>
  148. </div>
  149. <div class="container">
  150. <div class="block">
  151. #4<span class="rellax">#4</span>
  152. </div>
  153. </div>
  154. <div class="container">
  155. <div class="block">
  156. #5<span class="rellax">#5</span>
  157. </div>
  158. </div>
  159. <div class="container">
  160. <div class="block">
  161. #6<span class="rellax">#6</span>
  162. </div>
  163. </div>
  164. </div>
  165. </section>
  166. </div>
  167. </div>
  168. </main>
  169. <!-- Here can be fixed footer -->
  170. </div>
  171. </div>
  172. <!-- Scripts -->
  173. <script src="../rellax.js"></script>
  174. <script>
  175. var rellax = new Rellax('.rellax', {
  176. center: true,
  177. wrapper: document.querySelector('.Layout__main') // or '.Layout__main'
  178. });
  179. </script>
  180. </body>
  181. </html>