Skip to content

Commit f61ca83

Browse files
authored
added improved responsive behavior to header (#5)
1 parent d26b3ac commit f61ca83

File tree

4 files changed

+21
-10
lines changed

4 files changed

+21
-10
lines changed

src/components/Header/Header.svelte

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,29 @@
1010
<style>
1111
.header-wrap {
1212
display: flex;
13-
justify-content: space-evenly;
13+
justify-content: space-between;
1414
align-items: center;
15-
width: 80%;
15+
width: 70rem;
16+
margin: 2rem;
1617
}
1718
1819
.left {
19-
flex: 0 0 40%;
20+
margin: 1rem;
2021
}
2122
2223
.right {
23-
flex: 0 0 30%;
24+
margin: 1rem;
2425
}
2526
26-
@media only screen and (max-width: 760px) {
27+
@media only screen and (max-width: 970px) {
2728
.header-wrap {
2829
width: 95%;
2930
flex-direction: column;
30-
height: 60vh;
31+
height: fit-content;
32+
}
33+
34+
.right {
35+
margin-top: 3rem;
3136
}
3237
}
3338
</style>

src/components/HeaderInformation/HeaderInformation.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@
2020
.header-information {
2121
display: flex;
2222
flex-direction: column;
23+
width: fit-content;
2324
}
2425
2526
.title-main {
2627
font-size: 4rem;
2728
font-weight: bold;
2829
font-family: 'Nunito', sans-serif;
2930
margin: 0;
30-
width: fit-content;
31+
white-space: nowrap;
3132
}
3233
3334
.title-top {
@@ -42,6 +43,7 @@
4243
font-size: 1.3rem;
4344
font-family: 'Nunito', sans-serif;
4445
margin-top: 1.2rem;
46+
width: 30rem;
4547
}
4648
4749
.header-buttons {

src/components/Navbar/Navbar.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
.navbar{
55
position: fixed;
66
width: 100%;
7-
min-height: 4.5rem;
7+
min-height: 4rem;
88
box-shadow: 0 2px 4px 1px rgb(0 0 0 / 20%);
99
z-index: 10;
10-
background-color: white;
10+
background-color: #4285f4ff;
1111
}
1212
</style>

src/pages/Home/Home.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
</script>
44

55
<div class="home-page">
6-
<div></div>
6+
<div class="navbar-spacing"></div>
77
<div class="header-center"><Header/></div>
88
<Footer/>
99
</div>
@@ -20,4 +20,8 @@
2020
display: flex;
2121
justify-content: center;
2222
}
23+
24+
.navbar-spacing {
25+
min-height: 4rem;
26+
}
2327
</style>

0 commit comments

Comments
 (0)