Skip to content

Commit 4ed252e

Browse files
Resolve #75 by adding provider dropdown (#131)
* feat: github nav button, resolve #75 * fix: PR issues * fix: invert when in light mode (easy way to cheat img)
1 parent 7f69a1c commit 4ed252e

File tree

7 files changed

+104
-3
lines changed

7 files changed

+104
-3
lines changed

_data/topnav.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@ links:
88
page: develop.md
99
- title: discuss
1010
page: discuss.md
11+
- title: Docs
12+
url: https://docs.fabricmc.net/
1113
- title: wiki
1214
url: https://fabricmc.net/wiki/

_includes/header.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,13 @@
2020
<div class="trigger">
2121
{% for link in site.data.topnav.links %}
2222
{% if link.page %}
23-
<a class="page-link" href="{% link {{ link.page }} %}">{{ link.title | escape | capitalize }}</a>
23+
<a class="page-link" href="{% link {{ link.page }} %}">
24+
{{ link.title | escape | capitalize }}
25+
</a>
2426
{% else %}
25-
<a class="page-link" href="{{ link.url }}">{{ link.title | escape | capitalize }}</a>
27+
<a class="page-link" href="{{ link.url }}">
28+
{{ link.title | escape | capitalize }}
29+
</a>
2630
{% endif %}
2731
{% endfor %}
2832
</div>

_sass/fabric.scss

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212

1313
.site-nav {
1414
margin-top: 12px;
15+
16+
.page-link img {
17+
vertical-align: center;
18+
}
1519
}
1620

1721
.page-content {
@@ -207,4 +211,63 @@ p {
207211
object-fit: cover;
208212
}
209213
}
214+
}
215+
216+
.download-api-container {
217+
display: flex;
218+
position: relative;
219+
220+
@media (prefers-color-scheme: light) {
221+
img {
222+
filter: invert(1);
223+
}
224+
}
225+
226+
> a {
227+
flex: 1;
228+
border-radius: 5px 0 0 5px;
229+
}
230+
231+
.download-api {
232+
cursor: pointer;
233+
display: flex;
234+
flex-direction: column;
235+
236+
.button {
237+
border-left: none;
238+
border-radius: 0 5px 5px 0;
239+
}
240+
241+
&:focus-within .download-api-dropdown {
242+
opacity: 1;
243+
visibility: visible;
244+
transform: translateY(0);
245+
}
246+
247+
.download-api-dropdown {
248+
position: absolute;
249+
width: calc(100% - 2rem - 4px);
250+
background: $background-color;
251+
border: 2px solid $button-color;
252+
border-radius: 5px;
253+
top: calc(100% + 1rem); // Match gapping on the button row
254+
right: 0;
255+
display: flex;
256+
flex-direction: column;
257+
gap: .5rem;
258+
padding: 1rem;
259+
opacity: 0;
260+
visibility: hidden;
261+
transform: translateY(1rem);
262+
transition: visibility .25s ease-in-out,
263+
transform .25s ease-in-out,
264+
opacity .25s ease-in-out;
265+
266+
a {
267+
display: flex;
268+
gap: .75rem;
269+
align-items: center;
270+
}
271+
}
272+
}
210273
}

assets/icons/curseforge-logo.svg

Lines changed: 3 additions & 0 deletions
Loading

assets/icons/github-logo.svg

Lines changed: 4 additions & 0 deletions
Loading

assets/icons/modrinth-logo.svg

Lines changed: 1 addition & 0 deletions
Loading

index.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,31 @@ layout: default
1919
<section>
2020
<p class="component-body">The Fabric Loader download above is the bare minimum. Combine it with Fabric API to get all the important extra APIs mods use. It has to be put into the mods folder like any other mod.</p>
2121
</section>
22-
<a class="button secondary" href="https://www.curseforge.com/minecraft/mc-mods/fabric-api/files">Download Fabric API</a>
22+
<div class="download-api-container">
23+
<a class="button secondary" href="https://www.curseforge.com/minecraft/mc-mods/fabric-api/files">
24+
<img alt="CurseForge logo" src="/assets/icons/curseforge-logo.svg" width="20" />
25+
Download Fabric API
26+
</a>
27+
<div class="download-api" tabindex="-1">
28+
<div class="button secondary">
29+
<span>▼</span>
30+
</div>
31+
<div class="download-api-dropdown">
32+
<a href="https://www.curseforge.com/minecraft/mc-mods/fabric-api/files">
33+
<img alt="CurseForge logo" src="/assets/icons/curseforge-logo.svg" width="20" />
34+
CurseForge
35+
</a>
36+
<a href="https://modrinth.com/mod/fabric-api/versions">
37+
<img alt="Modrinth logo" src="/assets/icons/modrinth-logo.svg" width="20" />
38+
Modrinth
39+
</a>
40+
<a href="https://github.com/FabricMC/fabric/releases">
41+
<img alt="Github logo" src="/assets/icons/github-logo.svg" width="20" />
42+
GitHub
43+
</a>
44+
</div>
45+
</div>
46+
</div>
2347
</article>
2448
<article class="column">
2549
<h3>Develop</h3>

0 commit comments

Comments
 (0)