1 <!-- This file is part of api-worker <https://github.com/senpy-club/api-worker>.
2 Copyright (C) 2022-2022 Fuwn <contact@fuwn.me>
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, version 3.
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 Copyright (C) 2022-2022 Fuwn <contact@fuwn.me>
17 SPDX-License-Identifier: GPL-3.0-only -->
19 import { onMount } from "svelte";
20 import { fetchImages } from "$lib/api";
21 import { page } from "$app/stores";
23 let language = $page.url.searchParams.get("language");
24 let images, fetchTime;
28 fetchTime = performance.now();
29 images = await fetchImages(language);
30 fetchTime = performance.now() - fetchTime;
36 <title>{language} | senpy-club</title>
43 <p>Fetching images...</p>
44 {:else if images.length === 0}
45 <p>Sorry, no images were found for this language.</p>
47 <ul class="image-rack">
48 {#each images as image}
49 <li id="image-rack-item">
53 alt="Image of an anime girl holding a programming book"
59 <small>Fetch time: {fetchTime}ms</small>