Skip to content

Commit 15876fc

Browse files
authored
Merge pull request #300 from tjklint/refactor(1page)
docs: commented header.scss for better code readabliity.
2 parents f1d6939 + 85c1ff8 commit 15876fc

File tree

1 file changed

+59
-55
lines changed

1 file changed

+59
-55
lines changed

src/components/header/header.scss

Lines changed: 59 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,121 @@
11
.header-container {
2-
background-color: #1e1e1e;
3-
padding: 20px 40px;
2+
background-color: #1e1e1e; /* Dark background for the header */
3+
padding: 20px 40px; /* Spacing around the header content */
44
display: flex;
5-
align-items: center;
6-
justify-content: space-between;
7-
color: #fff;
5+
align-items: center; /* Vertically align items in the header */
6+
justify-content: space-between; /* Space items evenly (logo on the left, nav on the right) */
7+
color: #fff; /* White text color */
88
font-family: 'RobotoMono', sans-serif;
9-
position: relative;
10-
z-index: 1000;
9+
position: relative; /* Set relative position for z-index control */
10+
z-index: 1000; /* Ensure the header stays on top of other elements */
1111
}
1212

1313
.logo {
14-
font-size: 24px;
15-
font-weight: bold;
16-
letter-spacing: 2px;
17-
color: #e1e1e1;
18-
text-decoration: none;
14+
font-size: 24px; /* Size of the logo text */
15+
font-weight: bold; /* Bold text for emphasis */
16+
letter-spacing: 2px; /* Add space between the letters */
17+
color: #e1e1e1; /* Light gray color for the logo */
18+
text-decoration: none; /* Remove underline from logo text */
1919

2020
&:hover {
21-
color: #9b59b6;
21+
color: #9b59b6; /* Change logo color to purple on hover */
2222
}
2323
}
2424

2525
.nav {
2626
display: flex;
27-
align-items: center;
27+
align-items: center; /* Vertically align navigation links */
2828

29+
/* Mobile: Show the nav as a full-screen menu when open */
2930
@media (max-width: 768px) {
30-
position: fixed;
31+
position: fixed; /* Fix the nav in place on small screens */
3132
top: 0;
32-
right: -100%;
33-
width: 100%;
34-
height: 100%;
35-
background-color: #1e1e1e;
36-
flex-direction: column;
37-
justify-content: center;
38-
transition: right 0.3s ease-in-out;
39-
z-index: 999;
33+
right: -100%; /* Initially hide the nav by moving it offscreen */
34+
width: 100%; /* Full width for the mobile menu */
35+
height: 100%; /* Full height for the mobile menu */
36+
background-color: #1e1e1e; /* Same dark background */
37+
flex-direction: column; /* Stack the nav items vertically */
38+
justify-content: center; /* Center nav items vertically */
39+
transition: right 0.3s ease-in-out; /* Smooth slide-in effect */
40+
z-index: 999; /* Layer it above other content */
4041
}
4142

4243
&.open {
43-
right: 0;
44+
right: 0; /* Slide the nav into view when it's open */
4445
}
4546
}
4647

4748
.nav-link {
4849
display: flex;
49-
align-items: center;
50-
margin-left: 40px;
51-
color: #d3d3d3;
52-
text-decoration: none;
53-
font-size: 18px;
54-
transition: color 0.3s;
50+
align-items: center; /* Vertically align link content */
51+
margin-left: 40px; /* Add space between the links */
52+
color: #d3d3d3; /* Light gray for the link text */
53+
text-decoration: none; /* Remove underline from links */
54+
font-size: 18px; /* Set the link text size */
55+
transition: color 0.3s; /* Smooth color transition on hover */
5556
font-family: 'RobotoMono', sans-serif;
5657

5758
&:hover {
58-
color: #9b59b6;
59+
color: #9b59b6; /* Change link color to purple on hover */
5960
}
6061

6162
svg {
62-
margin-right: 8px;
63+
margin-right: 8px; /* Add space between the icon and the text */
6364
}
6465

66+
/* Mobile: Adjust link spacing and size */
6567
@media (max-width: 768px) {
6668
margin-left: 0;
67-
margin-bottom: 20px;
68-
font-size: 24px;
69+
margin-bottom: 20px; /* Add space between links */
70+
font-size: 24px; /* Larger font size on mobile */
6971
}
7072
}
7173

7274
.hamburger {
73-
display: none;
74-
cursor: pointer;
75+
display: none; /* Hide the hamburger menu by default */
76+
cursor: pointer; /* Pointer cursor to indicate it's clickable */
7577

78+
/* Mobile: Show the hamburger menu icon */
7679
@media (max-width: 768px) {
7780
display: block;
7881
position: absolute;
79-
top: 20px;
80-
right: 20px;
81-
z-index: 1001;
82+
top: 20px; /* Position the hamburger at the top */
83+
right: 20px; /* Align the hamburger to the right */
84+
z-index: 1001; /* Layer the hamburger above the nav */
8285
}
8386
}
8487

8588
.button {
8689
display: flex;
87-
align-items: center;
88-
margin-left: 40px;
89-
padding: 8px 16px;
90-
border: 2px solid #9b59b6;
91-
color: #9b59b6;
92-
text-decoration: none;
93-
font-size: 18px;
94-
transition: all 0.3s;
90+
align-items: center; /* Vertically align button content */
91+
margin-left: 40px; /* Space between the button and nav links */
92+
padding: 8px 16px; /* Padding inside the button */
93+
border: 2px solid #9b59b6; /* Purple border around the button */
94+
color: #9b59b6; /* Purple text */
95+
text-decoration: none; /* Remove underline from the button text */
96+
font-size: 18px; /* Set the button text size */
97+
transition: all 0.3s; /* Smooth transition for background and text color */
9598
font-family: 'RobotoMono', sans-serif;
96-
border-radius: 5px;
99+
border-radius: 5px; /* Rounded button corners */
97100

98101
&:hover {
99-
background-color: #9b59b6;
100-
color: #fff;
102+
background-color: #9b59b6; /* Purple background on hover */
103+
color: #fff; /* White text on hover */
101104
}
102105

103106
svg {
104-
margin-right: 8px;
107+
margin-right: 8px; /* Space between the icon and text */
105108
}
106109

110+
/* Mobile: Adjust button spacing and size */
107111
@media (max-width: 768px) {
108112
margin-left: 0;
109-
margin-bottom: 20px;
110-
font-size: 24px;
113+
margin-bottom: 20px; /* Add space between the button and other elements */
114+
font-size: 24px; /* Increase button font size on mobile */
111115
}
112116
}
113117

114118
.close-icon {
115-
display: block;
116-
z-index: 1002;
119+
display: block; /* Show the close icon by default */
120+
z-index: 1002; /* Ensure the close icon is above the nav */
117121
}

0 commit comments

Comments
 (0)