Skip to content

Commit

Permalink
Merge branch 'main' into news-on-this-page
Browse files Browse the repository at this point in the history
  • Loading branch information
doup committed Dec 10, 2024
2 parents e4de91f + 4e9f048 commit 7ff1928
Show file tree
Hide file tree
Showing 15 changed files with 118 additions and 90 deletions.
9 changes: 8 additions & 1 deletion content/community/links.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
title = "GitHub"
subtitle = "bevyengine"
url = "https://github.com/bevyengine/bevy"
image = "/assets/github.svg"
image = "/assets/github-mark-white.svg"
image_alt = "GitHub logo"
description = "Interact with Bevy's source code, report issues, and suggest changes"
show_in_footer = true

[[links]]
title = "Bevy People"
Expand Down Expand Up @@ -35,6 +36,7 @@ url = "https://discord.gg/bevy"
image = "/assets/discord.svg"
image_alt = "Discord logo"
description = "A community to discuss Bevy, Rust, and game development"
show_in_footer = true

[[links]]
title = "Bluesky"
Expand All @@ -43,6 +45,7 @@ url = "https://bsky.app/profile/bevyengine.org"
image = "/assets/bluesky.svg"
image_alt = "Bluesky logo"
description = "Quick updates and shared Bevy content from the community"
show_in_footer = true

[[links]]
title = "Twitter"
Expand All @@ -51,6 +54,7 @@ url = "https://twitter.com/BevyEngine"
image = "/assets/twitter.svg"
image_alt = "Twitter logo"
description = "Quick updates and shared Bevy content from the community"
show_in_footer = true

[[links]]
title = "Reddit"
Expand All @@ -59,6 +63,7 @@ url = "https://www.reddit.com/r/bevy/"
image = "/assets/reddit.svg"
image_alt = "Reddit logo"
description = "Stay up to date on Bevy news, share your games or plugins, and discuss Bevy."
show_in_footer = true

[[links]]
title = "itch.io"
Expand All @@ -67,6 +72,7 @@ url = "https://itch.io/games/tag-bevy"
image = "/assets/itchio-textless.svg"
image_alt = "itch.io logo"
description = 'Games tagged with "bevy" on itch.io.'
show_in_footer = true

[[links]]
title = "Mastodon"
Expand All @@ -75,3 +81,4 @@ url = "https://mastodon.social/@bevy"
image = "/assets/mastodon-logo-purple.svg"
image_alt = "Mastodon logo"
description = "News, boosted community creations and chatter on the short-form Fediverse network."
show_in_footer = true
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The glTF 3D model file format allows a single mesh to be associated with multipl
}
```

In Bevy 0.14 and before, these primitives are named using the format "Mesh.Index", which complicates querying. A new component [GltfMaterialName](https://docs.rs/bevy/0.15/bevy/gltf/struct.GltfMaterialName.html) is now added to each primitive node that has a material, letting you quickly look up the primitive by using the this component with the material name.
In Bevy 0.14 and before, these primitives are named using the format "Mesh.Index", which complicates querying. A new component [GltfMaterialName](https://docs.rs/bevy/0.15/bevy/gltf/struct.GltfMaterialName.html) is now added to each primitive node that has a material, letting you quickly look up the primitive by using this component with the material name.

```rust
fn find_top_material_and_mesh(
Expand All @@ -58,4 +58,4 @@ fn find_top_material_and_mesh(
}
}
}
```
```
13 changes: 13 additions & 0 deletions sass/_utils.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@ body:not(.show_drafts) .public_draft:not(.active_draft) {
color: #737373;
text-shadow: none;
font-weight: 500;
opacity: 0;
transition: opacity $duration;
}

h1,
h2,
h3,
h4,
h5,
h6 {
&:hover .anchor-link {
opacity: 1;
}
}

.public_draft>div>a {
Expand Down
14 changes: 11 additions & 3 deletions sass/components/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,23 @@
display: flex;
flex-direction: row;
justify-content: center;
gap: 25px;
padding: 20px;
flex-wrap: wrap;
padding: 32px 16px;
}

&__social {
padding: 12px;

img {
filter: grayscale(1) brightness(800%);
&:hover {
transition: scale $duration, opacity $duration;
opacity: 0.65;
}

&:hover {
img {
scale: 110%;
opacity: 1;
}
}
}
Expand Down
18 changes: 18 additions & 0 deletions sass/pages/_donate.scss
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,21 @@ div.donate-sponsor {
text-align: center;
margin-top: 4rem;
}

#membership {
display: block;
}

#corporate-sponsorship {
display: none;
}

@include state-checked("donate-view") {
#membership {
display: none;
}

#corporate-sponsorship {
display: block;
}
}
15 changes: 12 additions & 3 deletions sass/pages/_migration_guide.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,18 @@
}

h3 {
margin-block: 2rem .5rem;
padding-top: 2rem;
border-top: solid rgba(#fff, 0.05) 1px;
margin-block: 2rem 0.5rem;
}

hr {
$color: rgba(#fff, 0.05);

height: 1px;
color: $color;
background: $color;
font-size: 0;
border: 0;
margin-block: 2rem;
}
}

Expand Down
2 changes: 2 additions & 0 deletions static/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ if (versionsSelect) {

}

document.querySelector('[data-assets-filters]').classList.remove('hidden');

document
.querySelector('#assets-filter')
.addEventListener("change", (item) => {
Expand Down
16 changes: 0 additions & 16 deletions static/donate.js

This file was deleted.

20 changes: 11 additions & 9 deletions static/on-this-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,34 @@ let otp_state = new Map();
* @param {string | HTMLElement} id_or_node
*/
function otp_set_active(id_or_node){
let id = "";
if(typeof id_or_node == "object"){
id = id_or_node.getAttribute("id");
} else {
id = id_or_node;
}
id = "#" + id;
let id = `#${id_or_node instanceof HTMLElement ? id_or_node.getAttribute("id") : id_or_node}`;

document.querySelectorAll(".on-this-page a").forEach(a => {
a.setAttribute("data-active", a.getAttribute("href").includes(id));
});
}

let headerHeight = getComputedStyle(document.body).getPropertyValue(
"--header-height"
);

let otp_observer = new IntersectionObserver(
entries => {
entries.forEach(entry => {
otp_state.set(entry.target, entry.isIntersecting);
});

let intersecting = Array.from(otp_state)
.filter(([_el, inter]) => inter)
.map(([el, _inter]) => el);
intersecting.sort((element) => -element.getBoundingClientRect().y);

intersecting.sort((a, b) => a.getBoundingClientRect().y - b.getBoundingClientRect().y);

if (intersecting.length > 0) {
otp_set_active(intersecting[0]);
}
}, {
rootMargin: "0px 0px 20% 0px",
rootMargin: `-${headerHeight} 0px 20% 0px`,
threshold: 1.0,
});

Expand Down
24 changes: 13 additions & 11 deletions templates/assets.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@
{% block page_content %}
<div class="assets">
{{ assets_macros::init_svg() }}
<div class="assets-search">
<input class="assets-search__input"
type="text"
id="assets-search"
placeholder="Search (ie: 0.11 MIT)">
</div>
<div class="assets-filters">
<label>Bevy last supported version</label>
<select class="asset-version-select" id="assets-filter">
<option value="all_versions">All</option>
</select>
<div class="hidden" data-assets-filters>
<div class="assets-search">
<input class="assets-search__input"
type="text"
id="assets-search"
placeholder="Search (ie: 0.15 MIT)">
</div>
<div class="assets-filters">
<label>Bevy last supported version</label>
<select class="asset-version-select" id="assets-filter">
<option value="all_versions">All</option>
</select>
</div>
</div>
<div class="assets-intro media-content">
A collection of third-party Bevy assets, plugins, learning resources, and apps made by the community. If you
Expand Down
17 changes: 8 additions & 9 deletions templates/donate.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{% import "macros/numbers.html" as numbers %}
{% extends "layouts/base.html" %}

{% block head_extensions %}
<script src="/donate.js"></script>
{% endblock head_extensions %}

{% block content %}

{% set donors = load_data(path="content/donate/donors.toml") %}
Expand Down Expand Up @@ -83,6 +79,8 @@
</div>
</div>

<input id="donate-view-state" class="hidden" type="checkbox">
<div data-donate-view-state-container>
<div id="membership">
<h2 class="donate-header-padding">Membership</h2>
<div class="donate-levels-container">
Expand Down Expand Up @@ -120,12 +118,12 @@ <h2 class="donate-header-padding">Membership</h2>
{% endfor %}
</div>
</div>
<button type="button" class="card donate-corporate-button" onclick="show_corporate()">
<label for="donate-view-state" class="card donate-corporate-button">
Corporate Tiers
</button>
</label>
</div>

<div id="corporate-sponsorship" style="display: none">
<div id="corporate-sponsorship">
<h2 class="donate-header-padding">Corporate Sponsorship</h2>
<div class="donate-membership-description">
These tiers exist for individuals or organizations that want to support Bevy in a big way. We <i>highly</i> recommend using bank transfers for payments at these levels to avoid exorbitant credit card processor fees. Please <a href="mailto:[email protected]">contact us</a> if you have any questions, or if you would like to discuss other payment options!
Expand Down Expand Up @@ -166,9 +164,10 @@ <h2 class="donate-header-padding">Corporate Sponsorship</h2>
{% endfor %}
</div>
</div>
<button type="button" class="card donate-corporate-button" onclick="show_membership()">
<label for="donate-view-state" class="card donate-corporate-button">
Individual Tiers
</button>
</label>
</div>
</div>

<div class="donate-faq-link"><a href="/donate/options">Click here</a> for more donation options and FAQs</div>
Expand Down
47 changes: 14 additions & 33 deletions templates/layouts/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -192,41 +192,22 @@
<footer class="print:hidden">
{% block footer_extensions %}{% endblock footer_extensions %}
<div class="footer__social-container">
<a class="footer__social" href="https://github.com/bevyengine/bevy">
<img src="/assets/github-mark-white.svg"
alt="Bevy engine's GitHub repo"
width="32"
height="32" />
</a>
<a class="footer__social" href="https://discord.gg/bevy">
<img src="/assets/discord.svg"
alt="Bevy Discord server"
width="32"
height="32" />
</a>
<a class="footer__social" href="https://mastodon.social/@bevy">
<img src="/assets/mastodon-logo-purple.svg"
alt="Bevy Mastodon account"
width="32"
height="32" />
</a>
<a class="footer__social" href="https://twitter.com/BevyEngine">
<img src="/assets/twitter.svg"
alt="Bevy Twitter account"
width="32"
height="32" />
</a>
<a class="footer__social" href="https://www.reddit.com/r/bevy/">
<img src="/assets/reddit.svg"
alt="Bevy subreddit"
width="32"
height="32" />
</a>
<a class="footer__social" href="/atom.xml">
{% set community_links = load_data(path="content/community/links.toml") %}
{% for link in community_links.links %}
{% if link.show_in_footer %}
<a class="footer__social" href="{{ link.url }}" title="{{ link.title }}">
<img src="{{ link.image }}"
alt="{{ link.image_alt }}"
width="24"
height="24" />
</a>
{% endif %}
{% endfor %}
<a class="footer__social" href="/atom.xml" title="Bevy news feed">
<img src="/assets/feed.svg"
alt="Bevy news feed"
width="32"
height="32" />
width="24"
height="24" />
</a>
</div>
</footer>
Expand Down
4 changes: 2 additions & 2 deletions templates/layouts/examples.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="assets-intro media-content">
{% block intro %}{% endblock intro %}
</div>
<div class="assets-search">
<div class="assets-search hidden" data-assets-filters>
<input class="assets-search__input"
type="text"
id="assets-search"
Expand All @@ -30,5 +30,5 @@ <h1 class="asset-section" id="{{ section.title | slugify }}">
{% endif %}
{% endfor %}
</div>
<script type="module">import '/assets.js'</script>
<script type="module">import '/assets.js';</script>
{% endblock page_content %}
2 changes: 1 addition & 1 deletion templates/macros/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% set class = class~" main-menu__link--active" %}
{% endif %}
<li class="main-menu__entry {{ extra_class }}">
<a href="{{ route | lower }}" class="{{ class }}">
<a href="{{ route | lower }}/" class="{{ class }}">
<span>{{ name }}</span>
</a>
</li>
Expand Down
Loading

0 comments on commit 7ff1928

Please sign in to comment.