aboutsummaryrefslogtreecommitdiff
path: root/src/components/side_drawer/side_drawer.vue
blob: b5f399b5d6dc860929b58c1ece275230464d55f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<template>
  <div class="side-drawer-container" :class="{'side-drawer-container-closed': closed, 'side-drawer-container-open': !closed}">
    <div class="panel panel-default side-drawer" :class="{'side-drawer-closed': closed}">
      <ul>
        <li v-if='currentUser'>
          <a href="#" @click="gotoPanel('poststatus')">poststatus</a>
        </li>
        <li v-if='currentUser'>
          <a href="#" @click="gotoPanel('notifications')">notifications</a>
        </li>
        <li v-if='currentUser'>
          <router-link @click.native="gotoPanel('timeline')" to='/main/friends'>
            {{ $t("nav.timeline") }}
          </router-link>
        </li>
        <li v-if='currentUser'>
          <router-link @click.native="gotoPanel('timeline')" :to="{ name: 'mentions', params: { username: currentUser.screen_name } }">
            {{ $t("nav.mentions") }}
          </router-link>
        </li>
        <li v-if='currentUser'>
          <router-link @click.native="gotoPanel('timeline')" :to="{ name: 'dms', params: { username: currentUser.screen_name } }">
            {{ $t("nav.dms") }}
          </router-link>
        </li>
        <li v-if='currentUser && currentUser.locked'>
          <router-link @click.native="gotoPanel('timeline')" to='/friend-requests'>
            {{ $t("nav.friend_requests") }}
          </router-link>
        </li>
        <li>
          <router-link @click.native="gotoPanel('timeline')" to='/main/public'>
            {{ $t("nav.public_tl") }}
          </router-link>
        </li>
        <li>
          <router-link @click.native="gotoPanel('timeline')" to='/main/all'>
            {{ $t("nav.twkn") }}
          </router-link>
        </li>
      </ul>
    </div>
    <div class="side-drawer-click-outside" @click.stop.prevent="clickedOutside" :class="{'side-drawer-click-outside-closed': closed}"></div>
  </div>
</template>

<script src="./side_drawer.js" ></script>

<style lang="scss">
@import '../../_variables.scss';

.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%;
}

.side-drawer {
  overflow-x: hidden; /* Disable horizontal scroll */
  transition: 0.5s; /* 0.5 second transition effect to slide in the sidenav */
  transition-timing-function: cubic-bezier(0, 1, 0.5, 1);
  margin: 0 0 0 -100px;
  padding: 0 0 0 100px;
  width: 75%;
  flex: 0 0 75%;
}

.side-drawer-click-outside-closed {
  flex: 0 0 0;
}

.side-drawer-closed {
  margin: 0 0 0 calc(-100% - 100px);
}

.side-drawer .panel {
  overflow: hidden;
  margin: 0;
}
.side-drawer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-drawer li {
  border-bottom: 1px solid;
  border-color: $fallback--border;
  border-color: var(--border, $fallback--border);
  padding: 0;

  &:first-child a {
    border-top-right-radius: $fallback--panelRadius;
    border-top-right-radius: var(--panelRadius, $fallback--panelRadius);
    border-top-left-radius: $fallback--panelRadius;
    border-top-left-radius: var(--panelRadius, $fallback--panelRadius);
  }

  &:last-child a {
    border-bottom-right-radius: $fallback--panelRadius;
    border-bottom-right-radius: var(--panelRadius, $fallback--panelRadius);
    border-bottom-left-radius: $fallback--panelRadius;
    border-bottom-left-radius: var(--panelRadius, $fallback--panelRadius);
  }
}

.side-drawer li:last-child {
  border: none;
}

.side-drawer a {
  display: block;
  padding: 0.8em 0.85em;

  &:hover {
    background-color: $fallback--lightBg;
    background-color: var(--lightBg, $fallback--lightBg);
  }

  &.router-link-active {
    font-weight: bolder;
    background-color: $fallback--lightBg;
    background-color: var(--lightBg, $fallback--lightBg);

    &:hover {
      text-decoration: underline;
    }
  }
}
</style>