Added compact sidebar. Added tag sections and posters.

This commit is contained in:
2020-03-25 02:48:54 +01:00
parent d724f96728
commit 15a386ad05
48 changed files with 466 additions and 119 deletions

View File

@@ -3,7 +3,12 @@
class="container"
:class="theme"
>
<Header />
<Sidebar
v-if="showSidebar"
:toggle-sidebar="toggleSidebar"
/>
<Header :toggle-sidebar="toggleSidebar" />
<div class="content">
<!-- key forces rerender when new and old path use same component -->
@@ -15,21 +20,45 @@
<script>
import { mapState } from 'vuex';
import EventBus from '../../js/event-bus';
import Header from '../header/header.vue';
import Sidebar from '../sidebar/sidebar.vue';
function theme(state) {
return state.ui.theme;
}
function toggleSidebar(state) {
this.showSidebar = typeof state === 'boolean' ? state : !this.showSidebar;
}
function mounted() {
document.addEventListener('click', () => {
EventBus.$emit('blur');
this.showSidebar = false;
});
}
export default {
components: {
Header,
Sidebar,
},
data() {
return {
showSidebar: false,
};
},
computed: {
...mapState({
theme,
}),
},
mounted,
methods: {
toggleSidebar,
},
};
</script>
@@ -37,11 +66,12 @@ export default {
@import 'theme';
.container {
background: var(--background-dim);
position: relative;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden;
background: var(--background-dim);
}
.content {

View File

@@ -1,6 +1,12 @@
<template>
<header class="header">
<div class="header-nav">
<Icon
icon="menu"
class="sidebar-toggle"
@click.native.stop="toggleSidebar"
/>
<router-link
to="/home"
class="logo-link"
@@ -8,11 +14,6 @@
<Icon
icon="logo"
/>
<Icon
icon="logo_t"
class="logo-compact"
/>
</h1></router-link>
<nav class="nav">
@@ -148,6 +149,12 @@ export default {
components: {
Search,
},
props: {
toggleSidebar: {
type: Function,
default: null,
},
},
data() {
return {
searching: false,
@@ -170,6 +177,7 @@ export default {
@import 'theme';
.header {
height: 3rem;
display: flex;
align-items: center;
justify-content: space-between;
@@ -182,6 +190,7 @@ export default {
.header-nav {
display: flex;
align-items: center;
height: 100%;
}
.header-section {
@@ -191,6 +200,19 @@ export default {
flex-direction: row;
}
.sidebar-toggle {
display: none;
fill: var(--shadow);
padding: 0 1rem;
width: 1.75rem;
height: 100%;
&:hover {
fill: var(--primary);
cursor: pointer;
}
}
.logo-link {
color: inherit;
display: inline-block;
@@ -198,18 +220,15 @@ export default {
}
.logo {
height: 100%;
display: inline-block;
padding: .75rem 0 .75rem 1rem;
padding: 0 0 0 1rem;
margin: 0 1rem 0 0;
.icon {
width: 6rem;
height: 1.5rem;
}
.logo-compact {
display: none;
}
}
.nav {
@@ -264,21 +283,29 @@ export default {
}
}
.search-compact {
display: none;
height: 100%;
}
.search-button {
height: 100%;
padding: 0 1rem;
padding: .25rem 1rem 0 1rem;
background: none;
border: none;
outline: none;
margin: .2rem 0 0 0;
.icon {
fill: var(--shadow);
}
}
.search-compact {
display: none;
&:hover {
cursor: pointer;
.icon {
fill: var(--shadow-strong);
}
}
}
@media(max-width: $breakpoint2) {
@@ -289,33 +316,19 @@ export default {
.search-compact {
display: flex;
}
.header-toggles {
margin: 0;
}
}
@media(max-width: $breakpoint0) {
.nav-label {
.nav {
display: none;
}
.nav .nolist {
display: flex;
}
.nav,
.nav-item {
flex-grow: 1;
}
.logo {
margin: 0 .5rem 0 0;
.icon {
display: none;
}
.icon.logo-compact {
width: 1.5rem;
display: inline-block;
}
.sidebar-toggle {
display: inline-block;
}
}
</style>

View File

@@ -0,0 +1,197 @@
<template>
<div
class="sidebar"
@click.stop
>
<div class="sidebar-header">
<Icon
icon="cross"
class="sidebar-close"
@click.native="toggleSidebar(false)"
/>
<router-link
to="/home"
class="logo-link"
@click.native="toggleSidebar(false)"
>
<h1 class="sidebar-logo">
<div
class="logo logo-primary"
v-html="logoPrimary"
/>
<div
class="logo logo-light"
v-html="logoLight"
/>
</h1>
</router-link>
</div>
<nav class="nav">
<ul class="nolist">
<li class="nav-item">
<router-link
v-slot="{ href, isActive, navigate }"
to="/actors"
@click.native="toggleSidebar(false)"
>
<a
class="nav-link"
:href="href"
:class="{ active: isActive }"
@click="navigate"
>Actors</a>
</router-link>
</li>
<li class="nav-item">
<router-link
v-slot="{ href, isActive, navigate }"
to="/networks"
@click.native="toggleSidebar(false)"
>
<a
class="nav-link"
:href="href"
:class="{ active: isActive }"
@click="navigate"
>Networks</a>
</router-link>
</li>
<li class="nav-item">
<router-link
v-slot="{ href, isActive, navigate }"
to="/tags"
@click.native="toggleSidebar(false)"
>
<a
class="nav-link"
:href="href"
:class="{ active: isActive }"
@click="navigate"
>Tags</a>
</router-link>
</li>
</ul>
</nav>
</div>
</template>
<script>
import logoPrimary from '../../img/logo.svg';
import logoLight from '../../img/logo-light.svg';
export default {
props: {
toggleSidebar: {
type: Function,
default: null,
},
},
data() {
return {
logoPrimary,
logoLight,
};
}
};
</script>
<style lang="scss" scoped>
.sidebar {
display: flex;
flex-direction: column;
width: 15rem;
height: 100%;
position: absolute;
z-index: 10;
color: var(--text-light);
background: var(--primary);
box-shadow: 0 0 3px var(--darken);
}
.sidebar-header {
display: flex;
justify-content: space-between;
height: 3rem;
border-bottom: solid 1px var(--shadow-hint);
margin: 0 0 .5rem 0;
}
.sidebar-close {
width: 1.25rem;
height: 100%;
padding: 0 1.25rem;
fill: var(--lighten);
&:hover {
fill: var(--text-light);
cursor: pointer;
}
}
.sidebar-logo {
height: 100%;
display: flex;
align-items: center;
margin: 0;
}
.logo-link {
display: block;
height: 100%;
padding: 0 1rem;
}
.logo {
width: 6rem;
display: flex;
align-items: center;
margin: 0;
}
.logo-primary {
display: none;
}
.nav-item {
display: block;
}
.nav-link {
color: var(--lighten-strong);
display: block;
padding: 1rem;
text-decoration: none;
font-weight: bold;
&:hover,
&.active {
background: var(--shadow-hint);
}
&.active {
color: var(--text-light);
}
}
.dark .sidebar {
background: var(--profile);
.nav-link.active {
color: var(--primary);
background: var(--shadow-hint);
}
.logo-primary {
display: flex;
}
.logo-light {
display: none;
}
}
</style>

View File

@@ -1,11 +1,18 @@
<template>
<div class="tags">
<div class="tiles">
<Tag
v-for="tag in popularTags"
:key="`tag-${tag.id}`"
:tag="tag"
/>
<div
v-for="(tags, category) in categories"
:key="category"
>
<h3 class="heading">{{ category }}</h3>
<div class="tiles">
<Tag
v-for="tag in tags"
:key="`tag-${tag.id}`"
:tag="tag"
/>
</div>
</div>
</div>
</template>
@@ -14,63 +21,76 @@
import Tag from '../tile/tag.vue';
async function mounted() {
const tags = await this.$store.dispatch('fetchTags', {
slugs: [
'airtight',
const tagSlugsByCategory = {
popular: [
'anal',
'asian',
'blonde',
'blowjob',
'brunette',
'caucasian',
'creampie',
'deepthroat',
'double-penetration',
'ebony',
'facefucking',
'facial',
'gangbang',
'interracial',
'latina',
'lesbian',
'maid',
'mff',
'mfm',
'orgy',
'redhead',
'schoolgirl',
'teen',
'milf',
'orgy',
'gangbang',
'double-penetration',
'airtight',
'facial',
'creampie',
'blowjob',
'interracial',
],
extreme: [
'double-anal',
'double-vaginal',
'da-tp',
'dv-tp',
],
oral: [
'deepthroat',
'facefucking',
'double-blowjob',
'blowbang',
'pussy-eating',
'ass-eating',
'ass-to-mouth',
],
cumshot: [
'facial',
'bukkake',
'creampie',
'anal-creampie',
'cum-in-mouth',
],
appearance: [
'asian',
'ebony',
'latina',
'caucasian',
'blonde',
'brunette',
'redhead',
],
roleplay: [
'family',
'schoolgirl',
'maid',
],
tricks: [
'gaping',
],
};
const tags = await this.$store.dispatch('fetchTags', {
slugs: Object.values(tagSlugsByCategory).flat(),
});
const tagsBySlug = tags.reduce((acc, tag) => ({ ...acc, [tag.slug]: tag }), {});
this.popularTags = [
'anal',
'teen',
'lesbian',
'mff',
'mfm',
'orgy',
'double-penetration',
'gangbang',
'airtight',
'creampie',
'facial',
'interracial',
'blowjob',
'deepthroat',
'facefucking',
'asian',
'ebony',
'latina',
'caucasian',
'blonde',
'brunette',
'redhead',
'schoolgirl',
'maid',
].map(tagSlug => tagsBySlug[tagSlug]);
this.categories = Object.entries(tagSlugsByCategory).reduce((acc, [category, tagSlugs]) => ({
...acc,
[category]: tagSlugs.map(tagSlug => tagsBySlug[tagSlug]),
}), {});
console.log(this.categories);
this.pageTitle = 'Tags';
}
@@ -81,7 +101,7 @@ export default {
},
data() {
return {
popularTags: [],
categories: {},
pageTitle: null,
};
},
@@ -99,11 +119,13 @@ export default {
.tiles {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(20rem, .25fr));
grid-gap: 2rem;
grid-gap: 1rem;
margin: 0 0 1.5rem 0;
}
.heading {
font-size: 1.3rem;
text-transform: capitalize;
}
@media(max-width: $breakpoint3) {

View File

@@ -37,28 +37,27 @@ export default {
@import 'theme';
.tile {
color: var(--text);
background: var(--background);
color: var(--text-light);
background: var(--profile);
display: flex;
flex-direction: column;
align-items: center;
align-items: left;
justify-content: flex-end;
box-sizing: border-box;
box-shadow: 0 0 3px rgba(0, 0, 0, .25);
text-align: center;
text-decoration: none;
box-shadow: inset 0 0 3px var(--darken);
}
.poster {
width: 100%;
height: 14rem;
object-fit: cover;
box-shadow: 0 0 3px var(--darken);
}
.title {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-size: 1rem;
padding: .5rem 1rem;
font-weight: bold;