mirror of
https://github.com/romancm/gamebrary
synced 2024-12-22 17:13:09 +00:00
d2a3f78942
* Copy GameNotes and use it as boilerplate * Save and display progress data * Save and display progress data * Mobile adjustments and add label * Mobile adjustments and add label * save progress as integer * Add sorting by progress * Display progress on select GameCards * Fix `progress()` return * Reduce amount of props * Copy change * remove unnecessary check * use `input[type=range]` * remove unnecessary check * Add progress-pie in the Grid view Credit goes to @oliviale for her lovely CSS progress pie * Save and display progress data * Add progress-pie in the Grid view Credit goes to @oliviale for her lovely CSS progress pie * fix rebase conflict * add translation * Fixed merge conflict typo
220 lines
4 KiB
Vue
220 lines
4 KiB
Vue
<template lang="html">
|
|
<div
|
|
v-if="gameId && games[gameId]"
|
|
:class="gameCardClass"
|
|
>
|
|
<img
|
|
:src="coverUrl"
|
|
:alt="game.name"
|
|
@click="openDetails"
|
|
>
|
|
|
|
<div :class="{ 'game-info': showGameInfo }" >
|
|
<div
|
|
v-if="showGameInfo && progress"
|
|
class="title-progress"
|
|
>
|
|
<a
|
|
v-text="game.name"
|
|
@click="openDetails"
|
|
/>
|
|
|
|
<game-rating
|
|
v-if="showGameRatings"
|
|
:rating="game.rating"
|
|
small
|
|
@click.native="openDetails"
|
|
/>
|
|
|
|
<game-progress
|
|
small
|
|
pie
|
|
@click.native="openDetails"
|
|
/>
|
|
|
|
<i
|
|
v-if="note"
|
|
:title="note"
|
|
class="fas fa-sticky-note note"
|
|
@click="openDetails"
|
|
/>
|
|
</div>
|
|
|
|
<a
|
|
v-if="showGameInfo && !progress"
|
|
v-text="game.name"
|
|
@click="openDetails"
|
|
/>
|
|
|
|
<i class="fas fa-grip-vertical game-drag-handle" />
|
|
|
|
<game-rating
|
|
v-if="showGameInfo && showGameRatings && !progress"
|
|
:rating="game.rating"
|
|
small
|
|
@click.native="openDetails"
|
|
/>
|
|
|
|
<i
|
|
v-if="showGameInfo && note && !progress"
|
|
:title="note"
|
|
class="fas fa-sticky-note note"
|
|
@click="openDetails"
|
|
/>
|
|
|
|
<div v-if="showGameInfo && hasTags" class="game-tags">
|
|
|
|
<div
|
|
v-for="({ games, hex, tagTextColor }, name) in tags"
|
|
v-if="showGameInfo && games.includes(game.id)"
|
|
:key="name"
|
|
>
|
|
<tag
|
|
v-if="games.includes(game.id)"
|
|
:label="name"
|
|
:hex="hex"
|
|
:text-hex="tagTextColor"
|
|
readonly
|
|
@action="openTags"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import GameRating from '@/components/GameDetail/GameRating';
|
|
import GameProgress from '@/components/GameDetail/GameProgress';
|
|
import GameCardUtils from '@/components/GameCards/GameCard';
|
|
import Tag from '@/components/Tag';
|
|
|
|
export default {
|
|
components: {
|
|
GameRating,
|
|
GameProgress,
|
|
Tag,
|
|
},
|
|
|
|
mixins: [GameCardUtils],
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss" rel="stylesheet/scss" scoped>
|
|
@import "~styles/styles";
|
|
|
|
.game-card {
|
|
display: flex;
|
|
flex-direction: column;
|
|
position: relative;
|
|
border-radius: $border-radius;
|
|
overflow: hidden;
|
|
cursor: pointer;
|
|
|
|
&.card-placeholder {
|
|
background: var(--game-card-background);
|
|
opacity: 0.3;
|
|
|
|
.game-card-options {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
img {
|
|
width: 100%;
|
|
height: 185px;
|
|
object-fit: cover;
|
|
display: flex;
|
|
align-self: center;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.game-info {
|
|
padding: $gp / 2;
|
|
width: 100%;
|
|
display: flex;
|
|
border-bottom-left-radius: $border-radius;
|
|
border-bottom-right-radius: $border-radius;
|
|
flex-direction: column;
|
|
background: var(--game-card-background);
|
|
|
|
.game-tags {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
margin-top: $gp / 4;
|
|
}
|
|
|
|
.tag {
|
|
margin-right: $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 {
|
|
display: block;
|
|
white-space: nowrap;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
cursor: pointer;
|
|
margin-right: $gp / 2;
|
|
color: var(--game-card-text-color);
|
|
}
|
|
|
|
.title-progress {
|
|
display: grid;
|
|
grid-template: auto auto / auto auto;
|
|
|
|
a {
|
|
grid-column: 1;
|
|
}
|
|
|
|
.game-rating {
|
|
grid-column: 1;
|
|
grid-row: 2;
|
|
}
|
|
|
|
.game-progresses {
|
|
justify-self: end;
|
|
grid-column: 2;
|
|
grid-row: span 2;
|
|
}
|
|
}
|
|
}
|
|
|
|
.game-drag-handle {
|
|
@include drag-cursor;
|
|
position: absolute;
|
|
color: #e5e5e5;
|
|
right: $gp / 3;
|
|
top: $gp / 3;
|
|
|
|
&:hover {
|
|
color: #a5a2a2;
|
|
}
|
|
}
|
|
|
|
.game-tag {
|
|
margin-bottom: $gp / 3;
|
|
}
|
|
}
|
|
|
|
.note {
|
|
color: var(--note-color);
|
|
}
|
|
</style>
|