11<template >
2- <div class =" sticky top-0 z-20 nav-bar" >
3- <nav class =" bg-white dark:bg-gray-800" >
4- <div class =" main-typo flex items-center" >
5- <nuxt-link
2+ <div class =" nav-bar" >
3+ <div :class =" `rainbow-border ${birdColor}`" />
4+ <nav class =" flex flex-col md:flex-row px-5 justify-between text-center items-center pt-10" >
5+ <div >
6+ <nuxt-link
67 to =" /"
78 v-html =" require('~/assets/images/logo.svg?raw')"
8- :class =" `logo-image relative ${birdColor}`"
9+ :class =" `logo-image w-8 h-8 relative ${birdColor}`"
910 ></nuxt-link >
10- <nuxt-link :to = " localePath('/') " >
11- < h1 >geofind.io</ h1 >
12- <p class = " hidden sm:inline-block dark:text-gray-200 " >
13- {{ $t('t.catchPhrase') }}
14- </ p >
11+ </ div >
12+ < div class = " w-full flex items-center text-center justify-center flex-col " >
13+ <nuxt-link :to = " localePath('/') " >
14+ < h1 class = " relative text-5xl flex md:flex md:text-7xl dark:text-gray-200 " >geofind.io</ h1 >
15+
1516 </nuxt-link >
16- </div >
17- <ul class =" nav-links" >
18- <li class =" hidden sm:flex" v-if =" false" >
19- <nuxt-link
20- class =" green"
21- active-class =" active"
22- :to =" localePath('/tutor')"
23- >
24- <Icon name =" school" />
25- {{ $t('singleplayer.button') }}
26- </nuxt-link >
27- </li >
28- <li class =" hidden sm:flex" >
29- <nuxt-link
30- class =" blue"
31- active-class =" active"
32- :to =" localePath('/multiplayer')"
33- >
34- <Icon name =" controller" />
35- {{ $t('multiplayer.button') }}
36- </nuxt-link >
37- </li >
38- <li class =" hidden lg:flex" >
39- <nuxt-link
40- class =" red"
41- active-class =" active"
42- :to =" localePath('/matchmaking')"
43- >
44- <Icon name =" cube" />
45- {{ $t('matchmaking.button') }}
46- </nuxt-link >
47- </li >
48- <li class =" hidden sm:flex" >
49- <nuxt-link
50- class =" purple"
51- active-class =" active"
52- :to =" localePath('/lobbies')"
53- >
54- <Icon name =" public" />
55- {{ $t('lobbies.button') }}
56- </nuxt-link >
57- </li >
58- <li class =" hidden md:flex" >
59- <nuxt-link
60- class =" yellow"
61- active-class =" active"
62- :to =" localePath('/profile')"
63- >
64- <Icon name =" profile" />
65- {{ $t('profile.button') }}
66- </nuxt-link >
67- </li >
68- </ul >
69- <div class =" flex sm:hidden flex-col justify-center items-center" >
70- <button @click =" toggleMenu" class =" menu" >
71- <div
72- v-if =" menu"
73- v-html =" require('~/assets/images/close.svg?raw')"
74- ></div >
75- <div v-else v-html =" require('~/assets/images/menu.svg?raw')" ></div >
76- {{ $t('t.menu') }}
77- </button >
78- </div >
17+ </div >
18+ <div v-if =" players" class =" justify-center text-center font-lucky text-2xl flex" >{{ players }} {{ $t('t.players') }} online</div >
19+
7920 </nav >
80- <div :class =" `rainbow-border ${birdColor}`" />
81- <div
82- v-if =" menu"
83- class =" menu-area relative z-20 bg-white-50 dark:bg-gray-800 pb-4"
84- >
85- <div class =" p-4" >
86- <Button
87- @click =" menu = false"
88- :icon =" true"
89- :to =" localePath('/tutor')"
90- v-if =" false"
91- variant =" green"
92- :animated =" true"
93- >
94- {{ $t('singleplayer.button') }}
95- </Button >
96- <Button
97- @click =" menu = false"
98- :icon =" true"
99- :to =" localePath('/multiplayer')"
100- variant =" blue"
101- :animated =" true"
102- >
103- <template #icon >
104- <Icon class =" text-white" :height =" 48" name =" create" />
105- </template >
106- {{ $t('multiplayer.button') }}
107- </Button >
108-
109- <Button
110- @click =" menu = false"
111- :icon =" true"
112- :to =" localePath('lobbies')"
113- variant =" purple"
114- :animated =" true"
115- >
116- <template #icon >
117- <Icon class =" text-white" :height =" 48" name =" public" />
118- </template >
119- {{ $t('lobbies.button') }}
120- </Button >
121- <Button
122- @click =" menu = false"
123- :icon =" true"
124- :to =" localePath('/matchmaking')"
125- variant =" red"
126- :animated =" true"
127- >
128- <template #icon >
129- <Icon class =" text-white" :height =" 48" name =" cube" />
130- </template >
131- {{ $t('matchmaking.button') }}
132- </Button >
133- <!-- <Button to="teachers" variant="blue" :animated="true">
134- <template #icon>👩🏫</template>
135- Teacher Zone
136- </Button>-->
137- <Button
138- @click =" menu = false"
139- :icon =" true"
140- :to =" localePath('profile')"
141- variant =" yellow"
142- :animated =" true"
143- >
144- <template #icon >
145- <Icon class =" text-white" :height =" 48" name =" profile" />
146- </template >
147- {{ $t('profile.button') }}
148- </Button >
149- <Button
150- @click =" menu = false"
151- :icon =" true"
152- :to =" localePath('achievements')"
153- variant =" orange"
154- :animated =" true"
155- >
156- <template #icon >
157- <Icon class =" text-white" :height =" 48" name =" school" />
158- </template >
159- {{ $t('achievements.button') }}
160- </Button >
161- </div >
162- </div >
16321 </div >
16422</template >
16523<script lang="ts">
@@ -170,6 +28,18 @@ import { Component, Watch } from 'vue-property-decorator'
17028export default class Navigation extends Vue {
17129 menu = false
17230 birdColor = ' bird-yellow border-yellow'
31+ players = 0 ;
32+ timer = null ;
33+ mounted(){
34+ this .timer = setInterval (() => {
35+ this .players = (window as any ).playersOnline ;
36+ }, 200 )
37+ }
38+
39+ beforeDestroy(){
40+ this .timer = null ;
41+ }
42+
17343
17444 @Watch (' $route' , { immediate: true })
17545 setBirdColor() {
@@ -215,21 +85,6 @@ export default class Navigation extends Vue {
21585}
21686 </script >
21787<style lang="postcss" scoped>
218- nav {
219- @apply py-3 flex sm :py-4 px-2 sm:px-4;
220- @apply justify-between w-full items-center relative top-0 z-50 shadow;
221- backdrop-filter : blur (15 px );
222- }
223-
224- .menu {
225- @apply flex justify-center flex-col items-center mt-2 pr-4 focus :outline-none dark:text-gray-200;
226- font-size : 14 px ;
227- }
228-
229- .menu-area {
230- height : calc (100 vh - 80 px );
231- }
232-
23388.rainbow-border {
23489 background : linear-gradient (
23590 90 deg ,
@@ -274,7 +129,6 @@ nav p {
274129}
275130
276131nav h1 {
277- @apply relative text-2xl flex sm :hidden md:flex md:text-4xl dark:text-gray-200;
278132 position : relative;
279133 top : -8 px ;
280134 line-height : 0 px ;
@@ -350,8 +204,6 @@ nav img {
350204
351205.logo-image svg {
352206 @apply mr-5;
353- width : 64 px ;
354- height : 64 px ;
355207}
356208
357209.logo-image svg .bird-stroke {
0 commit comments