0
0
Fork 0
mirror of https://git.verdigado.com/NB-Public/simple-wkd.git synced 2024-12-05 03:12:50 +01:00

Add darkmode and prettier

This commit is contained in:
Delta1925 2023-04-16 11:26:32 +02:00
parent 352660231d
commit 9cea1cacad
No known key found for this signature in database
GPG key ID: 1C21ACE44193CB25
14 changed files with 199 additions and 118 deletions

14
.prettierrc.cjs Normal file
View file

@ -0,0 +1,14 @@
module.exports = {
plugins: [
require.resolve("prettier-plugin-astro"),
require.resolve("prettier-plugin-tailwindcss"),
],
overrides: [
{
files: "*.astro",
options: {
parser: "astro",
},
},
],
};

6
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,6 @@
{
"prettier.documentSelectors": ["**/*.astro"],
"[astro]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}

View file

@ -12,7 +12,6 @@ npm create astro@latest -- --template basics
![basics](https://user-images.githubusercontent.com/4677417/186188965-73453154-fdec-4d6b-9c34-cb35c248ae5b.png)
## 🚀 Project Structure
Inside of your Astro project, you'll see the following folders and files:

View file

@ -1,9 +1,9 @@
import { defineConfig } from 'astro/config';
import { defineConfig } from "astro/config";
import tailwind from "@astrojs/tailwind";
import critters from "astro-critters";
// https://astro.build/config
export default defineConfig({
integrations: [tailwind(), critters({ critters: { preload: "swap" } })]
});
integrations: [tailwind(), critters({ critters: { preload: "swap" } })],
});

View file

@ -15,5 +15,10 @@
"astro": "^2.3.0",
"astro-critters": "^1.1.31",
"tailwindcss": "^3.0.24"
},
"devDependencies": {
"prettier": "^2.8.7",
"prettier-plugin-astro": "^0.8.0",
"prettier-plugin-tailwindcss": "^0.2.7"
}
}
}

View file

@ -5,6 +5,9 @@ specifiers:
'@tailwindcss/forms': ^0.5.3
astro: ^2.3.0
astro-critters: ^1.1.31
prettier: ^2.8.7
prettier-plugin-astro: ^0.8.0
prettier-plugin-tailwindcss: ^0.2.7
tailwindcss: ^3.0.24
dependencies:
@ -14,6 +17,11 @@ dependencies:
astro-critters: 1.1.31
tailwindcss: 3.3.1
devDependencies:
prettier: 2.8.7
prettier-plugin-astro: 0.8.0
prettier-plugin-tailwindcss: 0.2.7_kb4gmvngxncp3puqxt3b6slppy
packages:
/@ampproject/remapping/2.2.1:
@ -30,7 +38,6 @@ packages:
/@astrojs/compiler/1.3.1:
resolution: {integrity: sha512-xV/3r+Hrfpr4ECfJjRjeaMkJvU73KiOADowHjhkqidfNPVAWPzbqw1KePXuMK1TjzMvoAVE7E163oqfH3lDwSw==}
dev: false
/@astrojs/language-server/0.28.3:
resolution: {integrity: sha512-fPovAX/X46eE2w03jNRMpQ7W9m2mAvNt4Ay65lD9wl1Z5vIQYxlg7Enp9qP225muTr4jSVB5QiLumFJmZMAaVA==}
@ -632,7 +639,6 @@ packages:
picocolors: 1.0.0
tiny-glob: 0.2.9
tslib: 2.5.0
dev: false
/@proload/core/0.3.3:
resolution: {integrity: sha512-7dAFWsIK84C90AMl24+N/ProHKm4iw0akcnoKjRvbfHifJZBLhaDsDus1QJmhG12lXj4e/uB/8mB/0aduCW+NQ==}
@ -1149,7 +1155,6 @@ packages:
path-key: 3.1.1
shebang-command: 2.0.0
which: 2.0.2
dev: false
/css-select/4.3.0:
resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==}
@ -1209,7 +1214,6 @@ packages:
/define-lazy-prop/2.0.0:
resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==}
engines: {node: '>=8'}
dev: false
/dequal/2.0.3:
resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}
@ -1508,11 +1512,9 @@ packages:
/globalyzer/0.1.0:
resolution: {integrity: sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==}
dev: false
/globrex/0.1.2:
resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==}
dev: false
/graceful-fs/4.2.11:
resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
@ -1680,7 +1682,6 @@ packages:
resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==}
engines: {node: '>=8'}
hasBin: true
dev: false
/is-docker/3.0.0:
resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==}
@ -1696,7 +1697,6 @@ packages:
/is-extglob/2.1.1:
resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
engines: {node: '>=0.10.0'}
dev: false
/is-fullwidth-code-point/3.0.0:
resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
@ -1708,7 +1708,6 @@ packages:
engines: {node: '>=0.10.0'}
dependencies:
is-extglob: 2.1.1
dev: false
/is-interactive/2.0.0:
resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==}
@ -1740,11 +1739,9 @@ packages:
engines: {node: '>=8'}
dependencies:
is-docker: 2.2.1
dev: false
/isexe/2.0.0:
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
dev: false
/jiti/1.18.2:
resolution: {integrity: sha512-QAdOptna2NYiSSpv0O/BwoHBSmz4YhpzJHyi+fnMRTXFjp7B8i/YG5Z8IfusxB1ufjcD2Sre1F3R+nX3fvy7gg==}
@ -2384,7 +2381,6 @@ packages:
define-lazy-prop: 2.0.0
is-docker: 2.2.1
is-wsl: 2.2.0
dev: false
/ora/6.3.0:
resolution: {integrity: sha512-1/D8uRFY0ay2kgBpmAwmSA404w4OoPVhHMqRqtjvrcK/dnzcEZxMJ+V4DUbyICu8IIVRclHcOf5wlD1tMY4GUQ==}
@ -2465,7 +2461,6 @@ packages:
/path-key/3.1.1:
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
engines: {node: '>=8'}
dev: false
/path-key/4.0.0:
resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==}
@ -2482,7 +2477,6 @@ packages:
/picocolors/1.0.0:
resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==}
dev: false
/picomatch/2.3.1:
resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}
@ -2618,11 +2612,76 @@ packages:
synckit: 0.8.5
dev: false
/prettier-plugin-astro/0.8.0:
resolution: {integrity: sha512-kt9wk33J7HvFGwFaHb8piwy4zbUmabC8Nu+qCw493jhe96YkpjscqGBPy4nJ9TPy9pd7+kEx1zM81rp+MIdrXg==}
engines: {node: ^14.15.0 || >=16.0.0, pnpm: '>=7.14.0'}
dependencies:
'@astrojs/compiler': 1.3.1
prettier: 2.8.7
sass-formatter: 0.7.6
synckit: 0.8.5
dev: true
/prettier-plugin-tailwindcss/0.2.7_kb4gmvngxncp3puqxt3b6slppy:
resolution: {integrity: sha512-jQopIOgjLpX+y8HeD56XZw7onupRTC0cw7eKKUimI7vhjkPF5/1ltW5LyqaPtSyc8HvEpvNZsvvsGFa2qpa59w==}
engines: {node: '>=12.17.0'}
peerDependencies:
'@ianvs/prettier-plugin-sort-imports': '*'
'@prettier/plugin-php': '*'
'@prettier/plugin-pug': '*'
'@shopify/prettier-plugin-liquid': '*'
'@shufo/prettier-plugin-blade': '*'
'@trivago/prettier-plugin-sort-imports': '*'
prettier: '>=2.2.0'
prettier-plugin-astro: '*'
prettier-plugin-css-order: '*'
prettier-plugin-import-sort: '*'
prettier-plugin-jsdoc: '*'
prettier-plugin-organize-attributes: '*'
prettier-plugin-organize-imports: '*'
prettier-plugin-style-order: '*'
prettier-plugin-svelte: '*'
prettier-plugin-twig-melody: '*'
peerDependenciesMeta:
'@ianvs/prettier-plugin-sort-imports':
optional: true
'@prettier/plugin-php':
optional: true
'@prettier/plugin-pug':
optional: true
'@shopify/prettier-plugin-liquid':
optional: true
'@shufo/prettier-plugin-blade':
optional: true
'@trivago/prettier-plugin-sort-imports':
optional: true
prettier-plugin-astro:
optional: true
prettier-plugin-css-order:
optional: true
prettier-plugin-import-sort:
optional: true
prettier-plugin-jsdoc:
optional: true
prettier-plugin-organize-attributes:
optional: true
prettier-plugin-organize-imports:
optional: true
prettier-plugin-style-order:
optional: true
prettier-plugin-svelte:
optional: true
prettier-plugin-twig-melody:
optional: true
dependencies:
prettier: 2.8.7
prettier-plugin-astro: 0.8.0
dev: true
/prettier/2.8.7:
resolution: {integrity: sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==}
engines: {node: '>=10.13.0'}
hasBin: true
dev: false
/pretty-bytes/5.6.0:
resolution: {integrity: sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==}
@ -2823,7 +2882,6 @@ packages:
/s.color/0.0.15:
resolution: {integrity: sha512-AUNrbEUHeKY8XsYr/DYpl+qk5+aM+DChopnWOPEzn8YKzOhv4l2zH6LzZms3tOZP3wwdOyc0RmTciyi46HLIuA==}
dev: false
/sade/1.8.1:
resolution: {integrity: sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==}
@ -2840,7 +2898,6 @@ packages:
resolution: {integrity: sha512-hXdxU6PCkiV3XAiSnX+XLqz2ohHoEnVUlrd8LEVMAI80uB1+OTScIkH9n6qQwImZpTye1r1WG1rbGUteHNhoHg==}
dependencies:
suf-log: 2.5.3
dev: false
/section-matter/1.0.0:
resolution: {integrity: sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==}
@ -2872,12 +2929,10 @@ packages:
engines: {node: '>=8'}
dependencies:
shebang-regex: 3.0.0
dev: false
/shebang-regex/3.0.0:
resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==}
engines: {node: '>=8'}
dev: false
/shiki/0.11.1:
resolution: {integrity: sha512-EugY9VASFuDqOexOgXR18ZV+TbFrQHeCpEYaXamO+SZlsnT/2LxuLBX25GGtIrwaEVFXUAbUQ601SWE2rMwWHA==}
@ -3013,7 +3068,6 @@ packages:
resolution: {integrity: sha512-KvC8OPjzdNOe+xQ4XWJV2whQA0aM1kGVczMQ8+dStAO6KfEB140JEVQ9dE76ONZ0/Ylf67ni4tILPJB41U0eow==}
dependencies:
s.color: 0.0.15
dev: false
/supports-color/5.5.0:
resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}
@ -3046,7 +3100,6 @@ packages:
dependencies:
'@pkgr/utils': 2.3.1
tslib: 2.5.0
dev: false
/tailwindcss/3.3.1:
resolution: {integrity: sha512-Vkiouc41d4CEq0ujXl6oiGFQ7bA3WEhUZdTgXAhtKxSy49OmKs8rEfQmupsfF0IGW8fv2iQkp1EVUuapCFrZ9g==}
@ -3099,7 +3152,6 @@ packages:
dependencies:
globalyzer: 0.1.0
globrex: 0.1.2
dev: false
/to-fast-properties/2.0.0:
resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==}
@ -3138,7 +3190,6 @@ packages:
/tslib/2.5.0:
resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==}
dev: false
/type-fest/0.13.1:
resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==}
@ -3419,7 +3470,6 @@ packages:
hasBin: true
dependencies:
isexe: 2.0.0
dev: false
/widest-line/4.0.1:
resolution: {integrity: sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==}

View file

@ -0,0 +1,8 @@
---
---
<div class="flex h-full flex-row items-center px-8 py-4">
<div class="flex w-full flex-col items-center">
<slot />
</div>
</div>

View file

@ -1,6 +1,6 @@
---
export interface Props {
title: string;
title: string;
}
const { title } = Astro.props;
@ -8,14 +8,14 @@ const { title } = Astro.props;
<!DOCTYPE html>
<html lang="en" class="h-full">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
</head>
<body class="h-full">
<slot />
</body>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
</head>
<body class="h-full font-mono dark:bg-neutral-800 dark:text-neutral-300">
<slot />
</body>
</html>

View file

@ -1,32 +1,29 @@
---
import Layout from "../layouts/Layout.astro";
import CenterXy from "../components/center-xy.astro";
import "../styles/global.css";
---
<Layout title="Submit a key">
<div class="flex flex-row items-center h-full font-mono px-8 py-4">
<div class="flex flex-col items-center w-full">
<form
action="{{%u}}api/delete"
method="get"
class="flex flex-col max-w-full"
>
<label for="email" class="font-bold text-xl mt-3"
>Request key deletion:</label
>
<input
type="email"
name="email"
id="email-input"
placeholder="e-mail"
size="65"
class="round focus:rounded-lg mt-3"
required
/>
<button type="submit" class="button mt-4 self-end"
>Delete</button
>
</form>
</div>
</div>
<CenterXy>
<form
action="{{%u}}api/delete"
method="get"
class="flex max-w-full flex-col"
>
<label for="email" class="mt-3 text-xl font-bold"
>Request key deletion:</label
>
<input
type="email"
name="email"
id="email-input"
placeholder="user@example.com"
size="65"
class="input mt-3 focus:rounded-lg"
required
/>
<button type="submit" class="button mt-4 self-end">Delete</button>
</form>
</CenterXy>
</Layout>

View file

@ -1,16 +1,15 @@
---
import Layout from "../layouts/Layout.astro";
import "../styles/global.css";
import CenterXy from "../components/center-xy.astro";
---
<Layout title="Manage keys">
<div class="flex flex-row items-center h-full font-mono px-8 py-4">
<div class="flex flex-col items-center w-full">
<h1 class="font-bold text-lg">What would you like to do?</h1>
<div class="flex flex-row space-x-6">
<a href="/submit" class="button">Submit a key</a>
<a href="/delete" class="button">Delete a key</a>
</div>
</div>
<CenterXy>
<h1 class="text-lg font-bold">What would you like to do?</h1>
<div class="flex flex-row space-x-6">
<a href="/submit" class="button">Submit a key</a>
<a href="/delete" class="button">Delete a key</a>
</div>
</CenterXy>
</Layout>

View file

@ -1,31 +1,28 @@
---
import Layout from "../layouts/Layout.astro";
import "../styles/global.css";
import CenterXy from "../components/center-xy.astro";
---
<Layout title="Submit a key">
<div class="flex flex-row items-center h-full font-mono px-8 py-4">
<div class="flex flex-col items-center w-full">
<form
action="{{%u}}api/submit"
method="post"
class="flex flex-col max-w-full"
>
<label for="key" class="font-bold text-xl"
>Paste your pgp keyblock here:</label
>
<textarea
name="key"
id="key-input"
cols="65"
rows="20"
class="round focus:rounded-lg mt-3 resize-none"
placeholder="-----BEGIN PGP PUBLIC KEY BLOCK-----"
required></textarea>
<button type="submit" class="button mt-6 self-end"
>Submit</button
>
</form>
</div>
</div>
<CenterXy>
<form
action="{{%u}}api/submit"
method="post"
class="flex max-w-full flex-col"
>
<label for="key" class="text-xl font-bold"
>Paste your pgp keyblock here:</label
>
<textarea
name="key"
id="key-input"
cols="65"
rows="20"
class="input mt-3 resize-none"
placeholder="-----BEGIN PGP PUBLIC KEY BLOCK-----"
required></textarea>
<button type="submit" class="button mt-6 self-end">Submit</button>
</form>
</CenterXy>
</Layout>

View file

@ -1,15 +1,23 @@
.button {
@apply bg-teal-50;
@apply p-4;
@apply hover:drop-shadow-md;
@apply hover:rounded-lg;
.input {
@apply focus:rounded-lg;
@apply dark:bg-neutral-800;
}
.round,
.button {
@apply border-black;
@apply border;
@apply rounded-tr-lg;
@apply rounded-bl-lg;
@apply transition-all;
}
@apply bg-slate-200;
@apply p-4;
@apply hover:rounded-lg;
@apply hover:drop-shadow-md;
@apply dark:bg-slate-700;
}
.input,
.button {
@apply rounded-bl-lg;
@apply rounded-tr-lg;
@apply border;
@apply border-black;
@apply transition-all;
@apply duration-300;
@apply dark:border-neutral-300;
}

View file

@ -1,10 +1,8 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
theme: {
extend: {},
},
plugins: [
require('@tailwindcss/forms'),
],
}
content: ["./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}"],
theme: {
extend: {},
},
plugins: [require("@tailwindcss/forms")],
};

View file

@ -1,3 +1,3 @@
{
"extends": "astro/tsconfigs/strict"
}
}