misc: Change the way buttons are handled

This commit is contained in:
Xyphyn committed 2023-07-19 13:43:18 -07:00
1 parent d8ac0d807a
commit e243848e17
30 files changed
+215 -152

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@
<div
class="bg-white break-words
p-1 {getColor(cardColor)} rounded-xl {clazz}"
p-1 {getColor(cardColor)} rounded-md {clazz}"
>
<slot />
</div>
+11 -10
View File
@@ -1,16 +1,17 @@
<script lang="ts">
export let width = 48
export let width = 48
</script>
<svg
{width}
viewBox="0 0 100 100"
fill="none"
xmlns="http://www.w3.org/2000/svg"
{width}
viewBox="0 0 100 100"
fill="none"
xmlns="http://www.w3.org/2000/svg"
aria-label="Home"
>
<path
id="hexagon"
d="M45.5 10.8868C48.594 9.10042 52.406 9.10042 55.5 10.8868L82.3061 26.3632C85.4001 28.1496 87.3061 31.4508 87.3061 35.0235V65.9765C87.3061 69.5492 85.4001 72.8504 82.3061 74.6368L55.5 90.1132C52.406 91.8996 48.594 91.8996 45.5 90.1132L18.6939 74.6368C15.5999 72.8504 13.6939 69.5492 13.6939 65.9765V35.0235C13.6939 31.4508 15.5999 28.1496 18.6939 26.3632L45.5 10.8868Z"
class="fill-black dark:fill-white"
/>
<path
id="hexagon"
d="M45.5 10.8868C48.594 9.10042 52.406 9.10042 55.5 10.8868L82.3061 26.3632C85.4001 28.1496 87.3061 31.4508 87.3061 35.0235V65.9765C87.3061 69.5492 85.4001 72.8504 82.3061 74.6368L55.5 90.1132C52.406 91.8996 48.594 91.8996 45.5 90.1132L18.6939 74.6368C15.5999 72.8504 13.6939 69.5492 13.6939 65.9765V35.0235C13.6939 31.4508 15.5999 28.1496 18.6939 26.3632L45.5 10.8868Z"
class="fill-black dark:fill-white"
/>
</svg>
+12 -16
View File
@@ -3,6 +3,7 @@
import Button from '$lib/components/input/Button.svelte'
import Link from '$lib/components/input/Link.svelte'
import Logo from '$lib/components/ui/Logo.svelte'
import Spinner from '$lib/components/ui/loader/Spinner.svelte'
import Menu from '$lib/components/ui/menu/Menu.svelte'
import MenuButton from '$lib/components/ui/menu/MenuButton.svelte'
import { authData, getInstance, instance, user } from '$lib/lemmy.js'
@@ -23,7 +24,7 @@
<nav
class="flex flex-row gap-2 items-center sticky top-0 bg-slate-50/80
lg:bg-white/80 lg:rounded-b-xl
lg:bg-white/80 lg:rounded-b-md
dark:bg-zinc-950/80 lg:dark:bg-zinc-900/80 backdrop-blur-3xl max-w-5xl
w-full mx-auto px-4 py-2 z-50 lg:border-x lg:border-b transition-all
border-slate-200 dark:border-zinc-800 box-border"
@@ -31,30 +32,25 @@
<div class="flex flex-row gap-2 items-center mr-auto">
<a href="/" class="flex flex-row items-center gap-2">
<Logo width={40} />
<div class="flex flex-col">
<span class="font-bold">Photon</span>
<span
class="text-xs opacity-50
transition-opacity"
>
{$instance}
</span>
</div>
<span class="opacity-30 text-lg">/</span>
<span class="text-sm font-bold">
{$instance}
</span>
</a>
</div>
<div class="flex flex-row gap-2 py-2 px-3">
<Link href="/communities" label="Communities">
<Icon src={GlobeAlt} width={16} />
<span class="hidden sm:inline ml-1">Explore</span>
</Link>
<Button href="/communities" label="Communities">
<Icon src={GlobeAlt} width={16} slot="icon" />
<span class="hidden sm:inline">Explore</span>
</Button>
<Menu let:toggleOpen alignment="bottom-right">
<Button
color={Color.accent}
color="primary"
slot="button"
label="Create"
on:click={toggleOpen}
>
<Icon src={Plus} width={18} mini />
<Icon src={Plus} width={18} mini slot="icon" />
<span class="hidden sm:inline">Create</span>
</Button>
<li class="text-xs opacity-80 text-left mx-4 my-1 py-1">Create</li>
+1 -1
View File
@@ -1,7 +1,7 @@
<aside
class="sticky top-20 border bg-white border-slate-200
dark:border-zinc-800 dark:bg-zinc-900 break-words flex
flex-col gap-4 p-6 w-[20rem] rounded-xl h-max max-h-[calc(100vh-6rem)]
flex-col gap-4 p-6 w-[20rem] rounded-md h-max max-h-[calc(100vh-6rem)]
overflow-auto"
>
<slot />
+8 -4
View File
@@ -1,8 +1,12 @@
<script lang="ts">
export let width: number = 28
export let width: number = 32
</script>
<div class="spinner" style="width: {width}px; height: {width}px;">
<div
class="spinner"
style="width: {width}px; height: {width}px;"
role="progressbar"
>
<div class="bar1" />
<div class="bar2" />
<div class="bar3" />
@@ -25,8 +29,8 @@
}
div.spinner div {
width: 6%;
height: 16%;
width: 7.5%;
height: 22%;
position: absolute;
left: 49%;
top: 43%;