horizontal.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. body
  15. {
  16. display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6, BB7 */
  17. display: -ms-flexbox; /* TWEENER - IE 10 */
  18. display: -webkit-flex; /* NEW - Safari 6.1+. iOS 7.1+, BB10 */
  19. display: flex; /* NEW, Spec - Firefox, Chrome, Opera */
  20. width: 400vw;
  21. }
  22. nav{
  23. font-size: 21pt;
  24. line-height: 1.5em;
  25. position: fixed;
  26. bottom: 0; left: 0;
  27. }
  28. nav a{ color: inherit; }
  29. section
  30. {
  31. width: 100vw;
  32. height: 200vh;
  33. -webkit-box-flex: 1; /* OLD - iOS 6-, Safari 3.1-6 */
  34. -webkit-flex: 1; /* Safari 6.1+. iOS 7.1+, BB10 */
  35. -ms-flex: 1; /* IE 10 */
  36. flex: 1; /* NEW, Spec - Firefox, Chrome */
  37. }
  38. .col{
  39. text-align: center;
  40. width: 50%;
  41. float: left;
  42. box-sizing: border-box;
  43. }
  44. h4{ text-align: center;}
  45. .container{
  46. outline: 1px solid #eed;
  47. font-size: 42pt;
  48. padding: 37.5vh 12.5vw;
  49. }
  50. .block{
  51. background: #223;
  52. color: #eed;
  53. line-height: 25vh;
  54. text-align: right;
  55. padding: 0 42pt;
  56. position: relative;
  57. }
  58. span{
  59. background: #eed;
  60. color: #223;
  61. line-height: 25vh;
  62. text-align: left;
  63. padding: 0 42pt;
  64. display: block;
  65. width: 50%;
  66. position: absolute;
  67. top: 0; left: 0;
  68. box-sizing: border-box;
  69. }
  70. </style>
  71. </head>
  72. <body>
  73. <section>
  74. <div class="col">
  75. <div class="container"><div class="block">#1<span class="rellax" data-rellax-speed="2">#1</span></div></div>
  76. </div>
  77. <div class="col">
  78. <div class="container"><div class="block">#1<span class="rellax" data-rellax-speed="-2">#1</span></div></div>
  79. </div>
  80. </section>
  81. <section>
  82. <div class="col">
  83. <div class="container"><div class="block">#2<span class="rellax" data-rellax-speed="4">#2</span></div></div>
  84. </div>
  85. <div class="col">
  86. <div class="container"><div class="block">#2<span class="rellax" data-rellax-speed="-4">#2</span></div></div>
  87. </div>
  88. </section>
  89. <section>
  90. <div class="col">
  91. <div class="container"><div class="block">#3<span class="rellax" data-rellax-speed="6" data-rellax-percentage="0.5">#3</span></div></div>
  92. </div>
  93. <div class="col">
  94. <div class="container"><div class="block">#3<span class="rellax" data-rellax-speed="-6" data-rellax-percentage="0.5">#3</span></div></div>
  95. </div>
  96. </section>
  97. <section>
  98. <div class="col">
  99. <div class="container"><div class="block">#4<span class="rellax" data-rellax-speed="8" data-rellax-percentage="0.5">#4</span></div></div>
  100. </div>
  101. <div class="col">
  102. <div class="container"><div class="block">#4<span class="rellax" data-rellax-speed="-8" data-rellax-percentage="0.5">#4</span></div></div>
  103. </div>
  104. </section>
  105. <!-- Scripts -->
  106. <script src="../rellax.js"></script>
  107. <script>
  108. var rellax = new Rellax('.rellax', {horizontal: true, vertical: true});
  109. </script>
  110. </body>
  111. </html>