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 {
|
2019-10-09 16:30:07 +00:00
|
|
|
background: var(--game-card-background);
|
2019-10-06 14:08:53 +00:00
|
|
|
margin-bottom: $gp / 2;
|
2019-05-22 06:26:05 +00:00
|
|
|
position: relative;
|
2019-09-11 19:06:42 +00:00
|
|
|
border-radius: $border-radius;
|
2019-10-18 20:01:36 +00:00
|
|
|
min-height: 50px;
|
2019-05-22 06:26:05 +00:00
|
|
|
|
|
|
|
&.card-placeholder {
|
2019-10-09 16:30:07 +00:00
|
|
|
background: #e5e5e5;
|
|
|
|
outline: 1px dashed #a5a2a2;
|
2019-05-22 06:26:05 +00:00
|
|
|
opacity: 0.6;
|
|
|
|
|
|
|
|
.game-card-options {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.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 {
|
|
|
|
cursor: pointer;
|
|
|
|
margin-right: $gp / 2;
|
2019-10-09 16:30:07 +00:00
|
|
|
color: var(--game-card-text-color);
|
2019-05-22 06:26:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.game-drag-handle {
|
|
|
|
@include drag-cursor;
|
|
|
|
position: absolute;
|
2019-10-09 16:30:07 +00:00
|
|
|
color: #e5e5e5;
|
2019-05-22 06:26:05 +00:00
|
|
|
right: $gp / 3;
|
|
|
|
top: $gp / 3;
|
|
|
|
|
|
|
|
&:hover {
|
2019-10-09 16:30:07 +00:00
|
|
|
color: #a5a2a2;
|
2019-05-22 06:26:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.game-tag {
|
|
|
|
margin-bottom: $gp / 3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.note {
|
2019-10-09 16:30:07 +00:00
|
|
|
color: var(--note-color);
|
2019-05-22 06:26:05 +00:00
|
|
|
}
|
|
|
|
</style>
|