style.scss 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. @import 'bourbon'; // http://bourbon.io/
  2. @import '../partials/variables'; // colors, fonts etc...
  3. @import '../partials/mixins'; // custom mixins
  4. @import '../partials/layout'; // responsive grid and media queries
  5. /* --------------------------------
  6. Primary style
  7. -------------------------------- */
  8. *, *::after, *::before {
  9. box-sizing: border-box;
  10. }
  11. html {
  12. font-size: 62.5%;
  13. }
  14. body {
  15. font: {
  16. size: 1.6rem;
  17. family: $primary-font; // variables inside partials > _variables.scss
  18. }
  19. color: $color-1;
  20. background-color: $color-3;
  21. }
  22. a {
  23. color: $color-2;
  24. text-decoration: none;
  25. }
  26. /* --------------------------------
  27. Patterns - reusable parts of our design
  28. -------------------------------- */
  29. .cd-btn {
  30. display: inline-block;
  31. padding: 1.6em 2.4em;
  32. font-size: 1.4rem;
  33. letter-spacing: .15em;
  34. color: $color-3;
  35. font-weight: 700;
  36. text-transform: uppercase;
  37. background-color: $color-2;
  38. box-shadow: 0 2px 10px rgba(#000, .08);
  39. @include font-smoothing;
  40. @include transition(box-shadow .3s);
  41. .no-touch &:hover {
  42. box-shadow: 0 6px 20px rgba(#000, .1);
  43. }
  44. }
  45. /* --------------------------------
  46. Typography
  47. -------------------------------- */
  48. h1 {
  49. font-size: 2.6rem;
  50. line-height: 1;
  51. margin-bottom: 1em;
  52. font-family: $secondary-font;
  53. font-style: italic;
  54. @include MQ(M) {
  55. font-size: 5rem;
  56. }
  57. }
  58. /* --------------------------------
  59. Main Content
  60. -------------------------------- */
  61. .cd-main-content {
  62. position: relative;
  63. z-index: 1;
  64. width: 100%;
  65. height: 100vh;
  66. /* vertically align its content */
  67. display: table;
  68. background-color: $color-5;
  69. .center {
  70. /* vertically align inside parent element */
  71. display: table-cell;
  72. vertical-align: middle;
  73. text-align: center;
  74. }
  75. }
  76. /* --------------------------------
  77. Modal window
  78. -------------------------------- */
  79. .cd-modal {
  80. position: fixed;
  81. top: 0;
  82. left: 0;
  83. z-index: 3;
  84. height: 100%;
  85. width: 100%;
  86. overflow: hidden;
  87. background: $color-4 url(../img/modal-bg.jpg) no-repeat center center;
  88. background-size: cover;
  89. opacity: 0;
  90. visibility: hidden;
  91. @include transition(opacity .3s 0s, visibility 0s .3s);
  92. .modal-content {
  93. height: 100%;
  94. overflow-y: auto;
  95. padding: 3em 5%;
  96. color: $color-5;
  97. @include font-smoothing;
  98. }
  99. h1 {
  100. text-align: center;
  101. &::after {
  102. /* ink/brush separation */
  103. content: '';
  104. display: block;
  105. width: 130px;
  106. height: 18px;
  107. background: url(../img/ink-separation.svg) no-repeat center center;
  108. margin: .2em auto 0;
  109. }
  110. }
  111. p {
  112. line-height: 1.6;
  113. margin: 2em auto;
  114. max-width: 800px;
  115. }
  116. .modal-close {
  117. /* 'X' icon */
  118. position: absolute;
  119. z-index: 1;
  120. top: 20px;
  121. right: 5%;
  122. height: 45px;
  123. width: 45px;
  124. border-radius: 50%;
  125. background: rgba(#000, .3) url(../img/cd-icon-close.svg) no-repeat center center;
  126. /* image replacement */
  127. overflow: hidden;
  128. text-indent: 100%;
  129. white-space: nowrap;
  130. visibility: hidden;
  131. opacity: 0;
  132. @include transform(scale(0));
  133. @include transition(transform .3s 0s, visibility 0s .3s, opacity .3s 0s);
  134. .no-touch &:hover {
  135. background-color: rgba(#000, .5);
  136. }
  137. }
  138. &.visible {
  139. opacity: 1;
  140. visibility: visible;
  141. @include transition(opacity .7s, visibility 0s);
  142. .modal-content {
  143. /* this fixes the buggy scrolling on webkit browsers - mobile devices only - when overflow property is applied */
  144. -webkit-overflow-scrolling: touch;
  145. }
  146. .modal-close {
  147. visibility: visible;
  148. opacity: 1;
  149. @include transition(transform .3s 0s, visibility 0s 0s, opacity .3s 0s);
  150. @include transform(scale(1));
  151. }
  152. }
  153. @include MQ(L) {
  154. .modal-content {
  155. padding: 6em 5%;
  156. }
  157. .modal-close {
  158. height: 60px;
  159. width: 60px;
  160. }
  161. p {
  162. font-size: 2rem;
  163. }
  164. }
  165. }
  166. /* --------------------------------
  167. Transition Layer
  168. -------------------------------- */
  169. .cd-transition-layer {
  170. position: fixed;
  171. top: 0;
  172. left: 0;
  173. z-index: 2;
  174. height: 100%;
  175. width: 100%;
  176. opacity: 0;
  177. visibility: hidden;
  178. overflow: hidden;
  179. .bg-layer {
  180. position: absolute;
  181. left: 50%;
  182. top: 50%;
  183. @include transform(translateY(-50%) translateX(-2%));
  184. /* its dimentions will be overwritten using jQuery to proportionally fit the viewport */
  185. height: 100%;
  186. /* our sprite is composed of 25 frames */
  187. width: 2500%;
  188. background: url(../img/ink.png) no-repeat 0 0;
  189. background-size: 100% 100%;
  190. }
  191. &.visible {
  192. opacity: 1;
  193. visibility: visible;
  194. }
  195. &.opening .bg-layer {
  196. @include animation(cd-sequence .8s steps(24));
  197. @include animation-fill-mode(forwards);
  198. }
  199. &.closing .bg-layer {
  200. @include animation(cd-sequence-reverse .8s steps(24));
  201. @include animation-fill-mode(forwards);
  202. }
  203. .no-cssanimations & {
  204. display: none;
  205. }
  206. }
  207. @include keyframes(cd-sequence) {
  208. 0% {
  209. /* translateX(-2%) is used to horizontally center the first frame inside the viewport */
  210. @include transform(translateY(-50%) translateX(-2%));
  211. }
  212. 100% {
  213. /* translateX(-98%) (2% + 96) is used to horizontally center the last frame inside the viewport */
  214. @include transform(translateY(-50%) translateX(-98%));
  215. }
  216. }
  217. @include keyframes(cd-sequence-reverse) {
  218. 0% {
  219. @include transform(translateY(-50%) translateX(-98%));
  220. }
  221. 100% {
  222. @include transform(translateY(-50%) translateX(-2%));
  223. }
  224. }