2019-05-22 06:26:05 +00:00
|
|
|
<template lang="html">
|
|
|
|
<div v-if="gameId && games[gameId]" :class="gameCardClass">
|
|
|
|
<div class="game-info">
|
|
|
|
<a v-text="game.name" @click="openDetails"/>
|
2019-06-21 19:13:59 +00:00
|
|
|
<i class="fas fa-grip-vertical game-drag-handle" />
|
2019-05-22 06:26:05 +00:00
|
|
|
|
|
|
|
<game-rating
|
|
|
|
v-if="showGameRatings && list.view !== 'covers'"
|
|
|
|
:rating="game.rating"
|
|
|
|
small
|
|
|
|
@click.native="openDetails"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<i
|
|
|
|
v-if="note"
|
|
|
|
:title="note"
|
|
|
|
class="fas fa-sticky-note note"
|
|
|
|
@click="openDetails"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<div class="game-tags" v-if="hasTags">
|
|
|
|
<div
|
|
|
|
v-for="({ games, hex }, name) in tags"
|
|
|
|
:key="name"
|
|
|
|
v-if="games.includes(game.id)"
|
|
|
|
>
|
|
|
|
<tag
|
|
|
|
v-if="games.includes(game.id)"
|
|
|
|
:label="name"
|
|
|
|
:hex="hex"
|
|
|
|
readonly
|
|
|
|
@action="openTags"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import GameRating from '@/components/GameDetail/GameRating';
|
|
|
|
import GameCardUtils from '@/components/GameCards/GameCard';
|
2019-08-06 22:45:59 +00:00
|
|
|
import Tag from '@/components/Tag';
|
2019-05-22 06:26:05 +00:00
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
GameRating,
|
|
|
|
Tag,
|
|
|
|
},
|
|
|
|
|
|
|
|
mixins: [GameCardUtils],
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" rel="stylesheet/scss" scoped>
|
2019-09-10 20:02:16 +00:00
|
|
|
@import "~styles/styles";
|
2019-05-22 06:26:05 +00:00
|
|
|
|
|
|
|
$gameCoverWidth: 80px;
|
|
|
|
|
|
|
|
.game-card {
|
|
|
|
background-color: $color-white;
|
|
|
|
margin-top: $gp / 2;
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
&.card-placeholder {
|
|
|
|
background: $color-light-gray;
|
|
|
|
outline: 1px dashed $color-gray;
|
|
|
|
opacity: 0.6;
|
|
|
|
|
|
|
|
.game-card-options {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.dark {
|
|
|
|
background: $color-gray;
|
|
|
|
}
|
|
|
|
|
|
|
|
.game-info {
|
|
|
|
padding: $gp / 3 $gp / 2;
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
.game-tags {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
align-items: center;
|
|
|
|
margin-top: $gp / 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
i.tags {
|
|
|
|
position: absolute;
|
|
|
|
bottom: $gp * 1.5;
|
|
|
|
right: $gp / 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
.game-rating, a {
|
|
|
|
display: inline-flex;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
a {
|
|
|
|
text-decoration: underline;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
a {
|
|
|
|
color: $color-darkest-gray;
|
|
|
|
cursor: pointer;
|
|
|
|
margin-right: $gp / 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.game-drag-handle {
|
|
|
|
@include drag-cursor;
|
|
|
|
position: absolute;
|
|
|
|
color: $color-light-gray;
|
|
|
|
right: $gp / 3;
|
|
|
|
top: $gp / 3;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: $color-gray;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.tags {
|
|
|
|
color: $color-light-gray;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: $color-blue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.game-tag {
|
|
|
|
margin-bottom: $gp / 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.note {
|
|
|
|
color: $color-orange;
|
|
|
|
}
|
|
|
|
</style>
|