2024-04-02 03:55:53 +00:00
|
|
|
<template>
|
|
|
|
<Dialog title="Settings">
|
|
|
|
<div class="dialog-body">
|
|
|
|
<div class="dialog-section">
|
2024-04-03 00:13:41 +00:00
|
|
|
<h3 class="dialog-heading">Filter</h3>
|
|
|
|
|
|
|
|
<p class="dialog-description">Check the tags that you prefer to be <strong>excluded</strong> from the results. The filter is a courtesy, and provides no guarantees.</p>
|
|
|
|
|
2024-04-02 03:55:53 +00:00
|
|
|
<ul class="tags nolist">
|
|
|
|
<li
|
2024-08-22 00:16:02 +00:00
|
|
|
v-for="(label, slug) in tags"
|
|
|
|
:key="`tag-${slug}`"
|
2024-04-02 03:55:53 +00:00
|
|
|
class="tags-item"
|
|
|
|
>
|
|
|
|
<label class="tag noselect">
|
|
|
|
<Checkbox
|
2024-08-22 00:16:02 +00:00
|
|
|
:value="slug"
|
|
|
|
:checked="checkedTags.has(slug)"
|
2024-04-03 00:13:41 +00:00
|
|
|
class="minus"
|
2024-08-22 00:16:02 +00:00
|
|
|
@change="(checked) => toggleTag(slug, checked)"
|
|
|
|
/>{{ label }}
|
2024-04-02 03:55:53 +00:00
|
|
|
</label>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Dialog>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { ref } from 'vue';
|
|
|
|
import Cookies from 'js-cookie';
|
|
|
|
|
|
|
|
import Dialog from '#/components/dialog/dialog.vue';
|
|
|
|
import Checkbox from '#/components/form/checkbox.vue';
|
|
|
|
|
|
|
|
const cookies = Cookies.withConverter({
|
|
|
|
write: (value) => value,
|
|
|
|
});
|
|
|
|
|
2024-08-22 00:16:02 +00:00
|
|
|
const tags = {
|
|
|
|
anal: 'anal',
|
|
|
|
'anal-prolapse': 'anal prolapse',
|
|
|
|
pissing: 'pissing',
|
|
|
|
gay: 'gay',
|
|
|
|
transsexual: 'transsexual',
|
|
|
|
bisexual: 'bisexual',
|
|
|
|
bts: 'behind the scenes',
|
|
|
|
vr: 'virtual reality',
|
|
|
|
};
|
2024-04-02 03:55:53 +00:00
|
|
|
|
|
|
|
const storedTags = cookies.get('tags');
|
|
|
|
const checkedTags = ref(new Set(storedTags ? JSON.parse(storedTags) : []));
|
|
|
|
|
|
|
|
function toggleTag(tag, isChecked) {
|
|
|
|
if (isChecked) {
|
|
|
|
checkedTags.value.add(tag);
|
|
|
|
} else {
|
|
|
|
checkedTags.value.delete(tag);
|
|
|
|
}
|
|
|
|
|
|
|
|
cookies.set('tags', JSON.stringify(Array.from(checkedTags.value)), { expires: 400 }); // 100 years from now
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.dialog-body {
|
|
|
|
padding: 1rem;
|
|
|
|
width: 30rem;
|
|
|
|
max-width: 100%;
|
2024-08-22 00:16:02 +00:00
|
|
|
overflow-y: auto;
|
2024-04-02 03:55:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.tags-item {
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.tag {
|
|
|
|
display: flex;
|
|
|
|
padding: .5rem 0;
|
|
|
|
text-transform: capitalize;
|
|
|
|
|
|
|
|
.check-container {
|
|
|
|
margin-right: 1rem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|