summaryrefslogtreecommitdiff
path: root/src/components/Navigation.vue
blob: 9f4e530209d370c3ae3fe30a4a4459a8676c1018 (plain) (blame)
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<template>
	<nav class="nav" id="nav">
		<a href="#nav" class="hamburger"></a>
		<div>
			<ul>
				<li><router-link :class="{ 'custom-active': isHome }" :to="{ name: 'home' }">Home</router-link></li>
				<li><router-link :to="{ name: 'registration' }">Create Account</router-link></li>
				<li><a href="https://wiki.themanaworld.org/index.php/Downloads">Download</a></li>
				<li><router-link :to="{ name: 'about' }">About</router-link></li>
				<li><a href="https://wiki.themanaworld.org/index.php/FAQ">FAQ</a></li> <!-- we might want to put FAQ under About, or put About on the wiki -->
				<li><router-link :class="{ 'custom-active': isSupport }" :to="{ name: 'support' }">Support</router-link></li>
				<li><a href="https://wiki.themanaworld.org/">Wiki</a></li>
				<li><a href="https://forums.themanaworld.org/">Forums</a></li>
			</ul>
		</div>
		<div class="server">
			<span>Server Status</span>
			<ServerStatus class="status"/>
		</div>
		<div class="screenshots">
			<a href="https://wiki.themanaworld.org/index.php/Screenshots">Screenshots</a>
		</div>
		<div>
			<span>Source Code</span>
			<ul>
				<li><a href="https://github.com/themanaworld">The Mana World</a></li>
				<li><a href="https://gitlab.com/evol">Evol Online</a></li>
				<li><a href="https://gitlab.com/manaplus">ManaPlus</a></li>
				<li><a href="https://github.com/bjorn/tiled">Tiled</a></li>
			</ul>
		</div>
	</nav>
</template>

<style scoped>
.nav {
	background: #BA7A58;
	color: #2f2e32;
	border-radius: 0 0 15px 15px;
	padding: 15px;
	font-size: 14px;

	& .hamburger {
		position: absolute;
		top: 0.4vw;
		right: 2vw;
		font-size: 8vw;
		text-decoration: none;
		color: gray(50);
		z-index: 300;
		display: block;
	}

	& div {
		background: #CBA083;
		margin: 0;
		padding: 0;
		border-radius: 5px;
		border: solid 1px #2f2e32;
		margin-bottom: 13px;
		min-width: max(160px, 17ch);

		& ul {
			list-style: none;
			margin: 0;
			padding: 0;

			& li {
				margin-left: 0.8ch;
				margin-right: 0.8ch;

				&:first-of-type {
					margin-top: 0.8ch;
				}

				&:last-of-type {
					margin-bottom: 0.8ch;
				}
			}
		}

		& span {
			text-align: center;
			display: block;
			padding: 5px;
			border-bottom: solid 1px #2f2e32;
		}

		& a, & a:visited {
			color: #2f2e32;
			text-decoration: none;
			display: block;
			border: solid 1px #CBA083;
			padding: 1ch;

			&:hover, &.router-link-exact-active, &.custom-active {
				background-color: rgba(255,255,255,0.4);
				border: solid 1px #2f2e32;
			}
		}
	}

	& .server > .status {
		text-align: center;
		font-weight: bolder;
		border: 0;
		border-radius: 0 0 5px 5px;

		&:hover {
			background-color: rgba(255,255,255,0.4);
		}
	}

	& .screenshots {
		& a, & a:visited {
			background: url(../assets/screenshot-thumb.webp) no-repeat center center #CBA083;
			border: 1px solid #784f3f;
			margin: 5px auto;
			padding: 0;
			width: 133px;
			height: 100px;
			color: rgba(0, 0, 0, 0);

			&:hover {
				opacity: 0.8;
			}
		}
	}
}

@media (min-width: 1100px) {
	.nav {
		border-radius: 0 15px 15px 0;

		& .hamburger {
			display: none;
		}
	}
}

@media (min-width: 460px) {
	.nav {
		& .hamburger {
			top: 3vw;
			right: 2vw;
			font-size: calc(1rem + 3vw);
		}
	}
}
</style>

<script lang="ts">
import { Options, Vue } from "vue-class-component";
import ServerStatus from "@/components/ServerStatus.vue";

@Options({
	components: {
		ServerStatus,
	},
	computed: {
		// XXX: find a better way to do this

		isSupport() {
			return this.$route.path.startsWith("/recover");
		},
		isHome() {
			return this.$route.path.startsWith("/news");
		}
	}
})
export default class NavigationV extends Vue {}
</script>