_header.scss 3.8 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
    line-height: 1em;
    white-space: nowrap;
    transition: all 100ms ease;

alain's avatar
alain committed
49
50
51
52
    @media (max-width: 480px) {
      font-size: 36px;
    }

53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
    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
71
72
}

73
74
#nav {
  margin: 0;;
alain's avatar
alain committed
75
76
}

77
#nav-container {
alain's avatar
alain committed
78
79
  position: relative;

80
81
82
83
84
85
86
87
88
89
90
91
  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
92

93
94
95
96
97
98
99
100
101
102
103
  .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
104

105
106
107
    &:first-child { transform-origin: 0% 0%; }
    &:nth-child(3) { transform-origin: 0% 100%; }
  }
alain's avatar
alain committed
108

109
110
111
112
  input:checked ~ .hamburger-bar {
    opacity: 1;
    transform: rotate(45deg) translate(3px,-1px);
  }
alain's avatar
alain committed
113

114
115
116
117
  input:checked ~ .hamburger-bar:nth-child(4) {
    opacity: 0;
    transform: rotate(0deg) scale(0.1, 0.1);
  }
alain's avatar
alain committed
118

119
120
121
122
  input:checked ~ .hamburger-bar:nth-child(3) {
    transform: rotate(-45deg) translate(-1px, 6px);
  }
}
alain's avatar
alain committed
123

124
125
126
127
#nav a {
  .nav-item-title {
    font-size: 1.25rem;
    line-height: 1.5rem;
alain's avatar
alain committed
128
129
130
    font-weight: 700;
  }

131
132
  &:hover .nav-item-title {
    text-decoration: underline;
alain's avatar
alain committed
133
  }
alain's avatar
alain committed
134

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

alain's avatar
alain committed
142

143
144
145
146
  }
}

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

    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
    background: #fff;
    box-shadow: 0 0 0.5rem 0 rgba(0, 0, 0, 0.2);
alain's avatar
alain committed
167
168
169
170
171
172
    -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);

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

178
}
alain's avatar
alain committed
179

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

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

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

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

alain's avatar
alain committed
200
201
202
203
204
205
206
207
    a .nav-item-subtitle {
      .scrolled & {
        max-width: 1px;
        max-height: 1px;
        overflow: hidden;
      }
    }

208
209
210
211
212
213
214
215
    ul {
      display: flex;
      padding: 0;
    }

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

217
218
219
220
      .scrolled & {
        padding-top: 0.3rem;
      }
    }
alain's avatar
alain committed
221
222
  }
}