Skip to content

Commit f4c4f3f

Browse files
committed
Set font for mobile menu
1 parent a482c56 commit f4c4f3f

File tree

7 files changed

+64
-18
lines changed

7 files changed

+64
-18
lines changed

.husky/pre-commit

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx astro check

package-lock.json

+15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77
"start": "astro dev",
88
"build": "astro check && astro build",
99
"preview": "astro preview",
10-
"astro": "astro"
10+
"astro": "astro",
11+
"prepare": "husky"
1112
},
1213
"dependencies": {
1314
"@astrojs/check": "^0.9.2",
1415
"@astrojs/mdx": "^3.1.3",
1516
"@astrojs/rss": "^4.0.8",
1617
"@astrojs/sitemap": "^3.1.6",
1718
"astro": "^4.14.2",
19+
"husky": "^9.1.6",
1820
"sass": "^1.77.8",
1921
"typescript": "^5.5.4"
2022
},

src/components/header/mobile/Menu.astro

+19-12
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
---
22
import { PAGES } from "../../../consts";
33
import { themes } from "../../../theme";
4+
import PageLink from "./PageLink.astro";
45
---
56

67
<div id="mobile-header" class="header">
78
<div id="mobile-nav-dropdown" class="dropdown">
89
<i id="burger-menu-icon" class="fa-solid fa-bars"></i>
910
<div class="dropdown-items">
1011
<nav class="dropdown-item">
11-
{
12-
PAGES.map(({ link, name, leetName }) => (
13-
<a href={link} title={name}>
14-
{leetName}
15-
</a>
16-
))
17-
}
12+
{PAGES.map((pageProps) => <PageLink {...pageProps} />)}
1813
</nav>
19-
<div class="dropdown-item">
14+
<div id="theme-row" class="dropdown-item">
2015
<label for="theme">Theme:</label>
2116
<select name="theme" id="theme-select">
2217
{
@@ -36,12 +31,14 @@ import { themes } from "../../../theme";
3631
const dropdown = document.getElementById("mobile-nav-dropdown")!;
3732
const burgerIcon = document.getElementById("burger-menu-icon")!;
3833
burgerIcon.addEventListener("click", () =>
39-
dropdown.classList.toggle("active")
34+
dropdown.classList.toggle("active"),
4035
);
4136

42-
document.getElementById("theme-select")!.addEventListener("change", (e: any) => {
43-
setTheme(e.currentTarget.value);
44-
});
37+
document
38+
.getElementById("theme-select")!
39+
.addEventListener("change", (e: any) => {
40+
setTheme(e.currentTarget.value);
41+
});
4542
</script>
4643

4744
<style lang="scss">
@@ -60,14 +57,24 @@ import { themes } from "../../../theme";
6057

6158
.dropdown-items {
6259
background-color: var(--bg-color);
60+
padding-top: 15px;
61+
background-clip: padding-box;
6362
}
6463

6564
.dropdown-item {
6665
background-color: var(--bg-hoverable);
66+
padding-left: 15px;
67+
padding-right: 15px
6768
}
6869

6970
nav {
7071
display: flex;
7172
flex-direction: column;
73+
padding-top: 15px;
74+
padding-bottom: 10px;
75+
}
76+
77+
#theme-row {
78+
padding-bottom: 15px;
7279
}
7380
</style>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
interface Props {
3+
link: string;
4+
name: string;
5+
leetName: string;
6+
}
7+
8+
const { link, name, leetName } = Astro.props;
9+
---
10+
11+
<a href={link} title={name}>
12+
{leetName}
13+
</a>
14+
15+
<style>
16+
:global(a) {
17+
font-family: "PixeloidMono";
18+
text-decoration: none;
19+
}
20+
</style>

src/layouts/BaseLayout.astro

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ import MobileHeader from "../components/header/mobile/Menu.astro";
77
88
interface Props {
99
title: string;
10-
isBlogPost: boolean;
10+
isBlogPost?: boolean;
1111
frontmatter?: { title: string };
12-
description: string;
12+
description?: string;
1313
}
1414
15-
const { frontmatter, isBlogPost } = Astro.props;
16-
let { title } = Astro.props;
15+
const { frontmatter} = Astro.props;
16+
let { title, isBlogPost } = Astro.props;
17+
isBlogPost = isBlogPost ?? false;
1718
// If a title wasn't explicitly passed in, get it from the frontmatter
1819
if (!title && frontmatter && "title" in frontmatter) {
1920
title = frontmatter.title;

src/pages/index.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ We are grateful to the Gemstone program for giving us the opportunity to work on
3131

3232
<div style="display: flex; width: 100%; align-items: center; justify-content: space-around;">
3333
<Sponsor name="Gemstone Program" url="https://gemstone.umd.edu/">
34-
<img loading="lazy" src="/img/gemstone.png" alt="Gemstone logo" />
34+
<img loading="lazy" src="/img/gemstone.png" alt="Gemstone logo" style="background-color: white;" />
3535
</Sponsor>
3636
<Sponsor name="Honors College" url="https://honors.umd.edu/">
3737
<img loading="lazy" src="/img/umdhonors.png" alt="Honors College logo" />

0 commit comments

Comments
 (0)