Prettier install & format

This commit is contained in:
2025-01-24 14:17:23 +00:00
parent ecff0a202c
commit 683151d591
27 changed files with 616 additions and 613 deletions

View File

@@ -11,6 +11,7 @@ This project uses `devenv.nix` to manage the development environment, which will
### Installation ### Installation
1. Clone the repository: 1. Clone the repository:
```bash ```bash
git clone https://github.com/Cian-H/am-d-model.eu.git git clone https://github.com/Cian-H/am-d-model.eu.git
cd am-d-model.eu cd am-d-model.eu
@@ -54,4 +55,3 @@ implemented in future but for now, simplicity is a virtue.
## License ## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

BIN
bun.lockb

Binary file not shown.

View File

@@ -39,6 +39,5 @@ networks:
am-d-model-network: am-d-model-network:
name: am-d-model-network name: am-d-model-network
volumes: volumes:
caddy_data: caddy_data:

View File

@@ -16,6 +16,7 @@
"autoprefixer": "^10.4.20", "autoprefixer": "^10.4.20",
"globals": "^15.14.0", "globals": "^15.14.0",
"publint": "^0.2.12", "publint": "^0.2.12",
"prettier": "^3.4.2",
"sass": "^1.83.1", "sass": "^1.83.1",
"svelte": "^5.17.3", "svelte": "^5.17.3",
"svelte-preprocess": "^5.1.4", "svelte-preprocess": "^5.1.4",

View File

@@ -1,6 +1,6 @@
export default { export default {
plugins: { plugins: {
tailwindcss: {}, tailwindcss: {},
autoprefixer: {} autoprefixer: {},
} },
}; };

8
prettier.config.js Normal file
View File

@@ -0,0 +1,8 @@
const config = {
singleQuote: false,
tabWidth: 4,
trailingComma: "all",
printWidth: 100,
};
export default config;

View File

@@ -1,6 +1,6 @@
<h1>This is a placeholder page</h1> <h1>This is a placeholder page</h1>
<h2>Please wait patiently while I set up the data repository</h2> <h2>Please wait patiently while I set up the data repository</h2>
<p> <p>
The data repository will be deployed as soon as possible, we just The data repository will be deployed as soon as possible, we just need to figure out some
need to figure out some details first before deployment happens. details first before deployment happens.
</p> </p>

View File

@@ -1,3 +1,3 @@
@import 'tailwindcss/base'; @import "tailwindcss/base";
@import 'tailwindcss/components'; @import "tailwindcss/components";
@import 'tailwindcss/utilities' @import "tailwindcss/utilities";

View File

@@ -1,6 +1,5 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" /> <link rel="icon" href="%sveltekit.assets%/favicon.png" />
@@ -11,5 +10,4 @@
<body data-sveltekit-preload-data="hover"> <body data-sveltekit-preload-data="hover">
<div>%sveltekit.body%</div> <div>%sveltekit.body%</div>
</body> </body>
</html> </html>

View File

@@ -1,10 +1,12 @@
import { goto } from "$app/navigation"; import { goto } from "$app/navigation";
import { error } from '@sveltejs/kit'; import { error } from "@sveltejs/kit";
export const navigation = { export const navigation = {
toHome: () => goto("/"), toHome: () => goto("/"),
toAbout: () => goto("/about"), toAbout: () => goto("/about"),
toContact: () => goto("/contact"), toContact: () => goto("/contact"),
toRepository: () => goto("/repo"), toRepository: () => goto("/repo"),
to404: () => { throw error(404, 'Page not found') }, to404: () => {
throw error(404, "Page not found");
},
}; };

View File

@@ -1,8 +1,9 @@
.form-container { .form-container {
input, input,
textarea { textarea {
transition: border-color 0.2s ease, box-shadow 0.2s ease; transition:
border-color 0.2s ease,
box-shadow 0.2s ease;
&:focus { &:focus {
outline: none; outline: none;

View File

@@ -43,8 +43,7 @@
justify-content: center; justify-content: center;
flex-shrink: 0; flex-shrink: 0;
position: relative; position: relative;
box-shadow: var(--button-shadow-box-shadow, box-shadow: var(--button-shadow-box-shadow, 0px 1px 2px 0px rgba(0, 0, 0, 0.05));
0px 1px 2px 0px rgba(0, 0, 0, 0.05));
} }
.navigation-header-button-text { .navigation-header-button-text {

View File

@@ -45,5 +45,4 @@
--contact-corner-round: 28px; --contact-corner-round: 28px;
/* Effects */ /* Effects */
} }

View File

@@ -29,7 +29,7 @@
.btmcall-buttons { .btmcall-buttons {
max-width: 100%; max-width: 100%;
padding-top: 32px padding-top: 32px;
} }
} }

View File

@@ -20,15 +20,13 @@
// Blend out the background image into the plain bg color // Blend out the background image into the plain bg color
&::after { &::after {
content: ''; content: "";
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 128px; height: 128px;
background: linear-gradient(to bottom, background: linear-gradient(to bottom, #00000000 0%, var(--background) 100%);
#00000000 0%,
var(--background) 100%);
z-index: 1; z-index: 1;
} }
} }

View File

@@ -36,8 +36,7 @@
justify-content: center; justify-content: center;
flex-shrink: 0; flex-shrink: 0;
position: relative; position: relative;
box-shadow: var(--button-shadow-box-shadow, box-shadow: var(--button-shadow-box-shadow, 0px 1px 2px 0px rgba(0, 0, 0, 0.05));
0px 1px 2px 0px rgba(0, 0, 0, 0.05));
} }
.navigation-header-button-text { .navigation-header-button-text {

View File

@@ -72,7 +72,6 @@
} }
} }
@media (max-width: 380px) { @media (max-width: 380px) {
.splash-title { .splash-title {
font-size: var(--splash-title-font-size-tiny); font-size: var(--splash-title-font-size-tiny);

View File

@@ -1,3 +1,3 @@
export function GET() { export function GET() {
return new Response('OK', { status: 200 }); return new Response("OK", { status: 200 });
} }

View File

@@ -1,5 +1,5 @@
import preprocess from "svelte-preprocess"; import preprocess from "svelte-preprocess";
import adapter from '@sveltejs/adapter-node'; import adapter from "@sveltejs/adapter-node";
/** @type {import('@sveltejs/kit').Config} */ /** @type {import('@sveltejs/kit').Config} */
const config = { const config = {
@@ -8,28 +8,28 @@ const config = {
}), }),
kit: { kit: {
paths: { paths: {
base: '', base: "",
}, },
adapter: adapter({ adapter: adapter({
out: 'build', out: "build",
precompress: true, // Pre-compresses files precompress: true, // Pre-compresses files
polyfill: true polyfill: true,
}), }),
csrf: { checkOrigin: false }, csrf: { checkOrigin: false },
prerender: { prerender: {
entries: ['*'], entries: ["*"],
handleMissingId: 'warn' handleMissingId: "warn",
}, },
csp: { csp: {
mode: 'auto', mode: "auto",
directives: { directives: {
'script-src': ['self'] "script-src": ["self"],
} },
}, },
version: { version: {
name: Date.now().toString() name: Date.now().toString(),
} },
} },
}; };
export default config; export default config;

View File

@@ -1,11 +1,11 @@
import forms from '@tailwindcss/forms'; import forms from "@tailwindcss/forms";
/** @type {import('tailwindcss').Config} */ /** @type {import('tailwindcss').Config} */
export default { export default {
content: ['./src/**/*.{html,js,svelte,ts}'], content: ["./src/**/*.{html,js,svelte,ts}"],
theme: { theme: {
extend: {} extend: {},
}, },
plugins: [forms], plugins: [forms],

View File

@@ -1,36 +1,36 @@
import { defineConfig } from 'vite'; import { defineConfig } from "vite";
import { sveltekit } from '@sveltejs/kit/vite' import { sveltekit } from "@sveltejs/kit/vite";
import viteCompression from 'vite-plugin-compression' import viteCompression from "vite-plugin-compression";
export default defineConfig({ export default defineConfig({
plugins: [ plugins: [
sveltekit(), sveltekit(),
viteCompression({ viteCompression({
algorithm: 'brotli', algorithm: "brotli",
threshold: 1024, threshold: 1024,
compressionOptions: { level: 11 }, compressionOptions: { level: 11 },
exclude: [/\.(br|gz)$/, /\.(jpe?g|png|gif|webp|zip)$/i], exclude: [/\.(br|gz)$/, /\.(jpe?g|png|gif|webp|zip)$/i],
filter: /\.(js|css|html|svg)$/i filter: /\.(js|css|html|svg)$/i,
}), }),
viteCompression({ viteCompression({
algorithm: 'gzip', algorithm: "gzip",
threshold: 1024, threshold: 1024,
compressionOptions: { level: 9 }, compressionOptions: { level: 9 },
exclude: [/\.(br|gz)$/, /\.(jpe?g|png|gif|webp|zip)$/i], exclude: [/\.(br|gz)$/, /\.(jpe?g|png|gif|webp|zip)$/i],
filter: /\.(js|css|html|svg)$/i filter: /\.(js|css|html|svg)$/i,
}) }),
], ],
build: { build: {
minify: 'terser', minify: "terser",
terserOptions: { terserOptions: {
compress: { compress: {
drop_console: true, drop_console: true,
drop_debugger: true drop_debugger: true,
} },
}, },
reportCompressedSize: true, reportCompressedSize: true,
cssMinify: true, cssMinify: true,
cssCodeSplit: true cssCodeSplit: true,
}, },
server: { server: {
host: "0.0.0.0", host: "0.0.0.0",