feat(frontend): working Discord login + signup

This commit is contained in:
Sam 2023-03-12 04:25:53 +01:00
parent 0e72097346
commit c8b5b7e2c2
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
24 changed files with 287 additions and 119 deletions

View file

@ -1,6 +1,7 @@
<script lang="ts">
export let urls: string[] | null;
export let urls: string[];
export let alt: string;
export let width = 300;
const contentTypeFor = (url: string) => {
if (url.endsWith(".webp")) {
@ -15,14 +16,14 @@
};
</script>
{#if urls}
{#if urls.length > 0}
<picture class="rounded-circle img-fluid">
{#each urls as url}
<source width=300 srcSet={url} type={contentTypeFor(url)} />
<source {width} srcSet={url} type={contentTypeFor(url)} />
{/each}
<img width=300 src={urls[0]} {alt} class="rounded-circle img-fluid" />
<img {width} src={urls[0]} {alt} class="rounded-circle img-fluid" />
</picture>
{:else}
<!-- TODO: actual placeholder that isn't a cat -->
<img width=300 class="rounded-circle img-fluid" src="https://placekitten.com/512/512" {alt} />
<img {width} class="rounded-circle img-fluid" src="https://placekitten.com/512/512" {alt} />
{/if}