aboutsummaryrefslogtreecommitdiff
path: root/client/src/Components
diff options
context:
space:
mode:
authorMelonai <einebeere@gmail.com>2021-01-21 01:03:34 +0100
committerMelonai <einebeere@gmail.com>2021-01-21 01:03:34 +0100
commit72da387a292ac0e1934e72bbcc30042c82007bd0 (patch)
treeb32d9a75a2d2c09045909d8cd89865598e244853 /client/src/Components
parent826c7c47785ee01d2b9267919132ada696425344 (diff)
downloadshorest-72da387a292ac0e1934e72bbcc30042c82007bd0.tar.zst
shorest-72da387a292ac0e1934e72bbcc30042c82007bd0.zip
Change case of components directory
Diffstat (limited to 'client/src/Components')
-rw-r--r--client/src/Components/Form.svelte64
-rw-r--r--client/src/Components/Response.svelte33
-rw-r--r--client/src/Components/Responses.svelte24
-rw-r--r--client/src/Components/Title.svelte22
-rw-r--r--client/src/Components/icons/ArrowIcon.svelte10
-rw-r--r--client/src/Components/icons/CrossIcon.svelte10
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