Preserving aspect ratio on release tiles.

This commit is contained in:
ThePendulum 2020-04-27 04:00:16 +02:00
parent f684923a8a
commit 79c7847f1c
5 changed files with 147 additions and 141 deletions

View File

@ -76,7 +76,7 @@ export default {
.tiles { .tiles {
width: 100%; width: 100%;
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(20rem, .25fr)); grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
grid-gap: 1rem; grid-gap: 1rem;
} }
@ -85,21 +85,15 @@ export default {
font-weight: bold; font-weight: bold;
} }
@media(max-width: $breakpoint4) {
.tiles {
grid-template-columns: repeat(auto-fit, minmax(20rem, .33fr));
}
}
@media(max-width: $breakpoint3) { @media(max-width: $breakpoint3) {
.tiles { .tiles {
grid-template-columns: repeat(auto-fit, minmax(20rem, .5fr)); grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
} }
} }
@media(max-width: $breakpoint) { @media(max-width: $breakpoint2) {
.tiles { .tiles {
grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
} }
} }
</style> </style>

View File

@ -113,8 +113,6 @@ export default {
&::before { &::before {
content: ''; content: '';
display: inline-block; display: inline-block;
width: 1px;
height: 0;
padding-bottom: 150%; padding-bottom: 150%;
} }
} }

View File

@ -1,10 +1,10 @@
<template> <template>
<div <div
:id="`${release.type}-${release.id}`" :id="`${release.type}-${release.id}`"
:class="{ [release.type]: true }"
class="tile" class="tile"
> >
<span class="poster"> <div class="scene">
<div class="poster">
<span class="details"> <span class="details">
<router-link <router-link
v-if="release.site && release.site.independent" v-if="release.site && release.site.independent"
@ -93,7 +93,7 @@
class="thumbnail" class="thumbnail"
>No thumbnail available</div> >No thumbnail available</div>
</a> </a>
</span> </div>
<div class="info"> <div class="info">
<a <a
@ -146,6 +146,7 @@
</ul> </ul>
</div> </div>
</div> </div>
</div>
</template> </template>
<script> <script>
@ -183,19 +184,34 @@ export default {
@import 'theme'; @import 'theme';
.tile { .tile {
width: 100%;
position: relative;
background: var(--background); background: var(--background);
box-shadow: 0 0 3px var(--shadow-weak);
&::before {
content: '';
display: inline-block;
padding: 45%;
}
}
.scene {
width: 100%;
height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
box-sizing: border-box; box-sizing: border-box;
padding: 0 0 .5rem 0; position: absolute;
top: 0;
left: 0;
overflow: hidden; overflow: hidden;
box-shadow: 0 0 3px var(--shadow-weak);
height: 100%;
} }
.poster { .poster {
flex-grow: 1;
height: 0;
position: relative; position: relative;
margin: 0 0 .5rem 0;
} }
.covers { .covers {
@ -209,7 +225,7 @@ export default {
.thumbnail { .thumbnail {
width: 100%; width: 100%;
height: 14rem; height: 100%;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
@ -284,7 +300,7 @@ export default {
.info { .info {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex-grow: 1; padding: .5rem 0;
} }
.link { .link {

View File

@ -172,7 +172,7 @@ function initActorActions(store, _router) {
limit, limit,
after: store.getters.after, after: store.getters.after,
before: store.getters.before, before: store.getters.before,
orderBy: store.getters.orderBy, orderBy: store.getters.orderBy === 'DATE_DESC' ? 'RELEASE_BY_RELEASE_ID__DATE_DESC' : 'RELEASE_BY_RELEASE_ID__DATE_ASC',
exclude: store.state.ui.filter, exclude: store.state.ui.filter,
}); });

View File

@ -356,7 +356,6 @@ async function fetchSource(source, baseMedia) {
if (type === 'image') { if (type === 'image') {
// generate thumbnail // generate thumbnail
/*
metaStream metaStream
.clone() .clone()
.resize({ .resize({
@ -366,7 +365,6 @@ async function fetchSource(source, baseMedia) {
.jpeg({ quality: config.media.thumbnailQuality }) .jpeg({ quality: config.media.thumbnailQuality })
.pipe(tempThumbTarget) .pipe(tempThumbTarget)
.on('error', error => logger.error(error)); .on('error', error => logger.error(error));
*/
} }
// pipeline destroys streams, so attach info event first // pipeline destroys streams, so attach info event first
@ -375,7 +373,7 @@ async function fetchSource(source, baseMedia) {
await pipeline( await pipeline(
res.originalRes, res.originalRes,
// metaStream, metaStream,
hashStream, hashStream,
tempFileTarget, tempFileTarget,
); );