2019-11-16 02:33:36 +00:00
|
|
|
<template>
|
2020-05-17 23:22:56 +00:00
|
|
|
<div class="releases">
|
|
|
|
<h3
|
|
|
|
v-if="context"
|
|
|
|
class="heading"
|
|
|
|
><span class="range">{{ range }}</span> releases for '{{ context }}'</h3>
|
2019-11-16 02:33:36 +00:00
|
|
|
|
2021-10-25 00:06:24 +00:00
|
|
|
<Ellipsis v-if="!done" />
|
|
|
|
|
2020-05-17 23:22:56 +00:00
|
|
|
<ul
|
2021-10-25 00:06:24 +00:00
|
|
|
v-else-if="releases.length > 0"
|
2020-05-17 23:22:56 +00:00
|
|
|
:key="sfw"
|
|
|
|
class="nolist tiles"
|
|
|
|
>
|
2023-07-02 03:07:38 +00:00
|
|
|
<template v-for="(item, index) in items">
|
|
|
|
<li
|
|
|
|
v-if="item === 'campaign'"
|
|
|
|
:key="`campaign-${index}`"
|
|
|
|
class="campaign"
|
|
|
|
>
|
|
|
|
<Campaign
|
|
|
|
v-if="item === 'campaign'"
|
|
|
|
:entity="entity"
|
|
|
|
:min-ratio="0.75"
|
|
|
|
:max-ratio="1.25"
|
|
|
|
:allow-generic="true"
|
|
|
|
/>
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li
|
|
|
|
v-else
|
|
|
|
:key="`release-${item.id}`"
|
|
|
|
>
|
|
|
|
<SceneTile
|
|
|
|
:release="item"
|
|
|
|
:referer="referer"
|
|
|
|
:index="index"
|
|
|
|
:stash="stash"
|
|
|
|
@stash="isStashed => $emit('stash', isStashed)"
|
|
|
|
/>
|
|
|
|
</li>
|
|
|
|
</template>
|
2020-05-17 23:22:56 +00:00
|
|
|
</ul>
|
2020-01-11 04:31:04 +00:00
|
|
|
|
2020-05-17 23:22:56 +00:00
|
|
|
<span
|
2021-10-25 00:06:24 +00:00
|
|
|
v-else-if="releases.length === 0 && range !== 'all'"
|
2020-05-17 23:22:56 +00:00
|
|
|
class="empty"
|
|
|
|
>No {{ range }} releases</span>
|
2020-01-11 04:31:04 +00:00
|
|
|
|
2020-05-17 23:22:56 +00:00
|
|
|
<span
|
|
|
|
v-else-if="releases.length === 0"
|
|
|
|
class="empty"
|
|
|
|
>No recent or upcoming releases</span>
|
|
|
|
</div>
|
2019-11-16 02:33:36 +00:00
|
|
|
</template>
|
|
|
|
|
2023-07-02 03:07:38 +00:00
|
|
|
<script setup>
|
2023-07-02 03:13:40 +00:00
|
|
|
import config from 'config';
|
|
|
|
|
2023-07-02 03:07:38 +00:00
|
|
|
import { defineProps, defineEmits, computed } from 'vue';
|
|
|
|
import { useStore } from 'vuex';
|
|
|
|
import { useRouter } from 'vue-router';
|
|
|
|
|
|
|
|
import Campaign from '../campaigns/campaign.vue';
|
2021-10-25 00:06:24 +00:00
|
|
|
import Ellipsis from '../loading/ellipsis.vue';
|
2020-08-12 01:30:20 +00:00
|
|
|
import SceneTile from './scene-tile.vue';
|
2019-11-16 02:33:36 +00:00
|
|
|
|
2023-07-02 03:07:38 +00:00
|
|
|
const router = useRouter();
|
|
|
|
const store = useStore();
|
2019-11-16 02:33:36 +00:00
|
|
|
|
2023-07-02 03:07:38 +00:00
|
|
|
defineEmits(['stash']);
|
2020-05-08 23:10:07 +00:00
|
|
|
|
2023-07-02 03:07:38 +00:00
|
|
|
const props = defineProps({
|
|
|
|
releases: {
|
|
|
|
type: Array,
|
|
|
|
default: () => [],
|
|
|
|
},
|
|
|
|
entity: {
|
|
|
|
type: Object,
|
|
|
|
default: null,
|
|
|
|
},
|
|
|
|
context: {
|
|
|
|
type: String,
|
|
|
|
default: null,
|
|
|
|
},
|
|
|
|
done: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true,
|
2020-05-17 23:22:56 +00:00
|
|
|
},
|
2023-07-02 03:07:38 +00:00
|
|
|
referer: {
|
|
|
|
type: String,
|
|
|
|
default: null,
|
2020-05-17 23:22:56 +00:00
|
|
|
},
|
2023-07-02 03:07:38 +00:00
|
|
|
stash: {
|
|
|
|
type: Object,
|
|
|
|
default: null,
|
2020-05-17 23:22:56 +00:00
|
|
|
},
|
2023-07-02 03:07:38 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
const campaignIndex = computed(() => Math.floor(Math.random() * props.releases.length - 5) + 5);
|
|
|
|
|
2023-07-02 03:13:40 +00:00
|
|
|
const items = computed(() => props.releases.flatMap((release, index) => (config.campaigns.tiles && props.releases.length > 10 && index === campaignIndex.value ? ['campaign', release] : release)));
|
2023-07-02 03:07:38 +00:00
|
|
|
|
|
|
|
const range = computed(() => router.route?.params.range);
|
|
|
|
const sfw = computed(() => store.state.ui.sfw);
|
2019-11-16 02:33:36 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2021-01-17 22:31:49 +00:00
|
|
|
@import 'breakpoints';
|
2019-11-16 02:33:36 +00:00
|
|
|
|
|
|
|
.heading {
|
|
|
|
padding: 0;
|
|
|
|
margin: 0 0 1rem 0;
|
|
|
|
|
|
|
|
.range {
|
|
|
|
text-transform: capitalize;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-28 02:22:19 +00:00
|
|
|
.releases {
|
2020-09-09 02:22:43 +00:00
|
|
|
flex-grow: 1;
|
2020-06-28 02:22:19 +00:00
|
|
|
border-top: solid 1px var(--crease);
|
2020-06-29 23:52:17 +00:00
|
|
|
|
|
|
|
&.embedded {
|
|
|
|
border: none;
|
|
|
|
|
|
|
|
.tiles {
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
}
|
2020-06-28 02:22:19 +00:00
|
|
|
}
|
|
|
|
|
2019-11-28 04:36:22 +00:00
|
|
|
.tiles {
|
2019-12-15 04:42:51 +00:00
|
|
|
width: 100%;
|
2019-11-16 02:33:36 +00:00
|
|
|
display: grid;
|
2020-04-27 02:00:16 +00:00
|
|
|
grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
|
2021-01-21 23:26:06 +00:00
|
|
|
grid-gap: .5rem;
|
2020-06-27 02:50:13 +00:00
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 1rem;
|
2019-11-16 02:33:36 +00:00
|
|
|
}
|
|
|
|
|
2020-01-11 04:31:04 +00:00
|
|
|
.empty {
|
2020-06-28 02:22:19 +00:00
|
|
|
display: inline-block;
|
2020-06-27 02:50:13 +00:00
|
|
|
padding: 1rem;
|
2020-03-23 00:43:49 +00:00
|
|
|
color: var(--shadow-strong);
|
2020-01-11 04:31:04 +00:00
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
2023-07-02 03:07:38 +00:00
|
|
|
.campaign {
|
|
|
|
display: flex;
|
|
|
|
align-items: flex-start;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
|
2021-10-30 23:00:12 +00:00
|
|
|
@media(max-width: $breakpoint-mega) {
|
|
|
|
.tiles {
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-17 22:31:49 +00:00
|
|
|
@media(max-width: $breakpoint-kilo) {
|
2019-11-28 04:36:22 +00:00
|
|
|
.tiles {
|
2021-10-30 23:00:12 +00:00
|
|
|
grid-template-columns: repeat(auto-fill, minmax(18.5rem, 1fr));
|
2021-01-17 22:31:49 +00:00
|
|
|
grid-gap: .5rem;
|
2021-01-17 23:32:52 +00:00
|
|
|
padding: .5rem;
|
2019-11-16 02:33:36 +00:00
|
|
|
}
|
|
|
|
}
|
2021-10-30 23:00:12 +00:00
|
|
|
|
|
|
|
@media(max-width: $breakpoint) {
|
|
|
|
.tiles {
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@media(max-width: $breakpoint-micro) {
|
|
|
|
.tiles {
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
|
|
|
|
}
|
|
|
|
}
|
2019-11-16 02:33:36 +00:00
|
|
|
</style>
|