import { onMount } from "svelte";
import { fetchRandomImage } from "$lib/api";
- let image;
+ let image, fetchTime;
let complete = false;
onMount(async () => {
- image = (await fetchRandomImage()).image;
+ fetchTime = performance.now();
+ image = await fetchRandomImage();
+ fetchTime = performance.now() - fetchTime;
complete = true;
});
</script>
{#if !complete}
<p>Fetching a random image...</p>
{:else}
- <div id="random-image">
- <a href={image}>
+ <div class="highlight-image">
+ <a href={`/language?language=${image.language}&image=${image.image}`}>
<img
- src={image}
+ src={image.image}
alt="Image of an anime girl holding a programming book"
/>
</a>
</div>
+
+ <p>Double fetch_time = {fetchTime}; /* ms */</p>
{/if}
- <h2>Contributing</h2>
- <p>
- If you'd like to support the project in any way, check out the repositories:
- </p>
+ <h2>Related Projects</h2>
+ <p>Check out these other [The] Senpy Club-related projects!</p>
<ul>
- <li><a href="https://github.com/senpy-club/api-worker">API</a></li>
- <li><a href="https://github.com/senpy-club/frontend-next">Frontend</a></li>
+ <li>
+ <a href="https://github.com/senpy-club/api-worker">API</a> — The Senpy
+ Club API
+ </li>
+ <li>
+ <a href="https://github.com/senpy-club/frontend-next">Frontend</a> —
+ You are here!
+ </li>
+ <li>
+ <a href="https://github.com/senpy-club/cli">CLI</a> — Access The Senpy
+ Club API from your terminal! (and export it to files too!)
+ </li>
+ <li>
+ <a href="https://docs.rs/senpy"><code>senpy-rs</code></a> — Access
+ The Senpy Club API from <a href="https://www.rust-lang.org/">Rust</a>!
+ </li>
+ <li>
+ <a href="https://docs.rs/senpy-ffi"><codE>senpy-ffi</codE></a> — Access
+ The Senpy Club API from any programming language!
+ </li>
</ul>
</section>