chore: init svelte project

This commit is contained in:
dusk 2024-07-11 15:51:49 +03:00
parent 84fb9c1d96
commit 95d5eb6f40
Signed by: dusk
SSH Key Fingerprint: SHA256:Abmvag+juovVufZTxyWY8KcVgrznxvBjQpJesv071Aw
25 changed files with 209 additions and 280 deletions

5
.gitattributes vendored
View File

@ -1,5 +0,0 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

24
.gitignore vendored
View File

@ -1,3 +1,21 @@
result node_modules
.obsidian
.trash # Output
.output
.vercel
/.svelte-kit
/build
# OS
.DS_Store
Thumbs.db
# Env
.env
.env.*
!.env.example
!.env.test
# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

1
.npmrc Normal file
View File

@ -0,0 +1 @@
engine-strict=true

4
.prettierignore Normal file
View File

@ -0,0 +1,4 @@
# Package Managers
package-lock.json
pnpm-lock.yaml
yarn.lock

8
.prettierrc Normal file
View File

@ -0,0 +1,8 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}

38
README.md Normal file
View File

@ -0,0 +1,38 @@
# create-svelte
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).
## Creating a project
If you're seeing this, you've probably already done this step. Congrats!
```bash
# create a new project in the current directory
npm create svelte@latest
# create a new project in my-app
npm create svelte@latest my-app
```
## Developing
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
```bash
npm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --open
```
## Building
To create a production version of your app:
```bash
npm run build
```
You can preview the production build with `npm run preview`.
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.

BIN
bun.lockb Normal file

Binary file not shown.

33
eslint.config.js Normal file
View File

@ -0,0 +1,33 @@
import js from '@eslint/js';
import ts from 'typescript-eslint';
import svelte from 'eslint-plugin-svelte';
import prettier from 'eslint-config-prettier';
import globals from 'globals';
/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node
}
}
},
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
parser: ts.parser
}
}
},
{
ignores: ['build/', '.svelte-kit/', 'dist/']
}
];

View File

@ -1,90 +0,0 @@
{
"nodes": {
"html-nix": {
"inputs": {
"nixpkgs": "nixpkgs",
"parts": "parts"
},
"locked": {
"lastModified": 1689376761,
"narHash": "sha256-T3UBWQAqmMmsIpgNySzxlbel9UjREGQJPJDyGY8BUWQ=",
"ref": "refs/heads/master",
"rev": "1f8450f6e4c42e2fd6204df95e513531001733b3",
"revCount": 71,
"type": "git",
"url": "https://git.gaze.systems/dusk/html.nix.git"
},
"original": {
"type": "git",
"url": "https://git.gaze.systems/dusk/html.nix.git"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1680668850,
"narHash": "sha256-mQMg13yRsS0LXVzaeoSPwqgPO6yhkGzGewPgMSqXSv8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "4a65e9f64e53fdca6eed31adba836717a11247d2",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1680213900,
"narHash": "sha256-cIDr5WZIj3EkKyCgj/6j3HBH4Jj1W296z7HTcWj1aMA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e3652e0735fbec227f342712f180f4f21f0594f2",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"parts": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1680392223,
"narHash": "sha256-n3g7QFr85lDODKt250rkZj2IFS3i4/8HBU2yKHO3tqw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "dcc36e45d054d7bb554c9cdab69093debd91a0b5",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"root": {
"inputs": {
"html-nix": "html-nix",
"nixpkgs": [
"html-nix",
"nixpkgs"
],
"parts": [
"html-nix",
"parts"
]
}
}
},
"root": "root",
"version": 7
}

124
flake.nix
View File

@ -1,124 +0,0 @@
{
inputs = {
html-nix.url = "git+https://git.gaze.systems/dusk/html.nix.git";
nixpkgs.follows = "html-nix/nixpkgs";
parts.follows = "html-nix/parts";
};
outputs = inputs @ {parts, ...}:
parts.lib.mkFlake {inherit inputs;} (topArgs: {
systems = ["x86_64-linux"];
imports = [inputs.html-nix.flakeModule];
perSystem = {
config,
lib,
...
}: let
l = lib // builtins;
html-nix = config.html-nix.lib;
site = local:
html-nix.mkSiteFrom {
inherit local;
src = ./src;
config = {
baseurl = "https://gaze.systems";
title = "dusk's place";
iconPath = "resources/icon.png";
siteLang = "en";
descriptionsById = {
"404" = "Page not found.";
"index" = "Home page of dusk's place with information about the website.";
"posts" = "A listing of posts published on the website.";
"_exporting_ssh_key_from_gpg" = "Instructions explaining how to export SSH keys from GPG.";
};
footerContent = ''
<div class="bg-svg"></div>
<div class="bg-svg-fg"></div>
'';
};
templater = ctx:
l.pipe ctx [
topArgs.config.html-nix.lib.templaters.simple
(ctx:
l.recursiveUpdate ctx {
site."resources"."icon.png" = ./src/resources/icon.png;
site."resources"."wave.svg" = ./src/resources/wave.svg;
site."resources"."wavealt.svg" = ./src/resources/wave-alt.svg;
site."site.css" = ''
${ctx.site."site.css"}
.bg-svg, .bg-svg-fg {
position: absolute;
bottom: 0;
left: 0;
width: 100vw;
background-size: cover;
background-repeat: repeat-x;
}
.bg-svg {
z-index: -2;
height: 50vh;
background-image: url(resources/wave.svg);
animation: move-svg 200s linear infinite;
}
.bg-svg-fg {
z-index: -1;
height: 40vh;
background-image: url(resources/wavealt.svg);
animation: move-svg 100s linear infinite reverse;
}
@keyframes move-svg {
0% {
background-position: 0 0;
}
50% {
background-position: 100vw 0;
}
100% {
background-position: 200vw 0;
}
}
body {
background: #3d1f7a;
color: #fff;
}
a {
color: #007fff;
}
a.novisited:visited {
color: #007fff;
}
a:visited {
color: #bf40bf;
}
pre,code {
background: #333;
color: #fff;
}
'';
}
)
];
};
dev = html-nix.mkServeFromSite (site true);
in {
packages.site = html-nix.mkSitePathFrom (site false);
apps.site.program = "${dev}/bin/serve";
};
});
}

33
package.json Normal file
View File

@ -0,0 +1,33 @@
{
"name": "website",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write ."
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@types/eslint": "^8.56.7",
"eslint": "^9.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.36.0",
"globals": "^15.0.0",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"svelte": "^4.2.7",
"svelte-check": "^3.6.0",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"typescript-eslint": "^8.0.0-alpha.20",
"vite": "^5.0.3"
},
"type": "module"
}

13
src/app.d.ts vendored Normal file
View File

@ -0,0 +1,13 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface PageState {}
// interface Platform {}
}
}
export {};

12
src/app.html Normal file
View File

@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>

View File

@ -1,28 +0,0 @@
<style>
h6:before {
all: unset;
}
</style>
# about
hi, i'm dusk, a software engineer and aspiring game developer.
feel free to send an e-mail or DM me on Discord if you have anything to ask.
+ contact:
- discord: yusdacra
- e-mail: y.bera003.06@pm.me
+ others:
- bluesky: https://bsky.app/profile/gaze.systems
- misskey.art: https://misskey.art/@yusdacra
## bio
i love using Nix / NixOS for anything.
i like developing with Rust for my hobby or work projects.
my projects are on [my GitHub](https://github.com/yusdacra) and [my Gitea](https://git.gaze.systems/dusk).
i love playing (and making) video games.
you can find any game i develop [here on my itch.io page](https://yusdacra.itch.io/).
###### [this site's source is available here](https://git.gaze.systems/dusk/website).

1
src/lib/index.ts Normal file
View File

@ -0,0 +1 @@
// place files you want to import through the `$lib` alias in this folder.

View File

@ -1,9 +0,0 @@
- gpg --export-secret-ssh-key doesn't work
- gpg --export-ssh-key works to export public key
-----------
- to export secret ssh key first remove password from your [A]uthentication subkey
- you can do this with `gpg --edit-key KEYID` and then `passwd` and `save`
- then do `gpg --export-secret-subkeys KEYID! | openpgp2ssh KEYID > ssh_key`

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<svg id="wave" style="transform:rotate(0deg); transition: 0.3s" viewBox="0 0 1440 300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:bx="https://boxy-svg.com">
<defs>
<linearGradient id="sw-gradient-0" x1="0" x2="0" y1="1" y2="0">
<stop stop-color="rgba(107, 213, 44, 1)" offset="0"/>
<stop stop-color="rgba(107, 213, 44, 1)" offset="1"/>
</linearGradient>
<bx:guide x="1441.0930872017134" y="165.14410770893244" angle="-90"/>
</defs>
<path style="transform:translate(0, 0px); opacity:1" fill="url(#sw-gradient-0)" d="M 0 165 L 26.7 150 C 72.192 120.938 119.554 60.623 160 60 C 213.294 59.179 267 120 320 155 C 373.3 190 427 200 480 215 C 533.3 230 587 250 640 225 C 693.3 200 747 130 800 130 C 853.3 130 907 200 960 190 C 1013.3 180 1067 90 1120 85 C 1173.3 80 1227.415 158.934 1280 180 C 1333.487 201.428 1389.415 178.414 1440 165 C 1491.746 151.279 1547 220 1600 200 C 1653.3 180 1707 90 1760 80 C 1813.3 70 1867 140 1920 180 C 1973.3 220 2027 230 2080 220 C 2133.3 210 2187 180 2240 170 C 2293.3 160 2347 170 2400 190 C 2453.3 210 2507 240 2560 245 C 2613.3 250 2667 230 2720 210 C 2773.3 190 2827 170 2880 155 C 2933.3 140 2987 130 3040 145 C 3093.3 160 3147 200 3200 195 C 3253.3 190 3307 140 3360 120 C 3413.3 100 3467 110 3520 115 C 3573.3 120 3627 120 3680 135 C 3733.3 150 3787 180 3813 195 L 3840 210 L 3840 300 L 3813.3 300 C 3786.7 300 3733 300 3680 300 C 3626.7 300 3573 300 3520 300 C 3466.7 300 3413 300 3360 300 C 3306.7 300 3253 300 3200 300 C 3146.7 300 3093 300 3040 300 C 2986.7 300 2933 300 2880 300 C 2826.7 300 2773 300 2720 300 C 2666.7 300 2613 300 2560 300 C 2506.7 300 2453 300 2400 300 C 2346.7 300 2293 300 2240 300 C 2186.7 300 2133 300 2080 300 C 2026.7 300 1973 300 1920 300 C 1866.7 300 1813 300 1760 300 C 1706.7 300 1653 300 1600 300 C 1546.7 300 1493 300 1440 300 C 1386.7 300 1333 300 1280 300 C 1226.7 300 1173 300 1120 300 C 1066.7 300 1013 300 960 300 C 906.7 300 853 300 800 300 C 746.7 300 693 300 640 300 C 586.7 300 533 300 480 300 C 426.7 300 373 300 320 300 C 266.7 300 213 300 160 300 C 106.7 300 53 300 27 300 L 0 300 L 0 165 Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<svg id="wave" style="transform:rotate(0deg); transition: 0.3s" viewBox="0 0 1440 430" version="1.1" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="sw-gradient-0" x1="0" x2="0" y1="1" y2="0">
<stop stop-color="rgba(107, 213, 44, 1)" offset="0"/>
<stop stop-color="rgba(80.792, 162.008, 32.523, 1)" offset="1"/>
</linearGradient>
</defs>
<path style="transform:translate(0, 0px); opacity:1" fill="url(#sw-gradient-0)" d="M 0 86 L 46.251 67.859 C 175.531 14.217 238.887 227.328 288 293.8 C 345.208 371.228 480 215 576 186.3 C 672 158 768 186 864 215 C 960 244 1055.968 271.887 1152 236.5 C 1248.032 201.113 1351.412 125.867 1440 86 C 1528.588 46.133 1632 143 1728 150.5 C 1824 158 1920 100 2016 71.7 C 2112 43 2208 43 2304 50.2 C 2400 57 2496 72 2592 129 C 2688 186 2784 287 2880 315.3 C 2976 344 3072 301 3168 243.7 C 3264 186 3360 115 3456 71.7 C 3552 29 3648 14 3744 50.2 C 3840 86 3936 172 4032 200.7 C 4128 229 4224 201 4320 179.2 C 4416 158 4512 143 4608 164.8 C 4704 186 4800 244 4896 229.3 C 4992 215 5088 129 5184 143.3 C 5280 158 5376 272 5472 329.7 C 5568 387 5664 387 5760 329.7 C 5856 272 5952 158 6048 143.3 C 6144 129 6240 215 6336 229.3 C 6432 244 6528 186 6624 143.3 C 6720 100 6816 72 6864 57.3 L 6912 43 L 6912 430 L 6864 430 C 6816 430 6720 430 6624 430 C 6528 430 6432 430 6336 430 C 6240 430 6144 430 6048 430 C 5952 430 5856 430 5760 430 C 5664 430 5568 430 5472 430 C 5376 430 5280 430 5184 430 C 5088 430 4992 430 4896 430 C 4800 430 4704 430 4608 430 C 4512 430 4416 430 4320 430 C 4224 430 4128 430 4032 430 C 3936 430 3840 430 3744 430 C 3648 430 3552 430 3456 430 C 3360 430 3264 430 3168 430 C 3072 430 2976 430 2880 430 C 2784 430 2688 430 2592 430 C 2496 430 2400 430 2304 430 C 2208 430 2112 430 2016 430 C 1920 430 1824 430 1728 430 C 1632 430 1536 430 1440 430 C 1344 430 1248 430 1152 430 C 1056 430 960 430 864 430 C 768 430 672 430 576 430 C 480 430 384 430 288 430 C 192 430 96 430 48 430 L 0 430 L 0 86 Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 2.0 KiB

2
src/routes/+page.svelte Normal file
View File

@ -0,0 +1,2 @@
<h1>Welcome to SvelteKit</h1>
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>

BIN
static/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

18
svelte.config.js Normal file
View File

@ -0,0 +1,18 @@
import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: vitePreprocess(),
kit: {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter()
}
};
export default config;

19
tsconfig.json Normal file
View File

@ -0,0 +1,19 @@
{
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"moduleResolution": "bundler"
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
// except $lib which is handled by https://kit.svelte.dev/docs/configuration#files
//
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
// from the referenced tsconfig.json - TypeScript does not merge them in
}

6
vite.config.ts Normal file
View File

@ -0,0 +1,6 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()]
});