mirror of
https://github.com/iptv-org/iptv-org.github.io.git
synced 2025-05-11 17:40:05 -04:00
Fixes contrast issues
This commit is contained in:
parent
ed62330e7d
commit
5ff37d78ef
16 changed files with 134 additions and 161 deletions
|
@ -3,7 +3,7 @@
|
|||
import DownloadButton from '~/components/DownloadButton.svelte'
|
||||
import SelectAllButton from '~/components/SelectAllButton.svelte'
|
||||
import Divider from '~/components/Divider.svelte'
|
||||
import SquareButton from '~/components/SquareButton.svelte'
|
||||
import CloseButton from '~/components/CloseButton.svelte'
|
||||
import { selected } from '~/store'
|
||||
import { downloadMode } from '~/store'
|
||||
</script>
|
||||
|
@ -20,24 +20,11 @@
|
|||
<SelectAllButton />
|
||||
<DownloadButton />
|
||||
<Divider />
|
||||
<SquareButton
|
||||
<CloseButton
|
||||
on:click={() => {
|
||||
downloadMode.set(false)
|
||||
}}
|
||||
>
|
||||
<svg
|
||||
class="w-5 h-5"
|
||||
fill="currentColor"
|
||||
viewBox="0 0 20 20"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
||||
clip-rule="evenodd"
|
||||
></path>
|
||||
</svg>
|
||||
</SquareButton>
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
import HTMLPreview from '~/components/HTMLPreview.svelte'
|
||||
import EditButton from '~/components/EditButton.svelte'
|
||||
import Divider from '~/components/Divider.svelte'
|
||||
import SquareButton from '~/components/SquareButton.svelte'
|
||||
import CloseButton from '~/components/CloseButton.svelte'
|
||||
import { getContext } from 'svelte'
|
||||
|
||||
export let channel
|
||||
|
@ -14,13 +14,9 @@
|
|||
close()
|
||||
}
|
||||
}
|
||||
|
||||
const closePopup = () => {
|
||||
close()
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="relative px-2 py-24 flex justify-center" on:keypress on:click|self={closePopup}>
|
||||
<div class="relative px-2 py-24 flex justify-center" on:keypress on:click|self={close}>
|
||||
<div class="relative bg-white rounded-md shadow dark:bg-gray-800 w-full max-w-[820px]">
|
||||
<div
|
||||
class="flex justify-between items-center py-3 pl-5 pr-4 rounded-t border-b dark:border-gray-700"
|
||||
|
@ -32,25 +28,12 @@
|
|||
<div class="inline-flex w-1/3 justify-end space-x-3 items-center">
|
||||
<EditButton {channel} />
|
||||
<Divider />
|
||||
<SquareButton on:click={closePopup}>
|
||||
<svg
|
||||
class="w-5 h-5"
|
||||
fill="currentColor"
|
||||
viewBox="0 0 20 20"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
||||
clip-rule="evenodd"
|
||||
></path>
|
||||
</svg>
|
||||
</SquareButton>
|
||||
<CloseButton on:click={close} />
|
||||
</div>
|
||||
</div>
|
||||
<div class="overflow-y-auto overflow-x-hidden w-full">
|
||||
<div class="p-12 pt-10">
|
||||
<HTMLPreview data={channel} close={closePopup} />
|
||||
<HTMLPreview data={channel} {close} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
13
src/components/CloseButton.svelte
Normal file
13
src/components/CloseButton.svelte
Normal file
|
@ -0,0 +1,13 @@
|
|||
<script>
|
||||
import SquareButton from '~/components/SquareButton.svelte'
|
||||
</script>
|
||||
|
||||
<SquareButton on:click area-label="Close">
|
||||
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
||||
clip-rule="evenodd"
|
||||
></path>
|
||||
</svg>
|
||||
</SquareButton>
|
|
@ -1,6 +1,6 @@
|
|||
<script>
|
||||
import { downloadMode } from '~/store'
|
||||
import DefaultButton from '~/components/DefaultButton.svelte'
|
||||
import OutlineButton from '~/components/OutlineButton.svelte'
|
||||
import ActionButton from '~/components/ActionButton.svelte'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<button
|
||||
{...$$restProps}
|
||||
class="rounded-md bg-transparent transition-colors duration-200 border border-gray-200 hover:border-gray-400 dark:border-gray-700 dark:bg-gray-700 text-gray-700 dark:text-white dark:hover:bg-gray-600 dark:hover:border-gray-600 text-sm font-normal text-center px-4 h-10 flex items-center justify-center w-auto space-x-3 shrink-0 min-w-14"
|
||||
type="button"
|
||||
on:click
|
||||
class="rounded-lg text-sm h-10 flex items-center justify-center text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 space-x-3 px-3"
|
||||
>
|
||||
<slot />
|
||||
</button>
|
||||
|
|
|
@ -1 +1 @@
|
|||
<span class="w-[1px] h-[24px] bg-gray-200 dark:bg-gray-700"></span>
|
||||
<span class="w-[1px] h-[22px] bg-gray-200 dark:bg-gray-700"></span>
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<script>
|
||||
import DefaultButton from '~/components/DefaultButton.svelte'
|
||||
|
||||
export let channel
|
||||
|
||||
const endpoint = 'https://github.com/iptv-org/database/issues/new'
|
||||
|
@ -15,15 +17,11 @@
|
|||
}
|
||||
</script>
|
||||
|
||||
<button
|
||||
on:click={goToEdit}
|
||||
type="button"
|
||||
class="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm ml-auto inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white h-10 justify-center space-x-3 px-3"
|
||||
>
|
||||
<DefaultButton on:click={goToEdit}>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" class="w-4 h-4">
|
||||
<path
|
||||
d="M21.731 2.269a2.625 2.625 0 00-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 000-3.712zM19.513 8.199l-3.712-3.712-12.15 12.15a5.25 5.25 0 00-1.32 2.214l-.8 2.685a.75.75 0 00.933.933l2.685-.8a5.25 5.25 0 002.214-1.32L19.513 8.2z"
|
||||
/>
|
||||
</svg>
|
||||
<span>Edit</span>
|
||||
</button>
|
||||
</DefaultButton>
|
||||
|
|
24
src/components/GitHubButton.svelte
Normal file
24
src/components/GitHubButton.svelte
Normal file
|
@ -0,0 +1,24 @@
|
|||
<script>
|
||||
import SquareButton from '~/components/SquareButton.svelte'
|
||||
</script>
|
||||
|
||||
<SquareButton
|
||||
on:click={() => {
|
||||
window.open('https://github.com/iptv-org/', '_blank', 'noreferrer')
|
||||
}}
|
||||
aria-label="GitHub"
|
||||
>
|
||||
<svg
|
||||
class="w-5 h-5"
|
||||
aria-hidden="true"
|
||||
focusable="false"
|
||||
role="img"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 496 512"
|
||||
>
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"
|
||||
></path>
|
||||
</svg>
|
||||
</SquareButton>
|
|
@ -89,12 +89,12 @@
|
|||
{#each fieldset as field}
|
||||
<tr>
|
||||
<td class="align-top w-[11rem]">
|
||||
<div class="flex pr-4 py-1 text-sm text-gray-400 whitespace-nowrap dark:text-gray-400">
|
||||
<div class="flex pr-4 py-1 text-sm text-gray-500 whitespace-nowrap dark:text-gray-400">
|
||||
{field.name}
|
||||
</div>
|
||||
</td>
|
||||
<td class="align-top">
|
||||
<div class="flex py-1 text-sm text-gray-700 dark:text-gray-100 flex-wrap">
|
||||
<div class="flex py-1 text-sm text-gray-800 dark:text-gray-100 flex-wrap">
|
||||
{#if field.type === 'image'}
|
||||
<img
|
||||
src={field.value}
|
||||
|
|
|
@ -4,26 +4,13 @@
|
|||
import SearchFieldMini from './SearchFieldMini.svelte'
|
||||
import Divider from './Divider.svelte'
|
||||
import CreatePlaylistButton from './CreatePlaylistButton.svelte'
|
||||
import SquareButton from './SquareButton.svelte'
|
||||
import ToggleModeButton from './ToggleModeButton.svelte'
|
||||
import GitHubButton from './GitHubButton.svelte'
|
||||
import { goto } from '$app/navigation'
|
||||
import { page } from '$app/stores'
|
||||
|
||||
export let withSearch = false
|
||||
|
||||
let dark = false
|
||||
function toggleDarkMode() {
|
||||
let mode = localStorage.theme || 'light'
|
||||
if (mode === 'dark' || window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
dark = false
|
||||
document.documentElement.classList.remove('dark')
|
||||
localStorage.theme = 'light'
|
||||
} else {
|
||||
dark = true
|
||||
document.documentElement.classList.add('dark')
|
||||
localStorage.theme = 'dark'
|
||||
}
|
||||
}
|
||||
|
||||
function reset() {
|
||||
document.body.scrollIntoView()
|
||||
query.set('')
|
||||
|
@ -75,53 +62,8 @@
|
|||
/>
|
||||
<Divider />
|
||||
<div class="inline-flex space-x-2">
|
||||
<SquareButton type="button" on:click={toggleDarkMode} aria-label="Toggle Dark Mode">
|
||||
<svg
|
||||
class="w-5 h-5"
|
||||
class:hidden={dark}
|
||||
fill="currentColor"
|
||||
viewBox="0 0 20 20"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
aria-hidden="true"
|
||||
focusable="false"
|
||||
role="img"
|
||||
>
|
||||
<path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"></path>
|
||||
</svg>
|
||||
<svg
|
||||
class="w-5 h-5"
|
||||
class:hidden={!dark}
|
||||
fill="currentColor"
|
||||
viewBox="0 0 20 20"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z"
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
></path>
|
||||
</svg>
|
||||
</SquareButton>
|
||||
<SquareButton
|
||||
on:click={() => {
|
||||
window.open('https://github.com/iptv-org/', '_blank', 'noreferrer')
|
||||
}}
|
||||
aria-label="GitHub"
|
||||
>
|
||||
<svg
|
||||
class="w-5 h-5"
|
||||
aria-hidden="true"
|
||||
focusable="false"
|
||||
role="img"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 496 512"
|
||||
>
|
||||
<path
|
||||
fill="currentColor"
|
||||
d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"
|
||||
></path>
|
||||
</svg>
|
||||
</SquareButton>
|
||||
<ToggleModeButton />
|
||||
<GitHubButton />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
7
src/components/OutlineButton.svelte
Normal file
7
src/components/OutlineButton.svelte
Normal file
|
@ -0,0 +1,7 @@
|
|||
<button
|
||||
{...$$restProps}
|
||||
class="rounded-md bg-transparent transition-colors duration-200 border border-gray-200 hover:border-gray-300 dark:border-gray-700 dark:bg-gray-700 text-gray-700 dark:text-white dark:hover:bg-gray-600 dark:hover:border-gray-600 text-sm font-normal text-center px-4 h-10 flex items-center justify-center w-auto space-x-3 shrink-0 min-w-14"
|
||||
on:click
|
||||
>
|
||||
<slot />
|
||||
</button>
|
|
@ -1,8 +1,11 @@
|
|||
<script>
|
||||
import CloseButton from '~/components/CloseButton.svelte'
|
||||
import { getContext } from 'svelte'
|
||||
const { close } = getContext('simple-modal')
|
||||
|
||||
export let title = 'Search syntax'
|
||||
|
||||
const { close } = getContext('simple-modal')
|
||||
|
||||
let examples = [
|
||||
{ query: 'cat', result: 'Finds channels that have "cat" in their descriptions.' },
|
||||
{ query: 'cat dog', result: 'Finds channels that have "cat" AND "dog" in their descriptions.' },
|
||||
|
@ -47,29 +50,12 @@
|
|||
<div class="relative px-2 py-20 flex justify-center" on:keypress on:click|self={close}>
|
||||
<div class="relative bg-white rounded-md shadow dark:bg-gray-800 w-full max-w-2xl">
|
||||
<div
|
||||
class="flex justify-between items-center py-4 pl-5 pr-4 rounded-t border-b dark:border-gray-700"
|
||||
class="flex justify-between items-center py-3 pl-5 pr-4 rounded-t border-b dark:border-gray-700"
|
||||
>
|
||||
<h3 class="text-l font-medium text-gray-800 dark:text-white inline-flex items-center">
|
||||
{title}
|
||||
</h3>
|
||||
<button
|
||||
on:click={close}
|
||||
type="button"
|
||||
class="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-full text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white"
|
||||
>
|
||||
<svg
|
||||
class="w-5 h-5"
|
||||
fill="currentColor"
|
||||
viewBox="0 0 20 20"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
||||
clip-rule="evenodd"
|
||||
></path>
|
||||
</svg>
|
||||
</button>
|
||||
<CloseButton on:click={close} />
|
||||
</div>
|
||||
<div class="overflow-y-auto overflow-x-hidden w-full">
|
||||
<div class="p-6 text-gray-800 dark:text-white">
|
||||
|
@ -83,8 +69,11 @@
|
|||
<tbody class="text-left">
|
||||
{#each examples as example}
|
||||
<tr class="even:bg-gray-50 even:dark:bg-gray-700">
|
||||
<td class="border dark:border-gray-700 px-4 py-3 whitespace-nowrap">
|
||||
{example.query}
|
||||
<td class="border dark:border-gray-700 px-3 py-3 whitespace-nowrap">
|
||||
<code
|
||||
class="break-words text-sm text-gray-600 bg-gray-100 dark:text-gray-300 dark:bg-gray-700 px-2 py-1 rounded-sm select-all cursor-text font-mono"
|
||||
>{example.query}</code
|
||||
>
|
||||
</td>
|
||||
<td class="border dark:border-gray-700 px-4 py-3">{example.result}</td>
|
||||
</tr>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script>
|
||||
import DefaultButton from '~/components/DefaultButton.svelte'
|
||||
import OutlineButton from '~/components/OutlineButton.svelte'
|
||||
import { selected, filteredChannels } from '~/store'
|
||||
|
||||
$: isAllSelected = $selected.length === $filteredChannels.length
|
||||
|
@ -14,8 +14,8 @@
|
|||
</script>
|
||||
|
||||
{#if isAllSelected}
|
||||
<DefaultButton on:click={deselectAll} area-label="Deselect All ({$selected.length})">
|
||||
<span class="inline">
|
||||
<OutlineButton on:click={deselectAll} area-label="Deselect All ({$selected.length})">
|
||||
<span class="text-gray-500 dark:text-white">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
|
@ -30,10 +30,10 @@
|
|||
</svg>
|
||||
</span>
|
||||
<span class="hidden sm:inline">Deselect All ({$selected.length})</span>
|
||||
</DefaultButton>
|
||||
</OutlineButton>
|
||||
{:else}
|
||||
<DefaultButton on:click={selectAll} area-label="Select All ({$filteredChannels.length})">
|
||||
<span class="inline">
|
||||
<OutlineButton on:click={selectAll} area-label="Select All ({$filteredChannels.length})">
|
||||
<span class="text-gray-500 dark:text-white">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
|
@ -49,5 +49,5 @@
|
|||
</span>
|
||||
|
||||
<span class="hidden sm:inline">Select All ({$filteredChannels.length})</span>
|
||||
</DefaultButton>
|
||||
</OutlineButton>
|
||||
{/if}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{...$$restProps}
|
||||
type="button"
|
||||
on:click
|
||||
class="text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg text-sm h-10 w-10 flex items-center justify-center"
|
||||
class="rounded-lg text-sm h-10 w-10 flex items-center justify-center text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700"
|
||||
>
|
||||
<slot />
|
||||
</button>
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
<script>
|
||||
import CloseButton from '~/components/CloseButton.svelte'
|
||||
import StreamItem from '~/components/StreamItem.svelte'
|
||||
import { getContext } from 'svelte'
|
||||
const { close } = getContext('simple-modal')
|
||||
|
||||
export let streams = []
|
||||
export let title = 'Streams'
|
||||
|
||||
const { close } = getContext('simple-modal')
|
||||
</script>
|
||||
|
||||
<div class="relative px-2 py-32 flex justify-center" on:keypress on:click|self={close}>
|
||||
<div class="relative bg-white rounded-md shadow dark:bg-gray-800 w-full max-w-2xl">
|
||||
<div
|
||||
class="flex justify-between items-center py-4 pl-5 pr-4 rounded-t border-b dark:border-gray-700"
|
||||
class="flex justify-between items-center py-3 pl-5 pr-4 rounded-t border-b dark:border-gray-700"
|
||||
>
|
||||
<h3 class="text-l font-medium text-gray-800 dark:text-white inline-flex items-center">
|
||||
<span
|
||||
|
@ -32,25 +34,7 @@
|
|||
</svg>
|
||||
</span>{title}
|
||||
</h3>
|
||||
<button
|
||||
on:click={close}
|
||||
type="button"
|
||||
class="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-full text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white"
|
||||
area-label="Close"
|
||||
>
|
||||
<svg
|
||||
class="w-5 h-5"
|
||||
fill="currentColor"
|
||||
viewBox="0 0 20 20"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
||||
clip-rule="evenodd"
|
||||
></path>
|
||||
</svg>
|
||||
</button>
|
||||
<CloseButton on:click={close} />
|
||||
</div>
|
||||
<div class="overflow-y-auto overflow-x-hidden w-full">
|
||||
<div class="p-6 space-y-2">
|
||||
|
|
45
src/components/ToggleModeButton.svelte
Normal file
45
src/components/ToggleModeButton.svelte
Normal file
|
@ -0,0 +1,45 @@
|
|||
<script>
|
||||
import SquareButton from './SquareButton.svelte'
|
||||
|
||||
let dark = false
|
||||
function toggleDarkMode() {
|
||||
let mode = localStorage.theme || 'light'
|
||||
if (mode === 'dark' || window.matchMedia('(prefers-color-scheme: dark)').matches) {
|
||||
dark = false
|
||||
document.documentElement.classList.remove('dark')
|
||||
localStorage.theme = 'light'
|
||||
} else {
|
||||
dark = true
|
||||
document.documentElement.classList.add('dark')
|
||||
localStorage.theme = 'dark'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<SquareButton on:click={toggleDarkMode} aria-label="Toggle Dark Mode">
|
||||
<svg
|
||||
class="w-5 h-5"
|
||||
class:hidden={dark}
|
||||
fill="currentColor"
|
||||
viewBox="0 0 20 20"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
aria-hidden="true"
|
||||
focusable="false"
|
||||
role="img"
|
||||
>
|
||||
<path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"></path>
|
||||
</svg>
|
||||
<svg
|
||||
class="w-5 h-5"
|
||||
class:hidden={!dark}
|
||||
fill="currentColor"
|
||||
viewBox="0 0 20 20"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z"
|
||||
fill-rule="evenodd"
|
||||
clip-rule="evenodd"
|
||||
></path>
|
||||
</svg>
|
||||
</SquareButton>
|
Loading…
Add table
Add a link
Reference in a new issue