header.styl 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. #header
  2. height: banner-height
  3. position: relative
  4. border-bottom: 1px solid color-border
  5. &:before, &:after
  6. content: ""
  7. position: absolute
  8. left: 0
  9. right: 0
  10. height: 40px
  11. &:before
  12. top: 0
  13. background: linear-gradient(rgba(0, 0, 0, 0.2), transparent)
  14. &:after
  15. bottom: 0
  16. background: linear-gradient(transparent, rgba(0, 0, 0, 0.2))
  17. #header-outer
  18. height: 100%
  19. position: relative
  20. #header-inner
  21. position: relative
  22. overflow: hidden
  23. #banner
  24. position: absolute
  25. top: 0
  26. left: 0
  27. width: 100%
  28. height: 100%
  29. background: url(banner-url) center #000
  30. background-size: cover
  31. z-index: -1
  32. #header-title
  33. text-align: center
  34. height: logo-size
  35. position: absolute
  36. top: 50%
  37. left: 0
  38. margin-top: logo-size * -0.5
  39. $logo-text
  40. text-decoration: none
  41. color: #fff
  42. font-weight: 300
  43. text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3)
  44. #logo
  45. @extend $logo-text
  46. font-size: logo-size
  47. line-height: logo-size
  48. letter-spacing: 2px
  49. #subtitle
  50. @extend $logo-text
  51. font-size: subtitle-size
  52. line-height: subtitle-size
  53. letter-spacing: 1px
  54. #subtitle-wrap
  55. margin-top: subtitle-size
  56. #main-nav
  57. float: left
  58. margin-left: -15px
  59. $nav-link
  60. float: left
  61. color: #fff
  62. opacity: 0.6
  63. text-decoration: none
  64. text-shadow: 0 1px rgba(0, 0, 0, 0.2)
  65. transition: opacity 0.2s
  66. display: block
  67. padding: 20px 15px
  68. &:hover
  69. opacity: 1
  70. .nav-icon
  71. @extend $nav-link
  72. font-family: font-icon
  73. text-align: center
  74. font-size: font-size
  75. width: font-size
  76. height: font-size
  77. padding: 20px 15px
  78. position: relative
  79. cursor: pointer
  80. .main-nav-link
  81. @extend $nav-link
  82. font-weight: 300
  83. letter-spacing: 1px
  84. @media mq-mobile
  85. display: none
  86. #main-nav-toggle
  87. display: none
  88. &:before
  89. content: "\f0c9"
  90. @media mq-mobile
  91. display: block
  92. #sub-nav
  93. float: right
  94. margin-right: -15px
  95. #nav-rss-link
  96. &:before
  97. content: "\f09e"
  98. #nav-search-btn
  99. &:before
  100. content: "\f002"
  101. #search-form-wrap
  102. position: absolute
  103. top: 15px
  104. width: 150px
  105. height: 30px
  106. right: -150px
  107. opacity: 0
  108. transition: 0.2s ease-out
  109. &.on
  110. opacity: 1
  111. right: 0
  112. @media mq-mobile
  113. width: 100%
  114. right: -100%
  115. .search-form
  116. position: absolute
  117. top: 0
  118. left: 0
  119. right: 0
  120. background: #fff
  121. padding: 5px 15px
  122. border-radius: 15px
  123. box-shadow: 0 0 10px rgba(0, 0, 0, 0.3)
  124. .search-form-input
  125. border: none
  126. background: none
  127. color: color-default
  128. width: 100%
  129. font: 13px font-sans
  130. outline: none
  131. &::-webkit-search-results-decoration
  132. &::-webkit-search-cancel-button
  133. -webkit-appearance: none
  134. .search-form-submit
  135. position: absolute
  136. top: 50%
  137. right: 10px
  138. margin-top: -7px
  139. font: 13px font-icon
  140. border: none
  141. background: none
  142. color: #bbb
  143. cursor: pointer
  144. &:hover, &:focus
  145. color: #777