mirror of
https://github.com/bartvdbraak/hellob.art.git
synced 2025-04-27 17:41:21 +00:00
Merge pull request #95 from bartvdbraak/refactor/web-vitals
This commit is contained in:
commit
49f5cf7d3e
8 changed files with 23 additions and 21 deletions
|
@ -4,6 +4,5 @@
|
||||||
"trailingComma": "none",
|
"trailingComma": "none",
|
||||||
"printWidth": 100,
|
"printWidth": 100,
|
||||||
"plugins": ["prettier-plugin-svelte"],
|
"plugins": ["prettier-plugin-svelte"],
|
||||||
"pluginSearchDirs": ["."],
|
|
||||||
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
|
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<h1 align="center">hellob.art</h1>
|
<a href="https://hellob.art"><h1 align="center">hellob.art</h1></a>
|
||||||
<h5>personal website built with Svelte</h5>
|
<h5>personal website built with Svelte</h5>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
3
lintstagedrc.cjs
Normal file
3
lintstagedrc.cjs
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
module.exports = {
|
||||||
|
'**/*.{js,ts,cjs,svelte,tsx}': [() => 'tsc -p tsconfig.json --noEmit', 'eslint --fix', 'prettier --write']
|
||||||
|
};
|
|
@ -8,8 +8,8 @@
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||||
"lint": "prettier --plugin-search-dir . --check . && eslint .",
|
"lint": "prettier --check . && eslint .",
|
||||||
"format": "prettier --plugin-search-dir . --write .",
|
"format": "prettier --write .",
|
||||||
"prepare": "npx husky install"
|
"prepare": "npx husky install"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
"lint-staged": "^13.2.3",
|
"lint-staged": "^13.2.3",
|
||||||
"postcss": "^8.4.24",
|
"postcss": "^8.4.24",
|
||||||
"postcss-load-config": "^4.0.1",
|
"postcss-load-config": "^4.0.1",
|
||||||
"prettier": "^2.8.0",
|
"prettier": "^3.0.1",
|
||||||
"prettier-plugin-svelte": "^3.0.0",
|
"prettier-plugin-svelte": "^3.0.0",
|
||||||
"svelte": "^4.0.5",
|
"svelte": "^4.0.5",
|
||||||
"svelte-check": "^3.4.3",
|
"svelte-check": "^3.4.3",
|
||||||
|
|
|
@ -62,11 +62,11 @@ devDependencies:
|
||||||
specifier: ^4.0.1
|
specifier: ^4.0.1
|
||||||
version: 4.0.1(postcss@8.4.26)
|
version: 4.0.1(postcss@8.4.26)
|
||||||
prettier:
|
prettier:
|
||||||
specifier: ^2.8.0
|
specifier: ^3.0.1
|
||||||
version: 2.8.8
|
version: 3.0.1
|
||||||
prettier-plugin-svelte:
|
prettier-plugin-svelte:
|
||||||
specifier: ^3.0.0
|
specifier: ^3.0.0
|
||||||
version: 3.0.3(prettier@2.8.8)(svelte@4.1.0)
|
version: 3.0.3(prettier@3.0.1)(svelte@4.1.0)
|
||||||
svelte:
|
svelte:
|
||||||
specifier: ^4.0.5
|
specifier: ^4.0.5
|
||||||
version: 4.1.0
|
version: 4.1.0
|
||||||
|
@ -2037,19 +2037,19 @@ packages:
|
||||||
engines: {node: '>= 0.8.0'}
|
engines: {node: '>= 0.8.0'}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/prettier-plugin-svelte@3.0.3(prettier@2.8.8)(svelte@4.1.0):
|
/prettier-plugin-svelte@3.0.3(prettier@3.0.1)(svelte@4.1.0):
|
||||||
resolution: {integrity: sha512-dLhieh4obJEK1hnZ6koxF+tMUrZbV5YGvRpf2+OADyanjya5j0z1Llo8iGwiHmFWZVG/hLEw/AJD5chXd9r3XA==}
|
resolution: {integrity: sha512-dLhieh4obJEK1hnZ6koxF+tMUrZbV5YGvRpf2+OADyanjya5j0z1Llo8iGwiHmFWZVG/hLEw/AJD5chXd9r3XA==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
prettier: ^3.0.0
|
prettier: ^3.0.0
|
||||||
svelte: ^3.2.0 || ^4.0.0-next.0
|
svelte: ^3.2.0 || ^4.0.0-next.0
|
||||||
dependencies:
|
dependencies:
|
||||||
prettier: 2.8.8
|
prettier: 3.0.1
|
||||||
svelte: 4.1.0
|
svelte: 4.1.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/prettier@2.8.8:
|
/prettier@3.0.1:
|
||||||
resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==}
|
resolution: {integrity: sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ==}
|
||||||
engines: {node: '>=10.13.0'}
|
engines: {node: '>=14'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import type { Metric } from 'web-vitals';
|
import type { Metric } from 'web-vitals';
|
||||||
import { getCLS, getFCP, getFID, getLCP, getTTFB } from 'web-vitals';
|
import { onCLS, onFCP, onFID, onLCP, onTTFB } from 'web-vitals';
|
||||||
|
|
||||||
const vitalsUrl = 'https://vitals.vercel-analytics.com/v1/vitals';
|
const vitalsUrl = 'https://vitals.vercel-analytics.com/v1/vitals';
|
||||||
|
|
||||||
|
@ -75,11 +75,11 @@ export function webVitals(options: {
|
||||||
debug: boolean;
|
debug: boolean;
|
||||||
}) {
|
}) {
|
||||||
try {
|
try {
|
||||||
getFID((metric) => sendToAnalytics(metric, options));
|
onFID((metric) => sendToAnalytics(metric, options));
|
||||||
getTTFB((metric) => sendToAnalytics(metric, options));
|
onTTFB((metric) => sendToAnalytics(metric, options));
|
||||||
getLCP((metric) => sendToAnalytics(metric, options));
|
onLCP((metric) => sendToAnalytics(metric, options));
|
||||||
getCLS((metric) => sendToAnalytics(metric, options));
|
onCLS((metric) => sendToAnalytics(metric, options));
|
||||||
getFCP((metric) => sendToAnalytics(metric, options));
|
onFCP((metric) => sendToAnalytics(metric, options));
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('[Web Vitals]', err);
|
console.error('[Web Vitals]', err);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
overall robustness and stability of our cloud infrastructure.
|
overall robustness and stability of our cloud infrastructure.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="max-h-80">
|
<div class="h-72">
|
||||||
<Canvas>
|
<Canvas>
|
||||||
<T.PerspectiveCamera makeDefault position={[-10, 15, 20]} fov={10}>
|
<T.PerspectiveCamera makeDefault position={[-10, 15, 20]} fov={10}>
|
||||||
<OrbitControls
|
<OrbitControls
|
||||||
|
|
Loading…
Reference in a new issue