added some css

This commit is contained in:
Djeeberjr 2022-05-10 23:19:31 +02:00
parent a11349e456
commit 3c5d62f86d
4 changed files with 55 additions and 17 deletions

View File

@ -13,13 +13,13 @@
contentType = res.headers.get("Content-Type");
let m;
while ((m = regex.exec(res.headers.get("Content-Disposition"))) !== null) {
let match;
while ((match = regex.exec(res.headers.get("Content-Disposition"))) !== null) {
// This is necessary to avoid infinite loops with zero-width matches
if (m.index === regex.lastIndex) {
if (match.index === regex.lastIndex) {
regex.lastIndex++;
}
filename = m[1];
filename = match[1];
}
document.title = filename;
@ -29,19 +29,24 @@
</script>
<main>
<div>{slug}</div>
<div>
{#if component === null}
{#if component === null}
Loading data...
{:else}
{#await component}
Loading data...
{:else}
{#await component}
Loading data...
{:then v }
<svelte:component this={v.default} slug={slug} contentType={contentType} filename={filename} />
{/await}
{/if}
</div>
{:then v }
<svelte:component this={v.default} slug={slug} contentType={contentType} filename={filename} />
{/await}
{/if}
</main>
<style>
main {
display: flex;
justify-content: center;
margin-top: 5rem;
}
</style>

4
web/index.css Normal file
View File

@ -0,0 +1,4 @@
body {
background-color: #0d1117;
font-family: sans-serif;
}

View File

@ -1,4 +1,5 @@
import App from "./App.svelte";
import "./index.css";
const app = new App({
target: document.body,

View File

@ -12,7 +12,35 @@ import { onMount } from "svelte";
});
</script>
<div>
Text opener
<div class="container" >
<header>{filename}</header>
<pre><code>{ content }</code></pre>
</div>
<style>
code{
color: #c9d1d9;
}
pre{
padding: 1rem;
}
header{
font-size: 1.5rem;
font-weight: bold;
margin-bottom: 1rem;
color: #58a6ff;
border-bottom: solid 1px #1f6feb;
padding: 1rem;
}
.container{
border-width: 2px;
border-color: #1f6feb;
border-style: solid;
border-radius: 5px;
}
</style>