-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make website not suck on mobile (and various fixes)
- Loading branch information
Showing
4 changed files
with
71 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,57 +34,66 @@ | |
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js"></script> | ||
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js" | ||
onload="renderMathInElement(document.body);"></script> | ||
|
||
<script> | ||
function thing() { | ||
document.getElementById("navbar").classList.toggle("open"); | ||
} | ||
</script> | ||
</head> | ||
|
||
<body class="max-w-4xl p-8 mx-auto flex flex-col gap-8"> | ||
{% block header %} | ||
<nav class="flex flex-col items-center gap-4"> | ||
<a href="/"><img src="/assets/logo.png" alt="BMT Logo" width="80"></a> | ||
<p class="text-2xl font-bold">Berkeley Math Tournament</p> | ||
|
||
<div class="flex gap-4"> | ||
{{ macros::nav_link(path="@/_index.md", label="Home") }} | ||
{{ macros::nav_link(path="@/news/_index.md", label="News") }} | ||
{{ macros::nav_link(path="@/about.md", label="About") }} | ||
{{ macros::nav_link(path="@/sponsors/index.md", label="Sponsors") }} | ||
{{ macros::nav_link(path="@/events/bmt-2023.md", label="BMT 2023") }} | ||
</div> | ||
</nav> | ||
{% endblock %} | ||
<body> | ||
<div class="max-w-4xl p-4 md:p-8 mx-auto flex flex-col gap-4 md:gap-8"> | ||
{% block header %} | ||
<header class="flex flex-col gap-4 text-center"> | ||
<a class="mx-auto" href="/"><img src="/assets/logo.png" alt="BMT Logo" width="80"></a> | ||
<p class="text-2xl font-bold">Berkeley Math Tournament</p> | ||
|
||
<nav id="navbar" | ||
class="[&.open>a.nav-hidden]:block [&>a.nav-hidden]:hidden flex flex-col md:flex-row md:mx-auto gap-4 items-stretch"> | ||
{{ macros::nav_link(path="@/_index.md", label="Home") }} | ||
{{ macros::nav_link(path="@/news/_index.md", label="News") }} | ||
{{ macros::nav_link(path="@/about.md", label="About") }} | ||
{{ macros::nav_link(path="@/sponsors/index.md", label="Sponsors") }} | ||
{{ macros::nav_link(path="@/events/bmt-2023.md", label="BMT 2023") }} | ||
</nav> | ||
</header> | ||
{% endblock %} | ||
|
||
<hr> | ||
<hr> | ||
|
||
<div class="flex flex-col gap-8"> | ||
{% block content %}{% endblock %} | ||
</div> | ||
<div class="flex flex-col gap-4 md:gap-8"> | ||
{% block content %}{% endblock %} | ||
</div> | ||
|
||
<hr> | ||
<hr> | ||
|
||
{% block footer %} | ||
<div class="flex flex-col items-center justify-between md:items-start text-center md:flex-row gap-4 mb-12"> | ||
<div class="flex flex-col gap-6 items-center md:items-start"> | ||
<img class="-ml-1 grayscale brightness-0" src="/assets/logo.png" alt="BMT Logo" width="50"> | ||
{% block footer %} | ||
<div class="flex flex-col items-center justify-between md:items-start text-center md:flex-row gap-4 mb-12"> | ||
<div class="flex flex-col gap-6 items-center md:items-start"> | ||
<img class="-ml-1 grayscale brightness-0" src="/assets/logo.png" alt="BMT Logo" width="50"> | ||
|
||
<div class="flex gap-4 text-xl"> | ||
<a href="https://www.instagram.com/berkeley_mt/"><i class="bi bi-instagram"></i></a> | ||
<a href="https://www.tiktok.com/@berkeley_mt"><i class="bi bi-tiktok"></i></a> | ||
<a href="mailto:[email protected]"><i class="bi bi-envelope-fill"></i></a> | ||
<div class="flex gap-4 text-xl"> | ||
<a href="https://www.instagram.com/berkeley_mt/"><i class="bi bi-instagram"></i></a> | ||
<a href="https://www.tiktok.com/@berkeley_mt"><i class="bi bi-tiktok"></i></a> | ||
<a href="mailto:[email protected]"><i class="bi bi-envelope-fill"></i></a> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="flex flex-col gap-4 items-center md:items-end md:text-right max-w-xs"> | ||
<a href="https://ocf.berkeley.edu"> | ||
<img src="http://ocf.berkeley.edu/hosting-logos/ocf-hosted-penguin-dark.svg" width="80" | ||
alt="Hosted by the OCF" /> | ||
</a> | ||
<div class="flex flex-col gap-4 items-center md:items-end md:text-right max-w-xs"> | ||
<a href="https://ocf.berkeley.edu"> | ||
<img src="https://ocf.berkeley.edu/hosting-logos/ocf-hosted-penguin-dark.svg" width="80" | ||
alt="Hosted by the OCF" /> | ||
</a> | ||
|
||
<p class="text-xs"> | ||
We are a student group acting independently of the University of California. We take full responsibility for | ||
our organization and this web site. | ||
</p> | ||
<p class="text-xs"> | ||
We are a student group acting independently of the University of California. We take full responsibility for | ||
our organization and this web site. | ||
</p> | ||
</div> | ||
</div> | ||
{% endblock %} | ||
</div> | ||
{% endblock %} | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,22 @@ | ||
{% macro nav_link(path, label) %} | ||
{% set href = get_url(path=path) %} | ||
<p class="first:hidden text-gray-400">⁄</p> | ||
<a href="{{ href }}" class="{% if current_url == href %} font-semibold {% endif %}"> | ||
|
||
{# Desktop version #} | ||
<p class="hidden md:block first:hidden text-gray-400">⁄</p> | ||
<a href="{{ href }}" class="hidden md:block {% if current_url == href %} font-semibold {% endif %}"> | ||
{{ label }} | ||
</a> | ||
|
||
{# Mobile version #} | ||
{% if current_url == href %} | ||
<button class="md:hidden order-1 font-semibold border py-2 px-3 rounded-xl relative" onclick="thing()"> | ||
{{ label }} | ||
<i class="bi bi-chevron-down [.open_&]:-scale-y-100 transition-transform absolute right-4"></i> | ||
</button> | ||
{% else %} | ||
<a href="{{ href }}" class="py-2 px-3 bg-gray-100 border rounded-xl nav-hidden order-2"> | ||
{{ label }} | ||
</a> | ||
{% endif %} | ||
|
||
{% endmacro nav_link %} |