feat: preload fonts

This commit is contained in:
ThaUnknown 2025-09-16 22:04:31 +02:00
parent b1ac5422b8
commit 015676648b
No known key found for this signature in database
11 changed files with 172 additions and 75 deletions

View file

@ -20,7 +20,7 @@ jobs:
- name: Install Node.js - name: Install Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: 22.9 node-version: 22.19
cache: 'pnpm' cache: 'pnpm'
- name: Install dependencies - name: Install dependencies

View file

@ -12,6 +12,16 @@ export default tseslint.config(
svelteConfig svelteConfig
} }
}, },
ignores: ['build/', '.svelte-kit/', 'node_modules/'] ignores: ['build/', '.svelte-kit/', 'node_modules/'],
rules: {
'@typescript-eslint/prefer-nullish-coalescing': [
'error',
{
ignoreConditionalTests: true,
ignoreMixedLogicalExpressions: false,
ignorePrimitives: true
}
]
}
} }
) )

View file

@ -1,6 +1,6 @@
{ {
"name": "ui", "name": "ui",
"version": "6.4.145", "version": "6.4.146",
"license": "BUSL-1.1", "license": "BUSL-1.1",
"private": true, "private": true,
"packageManager": "pnpm@9.15.5", "packageManager": "pnpm@9.15.5",
@ -33,6 +33,7 @@
"gql.tada": "^1.8.13", "gql.tada": "^1.8.13",
"hayase-extensions": "github:hayase-app/extensions", "hayase-extensions": "github:hayase-app/extensions",
"jassub": "^1.8.6", "jassub": "^1.8.6",
"jiti": "^2.5.1",
"ms": "^2.1.3", "ms": "^2.1.3",
"native": "github:hayase-app/native", "native": "github:hayase-app/native",
"rollup-plugin-license": "^3.6.0", "rollup-plugin-license": "^3.6.0",

View file

@ -179,7 +179,7 @@ importers:
version: 0.0.19(svelte@4.2.19) version: 0.0.19(svelte@4.2.19)
eslint-config-standard-universal: eslint-config-standard-universal:
specifier: ^1.0.9 specifier: ^1.0.9
version: 1.0.9(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2))(jiti@1.21.6) version: 1.0.9(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(jiti@2.5.1)
gql.tada: gql.tada:
specifier: ^1.8.13 specifier: ^1.8.13
version: 1.8.13(@gql.tada/svelte-support@1.0.1(svelte@4.2.19)(typescript@5.9.2))(graphql@16.10.0)(typescript@5.9.2) version: 1.8.13(@gql.tada/svelte-support@1.0.1(svelte@4.2.19)(typescript@5.9.2))(graphql@16.10.0)(typescript@5.9.2)
@ -189,6 +189,9 @@ importers:
jassub: jassub:
specifier: ^1.8.6 specifier: ^1.8.6
version: 1.8.6 version: 1.8.6
jiti:
specifier: ^2.5.1
version: 2.5.1
ms: ms:
specifier: ^2.1.3 specifier: ^2.1.3
version: 2.1.3 version: 2.1.3
@ -1887,6 +1890,10 @@ packages:
resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==} resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==}
hasBin: true hasBin: true
jiti@2.5.1:
resolution: {integrity: sha512-twQoecYPiVA5K/h6SxtORw/Bs3ar+mLUtoPSc7iMXzQzK8d7eJ/R09wmTwAjiamETn1cXYPGfNnu7DMoHgu12w==}
hasBin: true
js-levenshtein@1.1.6: js-levenshtein@1.1.6:
resolution: {integrity: sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==} resolution: {integrity: sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
@ -3023,9 +3030,9 @@ snapshots:
'@esbuild/win32-x64@0.21.5': '@esbuild/win32-x64@0.21.5':
optional: true optional: true
'@eslint-community/eslint-utils@4.7.0(eslint@9.34.0(jiti@1.21.6))': '@eslint-community/eslint-utils@4.7.0(eslint@9.34.0(jiti@2.5.1))':
dependencies: dependencies:
eslint: 9.34.0(jiti@1.21.6) eslint: 9.34.0(jiti@2.5.1)
eslint-visitor-keys: 3.4.3 eslint-visitor-keys: 3.4.3
'@eslint-community/regexpp@4.12.1': {} '@eslint-community/regexpp@4.12.1': {}
@ -3142,7 +3149,7 @@ snapshots:
dependencies: dependencies:
'@jridgewell/set-array': 1.2.1 '@jridgewell/set-array': 1.2.1
'@jridgewell/sourcemap-codec': 1.5.0 '@jridgewell/sourcemap-codec': 1.5.0
'@jridgewell/trace-mapping': 0.3.25 '@jridgewell/trace-mapping': 0.3.30
'@jridgewell/resolve-uri@3.1.2': {} '@jridgewell/resolve-uri@3.1.2': {}
@ -3264,11 +3271,11 @@ snapshots:
'@standard-schema/spec@1.0.0': {} '@standard-schema/spec@1.0.0': {}
'@stylistic/eslint-plugin@5.3.1(eslint@9.34.0(jiti@1.21.6))': '@stylistic/eslint-plugin@5.3.1(eslint@9.34.0(jiti@2.5.1))':
dependencies: dependencies:
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@1.21.6)) '@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1))
'@typescript-eslint/types': 8.41.0 '@typescript-eslint/types': 8.41.0
eslint: 9.34.0(jiti@1.21.6) eslint: 9.34.0(jiti@2.5.1)
eslint-visitor-keys: 4.2.1 eslint-visitor-keys: 4.2.1
espree: 10.4.0 espree: 10.4.0
estraverse: 5.3.0 estraverse: 5.3.0
@ -3403,15 +3410,15 @@ snapshots:
'@types/trusted-types@2.0.7': '@types/trusted-types@2.0.7':
optional: true optional: true
'@typescript-eslint/eslint-plugin@8.41.0(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2))(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)': '@typescript-eslint/eslint-plugin@8.41.0(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)':
dependencies: dependencies:
'@eslint-community/regexpp': 4.12.1 '@eslint-community/regexpp': 4.12.1
'@typescript-eslint/parser': 8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2) '@typescript-eslint/parser': 8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
'@typescript-eslint/scope-manager': 8.41.0 '@typescript-eslint/scope-manager': 8.41.0
'@typescript-eslint/type-utils': 8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2) '@typescript-eslint/type-utils': 8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
'@typescript-eslint/utils': 8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2) '@typescript-eslint/utils': 8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
'@typescript-eslint/visitor-keys': 8.41.0 '@typescript-eslint/visitor-keys': 8.41.0
eslint: 9.34.0(jiti@1.21.6) eslint: 9.34.0(jiti@2.5.1)
graphemer: 1.4.0 graphemer: 1.4.0
ignore: 7.0.5 ignore: 7.0.5
natural-compare: 1.4.0 natural-compare: 1.4.0
@ -3420,14 +3427,14 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
'@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)': '@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)':
dependencies: dependencies:
'@typescript-eslint/scope-manager': 8.41.0 '@typescript-eslint/scope-manager': 8.41.0
'@typescript-eslint/types': 8.41.0 '@typescript-eslint/types': 8.41.0
'@typescript-eslint/typescript-estree': 8.41.0(typescript@5.9.2) '@typescript-eslint/typescript-estree': 8.41.0(typescript@5.9.2)
'@typescript-eslint/visitor-keys': 8.41.0 '@typescript-eslint/visitor-keys': 8.41.0
debug: 4.4.1 debug: 4.4.1
eslint: 9.34.0(jiti@1.21.6) eslint: 9.34.0(jiti@2.5.1)
typescript: 5.9.2 typescript: 5.9.2
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -3450,13 +3457,13 @@ snapshots:
dependencies: dependencies:
typescript: 5.9.2 typescript: 5.9.2
'@typescript-eslint/type-utils@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)': '@typescript-eslint/type-utils@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)':
dependencies: dependencies:
'@typescript-eslint/types': 8.41.0 '@typescript-eslint/types': 8.41.0
'@typescript-eslint/typescript-estree': 8.41.0(typescript@5.9.2) '@typescript-eslint/typescript-estree': 8.41.0(typescript@5.9.2)
'@typescript-eslint/utils': 8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2) '@typescript-eslint/utils': 8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
debug: 4.4.1 debug: 4.4.1
eslint: 9.34.0(jiti@1.21.6) eslint: 9.34.0(jiti@2.5.1)
ts-api-utils: 2.1.0(typescript@5.9.2) ts-api-utils: 2.1.0(typescript@5.9.2)
typescript: 5.9.2 typescript: 5.9.2
transitivePeerDependencies: transitivePeerDependencies:
@ -3480,13 +3487,13 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
'@typescript-eslint/utils@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2)': '@typescript-eslint/utils@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)':
dependencies: dependencies:
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@1.21.6)) '@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1))
'@typescript-eslint/scope-manager': 8.41.0 '@typescript-eslint/scope-manager': 8.41.0
'@typescript-eslint/types': 8.41.0 '@typescript-eslint/types': 8.41.0
'@typescript-eslint/typescript-estree': 8.41.0(typescript@5.9.2) '@typescript-eslint/typescript-estree': 8.41.0(typescript@5.9.2)
eslint: 9.34.0(jiti@1.21.6) eslint: 9.34.0(jiti@2.5.1)
typescript: 5.9.2 typescript: 5.9.2
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -4156,24 +4163,24 @@ snapshots:
escape-string-regexp@4.0.0: {} escape-string-regexp@4.0.0: {}
eslint-compat-utils@0.5.1(eslint@9.34.0(jiti@1.21.6)): eslint-compat-utils@0.5.1(eslint@9.34.0(jiti@2.5.1)):
dependencies: dependencies:
eslint: 9.34.0(jiti@1.21.6) eslint: 9.34.0(jiti@2.5.1)
semver: 7.7.2 semver: 7.7.2
eslint-config-standard-universal@1.0.9(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2))(jiti@1.21.6): eslint-config-standard-universal@1.0.9(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(jiti@2.5.1):
dependencies: dependencies:
'@stylistic/eslint-plugin': 5.3.1(eslint@9.34.0(jiti@1.21.6)) '@stylistic/eslint-plugin': 5.3.1(eslint@9.34.0(jiti@2.5.1))
eslint: 9.34.0(jiti@1.21.6) eslint: 9.34.0(jiti@2.5.1)
eslint-import-resolver-node: 0.3.9 eslint-import-resolver-node: 0.3.9
eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2))(eslint@9.34.0(jiti@1.21.6)) eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.34.0(jiti@2.5.1))
eslint-plugin-n: 17.21.3(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2) eslint-plugin-n: 17.21.3(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
eslint-plugin-promise: 7.2.1(eslint@9.34.0(jiti@1.21.6)) eslint-plugin-promise: 7.2.1(eslint@9.34.0(jiti@2.5.1))
eslint-plugin-svelte: 3.11.0(eslint@9.34.0(jiti@1.21.6))(svelte@4.2.19) eslint-plugin-svelte: 3.11.0(eslint@9.34.0(jiti@2.5.1))(svelte@4.2.19)
globals: 16.3.0 globals: 16.3.0
svelte: 4.2.19 svelte: 4.2.19
typescript: 5.9.2 typescript: 5.9.2
typescript-eslint: 8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2) typescript-eslint: 8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
transitivePeerDependencies: transitivePeerDependencies:
- '@typescript-eslint/parser' - '@typescript-eslint/parser'
- eslint-import-resolver-typescript - eslint-import-resolver-typescript
@ -4190,24 +4197,24 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
eslint-module-utils@2.12.1(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint@9.34.0(jiti@1.21.6)): eslint-module-utils@2.12.1(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint@9.34.0(jiti@2.5.1)):
dependencies: dependencies:
debug: 3.2.7 debug: 3.2.7
optionalDependencies: optionalDependencies:
'@typescript-eslint/parser': 8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2) '@typescript-eslint/parser': 8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
eslint: 9.34.0(jiti@1.21.6) eslint: 9.34.0(jiti@2.5.1)
eslint-import-resolver-node: 0.3.9 eslint-import-resolver-node: 0.3.9
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
eslint-plugin-es-x@7.8.0(eslint@9.34.0(jiti@1.21.6)): eslint-plugin-es-x@7.8.0(eslint@9.34.0(jiti@2.5.1)):
dependencies: dependencies:
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@1.21.6)) '@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1))
'@eslint-community/regexpp': 4.12.1 '@eslint-community/regexpp': 4.12.1
eslint: 9.34.0(jiti@1.21.6) eslint: 9.34.0(jiti@2.5.1)
eslint-compat-utils: 0.5.1(eslint@9.34.0(jiti@1.21.6)) eslint-compat-utils: 0.5.1(eslint@9.34.0(jiti@2.5.1))
eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2))(eslint@9.34.0(jiti@1.21.6)): eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.34.0(jiti@2.5.1)):
dependencies: dependencies:
'@rtsao/scc': 1.1.0 '@rtsao/scc': 1.1.0
array-includes: 3.1.9 array-includes: 3.1.9
@ -4216,9 +4223,9 @@ snapshots:
array.prototype.flatmap: 1.3.3 array.prototype.flatmap: 1.3.3
debug: 3.2.7 debug: 3.2.7
doctrine: 2.1.0 doctrine: 2.1.0
eslint: 9.34.0(jiti@1.21.6) eslint: 9.34.0(jiti@2.5.1)
eslint-import-resolver-node: 0.3.9 eslint-import-resolver-node: 0.3.9
eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint@9.34.0(jiti@1.21.6)) eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(eslint-import-resolver-node@0.3.9)(eslint@9.34.0(jiti@2.5.1))
hasown: 2.0.2 hasown: 2.0.2
is-core-module: 2.16.1 is-core-module: 2.16.1
is-glob: 4.0.3 is-glob: 4.0.3
@ -4230,18 +4237,18 @@ snapshots:
string.prototype.trimend: 1.0.9 string.prototype.trimend: 1.0.9
tsconfig-paths: 3.15.0 tsconfig-paths: 3.15.0
optionalDependencies: optionalDependencies:
'@typescript-eslint/parser': 8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2) '@typescript-eslint/parser': 8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
transitivePeerDependencies: transitivePeerDependencies:
- eslint-import-resolver-typescript - eslint-import-resolver-typescript
- eslint-import-resolver-webpack - eslint-import-resolver-webpack
- supports-color - supports-color
eslint-plugin-n@17.21.3(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2): eslint-plugin-n@17.21.3(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2):
dependencies: dependencies:
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@1.21.6)) '@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1))
enhanced-resolve: 5.18.3 enhanced-resolve: 5.18.3
eslint: 9.34.0(jiti@1.21.6) eslint: 9.34.0(jiti@2.5.1)
eslint-plugin-es-x: 7.8.0(eslint@9.34.0(jiti@1.21.6)) eslint-plugin-es-x: 7.8.0(eslint@9.34.0(jiti@2.5.1))
get-tsconfig: 4.10.1 get-tsconfig: 4.10.1
globals: 15.15.0 globals: 15.15.0
globrex: 0.1.2 globrex: 0.1.2
@ -4251,16 +4258,16 @@ snapshots:
transitivePeerDependencies: transitivePeerDependencies:
- typescript - typescript
eslint-plugin-promise@7.2.1(eslint@9.34.0(jiti@1.21.6)): eslint-plugin-promise@7.2.1(eslint@9.34.0(jiti@2.5.1)):
dependencies: dependencies:
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@1.21.6)) '@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1))
eslint: 9.34.0(jiti@1.21.6) eslint: 9.34.0(jiti@2.5.1)
eslint-plugin-svelte@3.11.0(eslint@9.34.0(jiti@1.21.6))(svelte@4.2.19): eslint-plugin-svelte@3.11.0(eslint@9.34.0(jiti@2.5.1))(svelte@4.2.19):
dependencies: dependencies:
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@1.21.6)) '@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1))
'@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/sourcemap-codec': 1.5.5
eslint: 9.34.0(jiti@1.21.6) eslint: 9.34.0(jiti@2.5.1)
esutils: 2.0.3 esutils: 2.0.3
globals: 16.3.0 globals: 16.3.0
known-css-properties: 0.37.0 known-css-properties: 0.37.0
@ -4283,9 +4290,9 @@ snapshots:
eslint-visitor-keys@4.2.1: {} eslint-visitor-keys@4.2.1: {}
eslint@9.34.0(jiti@1.21.6): eslint@9.34.0(jiti@2.5.1):
dependencies: dependencies:
'@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@1.21.6)) '@eslint-community/eslint-utils': 4.7.0(eslint@9.34.0(jiti@2.5.1))
'@eslint-community/regexpp': 4.12.1 '@eslint-community/regexpp': 4.12.1
'@eslint/config-array': 0.21.0 '@eslint/config-array': 0.21.0
'@eslint/config-helpers': 0.3.1 '@eslint/config-helpers': 0.3.1
@ -4321,7 +4328,7 @@ snapshots:
natural-compare: 1.4.0 natural-compare: 1.4.0
optionator: 0.9.4 optionator: 0.9.4
optionalDependencies: optionalDependencies:
jiti: 1.21.6 jiti: 2.5.1
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@ -4732,6 +4739,8 @@ snapshots:
jiti@1.21.6: {} jiti@1.21.6: {}
jiti@2.5.1: {}
js-levenshtein@1.1.6: {} js-levenshtein@1.1.6: {}
js-yaml@4.1.0: js-yaml@4.1.0:
@ -5626,13 +5635,13 @@ snapshots:
possible-typed-array-names: 1.1.0 possible-typed-array-names: 1.1.0
reflect.getprototypeof: 1.0.10 reflect.getprototypeof: 1.0.10
typescript-eslint@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2): typescript-eslint@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2):
dependencies: dependencies:
'@typescript-eslint/eslint-plugin': 8.41.0(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2))(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2) '@typescript-eslint/eslint-plugin': 8.41.0(@typescript-eslint/parser@8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2))(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
'@typescript-eslint/parser': 8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2) '@typescript-eslint/parser': 8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
'@typescript-eslint/typescript-estree': 8.41.0(typescript@5.9.2) '@typescript-eslint/typescript-estree': 8.41.0(typescript@5.9.2)
'@typescript-eslint/utils': 8.41.0(eslint@9.34.0(jiti@1.21.6))(typescript@5.9.2) '@typescript-eslint/utils': 8.41.0(eslint@9.34.0(jiti@2.5.1))(typescript@5.9.2)
eslint: 9.34.0(jiti@1.21.6) eslint: 9.34.0(jiti@2.5.1)
typescript: 5.9.2 typescript: 5.9.2
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color

View file

@ -138,10 +138,10 @@
} }
} }
@font-face { /* @font-face {
font-family: 'molotregular'; font-family: 'molotregular';
src: url('/Molot-webfont-subset.woff') format('woff'); src: url('/Molot-webfont-subset.woff') format('woff');
} } */
@font-face { @font-face {
font-family: "Twemoji"; font-family: "Twemoji";
@ -475,9 +475,9 @@ body {
background-size: 119px; background-size: 119px;
} }
.font-molot { /* .font-molot {
font-family: 'molotregular'; font-family: 'molotregular';
} } */
.font-twemoji { .font-twemoji {
font-family: 'Twemoji'; font-family: 'Twemoji';

View file

@ -48,6 +48,8 @@
} }
$: checkIdleState(active, $settings.idleAnimation) $: checkIdleState(active, $settings.idleAnimation)
// MOLOT font was commented out in app.css since this feature was shelved
</script> </script>
<svelte:document bind:visibilityState /> <svelte:document bind:visibilityState />

View file

@ -13,7 +13,7 @@ const dummyFiles = [
type: 'video/webm', type: 'video/webm',
size: 1234567890, size: 1234567890,
path: '/Amebku.webm', path: '/Amebku.webm',
url: '/test2.mkv', url: 'video.mkv',
id: 0 id: 0
} }
// { // {

View file

@ -1,5 +1,5 @@
<script lang='ts'> <script lang='ts'>
import { goto, preloadCode } from '$app/navigation' import { goto, preloadData } from '$app/navigation'
import Logo from '$lib/components/icons/Logo.svelte' import Logo from '$lib/components/icons/Logo.svelte'
import { storagePromise } from '$lib/modules/anilist/urql-client' import { storagePromise } from '$lib/modules/anilist/urql-client'
@ -21,7 +21,7 @@
// this was previously in anilist/client but it was a top level await, which isn't a great solution, this *should* be better? // this was previously in anilist/client but it was a top level await, which isn't a great solution, this *should* be better?
// we want to wait for the cache to be ready, for the page preload to finish, and for the animation to finish, in that order, but as fast as possible for each // we want to wait for the cache to be ready, for the page preload to finish, and for the animation to finish, in that order, but as fast as possible for each
const promise = storagePromise.promise.then(() => preloadCode(data.goto)) const promise = storagePromise.promise.then(() => preloadData(data.goto))
async function navigate () { async function navigate () {
await promise await promise
@ -61,8 +61,8 @@
0 0 0 1 0' /> 0 0 0 1 0' />
<feOffset in='red_' dy='0' result='red'> <feOffset in='red_' dy='0' result='red'>
<animate attributeName='dx' <animate attributeName='dx'
values='4;2;0' values='4;0'
dur='0.2s' dur='0.1s'
begin='0s' /> begin='0s' />
</feOffset> </feOffset>
<feColorMatrix type='matrix' <feColorMatrix type='matrix'
@ -74,8 +74,8 @@
0 0 0 1 0' /> 0 0 0 1 0' />
<feOffset in='blue_' dy='0' result='blue'> <feOffset in='blue_' dy='0' result='blue'>
<animate attributeName='dx' <animate attributeName='dx'
values='-6;-3;0' values='-6;0'
dur='0.2s' dur='0.1s'
begin='0s' /> begin='0s' />
</feOffset> </feOffset>
<feBlend mode='screen' in='red' in2='blue' /> <feBlend mode='screen' in='red' in2='blue' />

6
src/types/fs.d.ts vendored
View file

@ -16,3 +16,9 @@ declare module 'node:fs' {
import path = require('fs') import path = require('fs')
export = path export = path
} }
declare module 'node:fs/promises' {
export function readdir(path: string | URL): Promise<string[]>
export function readFile(path: string | URL, options?: { encoding?: string, flag?: string } | string): Promise<string | Uint8Array>
export function writeFile(path: string | URL, data: string | Uint8Array, options?: { encoding?: string, mode?: number, flag?: string } | string): Promise<void>
}

1
src/types/path.d.ts vendored
View file

@ -1,5 +1,6 @@
declare module 'path' { declare module 'path' {
export function resolve(...paths: string[]): string export function resolve(...paths: string[]): string
export function join(...paths: string[]): string
} }
declare module 'node:path' { declare module 'node:path' {

View file

@ -1,8 +1,72 @@
import { readdir, readFile, writeFile } from 'node:fs/promises'
import { join } from 'node:path'
import process from 'node:process' import process from 'node:process'
import adapter from '@sveltejs/adapter-static' import staticAdapter from '@sveltejs/adapter-static'
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte' import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
/**
* Custom adapter wrapper that extends @sveltejs/adapter-static
* to inject font preload links after the build is complete
*
* @param {import('@sveltejs/adapter-static').AdapterOptions & {fontNames?: string[], formats?: string[]}} options
* @returns {import('@sveltejs/kit').Adapter}
*/
const adapterWithFontPreload = (options = {}) => {
const { fontNames = ['nunito'], formats = ['woff2', 'woff'], ...staticOptions } = options
const baseAdapter = staticAdapter(staticOptions)
return {
name: 'adapter-static-with-font-preload',
async adapt (builder) {
await baseAdapter.adapt(builder)
const outDir = './build' // Static adapter always writes to 'build' directory
try {
const assetsDir = join(outDir, '_app/immutable/assets')
const assetFiles = await readdir(assetsDir)
const fontFiles = assetFiles.filter(file => {
const lowerFileName = file.toLowerCase()
return formats.some(format => lowerFileName.endsWith(`.${format}`)) &&
fontNames.some(name => lowerFileName.includes(name.toLowerCase()))
})
if (fontFiles.length === 0) return
console.log('Found fonts to preload:', fontFiles)
const preloadLinks = fontFiles.map(fontFile => {
const format = fontFile.split('.').pop()
return `\t<link rel="preload" href="/_app/immutable/assets/${fontFile}" as="font" type="font/${format}" crossorigin>`
}).join('\n')
const htmlPath = join(outDir, '/index.html')
try {
const html = /** @type {string} */ (await readFile(htmlPath, 'utf-8'))
const headPattern = '</head>'
const replacement = `${preloadLinks}\n${headPattern}`
const updated = html.replace(headPattern, replacement)
if (updated !== html) {
await writeFile(htmlPath, updated, 'utf-8')
console.log(`Added font preload links to ${htmlPath}`)
}
} catch (error) {
console.log(`Could not process ${htmlPath}:`, error)
}
} catch (error) {
console.error('Error injecting font preloads:', error)
}
}
}
}
/** @type {import('@sveltejs/kit').Config} */ /** @type {import('@sveltejs/kit').Config} */
const config = { const config = {
onwarn: (warning, handler) => { onwarn: (warning, handler) => {
@ -12,7 +76,11 @@ const config = {
}, },
preprocess: vitePreprocess({}), preprocess: vitePreprocess({}),
kit: { kit: {
adapter: adapter({ fallback: 'index.html' }), adapter: adapterWithFontPreload({
fallback: 'index.html',
fontNames: ['nunito-latin-wght'],
formats: ['woff2', 'woff']
}),
version: { version: {
name: process.env.npm_package_version name: process.env.npm_package_version
}, },