You've already forked AstralRinth
forked from didirus/AstralRinth
Fix oled theme, docs, component bugs
This commit is contained in:
@@ -31,7 +31,7 @@
|
|||||||
>
|
>
|
||||||
{@const option = options[index]}
|
{@const option = options[index]}
|
||||||
<Checkbox
|
<Checkbox
|
||||||
checked={value.includes(option.value)}
|
checked={value && value.includes(option.value)}
|
||||||
on:change={(e) => handleChange(e, option.value)}
|
on:change={(e) => handleChange(e, option.value)}
|
||||||
>
|
>
|
||||||
{#if option.icon && typeof option.icon === 'string'}
|
{#if option.icon && typeof option.icon === 'string'}
|
||||||
|
|||||||
@@ -1,38 +1,52 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
// TODO: Fix mobile support, currently just cuts off buttons
|
// TODO: Fix mobile support, currently just cuts off buttons
|
||||||
|
|
||||||
import IconArrowRight from 'virtual:icons/heroicons-outline/arrow-right'
|
import IconArrowRight from 'virtual:icons/heroicons-outline/arrow-right';
|
||||||
import IconArrowLeft from 'virtual:icons/heroicons-outline/arrow-left'
|
import IconArrowLeft from 'virtual:icons/heroicons-outline/arrow-left';
|
||||||
import IconMinus from 'virtual:icons/heroicons-outline/minus'
|
import IconMinus from 'virtual:icons/heroicons-outline/minus';
|
||||||
import Button from "./Button.svelte";
|
import Button from './Button.svelte';
|
||||||
import { createEventDispatcher } from 'svelte'
|
import { createEventDispatcher } from 'svelte';
|
||||||
|
|
||||||
export let page: number;
|
export let page: number;
|
||||||
export let count: number;
|
export let count: number;
|
||||||
|
|
||||||
$: options = count > 4
|
$: options =
|
||||||
? page + 3 >= count
|
count > 4
|
||||||
? [1, '-', count - 4, count - 3, count - 2, count - 1, count]
|
? page + 3 >= count
|
||||||
: page > 4
|
? [1, '-', count - 4, count - 3, count - 2, count - 1, count]
|
||||||
|
: page > 4
|
||||||
? [1, '-', page - 1, page, page + 1, '-', count]
|
? [1, '-', page - 1, page, page + 1, '-', count]
|
||||||
: [1, 2, 3, 4, 5, '-', count]
|
: [1, 2, 3, 4, 5, '-', count]
|
||||||
: Array.from({ length: count }, (_, i) => i + 1)
|
: Array.from({ length: count }, (_, i) => i + 1);
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if count > 1}
|
{#if count > 1}
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
<Button color="raised" on:click={() => dispatch('change', page - 1)} disabled={page <= 1} title="Last page"><IconArrowLeft height="20px" />
|
<Button
|
||||||
|
color="raised"
|
||||||
|
on:click={() => dispatch('change', page - 1)}
|
||||||
|
disabled={page <= 1}
|
||||||
|
title="Last page"
|
||||||
|
><IconArrowLeft height="20px" />
|
||||||
</Button>
|
</Button>
|
||||||
{#each options as option}
|
{#each options as option}
|
||||||
{#if option === '-'}
|
{#if option === '-'}
|
||||||
<IconMinus class="pagination__dash" />
|
<IconMinus class="pagination__dash" />
|
||||||
{:else}
|
{:else}
|
||||||
<Button color={option === page ? 'primary' : 'raised'} on:click={() => dispatch('change', option)} evenPadding={true}>{option}</Button>
|
<Button
|
||||||
|
color={option === page ? 'primary' : 'raised'}
|
||||||
|
on:click={() => dispatch('change', option)}>{option}</Button
|
||||||
|
>
|
||||||
{/if}
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
<Button color="raised" on:click={() => dispatch('change', page + 1)} disabled={page >= count} title="Next page">
|
<Button
|
||||||
|
color="raised"
|
||||||
|
on:click={() => dispatch('change', page + 1)}
|
||||||
|
disabled={page >= count}
|
||||||
|
title="Next page"
|
||||||
|
>
|
||||||
<IconArrowRight height="20px" />
|
<IconArrowRight height="20px" />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@@ -54,7 +68,8 @@
|
|||||||
@media (width <= 500px) {
|
@media (width <= 500px) {
|
||||||
grid-gap: 0.25rem;
|
grid-gap: 0.25rem;
|
||||||
|
|
||||||
:global(> *:nth-child(4)), :global(> *:nth-child(6)) {
|
:global(> *:nth-child(4)),
|
||||||
|
:global(> *:nth-child(6)) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.oled-theme {
|
.theme-oled {
|
||||||
@extend .dark-theme;
|
@extend .dark-theme;
|
||||||
|
|
||||||
/* Container colors */
|
/* Container colors */
|
||||||
@@ -7,7 +7,6 @@
|
|||||||
--color-raised-bg-hover: hsl(220, 13%, 20%);
|
--color-raised-bg-hover: hsl(220, 13%, 20%);
|
||||||
--color-divider: hsl(220, 13%, 35%);
|
--color-divider: hsl(220, 13%, 35%);
|
||||||
--color-button-bg: hsl(220, 13%, 20%);
|
--color-button-bg: hsl(220, 13%, 20%);
|
||||||
--color-button-bg-hover: hsl(220, 13%, 15%);
|
|
||||||
|
|
||||||
/* Ad colors */
|
/* Ad colors */
|
||||||
--color-ad-bg: hsl(200, 70%, 15%);
|
--color-ad-bg: hsl(200, 70%, 15%);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ The `markdownInline` parser is perfect for translations and short bios. It doesn
|
|||||||
|
|
||||||
```svelte example raised
|
```svelte example raised
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { markdownInline } from "omorphia"
|
import { markdownInline } from "omorphia/utils"
|
||||||
|
|
||||||
const source = "This is some **bolded** and *italicized* text."
|
const source = "This is some **bolded** and *italicized* text."
|
||||||
</script>
|
</script>
|
||||||
@@ -45,7 +45,7 @@ The `markdownInline` parser is perfect for translations and short bios. It doesn
|
|||||||
|
|
||||||
```svelte example raised
|
```svelte example raised
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { ago } from 'omorphia';
|
import { ago } from 'omorphia/utils';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<p>Something happened {ago(Date.now())}.</p>
|
<p>Something happened {ago(Date.now())}.</p>
|
||||||
@@ -59,7 +59,7 @@ The `markdownInline` parser is perfect for translations and short bios. It doesn
|
|||||||
The `Permissions` class provides an easy way to manage user permissions.
|
The `Permissions` class provides an easy way to manage user permissions.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import { Permissions } from 'omorphia';
|
import { Permissions } from 'omorphia/utils';
|
||||||
|
|
||||||
const adminLevel = new Permissions('ALL');
|
const adminLevel = new Permissions('ALL');
|
||||||
const memberLevel = new Permissions(member.permissions); /* `member` from API */
|
const memberLevel = new Permissions(member.permissions); /* `member` from API */
|
||||||
@@ -76,7 +76,7 @@ The `formatVersions` function provides an easy way to parse a project's versions
|
|||||||
|
|
||||||
```svelte example raised
|
```svelte example raised
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { formatVersions } from 'omorphia';
|
import { formatVersions } from 'omorphia/utils';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<p>{formatVersions(["1.18", "1.18.1", "1.18.2", "1.17.1"])}</p>
|
<p>{formatVersions(["1.18", "1.18.1", "1.18.2", "1.17.1"])}</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user