_header.scss 3.63 KB
Newer Older
alain's avatar
alain committed
1

2
3
#site-header {
  position: fixed;
alain's avatar
alain committed
4
  display: flex;
5
6
7
  justify-content: space-between;
  align-items: flex-start;
  width: 100vw;
alain's avatar
alain committed
8
  color: #000;
9
  padding: 1rem;
alain's avatar
alain committed
10
11
12
  z-index: 1;
  -webkit-user-select: none;
  user-select: none;
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

  #site-header-bg {
    position: absolute;
    top: 0%;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #FFF;
    z-index: -1;
    transform: translateY(-111%);
    box-shadow: 0 0 0.5rem 0 rgba(0, 0, 0, 0.2);
    transition: all 100ms ease;
  }

  &.scrolled:not(.nav-active) #site-header-bg {
    transform: translateY(0%);
  }

  a {
    display: block;
    text-decoration: none;
    text-transform: lowercase;
    color: #000;
  }
alain's avatar
alain committed
37
38
}

alain's avatar
alain committed
39
40
41
42
43
44
#site-titles {
  #site-title {
    font-family: waax;
    font-weight: 400;
    font-size: 44px;
    margin: 0;
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
    line-height: 1em;
    white-space: nowrap;
    transition: all 100ms ease;

    a:hover {
      text-decoration: underline;
    }

    .scrolled & {
      font-size: 32px;
    }

    .nav-active & {
      opacity: 0;
    }
  }
  // #site-subtitle {
  //   font-size: 20px;
  //   max-width: 11em;
  //   font-weight: 400;
  //   margin: 0;
  // }
alain's avatar
alain committed
67
68
}

69
70
#nav {
  margin: 0;;
alain's avatar
alain committed
71
72
}

73
#nav-container {
alain's avatar
alain committed
74
75
  position: relative;

76
77
78
79
80
81
82
83
84
85
86
87
  input {
    position: absolute;
    top: -0.6rem;
    right: -0.5rem;
    width: 2rem;
    height: 2rem;
    margin: 0;
    cursor: pointer;
    opacity: 0; /* hide this */
    z-index: 2; /* and place it over the hamburger */
    -webkit-touch-callout: none;
  }
alain's avatar
alain committed
88

89
90
91
92
93
94
95
96
97
98
99
  .hamburger-bar {
    display: block;
    width: 14px;
    height: 2px;
    margin-bottom: 2px;
    position: relative;
    background: #000;
    border-radius: 2px;
    z-index: 1;
    transform-origin: 3px 0px;
    transition: all 100ms ease;
alain's avatar
alain committed
100

101
102
103
    &:first-child { transform-origin: 0% 0%; }
    &:nth-child(3) { transform-origin: 0% 100%; }
  }
alain's avatar
alain committed
104

105
106
107
108
  input:checked ~ .hamburger-bar {
    opacity: 1;
    transform: rotate(45deg) translate(3px,-1px);
  }
alain's avatar
alain committed
109

110
111
112
113
  input:checked ~ .hamburger-bar:nth-child(4) {
    opacity: 0;
    transform: rotate(0deg) scale(0.1, 0.1);
  }
alain's avatar
alain committed
114

115
116
117
118
  input:checked ~ .hamburger-bar:nth-child(3) {
    transform: rotate(-45deg) translate(-1px, 6px);
  }
}
alain's avatar
alain committed
119

120
121
122
123
#nav a {
  .nav-item-title {
    font-size: 1.25rem;
    line-height: 1.5rem;
alain's avatar
alain committed
124
125
126
    font-weight: 700;
  }

127
128
  &:hover .nav-item-title {
    text-decoration: underline;
alain's avatar
alain committed
129
  }
alain's avatar
alain committed
130

131
132
133
134
135
136
  .nav-item-subtitle {
    font-size: 1rem;
    line-height: 1rem;
    max-width: 280px;
    overflow: hidden;
    transition: max-width 200ms ease;
alain's avatar
alain committed
137

138
139
140
141
142
143
144
145
146
147
148
    .scrolled & {
      max-width: 1px;
      max-height: 1px;
      overflow: hidden;
    }
  }
}

// NARROW SCREEN
@media only screen and (max-width: 1200px) { 
  #nav-container {
alain's avatar
alain committed
149
150
    flex-direction: column;
    align-items: flex-end;
151
152
153
154
155
    margin: 1rem;

    input:checked ~ #nav {
      transform: translateX(-100%);
    }
alain's avatar
alain committed
156
157
  }

158
  #nav {
alain's avatar
alain committed
159
160
161
162
    position: absolute;
    width: 300px;
    right: -300px;
    top: 0;
163
164
    margin: -2.5rem;
    padding: 3.5rem 2.5rem 2.5rem;
alain's avatar
alain committed
165
166
167
168
169
170
171
    background: #eee;
    -webkit-font-smoothing: antialiased;
    /* to stop flickering of text in safari */
    transform-origin: 0% 0%;
    transform: translateX(0%);
    transition: transform 0.1s cubic-bezier(0.77,0.2,0.05,1.0);

172
173
174
    li {
      padding: 1rem 0;
    }
alain's avatar
alain committed
175
176
  }

177
}
alain's avatar
alain committed
178

179
180
181
// WIDE SCREEN
@media only screen and (min-width: 1201px) { 
  #nav-container {
alain's avatar
alain committed
182
183
    width: 100%;

184
185
186
    input {
      display: none;
    }
alain's avatar
alain committed
187

188
189
190
    .hamburger-bar {
      display: none;
    }
alain's avatar
alain committed
191
192
  }

193
  #nav {
alain's avatar
alain committed
194
195
196
197
198
    position: relative;
    width: 100%;
    display: flex;
    justify-content: flex-end;

199
200
201
202
203
204
205
206
    ul {
      display: flex;
      padding: 0;
    }

    li {
      padding: 1rem 1.5rem 0;
      transition: all 100ms ease;
alain's avatar
alain committed
207

208
209
210
211
      .scrolled & {
        padding-top: 0.3rem;
      }
    }
alain's avatar
alain committed
212
213
  }
}