Skip to content

Commit 070c22f

Browse files
committed
Nav-bar fixed, sections take up screen height & are vertically centered
1 parent 29f886f commit 070c22f

3 files changed

Lines changed: 49 additions & 45 deletions

File tree

src/index.scss

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $mobile-width: 720px;
2222
@media(max-width: #{$mobile-width}) { @content; }
2323
}
2424

25-
//override sass min() & max(), use css
25+
//override sass min() & max() fn's, use css's
2626
@function min($numbers...) {
2727
@return m#{i}n(#{$numbers});
2828
}
@@ -58,11 +58,6 @@ html, body, #root, #app, .full-height {
5858
flex-shrink: 0;
5959
}
6060

61-
.full-height { /* not really a good way to do it, will probably change to flex column layout */
62-
height: calc(100% - 445px);
63-
display: flex;
64-
flex-direction: column;
65-
}
6661
.desktop-banner {
6762
width: 100%;
6863

@@ -74,9 +69,10 @@ html, body, #root, #app, .full-height {
7469

7570
background-color: $blue;
7671
color: white;
77-
}
78-
.desktop-banner span {
79-
font-weight: 400;
72+
73+
span {
74+
font-weight: 400;
75+
}
8076
}
8177

8278
#mlh-badge {
@@ -99,14 +95,13 @@ html, body, #root, #app, .full-height {
9995
}
10096

10197
.navigation {
102-
display: inline-block;
103-
10498
width: 100%;
10599

106100
font-size: 15px;
107101
font-weight: 500;
108102

109103
color: $blue;
104+
background-color: white;
110105

111106
ul {
112107
list-style-type: none;
@@ -136,6 +131,8 @@ html, body, #root, #app, .full-height {
136131
}
137132

138133
@include tablet {
134+
display: inline-block;
135+
139136
font-size: 12px;
140137
font-weight: 400;
141138

@@ -168,15 +165,23 @@ html, body, #root, #app, .full-height {
168165
margin-bottom: max(1px, calc(10vh - 40px), calc(30vh - 190px));
169166
}
170167
}
168+
171169
.section {
170+
height: 100%;
171+
display: flex;
172+
flex-direction: column;
173+
}
174+
175+
.content {
172176
width: 100%;
173-
max-width: 1100px;
177+
178+
max-width: $desktop-width;
174179
text-align: center;
175180
margin: auto;
176-
177181

178182
@include tablet {
179183
flex-direction: column;
184+
margin: 0px;
180185
}
181186
}
182187

@@ -203,8 +208,8 @@ note: development on a mac may not have all font-weights,
203208
lines of text may be wider than they appear
204209
*/
205210
#hackathon-name {
206-
height: 65px;
207-
font-size: 60px;
211+
height: 75px;
212+
font-size: 70px;
208213
font-weight: 700;
209214
color: $blue;
210215

@@ -214,8 +219,8 @@ lines of text may be wider than they appear
214219
}
215220
}
216221
#hackathon-description {
217-
height: 37px;
218-
font-size: 28.0px;
222+
height: 43px;
223+
font-size: 34px;
219224
font-weight: 700;
220225
color: $blue;
221226

@@ -225,8 +230,8 @@ lines of text may be wider than they appear
225230
}
226231
}
227232
#hackathon-info {
228-
height: 20px;
229-
font-size: 14px;
233+
height: 25px;
234+
font-size: 17px;
230235
font-weight: 500;
231236
color: $blue;
232237

@@ -237,16 +242,16 @@ lines of text may be wider than they appear
237242
}
238243

239244
.mailchimp-container {
240-
height: 40px;
241-
width: 375px;
245+
height: 50px;
246+
width: 450px;
242247
margin: auto;
243248

244249
margin-top: 10px;
245250

246251
border-style: solid;
247252
border-width: 1px;
248253
border-color: $blue;
249-
border-radius: 20px;
254+
border-radius: 25px;
250255

251256
@include mobile {
252257
width: 80vw;
@@ -267,7 +272,7 @@ lines of text may be wider than they appear
267272

268273
outline: none;
269274
font-family: inherit;
270-
font-size: 14px;
275+
font-size: 17px;
271276
font-weight: 500;
272277

273278
&::placeholder { /* this refers to the input placeholder text (enter your email...)*/
@@ -284,28 +289,28 @@ lines of text may be wider than they appear
284289
}
285290
}
286291
.mailchimp-button {
287-
height: 30px;
288-
width: 30px;
292+
height: 40px;
293+
width: 40px;
289294

290295
margin-right: 5px;
291296

292297
border-style: solid;
293298
border-width: 1px;
294299
border-color: $blue;
295-
border-radius: 15px;
300+
border-radius: 20px;
296301

297302
background-color: white;
298303
background-image: url(./input-arrow.svg);
299304
background-repeat: no-repeat;
300-
background-position: 3.75px;
301-
background-size: 18px;
305+
background-position: 4.5px;
306+
background-size: 25px;
302307

303308
outline: none;
304309
transition: 0.1s;
305310

306311
@include desktop {
307312
&:hover {
308-
background-position: 5.25px;
313+
background-position: 6.5px;
309314
}
310315
}
311316

src/nav-bar.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,29 @@ import React from 'react';
22

33
class NavBar extends React.Component {
44
componentDidMount(){
5-
/*
6-
var fixedContainer = document.getElementById("fixed-container");
5+
var fixedContainer = document.getElementById("navigation-container");
76
var children = Array.from(fixedContainer.children);
87

98
children.forEach(child => {
109
var clone = child.cloneNode(true);
1110
clone.removeAttribute("id");
1211
clone.style.visibility = "hidden";
13-
12+
clone.classList.add("desktop-hide");
13+
1414
child.style.position = "fixed";
1515

1616
fixedContainer.append(child);
1717
fixedContainer.append(clone);
1818
});
19-
*/
2019
}
2120
render(){
2221
return(
23-
<div id="fixed-container">
24-
<div className="desktop-banner mobile-hide" id="desktop-banner">
25-
<span>{this.props.title}</span>{this.props.content}
26-
</div>
27-
22+
<div id="navigation-container">
2823
<div className="navigation" id="navigation">
24+
<div className="desktop-banner mobile-hide" id="desktop-banner">
25+
<span>{this.props.title}</span>{this.props.content}
26+
</div>
27+
2928
<a href="https://mlh.io/seasons/na-2021/events?utm_source=na-hackathon&amp;utm_medium=TrustBadge&amp;utm_campaign=2020-season&amp;utm_content=gray">
3029
<img id="mlh-badge" alt="Major League Hacking 2021 Hackathon Season" src="https://s3.amazonaws.com/logged-assets/trust-badge/2021/mlh-trust-badge-2021-gray.svg"></img>
3130
</a>

src/preregister.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ class PreRegister extends React.Component {
1414
render() {
1515
return (
1616
<div id="app">
17-
<div className="full-height">
18-
<NavBar
19-
title={desktopNotice}
20-
content={noticeContent}
21-
/>
22-
<div className="section flex-container">
17+
<NavBar
18+
title={desktopNotice}
19+
content={noticeContent}
20+
/>
21+
22+
<div className="section">
23+
<div className="content flex-container">
2324
<div className="left-half">
2425
<div id="hackathon-name">
2526
BRICKHACK 7
@@ -43,7 +44,6 @@ class PreRegister extends React.Component {
4344
</div>
4445
</div>
4546
</div>
46-
4747
</div>
4848
);
4949
}

0 commit comments

Comments
 (0)