feat(about): cleanup ui

This commit is contained in:
Philipp Dormann 2024-11-21 16:55:58 +01:00
parent 3532968b33
commit 84aa846b87
Signed by: philipp
GPG Key ID: 3BB9ADD52DCA4314

View File

@ -1,210 +1,196 @@
<script> <script>
import { _ } from "svelte-i18n"; import { _ } from "svelte-i18n";
import { clickOutside } from "../base/outsideclick"; import { clickOutside } from "../base/outsideclick";
export let modal_open; export let modal_open;
(function () { (function () {
document.onkeydown = function (e) { document.onkeydown = function (e) {
e = e || window.event; e = e || window.event;
if (e.key === "Escape") { if (e.key === "Escape") {
modal_open = false; modal_open = false;
} }
}; };
})(); })();
const license_promise = fetch("/licenses.json"); const license_promise = fetch("/licenses.json");
let licenses = []; let licenses = [];
$: currentlicense = ""; $: currentlicense = "";
$: licensetext = ""; $: licensetext = "";
license_promise license_promise
.then((response) => response.json()) .then((response) => response.json())
.then((json) => { .then((json) => {
licenses = json; licenses = json;
}); });
</script> </script>
{#if modal_open} {#if modal_open}
<div <div
class="fixed z-10 inset-0 overflow-y-auto" class="fixed z-10 inset-0 overflow-y-auto"
use:clickOutside use:clickOutside
on:click_outside={() => { on:click_outside={() => {
modal_open = false; modal_open = false;
}} }}
> >
<div <div
class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0" class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 sm:block sm:p-0"
> >
<div class="fixed inset-0 transition-opacity" aria-hidden="true"> <div class="fixed inset-0 transition-opacity" aria-hidden="true">
<div <div
class="absolute inset-0 bg-gray-500 opacity-75" class="absolute inset-0 bg-gray-500 opacity-75"
data-id="modal_backdrop" data-id="modal_backdrop"
/> />
</div> </div>
<span <span
class="hidden sm:inline-block sm:align-middle sm:h-screen" class="hidden sm:inline-block sm:align-middle sm:h-screen"
aria-hidden="true">&#8203;</span aria-hidden="true">&#8203;</span
> >
<div <div
class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full" class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full"
role="dialog" role="dialog"
aria-modal="true" aria-modal="true"
aria-labelledby="modal-headline" aria-labelledby="modal-headline"
> >
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"> <div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div class="sm:flex sm:items-start"> <div class="sm:flex sm:items-start">
<div <div
class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-100 sm:mx-0 sm:h-10 sm:w-10" class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-blue-100 sm:mx-0 sm:h-10 sm:w-10"
> >
<svg <svg
fill="currentColor" fill="currentColor"
class="h-6 w-6 text-blue-600" class="h-6 w-6 text-blue-600"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24" viewBox="0 0 24 24"
width="24" width="24"
height="24" height="24"
><path fill="none" d="M0 0h24v24H0z" /> ><path fill="none" d="M0 0h24v24H0z" />
<path <path
d="M14 20v2H2v-2h12zM14.586.686l7.778 7.778L20.95 9.88l-1.06-.354L17.413 12l5.657 5.657-1.414 1.414L16 13.414l-2.404 2.404.283 1.132-1.415 1.414-7.778-7.778 1.415-1.414 1.13.282 6.294-6.293-.353-1.06L14.586.686z" d="M14 20v2H2v-2h12zM14.586.686l7.778 7.778L20.95 9.88l-1.06-.354L17.413 12l5.657 5.657-1.414 1.414L16 13.414l-2.404 2.404.283 1.132-1.415 1.414-7.778-7.778 1.415-1.414 1.13.282 6.294-6.293-.353-1.06L14.586.686z"
/></svg /></svg
> >
</div> </div>
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"> <div class="mt-3 sm:mt-0 sm:ml-4 sm:text-left">
<h3 class="text-lg leading-6 font-medium"> <h3 class="text-lg leading-6 font-medium">
{$_("read-license")} {$_("read-license")}
</h3> </h3>
<div class="mt-2 mb-6"> <div class="mt-2 mb-6">
<p class="text-sm text-gray-500">{currentlicense}</p> <p class="text-sm text-gray-500">{currentlicense}</p>
</div> </div>
<div class="mt-2 mb-6"> <div class="mt-2 mb-6">
<p class="text-sm text-gray-500">{licensetext}</p> <p class="text-sm text-gray-500">{licensetext}</p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"> <div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
<button <button
on:click={() => { on:click={() => {
modal_open = false; modal_open = false;
}} }}
type="button" type="button"
class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:w-auto sm:text-sm" class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-blue-600 text-base font-medium text-white hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:w-auto sm:text-sm"
> >
{$_("close")} {$_("close")}
</button> </button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{/if} {/if}
<!-- /// --> <!-- /// -->
<div class="pt-12 px-4 sm:px-6 lg:px-8 lg:pt-20 bg-gray-900 pb-12"> <section class="container p-5">
<div class="text-center mb-8"> <h4 class="mb-1 text-3xl font-extrabold leading-tight font-mono">
<h1 {$_("about")}
class="mt-9 font-display text-4xl leading-none font-semibold text-white sm:text-5xl lg:text-6xl" </h4>
> <p class="mt-2 mb-2">
{$_("about")} Lauf für Kaya!
🧾 <strong class="font-medium">
</h1> {$_("by")}
<p <a href="https://odit.services" class="underline">ODIT.Services</a>
class="mt-2 max-w-xl mx-auto text-xl lg:max-w-3xl lg:text-2xl text-gray-300" </strong>
> <br />
Lauf für Kaya! <span>{$_("lfk-is-os")}</span>
<strong class="text-white font-medium"> </p>
{$_("by")} <h4 class="mb-1 text-3xl font-extrabold leading-tight font-mono">
<a href="https://odit.services" class="underline">ODIT.Services</a> {$_("credits")}
</strong> </h4>
<br /> <p class="text-left">{$_("oss_credit_description")}</p>
<span class="text-lg">{$_("lfk-is-os")}</span> <div class="mt-5 overflow-x-auto">
</p> {#await license_promise}
</div> <p>{$_("licenses-are-being-loaded")}</p>
</div> {:then}
<table class="font-mono">
<div class="pt-0 pb-16 overflow-hidden lg:pt-12 lg:py-24"> <thead class="border-b border-gray-400">
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8"> <tr class="odd:bg-white even:bg-gray-100">
<h2 class="text-4xl font-display font-semibold md:text-5xl"> <th>{$_("dependency_name")}</th>
{$_("credits")} <th>{$_("license")}</th>
</h2> <th>{$_("repo_link")}</th>
<div class="max-w-3xl mx-auto text-xl leading-8 font-medium mt-8"> <th>{$_("installed-version")}</th>
<p class="text-center">{$_("oss_credit_description")}</p> <th>{$_("author")}</th>
</div> </tr>
<div class="w-screen leading-8 pl-5 mt-5"> </thead>
{#await license_promise} <tbody>
<p class="text-center w-full">{$_("licenses-are-being-loaded")}</p> {#each licenses as l}
{:then} <tr class="odd:bg-white even:bg-gray-100 *:p-2">
<table> <td>{l.name}</td>
<thead class="border-b border-gray-400"> <td>
<tr class="odd:bg-white even:bg-gray-100"> <button
<th>{$_("dependency_name")}</th> class="underline cursor-pointer"
<th>{$_("license")}</th> on:click={() => {
<th>{$_("repo_link")}</th> modal_open = true;
<th>{$_("installed-version")}</th> currentlicense = l.name + "@" + l.version;
<th>{$_("author")}</th> licensetext =
</tr> l.licensetext || $_("no-license-text-could-be-found");
</thead> }}>{l.license || "?"}</button
<tbody> >
{#each licenses as l} </td>
<tr class="odd:bg-white even:bg-gray-100"> <td>
<td>{l.name}</td> {(l.repo?.url || l.repo)
<td> .replace("git+", "")
{l.license || "?"}<br /><button .replace("git://", "")}
class="underline cursor-pointer" </td>
on:click={() => { <td>{l.version || "?"}</td>
modal_open = true; <td>{l.author?.name || l.author || "?"}</td>
currentlicense = l.name + "@" + l.version; </tr>
licensetext = {/each}
l.licensetext || $_("no-license-text-could-be-found"); </tbody>
}}>{$_("read-license")}</button </table>
> {:catch error}
</td> <div
<td> class="text-white px-6 py-4 border-0 rounded relative mb-4 bg-red-500"
{(l.repo?.url || l.repo) >
.replace("git+", "") <span class="inline-block align-middle mr-8">
.replace("git://", "")} <b class="capitalize">{$_("general_promise_error")}</b>
</td> {error}
<td>{l.version || "?"}</td> </span>
<td>{l.author?.name || l.author || "?"}</td> </div>
</tr> {/await}
{/each} </div>
</tbody> <div class="w-full mt-8">
</table> <p class="font-medium">{$_("icon-image-credits")}</p>
{:catch error} <ul class="list-disc ml-6">
<div <li>
class="text-white px-6 py-4 border-0 rounded relative mb-4 bg-red-500" <a
> class="underline"
<span class="inline-block align-middle mr-8"> target="_blank"
<b class="capitalize">{$_("general_promise_error")}</b> rel="noopener noreferrer"
{error} href="https://storyset.com">https://storyset.com</a
</span> >
</div> </li>
{/await} <li>
</div> <a
<div class="w-full leading-8 mt-8"> class="underline"
<p class="text-xl font-medium">{$_("icon-image-credits")}</p> target="_blank"
<ul class="list-disc"> rel="noopener noreferrer"
<li> href="https://undraw.co">https://undraw.co</a
<a >
class="underline" </li>
target="_blank" <li>
rel="noopener noreferrer" <a
href="https://storyset.com">https://storyset.com</a class="underline"
> target="_blank"
</li> rel="noopener noreferrer"
<li> href="https://remixicon.com">https://remixicon.com</a
<a >
class="underline" </li>
target="_blank" </ul>
rel="noopener noreferrer" </div>
href="https://undraw.co">https://undraw.co</a </section>
>
</li>
<li>
<a
class="underline"
target="_blank"
rel="noopener noreferrer"
href="https://remixicon.com">https://remixicon.com</a
>
</li>
</ul>
</div>
</div>
</div>