James Peret's blog. Built with Jekyll and the Mikey theme.

_hero.scss 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. //
  2. // Hero area
  3. // --------------------------------------------------
  4. .section--first {
  5. width: 100%;
  6. top: 0;
  7. position: relative;
  8. color: $black;
  9. }
  10. .section--first,
  11. .section-backgroundImage {
  12. height: 19 * $leading;
  13. @media (max-width: $screen-xs-max) {
  14. height: 14 * $leading;
  15. }
  16. }
  17. .section--frontpage,
  18. .section--frontpage ~ .post-featuredImage {
  19. height: 12 * $leading;
  20. @media (max-width: $screen-xs-max) {
  21. height: 5 * $leading;
  22. }
  23. }
  24. .section--about,
  25. .section-backgroundImage,
  26. .section--about ~ .post-featuredImage {
  27. height: 24 * $leading;
  28. @media (max-width: $screen-xs-max) {
  29. height: 20 * $leading;
  30. }
  31. }
  32. // Inspired by SQUARESPACE
  33. .section-backgroundImage {
  34. position: absolute;
  35. display: block;
  36. width: 100%;
  37. background: #333;
  38. top: 0;
  39. z-index: $zIndex-neg2--carousel-backgroundImg;
  40. overflow: hidden;
  41. .post-featuredImage {
  42. min-width: 100%;
  43. min-height: 19 * $leading;
  44. width: 2000px;
  45. height: auto;
  46. position: fixed;
  47. left: 50%;
  48. transform: translateX(-50%);
  49. opacity: 0;
  50. -webkit-transition-property: opacity, left, top, width;
  51. -webkit-transition-duration: 1s, .1s, .1s, .1s;
  52. -webkit-transition-timing-function: cubic-bezier(.33,0,.2,1);
  53. -webkit-transition-delay: 0;
  54. -moz-transition-property: opacity, left, top, width;
  55. -moz-transition-duration: 1s, .1s, .1s, .1s;
  56. -moz-transition-timing-function: cubic-bezier(.33,0,.2,1);
  57. -moz-transition-delay: 0;
  58. -ms-transition-property: opacity, left, top, width;
  59. -ms-transition-duration: 1s, .1s, .1s, .1s;
  60. -ms-transition-timing-function: cubic-bezier(.33,0,.2,1);
  61. -ms-transition-delay: 0;
  62. -o-transition-property: opacity, left, top, width;
  63. -o-transition-duration: 1s, .1s, .1s, .1s;
  64. -o-transition-timing-function: cubic-bezier(.33,0,.2,1);
  65. -o-transition-delay: 0;
  66. transition-property: opacity, left, top, width;
  67. transition-duration: 1s, .1s, .1s, .1s;
  68. transition-timing-function: cubic-bezier(.33,0,.2,1);
  69. -transition-delay: 0;
  70. &.is-loaded {
  71. opacity: 1;
  72. }
  73. }
  74. }
  75. .section-backgroundImage--previousPage img {
  76. position: relative;
  77. }
  78. .section-gradient {
  79. &:before,
  80. &:after {
  81. content: '';
  82. height: 100%;
  83. width: 100%;
  84. top: 0;
  85. left: 0;
  86. position: absolute;
  87. z-index: $zIndex-neg1--section-gradient;
  88. opacity: 0.6;
  89. }
  90. &:before {
  91. background: -webkit-gradient(linear,left top,left bottom,from(rgba($hero-gradient,.8)),color-stop(100%,rgba($hero-gradient,0)));
  92. background: -webkit-linear-gradient(top,rgba($hero-gradient,.8),rgba($hero-gradient,0) 100%);
  93. background: linear-gradient(to bottom,rgba($hero-gradient,.8),rgba($hero-gradient,0) 100%);
  94. }
  95. &:after {
  96. background: rgba($hero-gradient,.6);
  97. }
  98. }
  99. .section-gradient--darker {
  100. &:before,
  101. &:after {
  102. opacity: 1;
  103. }
  104. }
  105. .section-gradient--lighter {
  106. &:before,
  107. &:after {
  108. opacity: 0.4;
  109. }
  110. }
  111. .section-title {
  112. z-index: $zIndex-1--section-title;
  113. text-align: center;
  114. }
  115. .section-title h2,
  116. .section-title h4 {
  117. margin-top: 0;
  118. }
  119. .section-title h2 {
  120. @media (max-width: $screen-xs-max) {
  121. font-size: $font-L;
  122. line-height: 1.5;
  123. }
  124. }
  125. .postMeta-wrapper {
  126. margin-top: $leading;
  127. display: inline-block;
  128. }
  129. .postMeta-wrapper--frontpage {
  130. position: absolute;
  131. display: inherit;
  132. top: 165px;
  133. left: 50%;
  134. transform: translateX(-50%);
  135. z-index: $zIndex-5--tagline-frontpage;
  136. .postMeta-tagline {
  137. font-weight: 300;
  138. letter-spacing: 0.04rem;
  139. color: $gray-light;
  140. text-transform: none;
  141. line-height: 0.5rem;
  142. @media (max-width: $screen-xs-max) {
  143. width: 100%;
  144. }
  145. }
  146. @media (max-width: $screen-xs-max) {
  147. width: 300px;
  148. top: 160px;
  149. }
  150. }
  151. .postMeta {
  152. list-style: none;
  153. margin: 0;
  154. padding: 0;
  155. }
  156. .postMeta li {
  157. float: left;
  158. margin: 0;
  159. padding: 0 0 0 10px;
  160. font-family: $title-secondary-font;
  161. font-weight: 700;
  162. font-size: $font-XS;
  163. text-transform: uppercase;
  164. letter-spacing: 2px;
  165. &:after {
  166. content: '';
  167. display: inline-block;
  168. width: 4px;
  169. height: 4px;
  170. overflow: hidden;
  171. margin-left: 4px;
  172. border-radius: 100%;
  173. margin-bottom: 2px;
  174. background-color: rgba(255,255,255,.6);
  175. }
  176. &:last-child:after {
  177. display: none;
  178. }
  179. &:first-child {
  180. padding-left: 0;
  181. }
  182. @media (max-width: $screen-xs-max) {
  183. font-size: $font-XXS;
  184. }
  185. }