Skip to content

Commit

Permalink
Deploy bevyengine/bevy-website to bevyengine/bevy-website:gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
GitHub Actions committed Jan 21, 2024
0 parents commit e1dfad4
Show file tree
Hide file tree
Showing 2,233 changed files with 333,837 additions and 0 deletions.
221 changes: 221 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@












<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name='viewport' content="width=device-width, initial-scale=1" />
<meta property="og:title" content="Bevy Engine" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://bevyengine.org" />
<meta property="og:image" content="https://bevyengine.org/assets/bevy_logo_fill.png" />
<meta property="og:description" content="Bevy is a refreshingly simple data-driven game engine built in Rust. It is free and open-source forever!" />
<link rel="shortcut icon" type="image/png" href="/assets/favicon.png">
<link rel="stylesheet" href="/site.css" />
<link href="/atom.xml" rel="alternate" type="application/atom+xml" />
<title>Bevy Engine</title>

</head>
<body>
<div class="layout">
<input id="mobile-menu-state" class="hidden" type="checkbox">
<header class="layout__header header" data-mobile-menu-state-container>
<div class="header__content">
<label class="main-menu-backdrop" for="mobile-menu-state"></label>
<label class="header__hamburger button-square button-square--header" for="mobile-menu-state">
<img src="/assets/icon-hamburger.svg">
</label>
<div class="header__left-block">
<a class="header__logo" href="/">
<img class="logo" src="/assets/bevy_logo_dark.svg" alt="Bevy Engine">
</a>
<div class="header__message">

Features

</div>
</div>

<nav class="header__menu main-menu " role="navigation" data-page-menu-switch-state-container>
<div class="main-menu__header">
<a href="/">
<img class="logo" src="/assets/bevy_logo_dark.svg" alt="Bevy Engine">
</a>
<label class="button-square button-square--header" for="mobile-menu-state">
<img src="/assets/icon-times.svg">
</label>
</div>

<div class="main-menu__content">
<div class="main-menu__page-menu">

</div>
<ul class="main-menu__menu">














<li class="main-menu__entry main-menu__entry--getting-started">
<a href="&#x2F;learn&#x2F;book&#x2F;getting-started&#x2F;" class="main-menu__link">
<span>Getting Started</span>
</a>
</li>















<li class="main-menu__entry ">
<a href="&#x2F;learn" class="main-menu__link">
<span>Learn</span>
</a>
</li>















<li class="main-menu__entry ">
<a href="&#x2F;news" class="main-menu__link">
<span>News</span>
</a>
</li>















<li class="main-menu__entry ">
<a href="&#x2F;community" class="main-menu__link">
<span>Community</span>
</a>
</li>















<li class="main-menu__entry ">
<a href="&#x2F;assets" class="main-menu__link">
<span>Assets</span>
</a>
</li>















<li class="main-menu__entry ">
<a href="&#x2F;examples" class="main-menu__link">
<span>Examples</span>
</a>
</li>


</ul>
</div>
</nav>
<div class="header__cta-container">
<a class="button button--pink header__cta" href="/community/donate">Donate <img class="button__icon" src="/assets/heart.svg" alt="heart icon"/></a>
<a class="header__cta header__cta--github" href="https://github.com/bevyengine/bevy">
<img src="/assets/github-mark-white.svg" alt="GitHub repo">
</a>
</div>
</div>
</header>
<main class="layout__content">
<div class="container">


<div class="fourohfour">
<h1>404</h1>
<p>Sorry, we couldn't find that page.</p>
<img src="/assets/bevy_icon_dark.svg" alt="Bevy logo">
</div>

</div>
</main>
</div>
<script>
const search_params = new URLSearchParams(window.location.search);
if (search_params.has("show_drafts") || document.cookie.indexOf("show_drafts") >= 0) {
if (search_params.get("show_drafts") === "0") {
document.cookie = "show_drafts=;path=/;expires=Thu, 01 Jan 1970 00:00:00 UTC";
} else {
document.cookie = "show_drafts=1;path=/"
document.body.classList.add('show_drafts');
}
}
</script>
</body>
</html>
1 change: 1 addition & 0 deletions CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bevyengine.org
116 changes: 116 additions & 0 deletions assets.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
let filters_state = {
search_terms: [''],
version: '*'
}

const check_filters = (filters) => (node) => {
let results = filters.map(filter => filter(node));
return results.every(val => val)
}

const pass_filters = check_filters([
filter_search_terms,
filter_version
]);

function filter_assets() {
document.querySelectorAll('.asset-card').forEach(asset => {
asset.parentElement.style.display = pass_filters(asset) ? 'block' : 'none'
})
}

// ------------ Search terms Filtering

const searchElement = document.querySelector('#assets-search')

searchElement.addEventListener("input", (_) => {
filters_state.search_terms = searchElement.value.toLowerCase().split(' ');
filter_assets()
hideEmptySubSections()
hideEmptySections()
})

function filter_search_terms(asset_node) {
const fullText = asset_node.text.toLowerCase()
return filters_state.search_terms.every((term) => fullText.includes(term))
}

function hideEmptySubSections() {
for (const itemGrid of document.querySelectorAll('.item-grid')) {
const cardInGrid = [...itemGrid.querySelectorAll('.asset-card')]
const areAllHidden = (cardInGrid.every((card) => card.parentElement.style.display === 'none'))
itemGrid.style.display = areAllHidden ? 'none' : 'grid'
itemGrid.previousElementSibling.style.display = areAllHidden ? 'none' : 'block'
}
}

function hideEmptySections() {
document.querySelectorAll('.asset-section').forEach(section => {
let nextElement = section.nextElementSibling
while (nextElement && !nextElement.classList.contains('asset-section')) {
if (nextElement.style.display !== 'none') {
section.style.display = 'block'
return
}
nextElement = nextElement.nextElementSibling
}
section.style.display = 'none'
})
}

// ------------ Version Filtering
const version_always_show = ['*', 'main', '']

function sort_versions(a, b) {
let a1 = a.split('.').map(i => i.padStart(3, '0')).join('');
let b1 = b.split('.').map(i => i.padStart(3, '0')).join('');
return b1 - a1;
}

function normalize_version(raw_version) {
let version = raw_version?.replace(/^[^\d]+/, '').replace(/[^\d]+$/, '');
let normalized_version = version ? Array.from({ ...version.split('.'), length: 3 }, (v, i) => v ?? 0).join('.') : '*'
return normalized_version;
}

function filter_version(asset_node) {
let name = asset_node.querySelector('.asset-card__title').innerHTML;

let tag = asset_node.querySelector('.asset-card__tags .asset-card__bevy-versions .asset-card__tag');
if (filters_state.version === 'all_versions') {
return true
}
else if (tag) {
let raw_item_value = tag.innerText;
let normalized_version = normalize_version(raw_item_value);
return [filters_state.version, ...version_always_show].includes(normalized_version);
} else return true
}

let versionsSelect = document.querySelector('#assets-filter');
if (versionsSelect) {
let versionsQuery = document.querySelectorAll('.asset-card .asset-card__bevy-versions .asset-card__tag');
[...new Set([...versionsQuery]
.map((item) => {
let raw_version = item?.innerText;
let normalized_version = normalize_version(raw_version);
return normalized_version
})
.filter(i => i)
.filter(i => !version_always_show.includes(i))
.sort(sort_versions)
)].forEach(i => {
var opt = document.createElement('option');
opt.value = i;
opt.innerHTML = i;
versionsSelect.appendChild(opt);
})

}

document
.querySelector('#assets-filter')
.addEventListener("change", (item) => {
filters_state.version = item.target.value;
filter_assets();
})
Binary file added assets/BFH.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/Encultured.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit e1dfad4

Please sign in to comment.