gamebrary/src/components/GameCards/GameCardText.vue

157 lines
3.1 KiB
Vue
Raw Normal View History

2019-05-22 06:26:05 +00:00
<template lang="html">
2019-11-14 21:10:10 +00:00
<div v-if="gameId && games[gameId]" :class="gameCardClass">
2019-11-08 20:34:06 +00:00
<div class="game-info">
2020-02-03 16:26:03 +00:00
<a v-text="game.name" class="drag-filter" @click="openDetails"/>
<i class="fas fa-grip-vertical draggable-icon game-drag-handle" />
2019-11-08 20:34:06 +00:00
<game-rating
v-if="showGameRatings && list.view !== 'covers'"
:rating="game.rating"
small
2020-02-03 16:26:03 +00:00
class="drag-filter"
2019-11-08 20:34:06 +00:00
@click.native="openDetails"
/>
<game-progress
v-if="gameProgress"
small
:progress="gameProgress"
2020-02-03 16:26:03 +00:00
class="drag-filter"
@click.native="openDetails"
/>
2019-11-08 20:34:06 +00:00
<i
v-if="note"
:title="note"
2020-02-03 16:26:03 +00:00
class="fas fa-sticky-note note drag-filter"
2019-11-08 20:34:06 +00:00
@click="openDetails"
/>
<div
v-if="hasTags"
2020-02-03 16:26:03 +00:00
class="game-tags drag-filter"
2019-11-14 21:10:10 +00:00
>
2019-11-08 20:34:06 +00:00
<div
v-for="({ games, hex, tagTextColor }, name) in tags"
2019-11-08 20:34:06 +00:00
v-if="games.includes(game.id)"
:key="name"
>
<tag
v-if="games.includes(game.id)"
:label="name"
:hex="hex"
:text-hex="tagTextColor"
2019-11-08 20:34:06 +00:00
readonly
@action="openTags"
/>
2019-05-22 06:26:05 +00:00
</div>
2019-11-08 20:34:06 +00:00
</div>
2019-05-22 06:26:05 +00:00
</div>
2019-11-08 20:34:06 +00:00
</div>
2019-05-22 06:26:05 +00:00
</template>
<script>
import GameRating from '@/components/GameDetail/GameRating';
import GameProgress from '@/components/GameDetail/GameProgress';
2019-05-22 06:26:05 +00:00
import GameCardUtils from '@/components/GameCards/GameCard';
2019-11-21 22:06:14 +00:00
import Tag from '@/components/Tag';
2019-05-22 06:26:05 +00:00
export default {
2019-11-08 19:56:03 +00:00
components: {
GameRating,
GameProgress,
2019-11-08 19:56:03 +00:00
Tag,
},
2019-05-22 06:26:05 +00:00
2019-11-08 19:56:03 +00:00
mixins: [GameCardUtils],
2019-05-22 06:26:05 +00:00
};
</script>
<style lang="scss" rel="stylesheet/scss" scoped>
2019-11-08 20:34:06 +00:00
@import "~styles/styles";
2019-05-22 06:26:05 +00:00
2019-11-08 20:34:06 +00:00
$gameCoverWidth: 80px;
2019-05-22 06:26:05 +00:00
2019-11-08 20:34:06 +00:00
.game-card {
background: var(--game-card-background);
margin-bottom: $gp / 2;
position: relative;
border-radius: var(--border-radius);
2019-11-08 20:34:06 +00:00
min-height: 50px;
overflow: hidden;
2019-05-22 06:26:05 +00:00
2019-11-08 20:34:06 +00:00
&.card-placeholder {
background: #e5e5e5;
outline: 1px dashed #a5a2a2;
2020-02-03 16:26:03 +00:00
opacity: 0.3;
2019-05-22 06:26:05 +00:00
2019-11-08 20:34:06 +00:00
.game-card-options {
display: none;
}
}
2019-05-22 06:26:05 +00:00
2019-11-08 20:34:06 +00:00
.game-info {
padding: $gp / 3 $gp / 2;
width: 100%;
display: flex;
flex-direction: column;
2020-02-03 16:26:03 +00:00
align-items: flex-start;
2019-11-08 20:34:06 +00:00
.game-tags {
display: flex;
flex-wrap: wrap;
align-items: center;
margin-top: $gp / 4;
}
2019-11-26 21:34:53 +00:00
.tag {
margin-right: $gp / 4;
}
2019-11-08 20:34:06 +00:00
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;
2019-05-22 06:26:05 +00:00
}
2019-11-08 20:34:06 +00:00
}
2019-05-22 06:26:05 +00:00
2019-11-08 20:34:06 +00:00
a {
cursor: pointer;
margin-right: $gp / 2;
color: var(--game-card-text-color);
}
}
2019-05-22 06:26:05 +00:00
2020-02-03 16:26:03 +00:00
.draggable-icon {
2019-11-08 20:34:06 +00:00
@include drag-cursor;
position: absolute;
color: #e5e5e5;
right: $gp / 3;
top: $gp / 3;
2019-05-22 06:26:05 +00:00
2019-11-08 20:34:06 +00:00
&:hover {
color: #a5a2a2;
}
2019-05-22 06:26:05 +00:00
}
2019-11-08 20:34:06 +00:00
.game-tag {
margin-bottom: $gp / 3;
2019-05-22 06:26:05 +00:00
}
2019-11-08 20:34:06 +00:00
}
.note {
color: var(--note-color);
}
2019-05-22 06:26:05 +00:00
</style>
2019-11-08 20:34:06 +00:00