Skip to content

Commit

Permalink
Hero images
Browse files Browse the repository at this point in the history
  • Loading branch information
dphfox committed Aug 28, 2024
1 parent c4dd4b0 commit e4ea5c0
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 12 deletions.
1 change: 1 addition & 0 deletions docs/api-reference/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: API Reference
hero_img: ../heroes/api-reference.jpg
---

# API Reference
Expand Down
Binary file added docs/assets/heroes/api-reference.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docs/assets/overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@
</style>
{% endif %}
{% endblock %}

{% block hero %}
{% if page.meta and page.meta.hero_img %}
<div class="fusiondoc-hero" style="--hero-img: url({{ page.meta.hero_img }});"></div>
{% endif %}
{{ super() }}
{% endblock %}
2 changes: 1 addition & 1 deletion docs/assets/theme/admonition.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
border-width: 0.1rem !important;
box-shadow:
0 0.25em 1.5em -0.75em var(--admonition-color),
inset 0 1em 2em -2em var(--admonition-color)
inset 0 1em 2em -2.25em var(--admonition-color)
!important;
}

Expand Down
28 changes: 27 additions & 1 deletion docs/assets/theme/page.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
.md-header,
.md-tabs {
color: var(--md-default-fg-color);
background-color: var(--md-default-bg-color);
background-color: transparent;
}

.md-header[data-md-state=shadow] {
Expand Down Expand Up @@ -307,4 +307,30 @@

#fusiondoc-home {
opacity: 0;
}


.fusiondoc-hero {
display: block;
position: relative;
width: 100%;
margin-top: -5em;
margin-bottom: -5em;
height: 10em;
max-height: 30svh;
}

.fusiondoc-hero::before {
content: " ";
display: block;
position: absolute;
inset: 0;
bottom: -20em;
z-index: -1;
opacity: 0.2;
background: radial-gradient(farthest-corner at 50% 0%, transparent, var(--fusiondoc-bg-1)), var(--hero-img);
background-position: center;
background-size: cover;
box-shadow: inset 0 -15em 15em -1em var(--fusiondoc-bg-1);
filter: blur(0.5em);
}
2 changes: 1 addition & 1 deletion docs/examples/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Examples
hero_img: ../../examples/place-thumbnails/Fusion-Obby.jpg
---

# Examples
Expand Down
6 changes: 0 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@
- navigation
---







<div id="fusiondoc-home" markdown>
<section id="fusiondoc-home-main">
<section id="fusiondoc-home-main-inner">
Expand Down
4 changes: 4 additions & 0 deletions docs/tutorials/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
hero_img: ../home/Hero-Light.svg
---

Welcome to the Fusion tutorial section! Here, you'll learn how to build great
things with Fusion, even if you're a complete newcomer to the library.

Expand Down
6 changes: 3 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ extra_javascript:
nav:
- Home: index.md
- Tutorials:
- Get Started: tutorials/index.md
- Tutorials: tutorials/index.md
- Installing Fusion: tutorials/get-started/installing-fusion.md
- Developer Tools: tutorials/get-started/developer-tools.md
- Getting Help: tutorials/get-started/getting-help.md
Expand Down Expand Up @@ -88,7 +88,7 @@ nav:
- Optimisation: tutorials/best-practices/optimisation.md

- Examples:
- Home: examples/index.md
- Examples: examples/index.md
- Cookbook:
- examples/cookbook/index.md
- Player List: examples/cookbook/player-list.md
Expand All @@ -99,7 +99,7 @@ nav:
- Loading Spinner: examples/cookbook/loading-spinner.md
- Drag & Drop: examples/cookbook/drag-and-drop.md
- API Reference:
- api-reference/index.md
- API Reference: api-reference/index.md
- General:
- Errors: api-reference/general/errors.md
- Types:
Expand Down

0 comments on commit e4ea5c0

Please sign in to comment.