mirror of
https://github.com/godotengine/godot-website.git
synced 2025-12-31 09:48:43 +03:00
76 lines
4.0 KiB
HTML
76 lines
4.0 KiB
HTML
<input type="checkbox" id="nav_toggle_cb">
|
|
<header>
|
|
<div class="container flex align-center">
|
|
<div id="nav_head">
|
|
<a href="/" id="logo-link">
|
|
<img class="nav-logo" src="/assets/logo.svg" width="136" height="48" alt="Godot Engine">
|
|
<img class="nav-logo dark-logo" src="/assets/logo_dark.svg" width="136" height="48" alt="Godot Engine">
|
|
</a>
|
|
<div class="mobile-links">
|
|
<span class="fund mobile"><a href="https://fund.godotengine.org"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="width: 13px; fill: white; margin-right: 4px;"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z"/></svg> Donate</a></span>
|
|
<label for="nav_toggle_cb" id="nav_toggle_btn">
|
|
<img src="/assets/icons/hamburger.svg" width="24" height="24" alt="Main menu">
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<nav id="nav">
|
|
<ul class="left">
|
|
<li><a href="/features/">{% t header.features %}</a></li>
|
|
<li><a href="/showcase/">{% t header.showcase %}</a></li>
|
|
<li><a href="/blog/">{% t header.blog %}</a></li>
|
|
<li><a href="/community/">{% t header.community %}</a></li>
|
|
<li><a href="https://godotengine.org/asset-library/asset">{% t header.assets %}</a></li>
|
|
</ul>
|
|
|
|
<ul class="right">
|
|
<li><a href="/download/windows/" class="set-os-download-url">{% t header.download %}</a></li>
|
|
<li><a href="https://docs.godotengine.org">{% t header.docs %}</a></li>
|
|
<li><a href="https://docs.godotengine.org/en/stable/contributing/how_to_contribute.html">{% t header.contribute %}</a></li>
|
|
{% if page.localize %}
|
|
<li class="language-selector" onclick="this.classList.toggle('open')">
|
|
<a class="mobile-language-selector" href="#">{% t header.language %}: </a>
|
|
<div class="language-dropdown">
|
|
{% for lang in page.localize %}
|
|
<div class="language-option"><a href="#" data-lang-path="{% if lang == 'en' %}/{% else %}/{{ lang }}/{% endif %}" data-lang="{{ lang }}" onclick="setLanguagePreference(event, this)"><span class="localize-language-label">{{ lang }}</span></a></div>
|
|
{% endfor %}
|
|
</div>
|
|
</li>
|
|
{% endif %}
|
|
<li class="fund desktop"><a href="https://fund.godotengine.org"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="width: 13px; fill: white; margin-right: 4px; top: 1px;
|
|
position: relative;"><!--!Font Awesome Free 6.6.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z"/></svg> {% t header.donate %}</a></li>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</header>
|
|
|
|
<script>
|
|
document.addEventListener('click', function(event) {
|
|
const languageSelector = document.querySelector('.language-selector');
|
|
if (!languageSelector) return;
|
|
|
|
// Check if the click is outside the language selector
|
|
if (!languageSelector.contains(event.target)) {
|
|
languageSelector.classList.remove('open');
|
|
}
|
|
});
|
|
|
|
function setLanguagePreference(event, element) {
|
|
event.preventDefault();
|
|
const path = element.getAttribute('data-lang-path');
|
|
const lang = element.getAttribute('data-lang');
|
|
|
|
// Set cookie that expires in 365 days
|
|
const expirationDate = new Date();
|
|
expirationDate.setDate(expirationDate.getDate() + 365);
|
|
document.cookie = `preferred_language=${lang}; expires=${expirationDate.toUTCString()}; path=/; SameSite=Lax`;
|
|
|
|
// Redirect to the language-specific path
|
|
window.location.href = path;
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
<main>
|