-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5111d5
commit dd1fb0a
Showing
6 changed files
with
125 additions
and
63 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
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
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
79 changes: 79 additions & 0 deletions
79
src/components/GameLobby/GameLobbyRolePickerModal/RolePickerRole.vue
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 |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<template> | ||
<div class="role-picker-role"> | ||
<div class="role-image-container" :class="{ selected }"> | ||
<div v-if="game.isRoleInGame(roleName)" | ||
v-tooltip="$t('RolePickerRole.totalInGameInThisRole')" | ||
class="role-count-in-game badge badge-light"> | ||
<i class="fa fa-chess-pawn mr-2"/> | ||
<span v-html="roleCountInGame"/> | ||
</div> | ||
<RoleImage :role="roleName"/> | ||
</div> | ||
<div v-if="roleName === 'back'" class="cursor-pointer"> | ||
<i class="fa fa-random mr-1"/> | ||
<span class="font-italic" v-html="$t('RolePickerRole.random')"/> | ||
</div> | ||
<RoleText v-else :role="roleName"/> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import RoleText from "@/components/shared/Game/Role/RoleText"; | ||
import RoleImage from "@/components/shared/Game/Role/RoleImage"; | ||
import Game from "@/classes/Game"; | ||
export default { | ||
name: "RolePickerRole", | ||
components: { RoleImage, RoleText }, | ||
props: { | ||
game: { | ||
type: Game, | ||
required: true, | ||
}, | ||
roleName: { | ||
type: String, | ||
required: true, | ||
}, | ||
selected: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
}, | ||
computed: { | ||
roleCountInGame() { | ||
return this.game.getPlayersWithRole(this.roleName).length; | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.role-image-container { | ||
border: 3px solid grey; | ||
border-radius: 8px; | ||
margin: 3px; | ||
transition: all 0.25s ease; | ||
cursor: pointer; | ||
.role-count-in-game { | ||
position: absolute; | ||
right: 2px; | ||
top: 2px; | ||
opacity: 0.8; | ||
transition: all 0.25s ease; | ||
z-index: 1; | ||
&:hover { | ||
opacity: 1; | ||
} | ||
} | ||
&:hover { | ||
border-color: #CACACA; | ||
} | ||
&.selected { | ||
border-color: #eeeeee; | ||
} | ||
} | ||
</style> |
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