-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
single player games now are public and improve navigation
- Loading branch information
Showing
4 changed files
with
189 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,106 +1,108 @@ | ||
<script> | ||
import { useSessionStore } from '@/stores/sessionStore.js' | ||
import router from '@/router/router.js' | ||
export default { | ||
name: 'Navbar', | ||
data(){ | ||
return{ | ||
sessionStore: useSessionStore() | ||
} | ||
}, | ||
methods: { | ||
exit(){ | ||
this.sessionStore.user.isConnected = false | ||
router.push('/'); | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<template> | ||
|
||
<nav> | ||
<ul v-if="!this.sessionStore.user.isConnected" class="navbar"> | ||
<li> | ||
<router-link to="/login" class="navbar__link">Login</router-link> | ||
</li> | ||
<li> | ||
<router-link to="/play" class="navbar__link">Play</router-link> | ||
</li> | ||
<li> | ||
<router-link to="/about" class="navbar__link">About</router-link> | ||
</li> | ||
</ul> | ||
|
||
|
||
<ul v-if="this.sessionStore.user.isConnected" class="navbar navbar--mod"> | ||
<li> | ||
<router-link to="/games" class="navbar__link navbar__link--mod">Games</router-link> | ||
</li> | ||
<li> | ||
<router-link to="/create" class="navbar__link navbar__link--mod" >Create</router-link> | ||
</li> | ||
|
||
<li class="navbar__submenu"> | ||
<router-link to="/profile" class="navbar__link navbar__link--mod" >Comunnity</router-link> | ||
</li> | ||
<li> | ||
<a @click="exit" class="navbar__link pointer navbar__link pointer--mod" >Exit</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
|
||
<!--For mobile--> | ||
<nav class= "hambmenu" v-if="!this.sessionStore.isConnected"> | ||
<article class="hambmenu__icon"> | ||
<input aria-label="drop menu on mobiles" type="checkbox" class="hambmenu__check"> | ||
<label for="hambmenu__check"> | ||
<img src="../../public/hambmenu.svg" | ||
alt="Menu icon" | ||
class="hambmenu__img"> | ||
</label> | ||
|
||
<ul class="hambmenu__submenu" v-if="!sessionStore.user.isConnected"> | ||
<li> | ||
<router-link to="/" aria-current="page" class="navbar__link">Home</router-link> | ||
</li> | ||
<li> | ||
<router-link to="/play" class="navbar__link">Play</router-link> | ||
</li> | ||
<li> | ||
<router-link to="/about" class="navbar__link">About</router-link> | ||
</li> | ||
</ul> | ||
</article> | ||
|
||
</nav> | ||
|
||
<nav class= "hambmenu hambmenu--mod" v-if="this.sessionStore.user.isConnected"> | ||
<article class="hambmenu__icon hambmenu__icon--mod"> | ||
<input aria-label="drop menu on mobiles" type="checkbox" class="hambmenu__check"> | ||
<label for="hambmenu__check"> | ||
<img src="../../public/hambmenu.svg" | ||
alt="Menu icon" | ||
class="hambmenu__img"> | ||
</label> | ||
<ul class="hambmenu__submenu hambmenu__submenu--mod"> | ||
<li> | ||
<router-link to="/games" class="navbar__link">Games</router-link> | ||
</li> | ||
<li> | ||
<router-link to="/create" class="navbar__link" >Create</router-link> | ||
</li> | ||
<li class="navbar__submenu"> | ||
<router-link to="/profile" class="navbar__link">Comunnity</router-link> | ||
</li> | ||
<li> | ||
<a @click="exit" class="navbar__link pointer" >Exit</a> | ||
</li> | ||
</ul> | ||
</article> | ||
|
||
</nav> | ||
|
||
</template> | ||
<script> | ||
import { useSessionStore } from '@/stores/sessionStore.js' | ||
import router from '@/router/router.js' | ||
export default { | ||
name: 'Navbar', | ||
data(){ | ||
return{ | ||
sessionStore: useSessionStore() | ||
} | ||
}, | ||
methods: { | ||
exit(){ | ||
this.sessionStore.user.isConnected = false | ||
router.push('/'); | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<template> | ||
|
||
<!--DESKTOP--> | ||
<!--no connected--> | ||
<nav> | ||
<ul v-if="!this.sessionStore.user.isConnected" class="navbar"> | ||
<li> | ||
<router-link to="/play" class="navbar__link">Play</router-link> | ||
</li> | ||
<li> | ||
<router-link to="/profile" class="navbar__link">Community</router-link> | ||
</li> | ||
<li> | ||
<router-link to="/about" class="navbar__link">About</router-link> | ||
</li> | ||
</ul> | ||
<!--connected--> | ||
<ul v-if="this.sessionStore.user.isConnected" class="navbar navbar--mod"> | ||
<li> | ||
<router-link to="/play" class="navbar__link navbar__link--mod">Play</router-link> | ||
</li> | ||
<li> | ||
<router-link to="/create" class="navbar__link navbar__link--mod" >Create</router-link> | ||
</li> | ||
<li class="navbar__submenu"> | ||
<router-link to="/profile" class="navbar__link navbar__link--mod" >Comunnity</router-link> | ||
</li> | ||
<li> | ||
<a @click="exit" class="navbar__link pointer navbar__link pointer--mod" >Exit</a> | ||
</li> | ||
</ul> | ||
</nav> | ||
|
||
<!--TABLET/MOBILE--> | ||
<!--no connected--> | ||
<nav class= "hambmenu" v-if="!this.sessionStore.isConnected"> | ||
<article class="hambmenu__icon"> | ||
<input aria-label="drop menu on mobiles" type="checkbox" class="hambmenu__check"> | ||
<label for="hambmenu__check"> | ||
<img src="../../public/hambmenu.svg" | ||
alt="Menu icon" | ||
class="hambmenu__img"> | ||
</label> | ||
|
||
<ul class="hambmenu__submenu" v-if="!sessionStore.user.isConnected"> | ||
<li> | ||
<router-link to="/play" class="navbar__link">Play</router-link> | ||
</li> | ||
<li> | ||
<router-link to="/profile" class="navbar__link">Community</router-link> | ||
</li> | ||
<li> | ||
<router-link to="/about" class="navbar__link">About</router-link> | ||
</li> | ||
</ul> | ||
</article> | ||
|
||
</nav> | ||
|
||
<!--connected--> | ||
<nav class= "hambmenu hambmenu--mod" v-if="this.sessionStore.user.isConnected"> | ||
<article class="hambmenu__icon hambmenu__icon--mod"> | ||
<input aria-label="drop menu on mobiles" type="checkbox" class="hambmenu__check"> | ||
<label for="hambmenu__check"> | ||
<img src="../../public/hambmenu.svg" | ||
alt="Menu icon" | ||
class="hambmenu__img"> | ||
</label> | ||
<ul class="hambmenu__submenu hambmenu__submenu--mod"> | ||
<li> | ||
<router-link to="/play" class="navbar__link">Play</router-link> | ||
</li> | ||
<li> | ||
<router-link to="/create" class="navbar__link" >Create</router-link> | ||
</li> | ||
<li class="navbar__submenu"> | ||
<router-link to="/profile" class="navbar__link">Comunnity</router-link> | ||
</li> | ||
<li> | ||
<a @click="exit" class="navbar__link pointer" >Exit</a> | ||
</li> | ||
</ul> | ||
</article> | ||
|
||
</nav> | ||
|
||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,71 @@ | ||
<script> | ||
import BigButtonsMenu from '@/components/BigButtonsMenu.vue' | ||
import router from '@/router/router.js' | ||
import { useSessionStore } from '@/stores/sessionStore.js' | ||
import { v4 as uuidv4 } from 'uuid'; | ||
export default { | ||
name: 'Games', | ||
components: { BigButtonsMenu }, | ||
data(){ | ||
return{ | ||
roomID: null | ||
} | ||
}, | ||
methods: { | ||
router() { | ||
return router | ||
}, | ||
generateRoomID(){ | ||
useSessionStore().user.createdRoomID = uuidv4().split('-')[4] | ||
useSessionStore().user.roomAdmin = true | ||
this.router().push('/room') | ||
}, | ||
joinToExistingRoom(){ | ||
useSessionStore().user.joinedRoomID = this.roomID | ||
this.router().push('/room') | ||
} | ||
}, | ||
} | ||
</script> | ||
|
||
<template> | ||
|
||
<section class="games"> | ||
|
||
<article class="games__content"> | ||
<div class="games__container"> | ||
<img class="games__hand" src="/public/Vectorhand.svg" alt="hand doodle"> | ||
</div> | ||
<BigButtonsMenu></BigButtonsMenu> | ||
<div class="games__container games__container--mod"> | ||
<img class="games__daydream" src="/public/Vectordaydream.svg" alt="hand doodle"> | ||
</div> | ||
</article> | ||
|
||
<article class="multi"> | ||
<h3 class="multi__title">Multiplayer</h3> | ||
|
||
<form class="multi__join"> | ||
<input type="text" placeholder="Room seed..." | ||
v-model="roomID" class="multi__input"> | ||
<button @click.prevent="joinToExistingRoom" class="multi__b-mod primary-button">Enter</button> | ||
</form> | ||
|
||
<div class="multi__create"> | ||
<h3 class="">Or create new one</h3> | ||
<button @click="generateRoomID" class="multi__new"> | ||
<img class="multi__box" alt="doodle of a box" src="/public/Vectorbox.svg"> | ||
</button> | ||
</div> | ||
|
||
</article> | ||
|
||
</section> | ||
|
||
|
||
</template> | ||
<script> | ||
import BigButtonsMenu from '@/components/BigButtonsMenu.vue' | ||
import router from '@/router/router.js' | ||
import { useSessionStore } from '@/stores/sessionStore.js' | ||
import { v4 as uuidv4 } from 'uuid'; | ||
export default { | ||
name: 'Games', | ||
components: { BigButtonsMenu }, | ||
data(){ | ||
return{ | ||
roomID: null | ||
} | ||
}, | ||
methods: { | ||
router() { | ||
return router | ||
}, | ||
generateRoomID(){ | ||
useSessionStore().user.createdRoomID = uuidv4().split('-')[4] | ||
useSessionStore().user.roomAdmin = true | ||
this.router().push('/room') | ||
}, | ||
joinToExistingRoom(){ | ||
useSessionStore().user.joinedRoomID = this.roomID | ||
this.router().push('/room') | ||
} | ||
}, | ||
} | ||
</script> | ||
|
||
<template> | ||
|
||
<section class="games"> | ||
|
||
<article class="games__content"> | ||
<div class="games__container"> | ||
<img class="games__hand" src="/public/Vectorhand.svg" alt="hand doodle"> | ||
</div> | ||
<BigButtonsMenu></BigButtonsMenu> | ||
<div class="games__container games__container--mod"> | ||
<img class="games__daydream" src="/public/Vectordaydream.svg" alt="hand doodle"> | ||
</div> | ||
</article> | ||
|
||
<article class="multi"> | ||
<h3 class="multi__title">Multiplayer</h3> | ||
|
||
<form class="multi__join"> | ||
<input type="text" placeholder="Room seed..." | ||
v-model="roomID" class="multi__input"> | ||
<button @click.prevent="joinToExistingRoom" class="multi__b-mod primary-button">Enter</button> | ||
</form> | ||
|
||
<div class="multi__create"> | ||
<h3 class="">Or create new one</h3> | ||
<button @click="generateRoomID" class="multi__new"> | ||
<img class="multi__box" alt="doodle of a box" src="/public/Vectorbox.svg"> | ||
</button> | ||
</div> | ||
|
||
</article> | ||
|
||
</section> | ||
|
||
|
||
</template> |
Oops, something went wrong.