2021-01-03 21:53:51 +00:00
|
|
|
<template>
|
|
|
|
<Dialog
|
2021-03-20 22:03:13 +00:00
|
|
|
title="Filters"
|
2021-01-03 21:53:51 +00:00
|
|
|
@close="$emit('close')"
|
|
|
|
>
|
2021-04-04 19:52:19 +00:00
|
|
|
<div class="filters dialog-body">
|
2021-01-04 00:30:39 +00:00
|
|
|
<h3 class="form-heading">Show me</h3>
|
2021-01-03 21:53:51 +00:00
|
|
|
|
2021-01-04 00:30:39 +00:00
|
|
|
<ul class="tags nolist">
|
|
|
|
<li
|
|
|
|
v-for="tag in tags"
|
|
|
|
:key="tag"
|
|
|
|
class="tags-item"
|
|
|
|
>
|
|
|
|
<Checkbox
|
|
|
|
:checked="!tagFilter.includes(tag)"
|
|
|
|
:label="tag"
|
|
|
|
class="tag"
|
|
|
|
@change="(state) => filterTag(tag, state)"
|
|
|
|
/>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
2021-01-05 02:29:02 +00:00
|
|
|
<p class="disclaimer">You may still incidentally see filtered out content</p>
|
2021-01-04 00:30:39 +00:00
|
|
|
</div>
|
2021-01-03 21:53:51 +00:00
|
|
|
</Dialog>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Checkbox from '../form/checkbox.vue';
|
|
|
|
|
|
|
|
function tagFilter() {
|
|
|
|
return this.$store.state.ui.tagFilter;
|
|
|
|
}
|
|
|
|
|
|
|
|
function filterTag(tag, isChecked) {
|
|
|
|
if (isChecked) {
|
|
|
|
this.$store.dispatch('setTagFilter', this.tagFilter.filter(filteredTag => filteredTag !== tag));
|
|
|
|
} else {
|
|
|
|
this.$store.dispatch('setTagFilter', this.tagFilter.concat(tag));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Checkbox,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2021-04-04 19:52:19 +00:00
|
|
|
tags: ['anal', 'gay', 'transsexual', 'bisexual', 'pissing', 'anal prolapse'],
|
2021-01-03 21:53:51 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
tagFilter,
|
|
|
|
},
|
|
|
|
emits: ['close'],
|
|
|
|
methods: {
|
|
|
|
filterTag,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2021-01-04 00:30:39 +00:00
|
|
|
.filters {
|
2021-01-03 21:53:51 +00:00
|
|
|
width: 20rem;
|
|
|
|
max-width: 100%;
|
2021-01-04 00:30:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.tags-item {
|
2021-01-03 21:53:51 +00:00
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.tag {
|
|
|
|
padding: .5rem 0;
|
|
|
|
}
|
2021-01-04 00:30:39 +00:00
|
|
|
|
|
|
|
.disclaimer {
|
|
|
|
margin: 1rem 0 0 0;
|
|
|
|
line-height: 1.5;
|
|
|
|
text-align: center;
|
|
|
|
font-size: .9rem;
|
|
|
|
color: var(--shadow);
|
|
|
|
}
|
2021-01-03 21:53:51 +00:00
|
|
|
</style>
|