Compare commits
No commits in common. "047fc545ae416f64d8a19dcbbcd8f126115e7f14" and "ac7b8e701381ed0d700c61d306f5198d49a72f0a" have entirely different histories.
047fc545ae
...
ac7b8e7013
10 changed files with 9 additions and 131 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "@yusurko/vigil",
|
"name": "@yusurko/vigil",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.1.0-dev74",
|
"version": "0.1.0-dev62",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite dev",
|
"dev": "vite dev",
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ let { narrow = false, small = false, children } : { narrow?: boolean, small ?: b
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="centered" class:narrow={narrow} class:small={small}>
|
<div class="centered" class:narrow={narrow} class:small={small}>
|
||||||
{@render children() }
|
{@render children () }
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
<script lang="ts">
|
|
||||||
import { getColorThemeCode, setColorThemeCode } from "./globals.svelte";
|
|
||||||
|
|
||||||
|
|
||||||
let color_values = [
|
|
||||||
{name: "Default"},
|
|
||||||
{name: "Rei"},
|
|
||||||
{name: "Ai"},
|
|
||||||
{name: "Aqua"},
|
|
||||||
{name: "Neru"},
|
|
||||||
{name: "Gumi"},
|
|
||||||
{name: "Emu"},
|
|
||||||
{name: "Spacegray"},
|
|
||||||
{name: "Haku"},
|
|
||||||
{name: "Miku"},
|
|
||||||
{name: "Defoko"},
|
|
||||||
{name: "Kaito"},
|
|
||||||
{name: "Meiko"},
|
|
||||||
{name: "WhatsApp"},
|
|
||||||
{name: "Teto"},
|
|
||||||
{name: "Ruby"}
|
|
||||||
];
|
|
||||||
|
|
||||||
// NOT AFFILIATED with the following:
|
|
||||||
// Oshi No Ko right holders, TwinDrill, Crypton Future Media or Meta Platforms!!
|
|
||||||
|
|
||||||
let { value = $bindable(0) } = $props();
|
|
||||||
|
|
||||||
$effect(() => {
|
|
||||||
if (+value !== getColorThemeCode()) {
|
|
||||||
setColorThemeCode(value);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<ul class="grid">
|
|
||||||
{#each color_values as {name: cname}, cval}
|
|
||||||
<li>
|
|
||||||
<label>
|
|
||||||
<input type="radio" name="color_theme" value={cval} checked={value == cval} onclick={() => {
|
|
||||||
value = cval;
|
|
||||||
}} />
|
|
||||||
<span class="color-nugget" style:--color={`var(--c${+cval}-accent)`}></span>
|
|
||||||
<span>{cname}</span>
|
|
||||||
</label>
|
|
||||||
</li>
|
|
||||||
{/each}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.color-nugget {
|
|
||||||
display: inline-block;
|
|
||||||
height: 1em;
|
|
||||||
width: 1em;
|
|
||||||
border-radius: 1em;
|
|
||||||
background-color: var(--color);
|
|
||||||
border: 1px solid var(--color, var(--border));
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { RiCompassLine, RiHome2Line, RiSettings2Line, RiShieldStarLine, RiAddBoxLine, RiUserLine } from 'svelte-remixicon';
|
import { RiCompassLine, RiHome2Line, RiSettings2Line, RiShieldStarLine, RiUserLine } from 'svelte-remixicon';
|
||||||
import MenuLink from './MenuLink.svelte';
|
import MenuLink from './MenuLink.svelte';
|
||||||
|
|
||||||
let { user = null } = $props();
|
let { user = null } = $props();
|
||||||
|
|
@ -11,9 +11,6 @@
|
||||||
<MenuLink href="/settings" icon={RiSettings2Line} label="Settings" />
|
<MenuLink href="/settings" icon={RiSettings2Line} label="Settings" />
|
||||||
{#if user}
|
{#if user}
|
||||||
<MenuLink href="/@{user.username}" icon={RiUserLine} label="My profile" />
|
<MenuLink href="/@{user.username}" icon={RiUserLine} label="My profile" />
|
||||||
{#if true}
|
|
||||||
<MenuLink href="/createguild" icon={RiAddBoxLine} label="Create guild" />
|
|
||||||
{/if}
|
|
||||||
{#if user.badges && user.badges.indexOf('administrator') >= 0}
|
{#if user.badges && user.badges.indexOf('administrator') >= 0}
|
||||||
<MenuLink href="/admin/" icon={RiShieldStarLine} label="Administration" />
|
<MenuLink href="/admin/" icon={RiShieldStarLine} label="Administration" />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
<script lang="ts">
|
|
||||||
import { RiShieldStarLine } from "svelte-remixicon";
|
|
||||||
import AsideCard from "./AsideCard.svelte";
|
|
||||||
import Centered from "./Centered.svelte";
|
|
||||||
import { getMe } from "./globals.svelte";
|
|
||||||
import Wip from "./Wip.svelte";
|
|
||||||
|
|
||||||
let { guildName, mods } = $props();
|
|
||||||
let me = getMe();
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{#if me && mods}
|
|
||||||
|
|
||||||
{#if mods.banned}
|
|
||||||
<Centered>Moderator list is hidden because you are banned.</Centered>
|
|
||||||
{:else if mods.unmoderated}
|
|
||||||
<Centered>+{guildName} is currently unmoderated</Centered>
|
|
||||||
{:else}
|
|
||||||
<AsideCard title={`Moderators of +${guildName}`}>
|
|
||||||
<ul>
|
|
||||||
{#each mods.has as mod}
|
|
||||||
<li>
|
|
||||||
@{mod.username}
|
|
||||||
{#if mod.is_owner}
|
|
||||||
<span><RiShieldStarLine/> <small>Owner</small></span>
|
|
||||||
{/if}
|
|
||||||
</li>
|
|
||||||
{/each}
|
|
||||||
</ul>
|
|
||||||
</AsideCard>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{/if}
|
|
||||||
|
|
@ -65,10 +65,6 @@ export function getColorThemeCode (): number {
|
||||||
return health.color_theme;
|
return health.color_theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setColorThemeCode(value: number) {
|
|
||||||
health.color_theme = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function isLoaded(): boolean {
|
export function isLoaded(): boolean {
|
||||||
return health.loaded;
|
return health.loaded;
|
||||||
}
|
}
|
||||||
|
|
@ -1,15 +1,12 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { GuildEntry, PostEntry } from "$lib/backend";
|
import type { GuildEntry, PostEntry } from "$lib/backend";
|
||||||
import Feed from "$lib/Feed.svelte";
|
import Feed from "$lib/Feed.svelte";
|
||||||
import { getMe } from "$lib/globals.svelte";
|
|
||||||
import GuildAbout from "$lib/GuildAbout.svelte";
|
import GuildAbout from "$lib/GuildAbout.svelte";
|
||||||
import GuildMenu from "$lib/GuildMenu.svelte";
|
import GuildMenu from "$lib/GuildMenu.svelte";
|
||||||
import ModeratorList from "$lib/ModeratorList.svelte";
|
|
||||||
import SLayout from "$lib/SLayout.svelte";
|
import SLayout from "$lib/SLayout.svelte";
|
||||||
|
|
||||||
let { data } : { data: { guild: GuildEntry , feed: PostEntry[], mods: any } } = $props();
|
let { data } : { data: { guild: GuildEntry , feed: PostEntry[] } } = $props();
|
||||||
let { guild, feed = [], mods = null } = $derived(data);
|
let { guild, feed = [] } = $derived(data);
|
||||||
let me = getMe();
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -22,9 +19,5 @@
|
||||||
|
|
||||||
{#snippet right()}
|
{#snippet right()}
|
||||||
<GuildAbout {guild} />
|
<GuildAbout {guild} />
|
||||||
|
|
||||||
{#if me}
|
|
||||||
<ModeratorList guildName={guild.name} {mods} />
|
|
||||||
{/if}
|
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</SLayout>
|
</SLayout>
|
||||||
|
|
@ -25,14 +25,7 @@ export async function load(event) {
|
||||||
|
|
||||||
if (!guild) error(404);
|
if (!guild) error(404);
|
||||||
|
|
||||||
let mods = null;
|
return { guild, feed };
|
||||||
const respMods = await backend.withEvent(event).fetch('guild/@' + encodeURIComponent(name) + '/mods');
|
|
||||||
|
|
||||||
if (respMods.status === 200) {
|
|
||||||
const respModsJ = await respMods.json();
|
|
||||||
mods = respModsJ;
|
|
||||||
}
|
|
||||||
return { guild, feed, mods };
|
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,6 @@ let { children } = $props();
|
||||||
</ul>
|
</ul>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
{#snippet right()}
|
{#snippet right()}
|
||||||
<button class="primary card" disabled>Save</button>
|
<button class="primary card">Save</button>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
</SLayout>
|
</SLayout>
|
||||||
|
|
@ -1,11 +1,2 @@
|
||||||
<script lang="ts">
|
|
||||||
import ColorThemeSelect from "$lib/ColorThemeSelect.svelte";
|
|
||||||
import { getColorThemeCode } from "$lib/globals.svelte";
|
|
||||||
|
|
||||||
let color_theme = $state(getColorThemeCode());
|
TODO
|
||||||
</script>
|
|
||||||
|
|
||||||
<section>
|
|
||||||
<h2>Color theme</h2>
|
|
||||||
<ColorThemeSelect bind:value={color_theme} />
|
|
||||||
</section>
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue