Accessibility settings to the app

Screen reader readable "Show Help" button.
Also added a new checkbox for accessibility settings.
This commit is contained in:
LL
2023-06-12 07:20:42 +09:00
parent 32f58fef1d
commit c829a539fc
14 changed files with 65 additions and 84 deletions

View File

@@ -4,17 +4,22 @@
export let check = false
export let onChange = (check) => {}
export let margin = true
export let name = ''
export let hiddenName = false
</script>
<label class:mr-2={margin}>
<input type="checkbox" class="hidden" bind:checked={check} on:change={() => {
<label title={name} class:mr-2={margin} class="flex relative">
<input title={name} type="checkbox" class='absolute opacity-0 w-6 h-6' bind:checked={check} on:change={() => {
onChange(check)
}}>
}}/>
{#if check}
<div class="w-6 h-6 bg-green-500 flex justify-center items-center text-sm">
<CheckIcon />
</div>
{:else}
<div class="w-6 h-6 bg-selected"></div>
<div class="w-6 h-6 bg-selected flex justify-center items-center text-sm"/>
{/if}
</label>
{#if name != '' && !hiddenName}
<span class="text-neutral-200 ml-2">{name}</span>
{/if}
</label>

View File

@@ -1,8 +1,7 @@
<button class="relative help inline-block cursor-default hover:text-green-500" on:click={() => {
<button title={name+' '+language.showHelp} class="relative help inline-block cursor-default hover:text-green-500" on:click={() => {
alertMd(language.help[key])
}}>
{#if key === "experimental"}
<div class="text-red-500 hover:text-green-500">
<FlaskConicalIcon size={16} />
@@ -13,9 +12,8 @@
</div>
{:else}
<HelpCircleIcon size={14} />
{/if}
{/if}
</button>
<script lang="ts">
import { AlertTriangle, FlaskConicalIcon, HelpCircleIcon } from "lucide-svelte";
import { language } from "src/lang";
@@ -23,4 +21,5 @@
export let unrecommended = false
export let key: (keyof (typeof language.help))
export let name = ''
</script>