Skip to content

Instantly share code, notes, and snippets.

@mauricius
Created May 23, 2018 11:03
Show Gist options
  • Save mauricius/6127bffd83b738c5b54b32c8bd115db5 to your computer and use it in GitHub Desktop.
Save mauricius/6127bffd83b738c5b54b32c8bd115db5 to your computer and use it in GitHub Desktop.
Tachyons.css Mobile Menu
<nav id="site-navigation" aria-label="Menu" class="dn-l bg-maillis">
<ul id="main-menu" class="dn list pa0">
@if (auth()->check())
<li class="bb bw1 b--maillis-orange pv2 pl4"><span class="f6 white b">{{ auth()->user()->email }}</span></li>
<li><a class="f6 link white dib dim pv2 pl4" href="{{ route("auth.profile") }}">{{ trans("public.profile") }}</a></li>
<li><a class="f6 link white dib dim pv2 pl4" href="{{ route("auth.logout") }}">{{ trans("public.logout") }}</a></li>
@else
<li><a class="f6 link white dib dim pv2 pl4" href="{{ route("auth.login") }}">{{ trans("public.login") }}</a></li>
@endif
<li><a class="f6 link white dib dim pv2 pl4" href="{{ route("auth.register") }}">{{ trans("public.contact") }}</a></li>
</ul>
</nav>
<label aria-label="Menu" id="menu" class="dn-l fr white"><i class="material-icons dp48">menu</i></label>
$("#menu").on("click", function (e) {
var $i = $(this).find("i");
$i.text() === "menu" ? $i.text("clear") : $i.text("menu");
$("#main-menu").toggleClass("dn");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment