2019-11-30 04:55:32 +00:00
|
|
|
<template>
|
2020-05-17 23:22:56 +00:00
|
|
|
<div class="actors">
|
|
|
|
<nav class="filter">
|
|
|
|
<ul class="genders nolist">
|
|
|
|
<li class="gender">
|
|
|
|
<router-link
|
|
|
|
:to="{ name: 'actors', params: { gender: 'female', letter } }"
|
|
|
|
:class="{ selected: gender === 'female' }"
|
|
|
|
class="gender-link female"
|
|
|
|
><Gender gender="female" /></router-link>
|
|
|
|
</li>
|
|
|
|
<li class="gender">
|
|
|
|
<router-link
|
|
|
|
:to="{ name: 'actors', params: { gender: 'male', letter } }"
|
|
|
|
:class="{ selected: gender === 'male' }"
|
|
|
|
class="gender-link male"
|
2020-06-27 00:57:30 +00:00
|
|
|
replace
|
2020-05-17 23:22:56 +00:00
|
|
|
><Gender gender="male" /></router-link>
|
|
|
|
</li>
|
|
|
|
<li class="gender">
|
|
|
|
<router-link
|
|
|
|
:to="{ name: 'actors', params: { gender: 'trans', letter } }"
|
|
|
|
:class="{ selected: gender === 'trans' }"
|
|
|
|
class="gender-link transsexual"
|
2020-06-27 00:57:30 +00:00
|
|
|
replace
|
2020-05-17 23:22:56 +00:00
|
|
|
><Gender gender="transsexual" /></router-link>
|
|
|
|
</li>
|
|
|
|
<li class="gender">
|
|
|
|
<router-link
|
|
|
|
:to="{ name: 'actors', params: { gender: 'other', letter } }"
|
|
|
|
:class="{ selected: gender === 'other' }"
|
|
|
|
class="gender-link other"
|
2020-06-27 00:57:30 +00:00
|
|
|
replace
|
2020-05-17 23:22:56 +00:00
|
|
|
><Icon icon="question5" /></router-link>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<ul class="letters nolist">
|
|
|
|
<li
|
|
|
|
v-for="letterX in letters"
|
|
|
|
:key="letterX"
|
|
|
|
class="letter"
|
|
|
|
>
|
|
|
|
<router-link
|
|
|
|
:to="{ name: 'actors', params: { gender, letter: letterX } }"
|
|
|
|
:class="{ selected: letterX === letter }"
|
|
|
|
class="letter-link"
|
2020-06-27 00:57:30 +00:00
|
|
|
replace
|
2020-05-17 23:22:56 +00:00
|
|
|
>{{ letterX || 'All' }}</router-link>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
|
2020-05-23 02:32:50 +00:00
|
|
|
<Pagination
|
|
|
|
:items-total="totalCount"
|
|
|
|
:items-per-page="limit"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<div
|
|
|
|
v-lazy-container="{ selector: '.lazy' }"
|
|
|
|
class="tiles"
|
|
|
|
>
|
2020-05-17 23:22:56 +00:00
|
|
|
<Actor
|
|
|
|
v-for="actor in actors"
|
|
|
|
:key="`actor-${actor.id}`"
|
|
|
|
:actor="actor"
|
|
|
|
/>
|
|
|
|
</div>
|
2020-05-23 02:32:50 +00:00
|
|
|
|
|
|
|
<Pagination
|
2020-05-25 00:02:28 +00:00
|
|
|
v-if="totalCount > 0"
|
2020-05-23 02:32:50 +00:00
|
|
|
:items-total="totalCount"
|
|
|
|
:items-per-page="limit"
|
|
|
|
class="pagination-top"
|
|
|
|
/>
|
2020-05-17 23:22:56 +00:00
|
|
|
</div>
|
2019-11-30 04:55:32 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-06-29 23:07:48 +00:00
|
|
|
import Actor from './tile.vue';
|
2020-02-09 04:30:10 +00:00
|
|
|
import Gender from './gender.vue';
|
2020-05-23 02:32:50 +00:00
|
|
|
import Pagination from '../pagination/pagination.vue';
|
2020-02-09 04:30:10 +00:00
|
|
|
|
|
|
|
async function fetchActors() {
|
2020-05-17 23:22:56 +00:00
|
|
|
const curatedGender = this.gender.replace('trans', 'transsexual');
|
2020-02-23 04:23:07 +00:00
|
|
|
|
2020-05-23 02:32:50 +00:00
|
|
|
const { actors, totalCount } = await this.$store.dispatch('fetchActors', {
|
|
|
|
limit: this.limit,
|
|
|
|
pageNumber: Number(this.$route.params.pageNumber) || 1,
|
2020-05-17 23:22:56 +00:00
|
|
|
letter: this.letter.replace('all', ''),
|
|
|
|
gender: curatedGender === 'other' ? null : curatedGender,
|
|
|
|
});
|
2020-05-23 02:32:50 +00:00
|
|
|
|
|
|
|
this.actors = actors;
|
|
|
|
this.totalCount = totalCount;
|
2020-02-09 04:30:10 +00:00
|
|
|
}
|
|
|
|
|
2020-05-08 23:42:10 +00:00
|
|
|
function letter() {
|
2020-05-17 23:22:56 +00:00
|
|
|
return this.$route.params.letter || 'all';
|
2020-05-08 23:42:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function gender() {
|
2020-05-17 23:22:56 +00:00
|
|
|
return this.$route.params.gender || 'female';
|
2020-05-08 23:42:10 +00:00
|
|
|
}
|
2020-02-09 04:30:10 +00:00
|
|
|
|
2020-05-08 23:42:10 +00:00
|
|
|
async function route() {
|
2020-05-17 23:22:56 +00:00
|
|
|
await this.fetchActors();
|
2020-02-09 04:30:10 +00:00
|
|
|
}
|
2019-11-30 04:55:32 +00:00
|
|
|
|
|
|
|
async function mounted() {
|
2020-05-17 23:22:56 +00:00
|
|
|
this.pageTitle = 'Actors';
|
2020-02-09 04:30:10 +00:00
|
|
|
|
2020-05-17 23:22:56 +00:00
|
|
|
await this.fetchActors();
|
2019-11-30 04:55:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
2020-05-17 23:22:56 +00:00
|
|
|
components: {
|
|
|
|
Actor,
|
|
|
|
Gender,
|
2020-05-23 02:32:50 +00:00
|
|
|
Pagination,
|
2020-05-17 23:22:56 +00:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
actors: [],
|
|
|
|
pageTitle: null,
|
2020-05-23 02:32:50 +00:00
|
|
|
totalCount: 0,
|
|
|
|
limit: 30,
|
2020-05-17 23:22:56 +00:00
|
|
|
letters: ['all'].concat(Array.from({ length: 26 }, (value, index) => String.fromCharCode(index + 97).toUpperCase())),
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
letter,
|
|
|
|
gender,
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
$route: route,
|
|
|
|
},
|
|
|
|
mounted,
|
|
|
|
methods: {
|
|
|
|
fetchActors,
|
|
|
|
},
|
2019-11-30 04:55:32 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
2020-02-09 04:30:10 +00:00
|
|
|
<style lang="scss">
|
|
|
|
@import 'theme';
|
|
|
|
|
2020-03-27 03:39:13 +00:00
|
|
|
.gender-link {
|
|
|
|
&.selected .gender .icon {
|
|
|
|
fill: var(--text-light);
|
|
|
|
filter: none;
|
|
|
|
}
|
|
|
|
|
2020-05-13 21:17:39 +00:00
|
|
|
&:hover:not(.selected) {
|
|
|
|
.gender .icon {
|
|
|
|
fill: var(--text-light);
|
|
|
|
}
|
|
|
|
|
|
|
|
.male .icon {
|
|
|
|
filter: drop-shadow(0 0 1px var(--male));
|
|
|
|
}
|
|
|
|
|
|
|
|
.female .icon {
|
|
|
|
filter: drop-shadow(0 0 1px var(--female));
|
|
|
|
}
|
2020-03-27 03:39:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&:hover:not(.selected) .transsexual .icon {
|
|
|
|
fill: var(--female);
|
|
|
|
filter: drop-shadow(1px 0 0 var(--text-light)) drop-shadow(-1px 0 0 var(--text-light)) drop-shadow(0 1px 0 var(--text-light)) drop-shadow(0 -1px 0 var(--text-light)) drop-shadow(1px 0 0 var(--male)) drop-shadow(-1px 0 0 var(--male)) drop-shadow(0 1px 0 var(--male)) drop-shadow(0 -1px 0 var(--male)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.5));
|
|
|
|
}
|
2020-02-09 04:30:10 +00:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
2019-11-30 04:55:32 +00:00
|
|
|
<style lang="scss" scoped>
|
2020-01-06 20:49:37 +00:00
|
|
|
@import 'theme';
|
|
|
|
|
2019-11-30 04:55:32 +00:00
|
|
|
.actors {
|
2020-02-09 04:30:10 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
|
|
|
|
.tiles {
|
2019-11-30 04:55:32 +00:00
|
|
|
display: grid;
|
2020-05-21 22:55:11 +00:00
|
|
|
grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
|
2020-06-29 23:07:48 +00:00
|
|
|
grid-gap: .5rem;
|
2019-11-30 04:55:32 +00:00
|
|
|
padding: 1rem;
|
2020-02-09 04:30:10 +00:00
|
|
|
flex-grow: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.filter {
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
padding: 0 1rem;
|
2020-02-19 03:41:53 +00:00
|
|
|
margin: 1rem 0;
|
2020-02-09 04:30:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.genders {
|
2020-02-23 04:23:07 +00:00
|
|
|
display: flex;
|
2020-02-19 03:41:53 +00:00
|
|
|
flex-shrink: 0;
|
2020-02-09 04:30:10 +00:00
|
|
|
padding: 0 .5rem 0 0;
|
2020-03-23 00:43:49 +00:00
|
|
|
border-right: solid 1px var(--shadow-hint);
|
2020-02-09 04:30:10 +00:00
|
|
|
margin: 0 1rem 0 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.letter,
|
|
|
|
.gender {
|
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.letter-link,
|
|
|
|
.gender-link {
|
|
|
|
width: 2.5rem;
|
|
|
|
height: 2.5rem;
|
2020-03-25 02:42:46 +00:00
|
|
|
display: flex;
|
2020-02-09 04:30:10 +00:00
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2020-03-25 02:42:46 +00:00
|
|
|
box-sizing: border-box;
|
2020-02-09 04:30:10 +00:00
|
|
|
margin: .25rem .5rem .25rem 0;
|
2020-03-23 00:43:49 +00:00
|
|
|
color: var(--shadow);
|
|
|
|
background: var(--background);
|
2020-02-09 04:30:10 +00:00
|
|
|
font-weight: bold;
|
|
|
|
text-decoration: none;
|
2020-03-25 02:42:46 +00:00
|
|
|
box-shadow: 0 0 3px var(--darken-weak);
|
|
|
|
|
2020-03-27 03:39:13 +00:00
|
|
|
.male,
|
|
|
|
.female,
|
|
|
|
.transsexual {
|
|
|
|
padding: .2rem 0 0 0;
|
|
|
|
}
|
|
|
|
|
2020-03-25 02:42:46 +00:00
|
|
|
.icon {
|
|
|
|
fill: var(--shadow);
|
|
|
|
}
|
2020-02-09 04:30:10 +00:00
|
|
|
|
|
|
|
&:hover {
|
2020-05-08 23:42:10 +00:00
|
|
|
color: var(--text);
|
2020-02-09 04:30:10 +00:00
|
|
|
cursor: pointer;
|
2020-03-27 03:39:13 +00:00
|
|
|
|
|
|
|
.icon {
|
2020-05-13 21:17:39 +00:00
|
|
|
fill: var(--text);
|
2020-03-27 03:39:13 +00:00
|
|
|
}
|
2020-02-09 04:30:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&.selected {
|
2020-03-23 00:43:49 +00:00
|
|
|
background: var(--primary);
|
2020-03-25 02:42:46 +00:00
|
|
|
color: var(--text-light);
|
2020-02-09 04:30:10 +00:00
|
|
|
|
2020-03-25 02:42:46 +00:00
|
|
|
&.other .icon {
|
|
|
|
fill: var(--text-light);
|
2020-02-09 04:30:10 +00:00
|
|
|
}
|
|
|
|
}
|
2019-11-30 04:55:32 +00:00
|
|
|
}
|
2020-01-06 20:49:37 +00:00
|
|
|
|
2020-05-17 23:22:56 +00:00
|
|
|
@media(max-width: $breakpoint0) {
|
2020-02-19 03:41:53 +00:00
|
|
|
.tiles {
|
2020-04-27 00:37:30 +00:00
|
|
|
grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
|
2020-01-06 20:49:37 +00:00
|
|
|
}
|
2020-02-23 04:23:07 +00:00
|
|
|
|
|
|
|
.genders {
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
2020-01-06 20:49:37 +00:00
|
|
|
}
|
2019-11-30 04:55:32 +00:00
|
|
|
</style>
|