2020-03-25 01:48:54 +00:00
|
|
|
<template>
|
2020-07-14 22:15:00 +00:00
|
|
|
<div class="sidebar-container">
|
|
|
|
<div
|
|
|
|
class="sidebar"
|
|
|
|
@click.stop
|
|
|
|
>
|
|
|
|
<div class="sidebar-section">
|
|
|
|
<div class="sidebar-header">
|
|
|
|
<Icon
|
|
|
|
icon="cross2"
|
|
|
|
class="sidebar-close"
|
|
|
|
@click.native="toggleSidebar(false)"
|
2020-05-25 00:02:28 +00:00
|
|
|
/>
|
|
|
|
|
|
|
|
<router-link
|
2020-06-28 01:19:09 +00:00
|
|
|
to="/updates"
|
2020-07-14 22:15:00 +00:00
|
|
|
class="logo-link"
|
2020-05-25 00:02:28 +00:00
|
|
|
@click.native="toggleSidebar(false)"
|
|
|
|
>
|
2020-07-14 22:15:00 +00:00
|
|
|
<h1 class="sidebar-logo">
|
|
|
|
<div
|
|
|
|
class="logo"
|
|
|
|
v-html="logo"
|
|
|
|
/>
|
|
|
|
</h1>
|
2020-05-25 00:02:28 +00:00
|
|
|
</router-link>
|
2020-07-14 22:15:00 +00:00
|
|
|
</div>
|
2020-05-25 00:02:28 +00:00
|
|
|
|
2020-07-14 22:15:00 +00:00
|
|
|
<nav class="nav">
|
|
|
|
<ul class="nolist">
|
|
|
|
<li class="nav-item">
|
|
|
|
<router-link
|
|
|
|
v-slot="{ href, isActive, navigate }"
|
|
|
|
to="/updates"
|
|
|
|
@click.native="toggleSidebar(false)"
|
|
|
|
>
|
|
|
|
<a
|
|
|
|
class="nav-link"
|
|
|
|
:href="href"
|
|
|
|
:class="{ active: isActive }"
|
|
|
|
@click="navigate"
|
|
|
|
>Home</a>
|
|
|
|
</router-link>
|
|
|
|
</li>
|
2020-05-25 00:02:28 +00:00
|
|
|
|
2020-07-14 22:15:00 +00:00
|
|
|
<li class="nav-item">
|
|
|
|
<router-link
|
|
|
|
v-slot="{ href, isActive, navigate }"
|
|
|
|
to="/actors"
|
|
|
|
@click.native="toggleSidebar(false)"
|
|
|
|
>
|
|
|
|
<a
|
|
|
|
class="nav-link"
|
|
|
|
:href="href"
|
|
|
|
:class="{ active: isActive }"
|
|
|
|
@click="navigate"
|
|
|
|
>Actors</a>
|
|
|
|
</router-link>
|
|
|
|
</li>
|
2020-05-25 00:02:28 +00:00
|
|
|
|
2020-07-14 22:15:00 +00:00
|
|
|
<li class="nav-item">
|
|
|
|
<router-link
|
|
|
|
v-slot="{ href, isActive, navigate }"
|
|
|
|
to="/networks"
|
|
|
|
@click.native="toggleSidebar(false)"
|
|
|
|
>
|
|
|
|
<a
|
|
|
|
class="nav-link"
|
|
|
|
:href="href"
|
|
|
|
:class="{ active: isActive }"
|
|
|
|
@click="navigate"
|
|
|
|
>Channels</a>
|
|
|
|
</router-link>
|
|
|
|
</li>
|
|
|
|
|
2020-07-25 01:44:19 +00:00
|
|
|
<li class="nav-item">
|
|
|
|
<router-link
|
|
|
|
v-slot="{ href, isActive, navigate }"
|
|
|
|
to="/movies"
|
|
|
|
@click.native="toggleSidebar(false)"
|
|
|
|
>
|
|
|
|
<a
|
|
|
|
class="nav-link"
|
|
|
|
:href="href"
|
|
|
|
:class="{ active: isActive }"
|
|
|
|
@click="navigate"
|
|
|
|
>Movies</a>
|
|
|
|
</router-link>
|
|
|
|
</li>
|
|
|
|
|
2020-07-14 22:15:00 +00:00
|
|
|
<li class="nav-item">
|
|
|
|
<router-link
|
|
|
|
v-slot="{ href, isActive, navigate }"
|
|
|
|
to="/tags"
|
|
|
|
@click.native="toggleSidebar(false)"
|
|
|
|
>
|
|
|
|
<a
|
|
|
|
class="nav-link"
|
|
|
|
:href="href"
|
|
|
|
:class="{ active: isActive }"
|
|
|
|
@click="navigate"
|
|
|
|
>Tags</a>
|
|
|
|
</router-link>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="sidebar-section toggles noselect">
|
|
|
|
<label
|
|
|
|
v-show="sfw"
|
|
|
|
class="toggle"
|
|
|
|
@click="setSfw(false)"
|
2020-07-20 02:20:33 +00:00
|
|
|
><Icon icon="fire" />Disable safe mode</label>
|
2020-07-14 22:15:00 +00:00
|
|
|
|
|
|
|
<label
|
|
|
|
v-show="!sfw"
|
|
|
|
class="toggle"
|
|
|
|
@click="setSfw(true)"
|
|
|
|
><Icon icon="flower" />Enable safe mode</label>
|
|
|
|
|
|
|
|
<label
|
|
|
|
v-show="theme === 'dark'"
|
|
|
|
class="toggle"
|
|
|
|
@click="setTheme('light')"
|
|
|
|
><Icon icon="sun" />Use light theme</label>
|
|
|
|
|
|
|
|
<label
|
|
|
|
v-show="theme === 'light'"
|
|
|
|
class="toggle"
|
|
|
|
@click="setTheme('dark')"
|
|
|
|
><Icon icon="moon" />Use dark theme</label>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-05-25 00:02:28 +00:00
|
|
|
</div>
|
2020-03-25 01:48:54 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-07-14 22:15:00 +00:00
|
|
|
import { mapState } from 'vuex';
|
|
|
|
|
2020-05-25 00:02:28 +00:00
|
|
|
import logo from '../../img/logo.svg';
|
2020-03-25 01:48:54 +00:00
|
|
|
|
2020-07-14 22:15:00 +00:00
|
|
|
function sfw(state) {
|
|
|
|
return state.ui.sfw;
|
|
|
|
}
|
|
|
|
|
|
|
|
function theme(state) {
|
|
|
|
return state.ui.theme;
|
|
|
|
}
|
|
|
|
|
|
|
|
function setTheme(newTheme) {
|
|
|
|
this.$store.dispatch('setTheme', newTheme);
|
|
|
|
}
|
|
|
|
|
|
|
|
function setSfw(enabled) {
|
|
|
|
this.$store.dispatch('setSfw', enabled);
|
|
|
|
}
|
|
|
|
|
2020-03-25 01:48:54 +00:00
|
|
|
export default {
|
2020-05-25 00:02:28 +00:00
|
|
|
props: {
|
|
|
|
toggleSidebar: {
|
|
|
|
type: Function,
|
|
|
|
default: null,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
logo,
|
|
|
|
};
|
|
|
|
},
|
2020-07-14 22:15:00 +00:00
|
|
|
computed: {
|
|
|
|
...mapState({
|
|
|
|
sfw,
|
|
|
|
theme,
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
setTheme,
|
|
|
|
setSfw,
|
|
|
|
},
|
2020-03-25 01:48:54 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2020-07-14 22:15:00 +00:00
|
|
|
.sidebar-container {
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
position: absolute;
|
|
|
|
z-index: 10;
|
|
|
|
background: var(--darken-hint);
|
|
|
|
}
|
|
|
|
|
2020-03-25 01:48:54 +00:00
|
|
|
.sidebar {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2020-07-14 22:15:00 +00:00
|
|
|
justify-content: space-between;
|
2020-03-25 01:48:54 +00:00
|
|
|
width: 15rem;
|
|
|
|
height: 100%;
|
2020-05-25 00:02:28 +00:00
|
|
|
color: var(--text);
|
|
|
|
background: var(--background);
|
2020-07-16 13:55:03 +00:00
|
|
|
box-shadow: 0 0 3px var(--darken-weak);
|
2020-03-25 01:48:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar-header {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
height: 3rem;
|
|
|
|
border-bottom: solid 1px var(--shadow-hint);
|
|
|
|
margin: 0 0 .5rem 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar-close {
|
2020-07-14 22:15:00 +00:00
|
|
|
width: 1.25rem;
|
2020-03-25 01:48:54 +00:00
|
|
|
height: 100%;
|
2020-07-14 22:15:00 +00:00
|
|
|
padding: 0 1.125rem;
|
|
|
|
fill: var(--shadow-modest);
|
2020-03-25 01:48:54 +00:00
|
|
|
|
|
|
|
&:hover {
|
2020-07-14 22:15:00 +00:00
|
|
|
fill: var(--primary);
|
2020-03-25 01:48:54 +00:00
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar-logo {
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.logo-link {
|
|
|
|
display: block;
|
|
|
|
height: 100%;
|
|
|
|
padding: 0 1rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.logo {
|
|
|
|
width: 6rem;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
margin: 0;
|
2020-05-25 00:02:28 +00:00
|
|
|
fill: var(--primary);
|
2020-03-25 01:48:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.nav-item {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.nav-link {
|
2020-07-14 22:15:00 +00:00
|
|
|
color: var(--shadow);
|
2020-03-25 01:48:54 +00:00
|
|
|
display: block;
|
|
|
|
padding: 1rem;
|
|
|
|
text-decoration: none;
|
|
|
|
font-weight: bold;
|
|
|
|
|
2020-05-25 00:02:28 +00:00
|
|
|
&:hover {
|
2020-07-14 22:15:00 +00:00
|
|
|
color: var(--shadow-strong);
|
2020-03-25 01:48:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&.active {
|
2020-07-14 22:15:00 +00:00
|
|
|
color: var(--primary);
|
2020-03-25 01:48:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-14 22:15:00 +00:00
|
|
|
.toggles {
|
|
|
|
border-top: solid 1px var(--shadow-hint);
|
|
|
|
margin: .5rem 0 0 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.toggle {
|
|
|
|
display: flex;
|
|
|
|
align-self: flex-end;
|
|
|
|
padding: 1rem;
|
|
|
|
color: var(--shadow);
|
|
|
|
font-weight: bold;
|
|
|
|
|
|
|
|
.icon {
|
|
|
|
fill: var(--shadow);
|
|
|
|
margin: 0 1rem 0 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.active .icon {
|
|
|
|
fill: var(--primary);
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
cursor: pointer;
|
|
|
|
color: var(--shadow-strong);
|
|
|
|
|
|
|
|
&:not(.active) .icon {
|
|
|
|
fill: var(--shadow-strong);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-25 01:48:54 +00:00
|
|
|
.dark .sidebar {
|
|
|
|
background: var(--profile);
|
|
|
|
|
2020-05-25 00:02:28 +00:00
|
|
|
.nav-link {
|
|
|
|
color: var(--shadow);
|
2020-03-25 01:48:54 +00:00
|
|
|
|
2020-05-25 00:02:28 +00:00
|
|
|
&.active {
|
|
|
|
color: var(--text-light);
|
|
|
|
}
|
|
|
|
}
|
2020-03-25 01:48:54 +00:00
|
|
|
|
2020-05-25 00:02:28 +00:00
|
|
|
.sidebar-close {
|
|
|
|
fill: var(--lighten);
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
fill: var(--text-light);
|
|
|
|
}
|
|
|
|
}
|
2020-03-25 01:48:54 +00:00
|
|
|
}
|
|
|
|
</style>
|