diff options
Diffstat (limited to 'src/routes/languages.svelte')
| -rw-r--r-- | src/routes/languages.svelte | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/routes/languages.svelte b/src/routes/languages.svelte new file mode 100644 index 0000000..9f14e18 --- /dev/null +++ b/src/routes/languages.svelte @@ -0,0 +1,54 @@ +<!-- This file is part of api-worker <https://github.com/senpy-club/api-worker>. +Copyright (C) 2022-2022 Fuwn <[email protected]> + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, version 3. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. + +Copyright (C) 2022-2022 Fuwn <[email protected]> +SPDX-License-Identifier: GPL-3.0-only --> +<script> + import { onMount } from "svelte"; + import { fetchLanguages } from "$lib/api"; + let languages; + let complete = false; + + onMount(async () => { + languages = await fetchLanguages(); + complete = true; + }); +</script> + +<svelte:head> + <title>languages | senpy-club</title> +</svelte:head> + +<div class="content"> + <h1>Languages</h1> + + {#if !complete} + <p>Fetching languages...</p> + {:else} + <ul> + {#each languages as language} + <li> + {#if language === "C#"} + <a href={"/language?language=C%23"}>C#</a> + {:else} + <a href={"/language?language=" + language}> + {language} + </a> + {/if} + </li> + {/each} + </ul> + {/if} +</div> |