Skip to content

Commit 4efd4ab

Browse files
committed
feat: first commit
0 parents  commit 4efd4ab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+907
-0
lines changed

.eslintignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
10+
# Ignore files for PNPM, NPM and YARN
11+
pnpm-lock.yaml
12+
package-lock.json
13+
yarn.lock

.eslintrc.cjs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module.exports = {
2+
root: true,
3+
extends: [
4+
'eslint:recommended',
5+
'plugin:@typescript-eslint/recommended',
6+
'plugin:svelte/recommended',
7+
'prettier'
8+
],
9+
parser: '@typescript-eslint/parser',
10+
plugins: ['@typescript-eslint'],
11+
parserOptions: {
12+
sourceType: 'module',
13+
ecmaVersion: 2020,
14+
extraFileExtensions: ['.svelte']
15+
},
16+
env: {
17+
browser: true,
18+
es2017: true,
19+
node: true
20+
},
21+
overrides: [
22+
{
23+
files: ['*.svelte'],
24+
parser: 'svelte-eslint-parser',
25+
parserOptions: {
26+
parser: '@typescript-eslint/parser'
27+
}
28+
}
29+
]
30+
};

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
vite.config.js.timestamp-*
10+
vite.config.ts.timestamp-*

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
engine-strict=true
2+
resolution-mode=highest

.prettierignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
10+
# Ignore files for PNPM, NPM and YARN
11+
pnpm-lock.yaml
12+
package-lock.json
13+
yarn.lock

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"useTabs": false,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 80,
6+
"plugins": ["prettier-plugin-svelte"],
7+
"pluginSearchDirs": ["."],
8+
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
9+
}

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# create-svelte
2+
3+
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
4+
5+
## Creating a project
6+
7+
If you're seeing this, you've probably already done this step. Congrats!
8+
9+
```bash
10+
# create a new project in the current directory
11+
npm create svelte@latest
12+
13+
# create a new project in my-app
14+
npm create svelte@latest my-app
15+
```
16+
17+
## Developing
18+
19+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
20+
21+
```bash
22+
npm run dev
23+
24+
# or start the server and open the app in a new browser tab
25+
npm run dev -- --open
26+
```
27+
28+
## Building
29+
30+
To create a production version of your app:
31+
32+
```bash
33+
npm run build
34+
```
35+
36+
You can preview the production build with `npm run preview`.
37+
38+
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.

bun.lockb

118 KB
Binary file not shown.

package.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "httpserver.rs",
3+
"version": "0.0.1",
4+
"private": true,
5+
"scripts": {
6+
"dev": "vite dev",
7+
"build": "vite build",
8+
"preview": "vite preview",
9+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
10+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
11+
"lint": "prettier --plugin-search-dir . --check . && eslint .",
12+
"format": "prettier --plugin-search-dir . --write ."
13+
},
14+
"devDependencies": {
15+
"@sveltejs/adapter-static": "^2.0.2",
16+
"@sveltejs/kit": "^1.20.4",
17+
"@tailwindcss/forms": "^0.5.3",
18+
"@tailwindcss/typography": "^0.5.9",
19+
"@typescript-eslint/eslint-plugin": "^5.45.0",
20+
"@typescript-eslint/parser": "^5.45.0",
21+
"autoprefixer": "^10.4.14",
22+
"eslint": "^8.28.0",
23+
"eslint-config-prettier": "^8.5.0",
24+
"eslint-plugin-svelte": "^2.30.0",
25+
"postcss": "^8.4.24",
26+
"prettier": "^2.8.0",
27+
"prettier-plugin-svelte": "^2.10.1",
28+
"svelte": "^4.0.0",
29+
"svelte-check": "^3.4.3",
30+
"tailwindcss": "^3.3.2",
31+
"tslib": "^2.4.1",
32+
"typescript": "^5.0.0",
33+
"unplugin-icons": "^0.16.3",
34+
"vite": "^4.3.6"
35+
},
36+
"type": "module"
37+
}

postcss.config.cjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {}
5+
}
6+
};

src/app.css

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
/* wix-madefor-text-regular - latin_latin-ext */
6+
@font-face {
7+
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
8+
font-family: 'Wix Madefor Text';
9+
font-style: normal;
10+
font-weight: 400;
11+
src: url('/fonts/wix-madefor-text-v12-latin_latin-ext-regular.woff2')
12+
format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
13+
}
14+
15+
/* wix-madefor-text-italic - latin_latin-ext */
16+
@font-face {
17+
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
18+
font-family: 'Wix Madefor Text';
19+
font-style: italic;
20+
font-weight: 400;
21+
src: url('/fonts/wix-madefor-text-v12-latin_latin-ext-italic.woff2')
22+
format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
23+
}
24+
25+
/* wix-madefor-text-500 - latin_latin-ext */
26+
@font-face {
27+
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
28+
font-family: 'Wix Madefor Text';
29+
font-style: normal;
30+
font-weight: 500;
31+
src: url('/fonts/wix-madefor-text-v12-latin_latin-ext-500.woff2')
32+
format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
33+
}
34+
35+
/* wix-madefor-text-500italic - latin_latin-ext */
36+
@font-face {
37+
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
38+
font-family: 'Wix Madefor Text';
39+
font-style: italic;
40+
font-weight: 500;
41+
src: url('/fonts/wix-madefor-text-v12-latin_latin-ext-500italic.woff2')
42+
format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
43+
}
44+
45+
/* wix-madefor-text-600 - latin_latin-ext */
46+
@font-face {
47+
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
48+
font-family: 'Wix Madefor Text';
49+
font-style: normal;
50+
font-weight: 600;
51+
src: url('/fonts/wix-madefor-text-v12-latin_latin-ext-600.woff2')
52+
format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
53+
}
54+
55+
/* wix-madefor-text-600italic - latin_latin-ext */
56+
@font-face {
57+
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
58+
font-family: 'Wix Madefor Text';
59+
font-style: italic;
60+
font-weight: 600;
61+
src: url('/fonts/wix-madefor-text-v12-latin_latin-ext-600italic.woff2')
62+
format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
63+
}
64+
65+
/* wix-madefor-text-700 - latin_latin-ext */
66+
@font-face {
67+
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
68+
font-family: 'Wix Madefor Text';
69+
font-style: normal;
70+
font-weight: 700;
71+
src: url('/fonts/wix-madefor-text-v12-latin_latin-ext-700.woff2')
72+
format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
73+
}
74+
75+
/* wix-madefor-text-700italic - latin_latin-ext */
76+
@font-face {
77+
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
78+
font-family: 'Wix Madefor Text';
79+
font-style: italic;
80+
font-weight: 700;
81+
src: url('/fonts/wix-madefor-text-v12-latin_latin-ext-700italic.woff2')
82+
format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
83+
}
84+
85+
/* wix-madefor-text-800 - latin_latin-ext */
86+
@font-face {
87+
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
88+
font-family: 'Wix Madefor Text';
89+
font-style: normal;
90+
font-weight: 800;
91+
src: url('/fonts/wix-madefor-text-v12-latin_latin-ext-800.woff2')
92+
format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
93+
}
94+
95+
/* wix-madefor-text-800italic - latin_latin-ext */
96+
@font-face {
97+
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
98+
font-family: 'Wix Madefor Text';
99+
font-style: italic;
100+
font-weight: 800;
101+
src: url('/fonts/wix-madefor-text-v12-latin_latin-ext-800italic.woff2')
102+
format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
103+
}
104+
105+
/* fira-code-regular - latin_latin-ext */
106+
@font-face {
107+
font-display: swap; /* Check https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/font-display for other options. */
108+
font-family: 'Fira Code';
109+
font-style: normal;
110+
font-weight: 400;
111+
src: url('/fonts/fira-code-v21-latin_latin-ext-regular.woff2') format('woff2'); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
112+
}
113+
114+
body {
115+
@apply font-body;
116+
}
117+
118+
code {
119+
@apply font-mono;
120+
}
121+
122+
h1,
123+
h2,
124+
h3 {
125+
@apply font-body;
126+
127+
font-weight: 600;
128+
}

src/app.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// See https://kit.svelte.dev/docs/types#app
2+
// for information about these interfaces
3+
declare global {
4+
namespace App {
5+
// interface Error {}
6+
// interface Locals {}
7+
// interface PageData {}
8+
// interface Platform {}
9+
}
10+
}
11+
12+
export {};

src/app.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
6+
<meta name="viewport" content="width=device-width" />
7+
%sveltekit.head%
8+
</head>
9+
<body data-sveltekit-preload-data="hover">
10+
<div style="display: contents">%sveltekit.body%</div>
11+
</body>
12+
</html>

src/lib/actions/copy_to_clipboard.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
export function copyToClipboard(node: Node, target: HTMLElement) {
2+
async function copyText() {
3+
let text = target
4+
? document.querySelector(target).innerText
5+
: node.innerText;
6+
7+
try {
8+
await navigator.clipboard.writeText(text);
9+
10+
node.dispatchEvent(
11+
new CustomEvent('copysuccess', {
12+
bubbles: true
13+
})
14+
);
15+
} catch (error) {
16+
node.dispatchEvent(
17+
new CustomEvent('copyerror', {
18+
bubbles: true,
19+
detail: error
20+
})
21+
);
22+
}
23+
}
24+
25+
node.addEventListener('click', copyText);
26+
27+
return {
28+
destroy() {
29+
node.removeEventListener('click', copyText);
30+
}
31+
};
32+
}

0 commit comments

Comments
 (0)