Skip to content

Commit

Permalink
feat: add ai-generated blocking group
Browse files Browse the repository at this point in the history
  • Loading branch information
kurozenzen committed Mar 8, 2024
1 parent a062321 commit ec06e66
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
export let dialog: HTMLDialogElement;
const close = () => dialog.close();
const reset = () => {
sort.reset();
filter.reset();
Expand All @@ -30,7 +32,11 @@

<Dialog bind:dialog on:close>
<div class="container">
<h3>Sorting and Filtering</h3>
<div class="row">
<h3>Sorting and Filtering</h3>
<div class="spacer" />
<button type="button" class="codicon codicon-close" on:click={close} />
</div>
<!-- svelte-ignore a11y-label-has-associated-control -->
<div>
<b>Sorting</b>
Expand All @@ -56,7 +62,7 @@
<RadioGroup name="rating" options={LABELS_RATING} bind:value={$filter.rating} />
</div>

<TextButton title="Return to searching" on:click={() => dialog.close()}>Done</TextButton>
<TextButton title="Return to searching" on:click={close}>Done</TextButton>
<TextButton title="Reset sort and filter" type="secondary" on:click={reset}>Reset</TextButton>
</div>
</Dialog>
Expand All @@ -77,4 +83,13 @@
display: block;
padding-bottom: var(--small-gap);
}
button {
background-color: unset;
justify-self: end;
}
.spacer {
flex-grow: 1;
}
</style>
2 changes: 2 additions & 0 deletions src/lib/logic/blocking-group-data.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export const ALL_BLOCKING_GROUPS: readonly kurosearch.BlockingGroup[] = Object.freeze([
'Loli',
'AI-Generated',
'Animal-Related',
'Non-Consentual',
'Gore',
Expand All @@ -9,6 +10,7 @@ export const ALL_BLOCKING_GROUPS: readonly kurosearch.BlockingGroup[] = Object.f
export const BLOCKING_GROUP_TAGS: Record<kurosearch.BlockingGroup, readonly string[]> =
Object.freeze({
Loli: Object.freeze(['young', 'younger', 'younger_*', 'young_*', 'lolita_*', 'loli*']),
'AI-Generated': Object.freeze(['ai_generated']),
'Animal-Related': Object.freeze([
'zoophilia',
'zoo',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/store/blocked-content-store.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ALL_BLOCKING_GROUPS } from '$lib/logic/blocking-group-data';
import { persistentWritable } from './persistent-store';
import { StoreKey } from './store-keys';

const getInitial = () => ({
Loli: true,
'AI-Generated': false,
'Animal-Related': false,
'Non-Consentual': false,
Gore: false,
Expand Down

0 comments on commit ec06e66

Please sign in to comment.