2019-06-03 03:31:38 +00:00
|
|
|
<template>
|
2020-12-27 01:15:06 +00:00
|
|
|
<div class="container">
|
2020-12-18 01:10:30 +00:00
|
|
|
<Warning
|
|
|
|
v-if="showWarning"
|
|
|
|
class="warning-container"
|
2021-01-04 00:30:39 +00:00
|
|
|
@enter="(includeQueer) => setConsent(true, includeQueer)"
|
2020-12-19 22:01:17 +00:00
|
|
|
@leave="setConsent(false)"
|
2020-12-18 01:10:30 +00:00
|
|
|
/>
|
|
|
|
|
2020-08-08 20:18:55 +00:00
|
|
|
<transition name="slide">
|
2022-11-28 02:33:46 +00:00
|
|
|
<Sidebar v-if="showSidebar" />
|
2020-08-08 20:18:55 +00:00
|
|
|
</transition>
|
2020-03-25 01:48:54 +00:00
|
|
|
|
2022-11-28 02:33:46 +00:00
|
|
|
<Header />
|
2019-06-03 03:31:38 +00:00
|
|
|
|
2021-02-05 02:50:03 +00:00
|
|
|
<p
|
|
|
|
v-if="config.showDisclaimer"
|
|
|
|
class="disclaimer"
|
|
|
|
>{{ config.disclaimer }}</p>
|
|
|
|
|
2023-06-18 23:36:04 +00:00
|
|
|
<p
|
|
|
|
v-if="config.showAnnouncement"
|
|
|
|
class="announcement"
|
|
|
|
>{{ config.announcement }}</p>
|
|
|
|
|
2021-01-17 20:24:20 +00:00
|
|
|
<div
|
|
|
|
ref="content"
|
|
|
|
class="content"
|
2021-02-28 02:38:54 +00:00
|
|
|
@scroll="scroll"
|
2021-01-17 20:24:20 +00:00
|
|
|
>
|
2022-11-28 02:33:46 +00:00
|
|
|
<RouterView @scroll="scrollToTop" />
|
2020-05-25 00:02:28 +00:00
|
|
|
</div>
|
2021-01-03 22:32:09 +00:00
|
|
|
|
|
|
|
<Filters
|
|
|
|
v-if="showFilters"
|
|
|
|
@close="toggleFilters(false)"
|
|
|
|
/>
|
2022-11-28 02:33:46 +00:00
|
|
|
|
|
|
|
<Settings
|
|
|
|
v-if="showSettings"
|
|
|
|
@close="toggleSettings(false)"
|
|
|
|
/>
|
2020-05-25 00:02:28 +00:00
|
|
|
</div>
|
2019-06-03 03:31:38 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-12-18 01:10:30 +00:00
|
|
|
import Warning from './warning.vue';
|
2019-06-03 03:31:38 +00:00
|
|
|
import Header from '../header/header.vue';
|
2020-03-25 01:48:54 +00:00
|
|
|
import Sidebar from '../sidebar/sidebar.vue';
|
2021-03-20 22:03:13 +00:00
|
|
|
import Filters from '../filters/filters.vue';
|
2022-11-28 02:33:46 +00:00
|
|
|
import Settings from '../settings/settings.vue';
|
2019-06-03 03:31:38 +00:00
|
|
|
|
2020-03-25 01:48:54 +00:00
|
|
|
function toggleSidebar(state) {
|
2020-05-25 00:02:28 +00:00
|
|
|
this.showSidebar = typeof state === 'boolean' ? state : !this.showSidebar;
|
2020-03-25 01:48:54 +00:00
|
|
|
}
|
|
|
|
|
2021-01-03 22:32:09 +00:00
|
|
|
function toggleFilters(state) {
|
|
|
|
this.showFilters = state;
|
|
|
|
this.showSidebar = false;
|
|
|
|
}
|
|
|
|
|
2022-11-28 02:33:46 +00:00
|
|
|
function toggleSettings(state) {
|
|
|
|
this.showSettings = state;
|
|
|
|
this.showSidebar = false;
|
|
|
|
}
|
|
|
|
|
2021-01-04 00:30:39 +00:00
|
|
|
async function setConsent(consent, includeQueer) {
|
2020-12-19 22:01:17 +00:00
|
|
|
if (consent) {
|
|
|
|
this.showWarning = false;
|
2020-12-20 18:49:57 +00:00
|
|
|
localStorage.setItem('consent', window.env.sessionId);
|
2020-12-19 22:01:17 +00:00
|
|
|
}
|
2021-01-04 00:30:39 +00:00
|
|
|
|
|
|
|
if (includeQueer) {
|
2022-03-26 16:40:20 +00:00
|
|
|
this.$store.dispatch('setTagFilter', this.$store.state.ui.tagFilter.filter((tag) => !['gay', 'bisexual', 'transsexual'].includes(tag)));
|
2021-01-04 00:30:39 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.$store.dispatch('setTagFilter', this.$store.state.ui.tagFilter.concat(['gay', 'bisexual', 'transsexual']));
|
2020-12-18 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2020-12-27 03:21:10 +00:00
|
|
|
function blur(event) {
|
|
|
|
this.events.emit('blur', event);
|
|
|
|
}
|
|
|
|
|
|
|
|
function resize(event) {
|
|
|
|
this.events.emit('resize', event);
|
|
|
|
}
|
|
|
|
|
2021-02-28 02:38:54 +00:00
|
|
|
function scroll(event) {
|
|
|
|
this.events.emit('scroll', event);
|
|
|
|
}
|
|
|
|
|
2021-01-17 20:24:20 +00:00
|
|
|
function scrollToTop() {
|
|
|
|
this.$refs.content.scrollTop = 0;
|
|
|
|
}
|
|
|
|
|
2020-12-27 03:21:10 +00:00
|
|
|
function mounted() {
|
|
|
|
document.addEventListener('click', this.blur);
|
|
|
|
window.addEventListener('resize', this.resize);
|
2022-11-28 02:33:46 +00:00
|
|
|
|
|
|
|
this.events.on('toggleSettings', this.toggleSettings);
|
|
|
|
this.events.on('toggleSidebar', this.toggleSidebar);
|
2020-12-27 03:21:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function beforeUnmount() {
|
|
|
|
document.removeEventListener('click', this.blur);
|
|
|
|
window.removeEventListener('resize', this.resize);
|
|
|
|
}
|
|
|
|
|
2019-06-03 03:31:38 +00:00
|
|
|
export default {
|
2020-05-25 00:02:28 +00:00
|
|
|
components: {
|
|
|
|
Header,
|
|
|
|
Sidebar,
|
2020-12-18 01:10:30 +00:00
|
|
|
Warning,
|
2021-01-03 22:32:09 +00:00
|
|
|
Filters,
|
2022-11-28 02:33:46 +00:00
|
|
|
Settings,
|
2020-05-25 00:02:28 +00:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
showSidebar: false,
|
2020-12-20 18:49:57 +00:00
|
|
|
showWarning: localStorage.getItem('consent') !== window.env.sessionId,
|
2021-01-03 22:32:09 +00:00
|
|
|
showFilters: false,
|
2022-11-28 02:33:46 +00:00
|
|
|
showSettings: false,
|
2022-05-15 21:28:56 +00:00
|
|
|
selected: null,
|
2020-05-25 00:02:28 +00:00
|
|
|
};
|
|
|
|
},
|
2020-12-27 03:21:10 +00:00
|
|
|
mounted,
|
|
|
|
beforeUnmount,
|
2020-05-25 00:02:28 +00:00
|
|
|
methods: {
|
|
|
|
toggleSidebar,
|
2021-01-03 22:32:09 +00:00
|
|
|
toggleFilters,
|
2022-11-28 02:33:46 +00:00
|
|
|
toggleSettings,
|
2020-12-19 22:01:17 +00:00
|
|
|
setConsent,
|
2020-12-27 03:21:10 +00:00
|
|
|
blur,
|
|
|
|
resize,
|
2021-02-28 02:38:54 +00:00
|
|
|
scroll,
|
2021-01-17 20:24:20 +00:00
|
|
|
scrollToTop,
|
2020-05-25 00:02:28 +00:00
|
|
|
},
|
2019-06-03 03:31:38 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
2019-10-28 01:54:37 +00:00
|
|
|
<style lang="scss">
|
2019-09-24 23:38:06 +00:00
|
|
|
.container {
|
2020-03-25 01:48:54 +00:00
|
|
|
position: relative;
|
2019-09-24 23:38:06 +00:00
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
overflow: hidden;
|
2020-05-25 00:02:28 +00:00
|
|
|
background: var(--background-soft);
|
2020-03-27 03:39:13 +00:00
|
|
|
color: var(--text);
|
2019-09-24 23:38:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.content {
|
2019-10-28 01:54:37 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2019-09-24 23:38:06 +00:00
|
|
|
flex-grow: 1;
|
2019-11-14 00:18:19 +00:00
|
|
|
overflow-y: auto;
|
2020-06-29 23:07:48 +00:00
|
|
|
overflow-x: hidden;
|
2019-09-24 23:38:06 +00:00
|
|
|
}
|
|
|
|
|
2019-06-03 03:31:38 +00:00
|
|
|
.content-inner {
|
2020-09-09 02:22:43 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2020-06-27 02:50:13 +00:00
|
|
|
flex-grow: 1;
|
|
|
|
overflow-y: auto;
|
2020-07-02 23:28:22 +00:00
|
|
|
overflow-x: hidden;
|
2020-08-17 13:53:20 +00:00
|
|
|
z-index: 1;
|
2019-06-03 03:31:38 +00:00
|
|
|
}
|
2020-08-08 20:18:55 +00:00
|
|
|
|
|
|
|
.slide-enter-active,
|
|
|
|
.slide-leave-active {
|
|
|
|
&.sidebar-container {
|
2020-09-11 01:13:51 +00:00
|
|
|
transition: background .15s ease-in-out;
|
2020-08-08 20:18:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar {
|
2020-09-11 01:13:51 +00:00
|
|
|
transition: transform .15s ease-in-out;
|
2020-08-08 20:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-29 19:04:18 +00:00
|
|
|
.slide-enter-from,
|
2020-08-08 20:18:55 +00:00
|
|
|
.slide-leave-to {
|
|
|
|
&.sidebar-container {
|
|
|
|
background: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar {
|
2020-09-11 01:13:51 +00:00
|
|
|
transform: translate(100%, 0);
|
2020-08-08 20:18:55 +00:00
|
|
|
}
|
|
|
|
}
|
2020-08-12 01:30:20 +00:00
|
|
|
|
|
|
|
.column {
|
|
|
|
width: 1200px;
|
|
|
|
max-width: 100%;
|
|
|
|
padding: 0 1rem;
|
|
|
|
margin: 0 auto;
|
|
|
|
box-sizing: border-box;
|
|
|
|
}
|
2021-03-03 18:21:56 +00:00
|
|
|
</style>
|
2021-02-05 02:50:03 +00:00
|
|
|
|
2021-03-03 18:21:56 +00:00
|
|
|
<style lang="scss" scoped>
|
2023-06-18 23:36:04 +00:00
|
|
|
.disclaimer,
|
|
|
|
.announcement {
|
2021-03-19 23:15:33 +00:00
|
|
|
padding: .5rem 1rem;
|
2021-02-05 02:50:03 +00:00
|
|
|
margin: 0;
|
|
|
|
color: var(--text-light);
|
|
|
|
font-weight: bold;
|
|
|
|
box-shadow: inset 0 0 3px var(--darken-weak);
|
|
|
|
text-align: center;
|
|
|
|
}
|
2023-06-18 23:36:04 +00:00
|
|
|
|
|
|
|
.disclaimer {
|
|
|
|
background: var(--warn);
|
|
|
|
}
|
|
|
|
|
|
|
|
.announcement {
|
|
|
|
background: var(--notice);
|
|
|
|
}
|
2019-06-03 03:31:38 +00:00
|
|
|
</style>
|