87 lines
2.5 KiB
HTML
87 lines
2.5 KiB
HTML
<nav class="main-nav">
|
|
<ul class="main-nav-ul">
|
|
<li class="main-nav-li" on:click="onClick(event, '/')">
|
|
<NavItem :page name="home" href="/" svg="#pinafore-logo" label="Home" />
|
|
</li>
|
|
<li class="main-nav-li" on:click="onClick(event, '/notifications')">
|
|
<NavItem :page name="notifications" href="/notifications" svg="#fa-bell" label="Notifications" />
|
|
</li>
|
|
{{#if $pinnedPage === '/local'}}
|
|
<li class="main-nav-li" on:click="onClick(event, '/local')">
|
|
<NavItem :page name="local" href="/local" svg="#fa-users" label="Local" />
|
|
</li>
|
|
{{elseif $pinnedPage === '/federated'}}
|
|
<li class="main-nav-li" on:click="onClick(event, '/federated')">
|
|
<NavItem :page name="federated" href="/federated" svg="#fa-globe" label="Federated" />
|
|
</li>
|
|
{{elseif $pinnedPage === '/favorites'}}
|
|
<li class="main-nav-li" on:click="onClick(event, '/favorites')">
|
|
<NavItem :page name="favorites" href="/favorites" svg="#fa-star" label="Favorites" />
|
|
</li>
|
|
{{elseif $pinnedPage.startsWith('/lists/')}}
|
|
<li class="main-nav-li" on:click="onClick(event, '/lists')">
|
|
<NavItem :page name="lists" href="{{$pinnedPage}}" svg="#fa-bars" label="{{$pinnedListTitle}}" />
|
|
</li>
|
|
{{/if}}
|
|
<li class="main-nav-li">
|
|
<NavItem :page name="community" href="/community" svg="#fa-comments" label="Community" />
|
|
</li>
|
|
<li class="main-nav-li">
|
|
<NavItem :page name="search" href="/search" svg="#fa-search" label="Search" />
|
|
</li>
|
|
<li class="main-nav-li">
|
|
<NavItem :page name="settings" href="/settings" svg="#fa-gear" label="Settings" />
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
|
|
<style>
|
|
.main-nav {
|
|
border-bottom: 1px solid var(--nav-border);
|
|
background: var(--nav-bg);
|
|
position: fixed;
|
|
left: 0;
|
|
right: 0;
|
|
top: 0;
|
|
z-index: 10;
|
|
}
|
|
|
|
.main-nav-ul {
|
|
margin: 0;
|
|
padding: 0;
|
|
list-style: none;
|
|
display: flex;
|
|
align-items: stretch;
|
|
}
|
|
|
|
.main-nav-li {
|
|
display: flex;
|
|
}
|
|
|
|
@media (max-width: 991px) {
|
|
.main-nav-li {
|
|
flex: 1;
|
|
}
|
|
}
|
|
|
|
</style>
|
|
<script>
|
|
import NavItem from './NavItem'
|
|
import { store } from '../_store/store'
|
|
import { scrollTop } from '../_actions/scroll'
|
|
|
|
export default {
|
|
store: () => store,
|
|
components: {
|
|
NavItem
|
|
},
|
|
methods: {
|
|
onClick(event, path) {
|
|
if (window.location.pathname === path || (window.location.pathname.startsWith(path) && window.location.pathname === '/')) {
|
|
scrollTop(document.querySelector('.container'))
|
|
event.preventDefault()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script> |