mirror of
https://git.verdigado.com/NB-Public/simple-wkd.git
synced 2024-12-05 03:32:49 +01:00
Merge website into master
This commit is contained in:
commit
7dc3109c72
20 changed files with 5285 additions and 0 deletions
21
website/.gitignore
vendored
Normal file
21
website/.gitignore
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
# build output
|
||||
dist/
|
||||
|
||||
# generated types
|
||||
.astro/
|
||||
|
||||
# dependencies
|
||||
node_modules/
|
||||
|
||||
# logs
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
# environment variables
|
||||
.env
|
||||
.env.production
|
||||
|
||||
# macOS-specific files
|
||||
.DS_Store
|
14
website/.prettierrc.cjs
Normal file
14
website/.prettierrc.cjs
Normal file
|
@ -0,0 +1,14 @@
|
|||
module.exports = {
|
||||
plugins: [
|
||||
require.resolve("prettier-plugin-astro"),
|
||||
require.resolve("prettier-plugin-tailwindcss"),
|
||||
],
|
||||
overrides: [
|
||||
{
|
||||
files: "*.astro",
|
||||
options: {
|
||||
parser: "astro",
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
4
website/.vscode/extensions.json
vendored
Normal file
4
website/.vscode/extensions.json
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"recommendations": ["astro-build.astro-vscode"],
|
||||
"unwantedRecommendations": []
|
||||
}
|
11
website/.vscode/launch.json
vendored
Normal file
11
website/.vscode/launch.json
vendored
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"command": "./node_modules/.bin/astro dev",
|
||||
"name": "Development server",
|
||||
"request": "launch",
|
||||
"type": "node-terminal"
|
||||
}
|
||||
]
|
||||
}
|
6
website/.vscode/settings.json
vendored
Normal file
6
website/.vscode/settings.json
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"prettier.documentSelectors": ["**/*.astro"],
|
||||
"[astro]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
}
|
||||
}
|
54
website/README.md
Normal file
54
website/README.md
Normal file
|
@ -0,0 +1,54 @@
|
|||
# Astro Starter Kit: Basics
|
||||
|
||||
```
|
||||
npm create astro@latest -- --template basics
|
||||
```
|
||||
|
||||
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
|
||||
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics)
|
||||
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json)
|
||||
|
||||
> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun!
|
||||
|
||||
![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:
|
||||
|
||||
```
|
||||
/
|
||||
├── public/
|
||||
│ └── favicon.svg
|
||||
├── src/
|
||||
│ ├── components/
|
||||
│ │ └── Card.astro
|
||||
│ ├── layouts/
|
||||
│ │ └── Layout.astro
|
||||
│ └── pages/
|
||||
│ └── index.astro
|
||||
└── package.json
|
||||
```
|
||||
|
||||
Astro looks for `.astro` or `.md` files in the `src/pages/` directory. Each page is exposed as a route based on its file name.
|
||||
|
||||
There's nothing special about `src/components/`, but that's where we like to put any Astro/React/Vue/Svelte/Preact components.
|
||||
|
||||
Any static assets, like images, can be placed in the `public/` directory.
|
||||
|
||||
## 🧞 Commands
|
||||
|
||||
All commands are run from the root of the project, from a terminal:
|
||||
|
||||
| Command | Action |
|
||||
| :--------------------- | :----------------------------------------------- |
|
||||
| `npm install` | Installs dependencies |
|
||||
| `npm run dev` | Starts local dev server at `localhost:3000` |
|
||||
| `npm run build` | Build your production site to `./dist/` |
|
||||
| `npm run preview` | Preview your build locally, before deploying |
|
||||
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
|
||||
| `npm run astro --help` | Get help using the Astro CLI |
|
||||
|
||||
## 👀 Want to learn more?
|
||||
|
||||
Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
|
9
website/astro.config.mjs
Normal file
9
website/astro.config.mjs
Normal file
|
@ -0,0 +1,9 @@
|
|||
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" } })],
|
||||
});
|
24
website/package.json
Normal file
24
website/package.json
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"name": "",
|
||||
"type": "module",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"dev": "astro dev",
|
||||
"start": "astro dev",
|
||||
"build": "astro build",
|
||||
"preview": "astro preview",
|
||||
"astro": "astro"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/tailwind": "^3.1.1",
|
||||
"@tailwindcss/forms": "^0.5.3",
|
||||
"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"
|
||||
}
|
||||
}
|
4970
website/pnpm-lock.yaml
Normal file
4970
website/pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load diff
8
website/src/components/center-xy.astro
Normal file
8
website/src/components/center-xy.astro
Normal 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>
|
9
website/src/components/cursor-catcher.astro
Normal file
9
website/src/components/cursor-catcher.astro
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
export interface Props {
|
||||
id: string;
|
||||
}
|
||||
|
||||
const { id } = Astro.props;
|
||||
---
|
||||
|
||||
<div class="absolute hidden h-full w-full cursor-wait" id={id}></div>
|
1
website/src/env.d.ts
vendored
Normal file
1
website/src/env.d.ts
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/// <reference types="astro/client" />
|
24
website/src/layouts/Layout.astro
Normal file
24
website/src/layouts/Layout.astro
Normal file
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
export interface Props {
|
||||
title: string;
|
||||
}
|
||||
|
||||
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 font-mono dark:bg-neutral-800 dark:text-neutral-300"
|
||||
id="body"
|
||||
>
|
||||
<slot />
|
||||
</body>
|
||||
</html>
|
35
website/src/pages/delete.astro
Normal file
35
website/src/pages/delete.astro
Normal file
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
import Layout from "../layouts/Layout.astro";
|
||||
import CenterXy from "../components/center-xy.astro";
|
||||
import CursorCatcher from "../components/cursor-catcher.astro";
|
||||
|
||||
import "../styles/global.css";
|
||||
---
|
||||
|
||||
<Layout title="Delete a key">
|
||||
<CursorCatcher id="cursor-catcher" />
|
||||
<CenterXy>
|
||||
<form
|
||||
action="((%u))api/delete"
|
||||
method="get"
|
||||
class="flex max-w-full flex-col"
|
||||
onsubmit="document.getElementById('submit-button').classList.add('cursor-wait'); document.getElementById('cursor-catcher').classList.remove('hidden')"
|
||||
>
|
||||
<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" id="submit-button" class="button mt-4 self-end"
|
||||
>Delete</button
|
||||
>
|
||||
</form>
|
||||
</CenterXy>
|
||||
</Layout>
|
16
website/src/pages/index.astro
Normal file
16
website/src/pages/index.astro
Normal file
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
import Layout from "../layouts/Layout.astro";
|
||||
import CenterXy from "../components/center-xy.astro";
|
||||
|
||||
import "../styles/global.css";
|
||||
---
|
||||
|
||||
<Layout title="Manage keys">
|
||||
<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>
|
10
website/src/pages/status.astro
Normal file
10
website/src/pages/status.astro
Normal file
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
import Layout from "../layouts/Layout.astro";
|
||||
import CenterXy from "../components/center-xy.astro";
|
||||
---
|
||||
|
||||
<Layout title="((%s))">
|
||||
<CenterXy>
|
||||
<h1 class="text-4xl font-bold">((%m))</h1>
|
||||
</CenterXy>
|
||||
</Layout>
|
35
website/src/pages/submit.astro
Normal file
35
website/src/pages/submit.astro
Normal file
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
import Layout from "../layouts/Layout.astro";
|
||||
import CenterXy from "../components/center-xy.astro";
|
||||
import CursorCatcher from "../components/cursor-catcher.astro";
|
||||
|
||||
import "../styles/global.css";
|
||||
---
|
||||
|
||||
<Layout title="Submit a key">
|
||||
<CursorCatcher id="cursor-catcher" />
|
||||
<CenterXy>
|
||||
<form
|
||||
action="((%u))api/submit"
|
||||
method="post"
|
||||
class="flex max-w-full flex-col"
|
||||
onsubmit="document.getElementById('submit-button').classList.add('cursor-wait'); document.getElementById('cursor-catcher').classList.remove('hidden')"
|
||||
>
|
||||
<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-----"
|
||||
spellcheck="false"
|
||||
required></textarea>
|
||||
<button type="submit" id="submit-button" class="button mt-6 self-end"
|
||||
>Submit</button
|
||||
>
|
||||
</form>
|
||||
</CenterXy>
|
||||
</Layout>
|
23
website/src/styles/global.css
Normal file
23
website/src/styles/global.css
Normal file
|
@ -0,0 +1,23 @@
|
|||
.input {
|
||||
@apply focus:rounded-lg;
|
||||
@apply dark:bg-neutral-800;
|
||||
}
|
||||
|
||||
.button {
|
||||
@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;
|
||||
}
|
8
website/tailwind.config.cjs
Normal file
8
website/tailwind.config.cjs
Normal file
|
@ -0,0 +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")],
|
||||
};
|
3
website/tsconfig.json
Normal file
3
website/tsconfig.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"extends": "astro/tsconfigs/strict"
|
||||
}
|
Loading…
Reference in a new issue