quitsocialmedia.club/_includes/nav.html

46 lines
1.9 KiB
HTML

<section id="nav" class="nav">
<div id="home">
<a href="{% if page.lang == 'it' %}/tuffo{% else %}/home{% endif %}" title="home">Quit Social Media</a>
</div>
<nav>
<a class="nav-mobile" href="javascript:void(0);" onclick="navtoggle()"><span></span></a>
<ul class="nav-list">
<li>{% if page.lang == 'it' %}<a href="/it/about">Info{% else %}<a href="/about">About{% endif %}</a></li>
<li>{% if page.lang == 'it' %}<a href="/it/why">Perché{% else %}<a href="/why">Why{% endif %}</a></li>
<li>{% if page.lang == 'it' %}<a href="/it/solutions">Soluzioni{% else %}<a href="/solutions">Solutions{% endif %}</a></li>
{% unless page.ref == nil %}
<li id="language-selector" class="dropdown"><a onclick="langdropdown()" href="#!" title="language selector"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="var(--text)" d="M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 2a8.19 8.19 0 0 1 1.79.21 2.61 2.61 0 0 1-.78 1c-.22.17-.46.31-.7.46a4.56 4.56 0 0 0-1.85 1.67 6.49 6.49 0 0 0-.62 3.3c0 1.36 0 2.16-.95 2.87-1.37 1.07-3.46.47-4.76-.07A8.33 8.33 0 0 1 4 12a8 8 0 0 1 8-8zm4.89 14.32a6.79 6.79 0 0 0-.63-1.14c-.11-.16-.22-.32-.32-.49-.39-.68-.25-1 .38-2l.1-.17a4.77 4.77 0 0 0 .58-2.43 5.42 5.42 0 0 1 .09-1c.16-.73 1.71-.93 2.67-1a7.94 7.94 0 0 1-2.86 8.28z"/></svg></a>
<ul class="dropdown-content">
{% for cosa in site.pages %}
{% if cosa.ref == page.ref %}
<li>
<a href="{{ cosa.url }}" class="{{ cosa.lang }}">{{ cosa.lang }}</a>
</li>
{% endif %}
{% endfor %}
</ul>
</li>
{% endunless %}
</ul>
</nav>
</section>
<script>
function navtoggle() {
var x = document.getElementById("nav");
if (x.className === "nav") {
x.className += " open-menu";
} else {
x.className = "nav";
}
}
function langdropdown() {
var x = document.getElementById("language-selector");
if (x.className === "dropdown") {
x.className += " open-menu";
} else {
x.className = "dropdown";
}
}
</script>