forked from DebaucheryLibrarian/traxxx
84 lines
1.3 KiB
Vue
84 lines
1.3 KiB
Vue
|
<template>
|
||
|
<div class="dialog-section">
|
||
|
<h3 class="form-heading">Show me</h3>
|
||
|
|
||
|
<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>
|
||
|
|
||
|
<p class="disclaimer">You may still incidentally see filtered out content</p>
|
||
|
</div>
|
||
|
</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 {
|
||
|
tags: ['anal', 'gay', 'transsexual', 'bisexual', 'pissing', 'anal prolapse'],
|
||
|
};
|
||
|
},
|
||
|
computed: {
|
||
|
tagFilter,
|
||
|
},
|
||
|
methods: {
|
||
|
filterTag,
|
||
|
},
|
||
|
};
|
||
|
</script>
|
||
|
|
||
|
<style lang="scss" scoped>
|
||
|
.dialog-body {
|
||
|
width: 40rem;
|
||
|
max-width: 100%;
|
||
|
}
|
||
|
|
||
|
.filters {
|
||
|
width: 20rem;
|
||
|
max-width: 100%;
|
||
|
}
|
||
|
|
||
|
.tags-item {
|
||
|
display: block;
|
||
|
}
|
||
|
|
||
|
.tag {
|
||
|
padding: .5rem 0;
|
||
|
}
|
||
|
|
||
|
.disclaimer {
|
||
|
margin: 1rem 0 0 0;
|
||
|
line-height: 1.5;
|
||
|
text-align: center;
|
||
|
font-size: .9rem;
|
||
|
color: var(--shadow);
|
||
|
}
|
||
|
</style>
|