2019-11-30 04:55:32 +00:00
|
|
|
<template>
|
|
|
|
<div class="actors">
|
2020-02-09 04:30:10 +00:00
|
|
|
<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"
|
|
|
|
><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"
|
|
|
|
><Gender gender="transsexual" /></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"
|
|
|
|
@click="setLetter(letterX)"
|
|
|
|
>{{ letterX || 'All' }}</router-link>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
<div class="tiles">
|
|
|
|
<Actor
|
|
|
|
v-for="actor in actors"
|
|
|
|
:key="`actor-${actor.id}`"
|
|
|
|
:actor="actor"
|
|
|
|
/>
|
|
|
|
</div>
|
2019-11-30 04:55:32 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Actor from '../tile/actor.vue';
|
2020-02-09 04:30:10 +00:00
|
|
|
import Gender from './gender.vue';
|
|
|
|
|
|
|
|
async function fetchActors() {
|
|
|
|
this.actors = await this.$store.dispatch('fetchActors', {
|
|
|
|
limit: 1000,
|
|
|
|
letter: this.letter.replace('all', ''),
|
|
|
|
genders: [this.gender.replace('trans', 'transsexual').replace('other', null)],
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async function setLetter(letter) {
|
|
|
|
this.letter = letter;
|
|
|
|
|
|
|
|
await this.fetchActors();
|
|
|
|
}
|
2019-11-30 04:55:32 +00:00
|
|
|
|
|
|
|
async function mounted() {
|
2020-01-24 22:36:06 +00:00
|
|
|
this.pageTitle = 'Actors';
|
2020-02-09 04:30:10 +00:00
|
|
|
|
|
|
|
await this.fetchActors();
|
2019-11-30 04:55:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Actor,
|
2020-02-09 04:30:10 +00:00
|
|
|
Gender,
|
2019-11-30 04:55:32 +00:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
actors: [],
|
2020-01-24 22:36:06 +00:00
|
|
|
pageTitle: null,
|
2020-02-09 04:30:10 +00:00
|
|
|
letters: ['all'].concat(Array.from({ length: 26 }, (value, index) => String.fromCharCode(index + 97).toUpperCase())),
|
2020-02-09 18:41:39 +00:00
|
|
|
letter: this.$route.params.letter || 'all',
|
2020-02-09 04:30:10 +00:00
|
|
|
gender: this.$route.params.gender || 'female',
|
2019-11-30 04:55:32 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted,
|
2020-02-09 04:30:10 +00:00
|
|
|
methods: {
|
|
|
|
fetchActors,
|
|
|
|
setLetter,
|
|
|
|
},
|
2019-11-30 04:55:32 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
2020-02-09 04:30:10 +00:00
|
|
|
<style lang="scss">
|
|
|
|
@import 'theme';
|
|
|
|
|
|
|
|
.gender-link.selected .gender .icon {
|
|
|
|
fill: $text-contrast;
|
|
|
|
filter: none;
|
|
|
|
}
|
|
|
|
</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-01-06 20:49:37 +00:00
|
|
|
grid-template-columns: repeat(auto-fit, minmax(10rem, .5fr));
|
2019-11-30 04:55:32 +00:00
|
|
|
grid-gap: 0 .5rem;
|
|
|
|
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;
|
|
|
|
margin: 1rem 0 0 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.genders {
|
|
|
|
padding: 0 .5rem 0 0;
|
|
|
|
border-right: solid 1px $shadow-hint;
|
|
|
|
margin: 0 1rem 0 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.letter,
|
|
|
|
.gender {
|
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.letter-link,
|
|
|
|
.gender-link {
|
|
|
|
width: 2.5rem;
|
|
|
|
height: 2.5rem;
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
margin: .25rem .5rem .25rem 0;
|
|
|
|
color: $shadow;
|
|
|
|
background: $background;
|
|
|
|
font-weight: bold;
|
|
|
|
text-decoration: none;
|
|
|
|
box-shadow: 0 0 3px $shadow-weak;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: $primary;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.selected {
|
|
|
|
background: $primary;
|
|
|
|
color: $text-contrast;
|
|
|
|
|
|
|
|
.icon {
|
|
|
|
fill: $text-contrast;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.male {
|
|
|
|
background: $male;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.female {
|
|
|
|
background: $female;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.transsexual {
|
|
|
|
width: 2rem;
|
|
|
|
height: 2rem;
|
|
|
|
background: $female;
|
|
|
|
border: solid .25rem $male;
|
|
|
|
}
|
|
|
|
}
|
2019-11-30 04:55:32 +00:00
|
|
|
}
|
2020-01-06 20:49:37 +00:00
|
|
|
|
|
|
|
@media(max-width: $breakpoint) {
|
|
|
|
.actors {
|
|
|
|
grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
|
|
|
|
}
|
|
|
|
}
|
2019-11-30 04:55:32 +00:00
|
|
|
</style>
|