2018-12-15 17:13:01 +00:00
|
|
|
<template>
|
2018-12-29 10:44:21 +00:00
|
|
|
<div class="side-drawer-container"
|
|
|
|
:class="{ 'side-drawer-container-closed': closed, 'side-drawer-container-open': !closed }"
|
|
|
|
>
|
2018-12-28 19:39:54 +00:00
|
|
|
<div class="side-drawer"
|
2018-12-23 18:14:40 +00:00
|
|
|
:class="{'side-drawer-closed': closed}"
|
|
|
|
@touchstart="touchStart"
|
2018-12-28 19:39:54 +00:00
|
|
|
@touchmove="touchMove"
|
2018-12-23 18:14:40 +00:00
|
|
|
>
|
2018-12-28 19:39:54 +00:00
|
|
|
<div class="side-drawer-heading" @click="toggleDrawer">
|
2019-03-05 07:32:23 +00:00
|
|
|
<UserCardContent :user="currentUser" :hideBio="true" v-if="currentUser"/>
|
2019-02-04 18:34:07 +00:00
|
|
|
<div class="side-drawer-logo-wrapper" v-else>
|
2019-02-03 19:47:02 +00:00
|
|
|
<img :src="logo"/>
|
|
|
|
<span>{{sitename}}</span>
|
|
|
|
</div>
|
2018-12-23 17:50:19 +00:00
|
|
|
</div>
|
2018-12-15 17:13:01 +00:00
|
|
|
<ul>
|
2018-12-28 19:39:54 +00:00
|
|
|
<li v-if="currentUser" @click="toggleDrawer">
|
|
|
|
<router-link :to="{ name: 'new-status', params: { username: currentUser.screen_name } }">
|
2018-12-22 15:32:07 +00:00
|
|
|
{{ $t("post_status.new_status") }}
|
2018-12-28 19:39:54 +00:00
|
|
|
</router-link>
|
2018-12-22 15:32:07 +00:00
|
|
|
</li>
|
2018-12-28 19:39:54 +00:00
|
|
|
<li v-else @click="toggleDrawer">
|
|
|
|
<router-link :to="{ name: 'login' }">
|
2018-12-22 15:32:07 +00:00
|
|
|
{{ $t("login.login") }}
|
2018-12-28 19:39:54 +00:00
|
|
|
</router-link>
|
2018-12-20 20:20:04 +00:00
|
|
|
</li>
|
2018-12-28 19:39:54 +00:00
|
|
|
<li v-if="currentUser" @click="toggleDrawer">
|
|
|
|
<router-link :to="{ name: 'notifications', params: { username: currentUser.screen_name } }">
|
|
|
|
{{ $t("notifications.notifications") }} {{ unseenNotificationsCount > 0 ? `(${unseenNotificationsCount})` : '' }}
|
2018-12-15 17:13:01 +00:00
|
|
|
</router-link>
|
|
|
|
</li>
|
2018-12-28 19:39:54 +00:00
|
|
|
<li v-if="currentUser" @click="toggleDrawer">
|
|
|
|
<router-link :to="{ name: 'dms', params: { username: currentUser.screen_name } }">
|
2018-12-15 17:13:01 +00:00
|
|
|
{{ $t("nav.dms") }}
|
|
|
|
</router-link>
|
|
|
|
</li>
|
2018-12-29 10:44:21 +00:00
|
|
|
</ul>
|
|
|
|
<ul>
|
2018-12-28 19:39:54 +00:00
|
|
|
<li v-if="currentUser" @click="toggleDrawer">
|
|
|
|
<router-link :to="{ name: 'friends' }">
|
|
|
|
{{ $t("nav.timeline") }}
|
|
|
|
</router-link>
|
|
|
|
</li>
|
|
|
|
<li v-if="currentUser && currentUser.locked" @click="toggleDrawer">
|
|
|
|
<router-link to='/friend-requests'>
|
2018-12-15 17:13:01 +00:00
|
|
|
{{ $t("nav.friend_requests") }}
|
2019-02-27 19:38:10 +00:00
|
|
|
<span v-if='followRequestCount > 0' class="badge follow-request-count">
|
|
|
|
{{followRequestCount}}
|
2019-02-11 09:41:17 +00:00
|
|
|
</span>
|
|
|
|
|
2018-12-15 17:13:01 +00:00
|
|
|
</router-link>
|
|
|
|
</li>
|
2018-12-28 19:39:54 +00:00
|
|
|
<li @click="toggleDrawer">
|
|
|
|
<router-link to='/main/public'>
|
2018-12-15 17:13:01 +00:00
|
|
|
{{ $t("nav.public_tl") }}
|
|
|
|
</router-link>
|
|
|
|
</li>
|
2018-12-28 19:39:54 +00:00
|
|
|
<li @click="toggleDrawer">
|
|
|
|
<router-link to='/main/all'>
|
2018-12-15 17:13:01 +00:00
|
|
|
{{ $t("nav.twkn") }}
|
|
|
|
</router-link>
|
|
|
|
</li>
|
2018-12-28 19:39:54 +00:00
|
|
|
<li v-if="currentUser && chat" @click="toggleDrawer">
|
|
|
|
<router-link :to="{ name: 'chat' }">
|
|
|
|
{{ $t("nav.chat") }}
|
|
|
|
</router-link>
|
|
|
|
</li>
|
2018-12-29 10:44:21 +00:00
|
|
|
</ul>
|
|
|
|
<ul>
|
2018-12-28 19:39:54 +00:00
|
|
|
<li @click="toggleDrawer">
|
2019-01-16 02:33:08 +00:00
|
|
|
<router-link :to="{ name: 'user-search' }">
|
2018-12-28 19:39:54 +00:00
|
|
|
{{ $t("nav.user_search") }}
|
|
|
|
</router-link>
|
|
|
|
</li>
|
2019-01-16 02:33:08 +00:00
|
|
|
<li v-if="currentUser && suggestionsEnabled" @click="toggleDrawer">
|
|
|
|
<router-link :to="{ name: 'who-to-follow' }">
|
|
|
|
{{ $t("nav.who_to_follow") }}
|
|
|
|
</router-link>
|
|
|
|
</li>
|
2018-12-28 19:39:54 +00:00
|
|
|
<li @click="toggleDrawer">
|
2019-01-16 02:33:08 +00:00
|
|
|
<router-link :to="{ name: 'settings' }">
|
2018-12-22 15:32:07 +00:00
|
|
|
{{ $t("settings.settings") }}
|
|
|
|
</router-link>
|
|
|
|
</li>
|
2019-01-07 17:26:47 +00:00
|
|
|
<li @click="toggleDrawer">
|
|
|
|
<router-link :to="{ name: 'about'}">
|
|
|
|
{{ $t("nav.about") }}
|
|
|
|
</router-link>
|
|
|
|
</li>
|
2018-12-28 19:39:54 +00:00
|
|
|
<li v-if="currentUser" @click="toggleDrawer">
|
2018-12-22 15:32:07 +00:00
|
|
|
<a @click="doLogout" href="#">
|
|
|
|
{{ $t("login.logout") }}
|
|
|
|
</a>
|
|
|
|
</li>
|
2018-12-15 17:13:01 +00:00
|
|
|
</ul>
|
|
|
|
</div>
|
2018-12-29 10:44:21 +00:00
|
|
|
<div class="side-drawer-click-outside"
|
|
|
|
@click.stop.prevent="toggleDrawer"
|
|
|
|
:class="{'side-drawer-click-outside-closed': closed}"
|
|
|
|
></div>
|
2018-12-15 17:13:01 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./side_drawer.js" ></script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import '../../_variables.scss';
|
|
|
|
|
2018-12-20 20:20:04 +00:00
|
|
|
.side-drawer-container {
|
|
|
|
position: fixed;
|
|
|
|
z-index: 1000;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: stretch;
|
|
|
|
}
|
|
|
|
|
|
|
|
.side-drawer-container-open {
|
|
|
|
transition-delay: 0.0s;
|
|
|
|
transition-property: left;
|
|
|
|
}
|
|
|
|
|
|
|
|
.side-drawer-container-closed {
|
|
|
|
left: -100%;
|
|
|
|
transition-delay: 0.5s;
|
|
|
|
transition-property: left;
|
|
|
|
}
|
|
|
|
|
|
|
|
.side-drawer-click-outside {
|
|
|
|
flex: 1 1 100%;
|
|
|
|
}
|
|
|
|
|
2018-12-15 17:13:01 +00:00
|
|
|
.side-drawer {
|
2018-12-29 10:44:21 +00:00
|
|
|
overflow-x: hidden;
|
2019-01-27 06:27:41 +00:00
|
|
|
transition: 0.35s;
|
2018-12-15 17:13:01 +00:00
|
|
|
transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
|
2018-12-20 20:20:04 +00:00
|
|
|
margin: 0 0 0 -100px;
|
2018-12-28 19:39:54 +00:00
|
|
|
padding: 0 0 1em 100px;
|
|
|
|
width: 80%;
|
|
|
|
max-width: 20em;
|
|
|
|
flex: 0 0 80%;
|
|
|
|
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
|
|
|
|
box-shadow: var(--panelShadow);
|
|
|
|
background-color: $fallback--bg;
|
|
|
|
background-color: var(--bg, $fallback--bg);
|
2019-02-04 18:34:07 +00:00
|
|
|
}
|
2019-02-03 19:47:02 +00:00
|
|
|
|
2019-02-04 18:34:07 +00:00
|
|
|
.side-drawer-logo-wrapper {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
padding: 0.85em;
|
2019-02-03 19:47:02 +00:00
|
|
|
|
2019-02-04 18:34:07 +00:00
|
|
|
img {
|
|
|
|
flex: none;
|
|
|
|
height: 50px;
|
|
|
|
margin-right: 0.85em;
|
|
|
|
}
|
2019-02-03 19:47:02 +00:00
|
|
|
|
2019-02-04 18:34:07 +00:00
|
|
|
span {
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
2019-02-03 19:47:02 +00:00
|
|
|
}
|
2018-12-20 20:20:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.side-drawer-click-outside-closed {
|
|
|
|
flex: 0 0 0;
|
2018-12-15 17:13:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.side-drawer-closed {
|
2019-01-27 06:27:41 +00:00
|
|
|
transform: translate(-100%);
|
2018-12-15 17:13:01 +00:00
|
|
|
}
|
|
|
|
|
2018-12-23 17:50:19 +00:00
|
|
|
.side-drawer-heading {
|
|
|
|
background: transparent;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: stretch;
|
|
|
|
display: flex;
|
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
2018-12-15 17:13:01 +00:00
|
|
|
}
|
2018-12-23 17:50:19 +00:00
|
|
|
|
2018-12-15 17:13:01 +00:00
|
|
|
.side-drawer ul {
|
|
|
|
list-style: none;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
2018-12-29 10:44:21 +00:00
|
|
|
|
|
|
|
border-bottom: 1px solid;
|
|
|
|
border-color: $fallback--border;
|
|
|
|
border-color: var(--border, $fallback--border);
|
|
|
|
margin: 0.2em 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.side-drawer ul:last-child {
|
|
|
|
border: 0;
|
2018-12-15 17:13:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.side-drawer li {
|
|
|
|
padding: 0;
|
|
|
|
|
2018-12-23 17:50:19 +00:00
|
|
|
a {
|
|
|
|
display: block;
|
2018-12-28 19:39:54 +00:00
|
|
|
padding: 0.5em 0.85em;
|
2018-12-15 17:13:01 +00:00
|
|
|
|
2018-12-23 17:50:19 +00:00
|
|
|
&:hover {
|
|
|
|
background-color: $fallback--lightBg;
|
|
|
|
background-color: var(--lightBg, $fallback--lightBg);
|
|
|
|
}
|
2018-12-15 17:13:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|