gamebrary/src/components/GameDetail/GameDetailPlaceholder.vue

206 lines
4.4 KiB
Vue
Raw Normal View History

2019-01-11 20:20:21 +00:00
<template lang="html">
2020-08-15 00:00:55 +00:00
<b-card class="mt-4" no-body>
<b-tabs card>
<b-tab title="Game details" active>
<template v-slot:title>
<placeholder class="w-10 h-100" />
</template>
<dl class="row">
<dt class="col-sm-3">{{ $t('gameDetail.platforms') }}</dt>
<dd class="col-sm-9">
<placeholder class="w-75" />
</dd>
<dt class="col-sm-3">{{ $t('gameDetail.genres') }}</dt>
<dd class="col-sm-9">
<placeholder class="w-75" />
</dd>
<dt class="col-sm-3">{{ $t('gameDetail.gameModes') }}</dt>
<dd class="col-sm-9">
<placeholder class="w-75" />
</dd>
<dt class="col-sm-3">{{ $t('gameDetail.developers') }}</dt>
<dd class="col-sm-9">
<placeholder class="w-75" />
</dd>
<dt class="col-sm-3">{{ $t('gameDetail.publishers') }}</dt>
<dd class="col-sm-9">
<placeholder class="w-75" />
</dd>
<dt class="col-sm-3">{{ $t('gameDetail.perspective') }}</dt>
<dd class="col-sm-9">
<placeholder class="w-75" />
</dd>
<dt class="col-sm-3">{{ $t('gameDetail.timeToBeat') }}</dt>
<dd class="col-sm-9">
<placeholder class="w-75" />
</dd>
<dt class="col-sm-3">{{ $t('gameDetail.ageRatings') }}</dt>
<dd class="col-sm-9">
<placeholder class="w-75" />
</dd>
</dl>
</b-tab>
<b-tab title="Game details">
<template v-slot:title>
<placeholder class="w-10 h-100" />
</template>
</b-tab>
<b-tab title="Game details">
<template v-slot:title>
<placeholder class="w-10 h-100" />
</template>
</b-tab>
</b-tabs>
</b-card>
<!-- <div class="game-detail-placeholder">
2019-11-08 20:34:06 +00:00
<div class="game-hero" />
<div class="game-detail-container">
<div class="game-detail">
2019-11-14 21:10:10 +00:00
<img :src="coverUrl" :alt="gamePreviewData.name" class="game-cover">
2019-11-08 20:34:06 +00:00
<div>
<h2>{{ gamePreviewData.name }}</h2>
<placeholder :lines="3" />
2019-01-11 20:20:21 +00:00
</div>
2019-11-08 20:34:06 +00:00
</div>
2019-01-11 20:20:21 +00:00
</div>
2020-08-15 00:00:55 +00:00
</div> -->
2019-01-11 20:20:21 +00:00
</template>
<script>
2019-10-09 16:30:07 +00:00
import { mapState } from 'vuex';
import Placeholder from '@/components/Placeholder';
2019-01-11 20:20:21 +00:00
export default {
2019-11-08 19:56:03 +00:00
components: {
Placeholder,
},
2019-01-17 06:21:41 +00:00
2019-11-08 19:56:03 +00:00
props: {
2019-11-08 20:34:06 +00:00
id: {
type: [Number, String],
default: null,
},
2019-11-08 19:56:03 +00:00
},
2019-05-03 04:53:16 +00:00
2019-11-08 19:56:03 +00:00
computed: {
...mapState(['games']),
2019-05-03 04:53:16 +00:00
2019-11-08 19:56:03 +00:00
gamePreviewData() {
return this.games[this.id];
},
2019-05-03 04:53:16 +00:00
2019-11-08 19:56:03 +00:00
coverUrl() {
const game = this.games[this.id];
2019-05-03 04:53:16 +00:00
2019-11-08 19:56:03 +00:00
return game.cover && game.cover.image_id
? `https://images.igdb.com/igdb/image/upload/t_cover_small_2x/${game.cover.image_id}.jpg`
: '/static/no-image.jpg';
2019-01-17 06:21:41 +00:00
},
2019-11-08 19:56:03 +00:00
},
2019-01-11 20:20:21 +00:00
};
</script>
<style lang="scss" rel="stylesheet/scss" scoped>
2020-07-22 20:44:48 +00:00
// @import "~styles/styles";
2019-01-11 20:20:21 +00:00
2019-11-08 20:34:06 +00:00
.game-detail-placeholder {
2019-01-11 20:20:21 +00:00
display: flex;
justify-content: center;
2019-10-09 16:30:07 +00:00
background: var(--modal-background);
2020-07-22 20:44:48 +00:00
min-height: calc(100vh - 48px);
2019-11-08 20:34:06 +00:00
}
2019-01-11 20:20:21 +00:00
2019-11-08 20:34:06 +00:00
.game-hero {
2019-01-11 20:20:21 +00:00
position: absolute;
width: 100%;
left: 0;
height: 400px;
z-index: 2;
2019-01-11 20:20:21 +00:00
2020-07-22 20:44:48 +00:00
@media(max-width: 780px) {
2019-11-08 20:34:06 +00:00
display: none;
2019-01-11 20:20:21 +00:00
}
2019-11-08 20:34:06 +00:00
}
2019-01-11 20:20:21 +00:00
2019-11-08 20:34:06 +00:00
.game-cover {
2019-10-09 16:30:07 +00:00
border: 5px solid #a5a2a2;
2019-05-03 04:57:20 +00:00
background-size: contain;
width: 100%;
height: auto;
2020-07-22 20:44:48 +00:00
@media(max-width: 780px) {
2019-11-08 20:34:06 +00:00
border: 3px solid #a5a2a2;
height: auto;
width: auto;
min-width: auto;
max-width: 100%;
2019-05-03 04:57:20 +00:00
}
2019-11-08 20:34:06 +00:00
}
2019-05-03 04:57:20 +00:00
2019-11-08 20:34:06 +00:00
.game-detail-container {
2019-10-09 16:30:07 +00:00
-webkit-box-shadow: 0 0 2px 0 #a5a2a2;
box-shadow: 0 0 2px 0 #a5a2a2;
2020-07-22 20:44:48 +00:00
width: 900px;
2019-01-11 20:20:21 +00:00
max-width: 100%;
z-index: 2;
2020-07-22 20:44:48 +00:00
margin: 3rem;
padding: 1rem 0;
border-radius: var(--border-radius);
2019-01-11 20:20:21 +00:00
2020-07-22 20:44:48 +00:00
@media(max-width: 780px) {
2019-11-08 20:34:06 +00:00
margin: 0;
2020-07-22 20:44:48 +00:00
padding-top: 3rem;
2019-11-08 20:34:06 +00:00
border-radius: 0;
2019-01-17 06:21:41 +00:00
}
2019-11-08 20:34:06 +00:00
}
2019-01-17 06:21:41 +00:00
2019-11-08 20:34:06 +00:00
.game-detail {
2019-01-17 06:21:41 +00:00
display: grid;
grid-template-columns: 180px auto;
2020-07-22 20:44:48 +00:00
grid-gap: 2rem;
margin: 0 1rem;
2019-01-17 06:21:41 +00:00
2020-07-22 20:44:48 +00:00
@media(max-width: 780px) {
2019-11-08 20:34:06 +00:00
grid-template-columns: auto;
2019-01-11 20:20:21 +00:00
}
2019-11-08 20:34:06 +00:00
}
2019-01-17 06:21:41 +00:00
2019-11-08 20:34:06 +00:00
.game-cover {
2019-01-17 06:21:41 +00:00
--placeholder-image-width: 175px;
--placeholder-image-height: 220px;
2019-01-11 20:20:21 +00:00
2020-07-22 20:44:48 +00:00
@media(max-width: 780px) {
2019-11-08 20:34:06 +00:00
--placeholder-image-width: 240px;
--placeholder-image-height: 300px;
width: 240px;
margin: 0 auto;
2019-01-11 20:20:21 +00:00
}
2019-11-08 20:34:06 +00:00
}
2019-01-17 06:21:41 +00:00
2019-11-08 20:34:06 +00:00
.game-title {
2019-01-17 06:21:41 +00:00
--placeholder-text-height: 30px;
width: 50%;
2019-01-11 20:20:21 +00:00
2020-07-22 20:44:48 +00:00
@media(max-width: 780px) {
2019-11-08 20:34:06 +00:00
width: 50%;
margin: 0 auto;
2019-01-11 20:20:21 +00:00
}
2019-11-08 20:34:06 +00:00
}
2019-02-08 06:13:48 +00:00
2019-11-08 20:34:06 +00:00
.game-rating {
2020-07-22 20:44:48 +00:00
margin-bottom: 1rem;
2019-11-08 20:34:06 +00:00
}
2019-01-11 20:20:21 +00:00
</style>