Skip to content
Permalink
1e0d3fb33a
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
Latest commit 1e0d3fb Sep 25, 2024 History
1 contributor

Users who have contributed to this file

120 lines (99 sloc) 3.75 KB
/* ==================== RESET ==================== */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
/* ==================== BODY ==================== */
body {
font-family: 'Work Sans', sans-serif; /* Use Work Sans from Google Fonts */
font-size: 16px; /* Set base font size to 16px */
display: flex;
}
/* ==================== SIDEBAR ==================== */
.sidebar {
width: 33.33%; /* Sidebar takes 1/3 of the screen */
background-color: #333;
color: white;
height: 100vh; /* Full height */
position: fixed; /* Keep it fixed on the left */
display: flex;
flex-direction: column;
justify-content: center; /* Centers content vertically */
padding: 5%; /* Padding as a percentage */
text-align: center; /* Centers the text horizontally */
}
.sidebar h2 {
text-align: center;
margin-bottom: 10%; /* Margin in percentage */
font-size: 2.5em; /* Relative font size */
}
.sidebar ul {
list-style: none;
padding: 0;
}
.sidebar ul li {
margin: 5% 0; /* Margin between list items */
}
.sidebar ul li a {
color: #fff;
text-decoration: none;
font-size: 1.5em; /* Adjusted relative font size for links */
padding: 2%; /* Padding in percentage */
display: inline-block; /* Ensures proper alignment */
transition: background 0.3s ease;
}
.sidebar ul li a:hover {
background-color: #575757; /* Change background on hover */
}
/* ==================== CONTENT SWITCHING ==================== */
/* Initially hide all sections */
.section-content {
display: none;
}
/* Display the section when targeted by the URL hash */
#home:target, #projects:target, #contact:target {
display: block;
}
/* Default content: Show home section if no target is set */
body:not(:has(:target)) #home {
display: block;
}
/* ==================== CONTENT ==================== */
.content {
margin-left: 33.33%; /* Same width as the sidebar */
width: 66.67%; /* Remaining space for content */
padding: 5%; /* Padding in percentage */
}
.content h1 {
margin-bottom: 5%; /* Margin as a percentage */
text-align: center; /* Centers the text */
font-size: 3em; /* Adjusted relative font size for h1 */
}
.content p {
font-size: 1.125em; /* Adjusted paragraph font size for readability */
line-height: 1.6; /* Line height for readability */
}
/* ==================== PROJECT GRID ==================== */
.project-grid {
display: grid;
grid-template-columns: repeat(3, 1fr); /* 3 equal-width columns */
grid-template-rows: repeat(2, 1fr); /* 2 equal-height rows */
gap: 20px; /* Spacing between boxes */
margin-top: 30px;
}
.project-box {
background-color: #f4f4f4; /* Light gray background for the box */
display: flex;
align-items: center;
justify-content: center;
width: 100%; /* Full width of the grid cell */
height: 200px; /* Fixed height for each box */
border: 2px solid #ddd; /* Light border around each box */
overflow: hidden; /* Hide overflowing parts of images */
}
.project-box img {
width: 100%;
height: 100%;
object-fit: cover; /* Ensure the image covers the entire box */
}