Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styling and dropdown menus for navbar departments #56

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 131 additions & 22 deletions components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,31 +56,140 @@ const Navbar = () => {
</div>
</nav>
<div id={styles.department_bar}>
<span>
<Link href="/department/news">News</Link>
</span>
<span>
<Link href="/department/features">Features</Link>
</span>
<span>
<Link href="/department/opinions">Opinions</Link>
</span>
<span>
<div className={styles.department}>
<span className={styles.maindepartment}>
<Link href="/department/news">News</Link>
</span>
<div className={styles.subdepartment}>
<span>
<Link href="/department/news/campaign-coverage">
Campaign Coverage
</Link>
</span>
<span>
<Link href="/department/news/israel-hamas-war">
Israel-Hamas War
</Link>
</span>
</div>
</div>
<div className={styles.department}>
<span className={styles.maindepartment}>
<Link href="/department/features">Features</Link>
</span>
<div className={styles.subdepartment}>
<span>
<Link href="/department/opinions/voices">
VOICES
</Link>
</span>
<span>
<Link href="/department/opinions/9-11">9/11</Link>
</span>
</div>
</div>
<div className={styles.department}>
<span className={styles.maindepartment}>
<Link href="/department/opinions">Opinions</Link>
</span>
<div className={styles.subdepartment}>
<span>
<Link href="/department/opinions/staff-editorials">
Staff Editorials
</Link>
</span>
</div>
</div>
<span className={styles.maindepartment}>
<Link href="/department/science">Science</Link>
</span>
<span>
<Link href="/department/ae">Arts & Entertainment</Link>
</span>
<span>
<Link href="/department/humor">Humor</Link>
</span>
<span>
<Link href="/department/sports">Sports</Link>
</span>
<span>
<div className={styles.department}>
<span className={styles.maindepartment}>
<Link href="/department/ae">Arts & Entertainment</Link>
</span>
<div className={styles.subdepartment}>
<span>
<Link href="/department/ae/fashion">Fashion</Link>
</span>
<span>
<Link href="/department/ae/art">Art</Link>
</span>
<span>
<Link href="/department/ae/culture">Culture</Link>
</span>
<span>
<Link href="/department/ae/film">Film</Link>
</span>
<span>
<Link href="/department/ae/food">Food</Link>
</span>
<span>
<Link href="/department/ae/literature">
Literature
</Link>
</span>
<span>
<Link href="/department/ae/music">Music</Link>
</span>
<span>
<Link href="/department/ae/television">
Television
</Link>
</span>
<span>
<Link href="/department/ae/theater">Theater</Link>
</span>
<span>
<Link href="/department/ae/thinkpiece">
Thinkpiece
</Link>
</span>
<span>
<Link href="/department/ae/sing!">Sing!</Link>
</span>
<span>
<Link href="/department/ae/stc">STC!</Link>
</span>
</div>
</div>
<div className={styles.department}>
<span className={styles.maindepartment}>
<Link href="/department/humor">Humor</Link>
</span>
<div className={styles.subdepartment}>
<span>
<Link href="/department/humor/disrespectator">
Disrespectator
</Link>
</span>
<span>
<Link href="/department/humor/spooktator">
Spooktator
</Link>
</span>
</div>
</div>
<div className={styles.department}>
<span className={styles.maindepartment}>
<Link href="/department/sports">Sports</Link>
</span>
<div className={styles.subdepartment}>
<span>
<Link href="/department/sports/professional-sports">
Professional Sports
</Link>
</span>
<span>
<Link href="/department/sports/sports-at-stuyvesant">
Sports At Stuy
</Link>
</span>
</div>
</div>
<span className={styles.maindepartment}>
<Link href="/department/spec-plus">Spec+</Link>
</span>
<span>
<span className={styles.maindepartment}>
<Link href="/about/recruitments">Recruitments</Link>
</span>
</div>
Expand All @@ -91,4 +200,4 @@ const Navbar = () => {
);
};

export default Navbar;
export default Navbar;
46 changes: 43 additions & 3 deletions styles/Navbar.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,55 @@
#subscribe_parent {
margin-left: auto;
}

#logo_container {
font-size: var(--large-text);
color: var(--primary-immutable);
justify-self: center;
width: 250px;
text-align: center;
position: absolute;
top: 32px; /* position the top edge of the element at the middle of the parent */
left: 50%; /* position the left edge of the element at the middle of the parent */
top: 32px;
/* position the top edge of the element at the middle of the parent */
left: 50%;
/* position the left edge of the element at the middle of the parent */

transform: translate(-50%, -50%);
cursor: pointer;
font-family: "Old English Text MT";
}

.subdepartment {
position: absolute;
display: none;
transition-delay: 1s;
}

.subdepartment span {
margin-top: 5px;
margin-bottom: 5px;
font-size: 1rem;
}

.department:hover .subdepartment {
position: absolute;
display: flex;
background-color: #3d3d3d;
box-shadow: 3px 3px 5px var(--secondary-nav);
padding: 5px 15px;
flex-direction: column;
justify-content: center;
transition-delay: 3s;
}

.maindepartment:hover {
opacity: 0.75;
}

.subdepartment span:hover {
opacity: 0.75;
}

#colorModeToggle {
grid-column-start: 4;
grid-column-end: 4;
Expand All @@ -65,9 +99,11 @@
#subscribe:hover,
#colorModeToggle:hover,
#searchButton:hover,
#logo_container:hover,
.clickable_nav_element:hover {
opacity: 0.75;
}

#hamburgerMenu:active,
#subscribe:active,
#colorModeToggle:active,
Expand All @@ -81,6 +117,7 @@
grid-template-columns: 48px calc(100% - 188px) 56px 56px;
column-gap: 1.5rem;
}

#logo_container {
font-size: 2rem;
position: static;
Expand All @@ -93,14 +130,17 @@
width: 220px;
text-align: center;
}

#subscribe_parent {
display: none;
}

#colorModeToggle {
grid-column-start: 3;
grid-column-end: 3;
place-self: center;
}

#searchButton {
grid-column-start: 4;
grid-column-end: 4;
Expand Down Expand Up @@ -138,4 +178,4 @@

.clickable_nav_element {
cursor: pointer;
}
}