Tweak some layout stuff

This commit is contained in:
Jon Staab
2024-08-23 16:54:05 -07:00
parent 8dac345fc4
commit 51b0c69513
12 changed files with 108 additions and 11 deletions

View File

@@ -46,6 +46,14 @@
@apply p-6 bg-base-100 text-base-content rounded-box;
}
.card2.card2-sm {
@apply p-4 bg-base-100 text-base-content rounded-box;
}
.card2.card2-alt {
@apply bg-base-300;
}
.column {
@apply flex flex-col;
}

View File

@@ -160,7 +160,7 @@
})
</script>
<div class="flex gap-2 relative z-feature border-t border-solid border-base-100 p-2 shadow-top-xl bg-neutral">
<div class="flex gap-2 relative z-feature border-t border-solid border-base-100 p-2 shadow-top-xl bg-base-100">
<Button on:click={addFile} class="bg-base-300 rounded-box w-10 h-10 center">
{#if uploading}
<span class="loading loading-spinner loading-xs"></span>

View File

@@ -24,7 +24,7 @@
as a user.
</p>
{#each DEFAULT_RELAYS as url}
<div class="alert !flex items-center justify-between">
<div class="card2 card2-alt card2-sm flex items-center justify-between">
<div class="flex items-center gap-2">
<Icon icon="remote-controller-minimalistic" />
{displayRelayUrl(url)}

View File

@@ -37,7 +37,7 @@
}
</script>
<div class="relative w-14 bg-base-100 flex-shrink-0" bind:this={element}>
<div class="relative w-14 bg-base-100 flex-shrink-0 pt-4" bind:this={element}>
<div
class="absolute z-nav-active ml-2 h-[144px] w-12 bg-base-300"
style={`top: ${$activeOffset}px`} />

View File

@@ -204,7 +204,6 @@ export const load = (request: SubscribeRequest) =>
const events: TrustedEvent[] = []
sub.emitter.on("event", (url: string, e: SignedEvent) => events.push(e))
sub.emitter.on("complete", () => resolve(events))
})
@@ -339,6 +338,15 @@ export const {
}),
})
export const searchRelays = derived(relays, $relays =>
createSearch($relays, {
getValue: (relay: Relay) => relay.url,
fuseOptions: {
keys: ["url", "name", {name: "description", weight: 0.3}],
},
}),
)
// Handles
export const handles = writable<Handle[]>([])

View File

@@ -0,0 +1,5 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<circle cx="12" cy="9" r="3" stroke="#1C274C" stroke-width="1.5"/>
<circle cx="12" cy="12" r="10" stroke="#1C274C" stroke-width="1.5"/>
<path d="M17.9692 20C17.81 17.1085 16.9247 15 12 15C7.07526 15 6.18996 17.1085 6.03081 20" stroke="#1C274C" stroke-width="1.5" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 391 B

View File

@@ -56,6 +56,7 @@
import SquareShareLine from "@assets/icons/Square Share Line.svg?dataurl"
import UFO3 from "@assets/icons/UFO 3.svg?dataurl"
import UserHeart from "@assets/icons/User Heart.svg?dataurl"
import UserCircle from "@assets/icons/User Circle.svg?dataurl"
import UserRounded from "@assets/icons/User Rounded.svg?dataurl"
import Widget from "@assets/icons/Widget.svg?dataurl"
import WiFiRouterRound from "@assets/icons/Wi-Fi Router Round.svg?dataurl"
@@ -114,6 +115,7 @@
"ufo-3": UFO3,
"square-share-line": SquareShareLine,
"user-heart": UserHeart,
"user-circle": UserCircle,
"user-rounded": UserRounded,
widget: Widget,
"wifi-router-round": WiFiRouterRound,

View File

@@ -145,7 +145,7 @@
<div data-theme={$theme} />
{:then}
<div data-theme={$theme}>
<div class="flex h-screen">
<div class="flex h-screen overflow-hidden">
<PrimaryNav />
<slot />
</div>

View File

@@ -15,15 +15,20 @@
<SecondaryNavSection>
<div in:fly|local>
<SecondaryNavItem href="/settings">
<Icon icon="settings" /> Settings
<Icon icon="user-circle" /> Profile
</SecondaryNavItem>
</div>
<div in:fly|local>
<div in:fly|local={{delay: 50}}>
<SecondaryNavItem href="/settings/relays">
<Icon icon="remote-controller-minimalistic" /> Relays
</SecondaryNavItem>
</div>
<div in:fly|local={{delay: 100}}>
<SecondaryNavItem href="/settings/about">
<Icon icon="info-square" /> About
</SecondaryNavItem>
</div>
<div in:fly|local={{delay: 50}}>
<div in:fly|local={{delay: 150}}>
<SecondaryNavItem class="text-error hover:text-error" on:click={logout}>
<Icon icon="exit" /> Log Out
</SecondaryNavItem>

View File

@@ -12,18 +12,18 @@
<div class="hero min-h-screen bg-base-200">
<div class="hero-content">
<div class="column content gap-6">
<p class="text-center text-3xl">Thanks for using</p>
<p class="text-center text-2xl">Thanks for using</p>
<h1 class="mb-4 text-center text-5xl font-bold uppercase">Flotilla</h1>
<div class="grid grid-cols-1 gap-8 lg:grid-cols-2">
<div class="card2 shadow-2xl flex flex-col gap-2 text-center">
<h3 class="text-xl sm:h-12">Support development</h3>
<h3 class="text-2xl sm:h-12">Support development</h3>
<p class="sm:h-16">Funds will be used to support development.</p>
<Button class="btn btn-primary">
Zap the Developer
</Button>
</div>
<div class="card2 shadow-2xl flex flex-col gap-2 text-center">
<h3 class="text-xl sm:h-12">Get in touch</h3>
<h3 class="text-2xl sm:h-12">Get in touch</h3>
<p class="sm:h-16">Having problems? Let us know by filing an issue.</p>
<Link
external

View File

@@ -0,0 +1,68 @@
<script lang="ts">
import {onMount} from 'svelte'
import {readable} from 'svelte/store'
import {displayRelayUrl, isShareableRelayUrl} from '@welshman/util'
import type {SignedEvent} from '@welshman/util'
import Button from "@lib/components/Button.svelte"
import Link from "@lib/components/Link.svelte"
import Icon from "@lib/components/Icon.svelte"
import {clip} from "@app/toast"
import {DEFAULT_RELAYS, INDEXER_RELAYS} from "@app/base"
import {searchRelays, subscribe, loadRelay} from "@app/state"
const relays = readable(DEFAULT_RELAYS)
const removeRelay = (url: string) => null
const addRelay = (url: string) => null
let term = ""
onMount(() => {
const sub = subscribe({
filters: [{kinds: [30166], '#N': ['29']}],
relays: [...INDEXER_RELAYS, ...DEFAULT_RELAYS],
})
sub.emitter.on('event', (url: string, event: SignedEvent) => {
const d = event.tags.find(t => t[0] === 'd')?.[1] || ""
if (isShareableRelayUrl(d)) {
loadRelay(d)
}
})
return () => sub.close()
})
</script>
<div class="content column gap-4">
<h1 class="superheading mt-20">Relays</h1>
<p class="text-center">Get connected with the nostr network</p>
{#each $relays as url}
<div class="card2 card2-sm flex items-center justify-between">
<div class="flex items-center gap-2">
<Icon icon="remote-controller-minimalistic" />
{displayRelayUrl(url)}
</div>
<Button class="flex items-center" on:click={() => removeRelay(url)}>
<Icon icon="close-circle" />
</Button>
</div>
{/each}
<label class="input input-bordered flex w-full items-center gap-2">
<Icon icon="magnifer" />
<input bind:value={term} class="grow" type="text" placeholder="Search for relays..." />
</label>
{#each $searchRelays.searchValues(term).filter(url => !$relays.includes(url)) as url (url)}
<div class="card2 card2-sm flex items-center justify-between">
<div class="flex items-center gap-2">
<Icon icon="remote-controller-minimalistic" />
{displayRelayUrl(url)}
</div>
<Button class="flex items-center" on:click={() => addRelay(url)}>
<Icon icon="add-circle" />
</Button>
</div>
{/each}
</div>

View File

@@ -64,6 +64,7 @@
</Popover>
{/if}
</div>
<div class="my-3 h-px bg-base-200" />
<div in:fly|local>
<SecondaryNavItem href="/spaces/{nom}">
<Icon icon="chat-round" /> Chat