diff options
| author | Melonai <einebeere@gmail.com> | 2021-03-24 09:51:36 +0100 |
|---|---|---|
| committer | Melonai <einebeere@gmail.com> | 2021-03-24 09:51:36 +0100 |
| commit | 42860fa15985401825d8d51e73ec497fe5876710 (patch) | |
| tree | daa43dd5f4ac77e46dbdd78b1a07811fa5db755c /client/src/components | |
| parent | 5dde1f55d818a74e838afa37b0e20217b1549a83 (diff) | |
| download | shorest-42860fa15985401825d8d51e73ec497fe5876710.tar.zst shorest-42860fa15985401825d8d51e73ec497fe5876710.zip | |
Update SvelteKit to public beta
Diffstat (limited to 'client/src/components')
| -rw-r--r-- | client/src/components/Form.svelte | 64 | ||||
| -rw-r--r-- | client/src/components/Response.svelte | 33 | ||||
| -rw-r--r-- | client/src/components/Responses.svelte | 24 | ||||
| -rw-r--r-- | client/src/components/Title.svelte | 22 | ||||
| -rw-r--r-- | client/src/components/icons/ArrowIcon.svelte | 10 | ||||
| -rw-r--r-- | client/src/components/icons/CrossIcon.svelte | 10 |
6 files changed, 0 insertions, 163 deletions
diff --git a/client/src/components/Form.svelte b/client/src/components/Form.svelte deleted file mode 100644 index 327d25d..0000000 --- a/client/src/components/Form.svelte +++ /dev/null @@ -1,64 +0,0 @@ -<script lang="ts"> - import shorten from "$actions/shorten"; - import { links } from "$data/links"; - import checkUrl from "$utils/checkUrl"; - import debounce from "$utils/debounce"; - import ArrowIcon from "./icons/ArrowIcon.svelte"; - import CrossIcon from "./icons/CrossIcon.svelte"; - - let value = ""; - let valid = false; - - function submit() { - const url = checkUrl(value); - if (url !== null) { - links.add(shorten(url)); - } - } - - const check = debounce(() => valid = !!checkUrl(value), 100); - - // @ts-ignore: Value is a dependency - $: value, check(); -</script> - -<style> - form { - position: relative; - border: 1px solid #aaaabb; - box-shadow: 0 4px 6px #aaaabb30; - box-sizing: border-box; - border-radius: 5px; - } - - .field { - box-sizing: border-box; - width: 100%; - border: none; - padding: 15px 50px 15px 20px; - background: transparent; - font-size: 1rem; - } - - .button { - position: absolute; - right: 10px; - margin: auto; - top: 0; - bottom: 0; - background: transparent; - border: none; - cursor: pointer; - } -</style> - -<form on:submit|preventDefault={submit}> - <input class="field" bind:value type="text"/> - <button class="button" type="submit"> - {#if valid} - <ArrowIcon/> - {:else} - <CrossIcon/> - {/if} - </button> -</form> diff --git a/client/src/components/Response.svelte b/client/src/components/Response.svelte deleted file mode 100644 index 215af1b..0000000 --- a/client/src/components/Response.svelte +++ /dev/null @@ -1,33 +0,0 @@ -<script lang="ts"> - import type { ShortenRequest } from "$actions/shorten"; - - export let info: ShortenRequest; -</script> - -<style> - div { - display: flex; - justify-content: space-between; - } - - .url { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - - .output { - margin-left: 50px; - } -</style> - -<div> - <span class="url">{info.url}</span> - {#await info.response} - <span class="output">Loading...</span> - {:then { hash }} - <a class="output" href="https://sho.rest/{hash}">sho.rest/{hash}</a> - {:catch { error }} - <span class="output">{error}</span> - {/await} -</div> \ No newline at end of file diff --git a/client/src/components/Responses.svelte b/client/src/components/Responses.svelte deleted file mode 100644 index 7124f1e..0000000 --- a/client/src/components/Responses.svelte +++ /dev/null @@ -1,24 +0,0 @@ -<script lang="ts"> - import Response from "./Response.svelte" - import { slide } from 'svelte/transition'; - import { links } from "$data/links"; -</script> - -<style> - ul { - list-style: none; - padding: 0 10px; - } - - li { - margin-bottom: 10px; - } -</style> - -<ul> - {#each $links as info (info.nonce)} - <li transition:slide > - <Response {info}/> - </li> - {/each} -</ul> \ No newline at end of file diff --git a/client/src/components/Title.svelte b/client/src/components/Title.svelte deleted file mode 100644 index 4266eb1..0000000 --- a/client/src/components/Title.svelte +++ /dev/null @@ -1,22 +0,0 @@ -<style> - p { - color: #212121; - margin: 0 0 5px 0; - } - - .text { - margin: 10px 0 15px 0; - } - - img { - width: 25px; - } -</style> - -<div> - <img src="/shorest.svg" alt=""/> - <div class="text"> - <p><b>sho.rest</b></p> - <p>Made with ❤ by <b>Mel</b></p> - </div> -</div> diff --git a/client/src/components/icons/ArrowIcon.svelte b/client/src/components/icons/ArrowIcon.svelte deleted file mode 100644 index 52c79ae..0000000 --- a/client/src/components/icons/ArrowIcon.svelte +++ /dev/null @@ -1,10 +0,0 @@ -<style> - svg { - width: 20px; - color: #212121; - } -</style> - -<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14 5l7 7m0 0l-7 7m7-7H3" /> -</svg> \ No newline at end of file diff --git a/client/src/components/icons/CrossIcon.svelte b/client/src/components/icons/CrossIcon.svelte deleted file mode 100644 index 55525d8..0000000 --- a/client/src/components/icons/CrossIcon.svelte +++ /dev/null @@ -1,10 +0,0 @@ -<style> - svg { - width: 20px; - color: #212121; - } -</style> - -<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /> -</svg> \ No newline at end of file |
