mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-15 11:12:54 +02:00
✨ feat: add image lightbox functionality
- Add imageConfig in astro.config.ts to optimize remote image processing in Markdown files - Update PhotoSwipe component initialization logic to ensure proper setup on page load
This commit is contained in:
parent
043b811ce4
commit
dfc30d7f85
5 changed files with 115 additions and 118 deletions
|
@ -16,6 +16,17 @@ import { remarkReadingTime } from './src/plugins/remark-reading-time'
|
|||
const url = themeConfig.site.url
|
||||
const locale = themeConfig.global.locale
|
||||
const linkPrefetch = themeConfig.preload.linkPrefetch
|
||||
const imageHostURL = themeConfig.preload.imageHostURL
|
||||
const imageConfig = imageHostURL
|
||||
? {
|
||||
// Configure domains and remotePatterns to optimize remote images in Markdown files using  syntax (adds width and height)
|
||||
// Docs: https://docs.astro.build/en/guides/images/#authorizing-remote-images
|
||||
image: {
|
||||
domains: [imageHostURL],
|
||||
remotePatterns: [{ protocol: 'https' }],
|
||||
}
|
||||
}
|
||||
: {};
|
||||
|
||||
export default defineConfig({
|
||||
site: url,
|
||||
|
@ -25,6 +36,7 @@ export default defineConfig({
|
|||
prefetchAll: true,
|
||||
defaultStrategy: linkPrefetch,
|
||||
},
|
||||
...imageConfig,
|
||||
i18n: {
|
||||
locales: Object.entries(langMap).map(([path, codes]) => ({
|
||||
path,
|
||||
|
|
132
pnpm-lock.yaml
generated
132
pnpm-lock.yaml
generated
|
@ -68,7 +68,7 @@ importers:
|
|||
devDependencies:
|
||||
'@antfu/eslint-config':
|
||||
specifier: ^4.12.0
|
||||
version: 4.12.0(@typescript-eslint/utils@8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(@unocss/eslint-plugin@66.1.0-beta.11(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(@vue/compiler-sfc@3.5.13)(astro-eslint-parser@1.2.2)(eslint-plugin-astro@1.3.1(eslint@9.24.0(jiti@2.4.2)))(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)(vitest@3.1.1(@types/debug@4.1.12)(@types/node@22.14.1)(jiti@2.4.2)(lightningcss@1.29.3)(terser@5.39.0)(yaml@2.7.1))
|
||||
version: 4.12.0(@typescript-eslint/utils@8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(@unocss/eslint-plugin@66.1.0-beta.11(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(@vue/compiler-sfc@3.5.13)(astro-eslint-parser@1.2.2)(eslint-plugin-astro@1.3.1(eslint@9.24.0(jiti@2.4.2)))(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)(vitest@3.1.1(@types/debug@4.1.12)(@types/node@22.14.1)(jiti@2.4.2)(lightningcss@1.29.3)(terser@5.39.0)(yaml@2.7.1))
|
||||
'@astrojs/check':
|
||||
specifier: ^0.9.4
|
||||
version: 0.9.4(typescript@5.8.3)
|
||||
|
@ -1045,51 +1045,51 @@ packages:
|
|||
'@types/web-bluetooth@0.0.21':
|
||||
resolution: {integrity: sha512-oIQLCGWtcFZy2JW77j9k8nHzAOpqMHLQejDA48XXMWH6tjCQHz5RCFz1bzsmROyL6PUm+LLnUiI4BCn221inxA==}
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.29.1':
|
||||
resolution: {integrity: sha512-ba0rr4Wfvg23vERs3eB+P3lfj2E+2g3lhWcCVukUuhtcdUx5lSIFZlGFEBHKr+3zizDa/TvZTptdNHVZWAkSBg==}
|
||||
'@typescript-eslint/eslint-plugin@8.30.1':
|
||||
resolution: {integrity: sha512-v+VWphxMjn+1t48/jO4t950D6KR8JaJuNXzi33Ve6P8sEmPr5k6CEXjdGwT6+LodVnEa91EQCtwjWNUCPweo+Q==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
'@typescript-eslint/parser': ^8.0.0 || ^8.0.0-alpha.0
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <5.9.0'
|
||||
|
||||
'@typescript-eslint/parser@8.29.1':
|
||||
resolution: {integrity: sha512-zczrHVEqEaTwh12gWBIJWj8nx+ayDcCJs06yoNMY0kwjMWDM6+kppljY+BxWI06d2Ja+h4+WdufDcwMnnMEWmg==}
|
||||
'@typescript-eslint/parser@8.30.1':
|
||||
resolution: {integrity: sha512-H+vqmWwT5xoNrXqWs/fesmssOW70gxFlgcMlYcBaWNPIEWDgLa4W9nkSPmhuOgLnXq9QYgkZ31fhDyLhleCsAg==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <5.9.0'
|
||||
|
||||
'@typescript-eslint/scope-manager@8.29.1':
|
||||
resolution: {integrity: sha512-2nggXGX5F3YrsGN08pw4XpMLO1Rgtnn4AzTegC2MDesv6q3QaTU5yU7IbS1tf1IwCR0Hv/1EFygLn9ms6LIpDA==}
|
||||
'@typescript-eslint/scope-manager@8.30.1':
|
||||
resolution: {integrity: sha512-+C0B6ChFXZkuaNDl73FJxRYT0G7ufVPOSQkqkpM/U198wUwUFOtgo1k/QzFh1KjpBitaK7R1tgjVz6o9HmsRPg==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@typescript-eslint/type-utils@8.29.1':
|
||||
resolution: {integrity: sha512-DkDUSDwZVCYN71xA4wzySqqcZsHKic53A4BLqmrWFFpOpNSoxX233lwGu/2135ymTCR04PoKiEEEvN1gFYg4Tw==}
|
||||
'@typescript-eslint/type-utils@8.30.1':
|
||||
resolution: {integrity: sha512-64uBF76bfQiJyHgZISC7vcNz3adqQKIccVoKubyQcOnNcdJBvYOILV1v22Qhsw3tw3VQu5ll8ND6hycgAR5fEA==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <5.9.0'
|
||||
|
||||
'@typescript-eslint/types@8.29.1':
|
||||
resolution: {integrity: sha512-VT7T1PuJF1hpYC3AGm2rCgJBjHL3nc+A/bhOp9sGMKfi5v0WufsX/sHCFBfNTx2F+zA6qBc/PD0/kLRLjdt8mQ==}
|
||||
'@typescript-eslint/types@8.30.1':
|
||||
resolution: {integrity: sha512-81KawPfkuulyWo5QdyG/LOKbspyyiW+p4vpn4bYO7DM/hZImlVnFwrpCTnmNMOt8CvLRr5ojI9nU1Ekpw4RcEw==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@typescript-eslint/typescript-estree@8.29.1':
|
||||
resolution: {integrity: sha512-l1enRoSaUkQxOQnbi0KPUtqeZkSiFlqrx9/3ns2rEDhGKfTa+88RmXqedC1zmVTOWrLc2e6DEJrTA51C9iLH5g==}
|
||||
'@typescript-eslint/typescript-estree@8.30.1':
|
||||
resolution: {integrity: sha512-kQQnxymiUy9tTb1F2uep9W6aBiYODgq5EMSk6Nxh4Z+BDUoYUSa029ISs5zTzKBFnexQEh71KqwjKnRz58lusQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
typescript: '>=4.8.4 <5.9.0'
|
||||
|
||||
'@typescript-eslint/utils@8.29.1':
|
||||
resolution: {integrity: sha512-QAkFEbytSaB8wnmB+DflhUPz6CLbFWE2SnSCrRMEa+KnXIzDYbpsn++1HGvnfAsUY44doDXmvRkO5shlM/3UfA==}
|
||||
'@typescript-eslint/utils@8.30.1':
|
||||
resolution: {integrity: sha512-T/8q4R9En2tcEsWPQgB5BQ0XJVOtfARcUvOa8yJP3fh9M/mXraLxZrkCfGb6ChrO/V3W+Xbd04RacUEqk1CFEQ==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: '>=4.8.4 <5.9.0'
|
||||
|
||||
'@typescript-eslint/visitor-keys@8.29.1':
|
||||
resolution: {integrity: sha512-RGLh5CRaUEf02viP5c1Vh1cMGffQscyHe7HPAzGpfmfflFg1wUz2rYxd+OZqwpeypYvZ8UxSxuIpF++fmOzEcg==}
|
||||
'@typescript-eslint/visitor-keys@8.30.1':
|
||||
resolution: {integrity: sha512-aEhgas7aJ6vZnNFC7K4/vMGDGyOiqWcYZPpIWrTKuTAlsvDNKy2GFDqh9smL+iq069ZvR0YzEeq0B8NJlLzjFA==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
|
||||
|
||||
'@ungap/structured-clone@1.3.0':
|
||||
|
@ -1841,8 +1841,8 @@ packages:
|
|||
duplexer@0.1.2:
|
||||
resolution: {integrity: sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==}
|
||||
|
||||
electron-to-chromium@1.5.136:
|
||||
resolution: {integrity: sha512-kL4+wUTD7RSA5FHx5YwWtjDnEEkIIikFgWHR4P6fqjw1PPLlqYkxeOb++wAauAssat0YClCy8Y3C5SxgSkjibQ==}
|
||||
electron-to-chromium@1.5.137:
|
||||
resolution: {integrity: sha512-/QSJaU2JyIuTbbABAo/crOs+SuAZLS+fVVS10PVrIT9hrRkmZl8Hb0xPSkKRUUWHQtYzXHpQUW3Dy5hwMzGZkA==}
|
||||
|
||||
emmet@2.4.11:
|
||||
resolution: {integrity: sha512-23QPJB3moh/U9sT4rQzGgeyyGIrcM+GH5uVYg2C6wZIxAIJq7Ng3QLT79tl8FUwDXhyq9SusfknOrofAKqvgyQ==}
|
||||
|
@ -4042,16 +4042,16 @@ snapshots:
|
|||
'@jridgewell/gen-mapping': 0.3.8
|
||||
'@jridgewell/trace-mapping': 0.3.25
|
||||
|
||||
'@antfu/eslint-config@4.12.0(@typescript-eslint/utils@8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(@unocss/eslint-plugin@66.1.0-beta.11(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(@vue/compiler-sfc@3.5.13)(astro-eslint-parser@1.2.2)(eslint-plugin-astro@1.3.1(eslint@9.24.0(jiti@2.4.2)))(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)(vitest@3.1.1(@types/debug@4.1.12)(@types/node@22.14.1)(jiti@2.4.2)(lightningcss@1.29.3)(terser@5.39.0)(yaml@2.7.1))':
|
||||
'@antfu/eslint-config@4.12.0(@typescript-eslint/utils@8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(@unocss/eslint-plugin@66.1.0-beta.11(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(@vue/compiler-sfc@3.5.13)(astro-eslint-parser@1.2.2)(eslint-plugin-astro@1.3.1(eslint@9.24.0(jiti@2.4.2)))(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)(vitest@3.1.1(@types/debug@4.1.12)(@types/node@22.14.1)(jiti@2.4.2)(lightningcss@1.29.3)(terser@5.39.0)(yaml@2.7.1))':
|
||||
dependencies:
|
||||
'@antfu/install-pkg': 1.0.0
|
||||
'@clack/prompts': 0.10.1
|
||||
'@eslint-community/eslint-plugin-eslint-comments': 4.5.0(eslint@9.24.0(jiti@2.4.2))
|
||||
'@eslint/markdown': 6.3.0
|
||||
'@stylistic/eslint-plugin': 4.2.0(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@typescript-eslint/eslint-plugin': 8.29.1(@typescript-eslint/parser@8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@typescript-eslint/parser': 8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@vitest/eslint-plugin': 1.1.42(@typescript-eslint/utils@8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)(vitest@3.1.1(@types/debug@4.1.12)(@types/node@22.14.1)(jiti@2.4.2)(lightningcss@1.29.3)(terser@5.39.0)(yaml@2.7.1))
|
||||
'@typescript-eslint/eslint-plugin': 8.30.1(@typescript-eslint/parser@8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@typescript-eslint/parser': 8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@vitest/eslint-plugin': 1.1.42(@typescript-eslint/utils@8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)(vitest@3.1.1(@types/debug@4.1.12)(@types/node@22.14.1)(jiti@2.4.2)(lightningcss@1.29.3)(terser@5.39.0)(yaml@2.7.1))
|
||||
ansis: 3.17.0
|
||||
cac: 6.7.14
|
||||
eslint: 9.24.0(jiti@2.4.2)
|
||||
|
@ -4070,7 +4070,7 @@ snapshots:
|
|||
eslint-plugin-regexp: 2.7.0(eslint@9.24.0(jiti@2.4.2))
|
||||
eslint-plugin-toml: 0.12.0(eslint@9.24.0(jiti@2.4.2))
|
||||
eslint-plugin-unicorn: 58.0.0(eslint@9.24.0(jiti@2.4.2))
|
||||
eslint-plugin-unused-imports: 4.1.4(@typescript-eslint/eslint-plugin@8.29.1(@typescript-eslint/parser@8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.24.0(jiti@2.4.2))
|
||||
eslint-plugin-unused-imports: 4.1.4(@typescript-eslint/eslint-plugin@8.30.1(@typescript-eslint/parser@8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.24.0(jiti@2.4.2))
|
||||
eslint-plugin-vue: 10.0.0(eslint@9.24.0(jiti@2.4.2))(vue-eslint-parser@10.1.3(eslint@9.24.0(jiti@2.4.2)))
|
||||
eslint-plugin-yml: 1.17.0(eslint@9.24.0(jiti@2.4.2))
|
||||
eslint-processor-vue-blocks: 2.0.0(@vue/compiler-sfc@3.5.13)(eslint@9.24.0(jiti@2.4.2))
|
||||
|
@ -4298,7 +4298,7 @@ snapshots:
|
|||
dependencies:
|
||||
'@types/eslint': 9.6.1
|
||||
'@types/estree': 1.0.7
|
||||
'@typescript-eslint/types': 8.29.1
|
||||
'@typescript-eslint/types': 8.30.1
|
||||
comment-parser: 1.4.1
|
||||
esquery: 1.6.0
|
||||
jsdoc-type-pratt-parser: 4.1.0
|
||||
|
@ -4827,7 +4827,7 @@ snapshots:
|
|||
|
||||
'@stylistic/eslint-plugin@4.2.0(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@typescript-eslint/utils': 8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@typescript-eslint/utils': 8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
eslint: 9.24.0(jiti@2.4.2)
|
||||
eslint-visitor-keys: 4.2.0
|
||||
espree: 10.3.0
|
||||
|
@ -4924,14 +4924,14 @@ snapshots:
|
|||
|
||||
'@types/web-bluetooth@0.0.21': {}
|
||||
|
||||
'@typescript-eslint/eslint-plugin@8.29.1(@typescript-eslint/parser@8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)':
|
||||
'@typescript-eslint/eslint-plugin@8.30.1(@typescript-eslint/parser@8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@eslint-community/regexpp': 4.12.1
|
||||
'@typescript-eslint/parser': 8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@typescript-eslint/scope-manager': 8.29.1
|
||||
'@typescript-eslint/type-utils': 8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@typescript-eslint/utils': 8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@typescript-eslint/visitor-keys': 8.29.1
|
||||
'@typescript-eslint/parser': 8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@typescript-eslint/scope-manager': 8.30.1
|
||||
'@typescript-eslint/type-utils': 8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@typescript-eslint/utils': 8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@typescript-eslint/visitor-keys': 8.30.1
|
||||
eslint: 9.24.0(jiti@2.4.2)
|
||||
graphemer: 1.4.0
|
||||
ignore: 5.3.2
|
||||
|
@ -4941,27 +4941,27 @@ snapshots:
|
|||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/parser@8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)':
|
||||
'@typescript-eslint/parser@8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@typescript-eslint/scope-manager': 8.29.1
|
||||
'@typescript-eslint/types': 8.29.1
|
||||
'@typescript-eslint/typescript-estree': 8.29.1(typescript@5.8.3)
|
||||
'@typescript-eslint/visitor-keys': 8.29.1
|
||||
'@typescript-eslint/scope-manager': 8.30.1
|
||||
'@typescript-eslint/types': 8.30.1
|
||||
'@typescript-eslint/typescript-estree': 8.30.1(typescript@5.8.3)
|
||||
'@typescript-eslint/visitor-keys': 8.30.1
|
||||
debug: 4.4.0
|
||||
eslint: 9.24.0(jiti@2.4.2)
|
||||
typescript: 5.8.3
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/scope-manager@8.29.1':
|
||||
'@typescript-eslint/scope-manager@8.30.1':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.29.1
|
||||
'@typescript-eslint/visitor-keys': 8.29.1
|
||||
'@typescript-eslint/types': 8.30.1
|
||||
'@typescript-eslint/visitor-keys': 8.30.1
|
||||
|
||||
'@typescript-eslint/type-utils@8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)':
|
||||
'@typescript-eslint/type-utils@8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@typescript-eslint/typescript-estree': 8.29.1(typescript@5.8.3)
|
||||
'@typescript-eslint/utils': 8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@typescript-eslint/typescript-estree': 8.30.1(typescript@5.8.3)
|
||||
'@typescript-eslint/utils': 8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
debug: 4.4.0
|
||||
eslint: 9.24.0(jiti@2.4.2)
|
||||
ts-api-utils: 2.1.0(typescript@5.8.3)
|
||||
|
@ -4969,12 +4969,12 @@ snapshots:
|
|||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/types@8.29.1': {}
|
||||
'@typescript-eslint/types@8.30.1': {}
|
||||
|
||||
'@typescript-eslint/typescript-estree@8.29.1(typescript@5.8.3)':
|
||||
'@typescript-eslint/typescript-estree@8.30.1(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.29.1
|
||||
'@typescript-eslint/visitor-keys': 8.29.1
|
||||
'@typescript-eslint/types': 8.30.1
|
||||
'@typescript-eslint/visitor-keys': 8.30.1
|
||||
debug: 4.4.0
|
||||
fast-glob: 3.3.3
|
||||
is-glob: 4.0.3
|
||||
|
@ -4985,20 +4985,20 @@ snapshots:
|
|||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/utils@8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)':
|
||||
'@typescript-eslint/utils@8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.6.0(eslint@9.24.0(jiti@2.4.2))
|
||||
'@typescript-eslint/scope-manager': 8.29.1
|
||||
'@typescript-eslint/types': 8.29.1
|
||||
'@typescript-eslint/typescript-estree': 8.29.1(typescript@5.8.3)
|
||||
'@typescript-eslint/scope-manager': 8.30.1
|
||||
'@typescript-eslint/types': 8.30.1
|
||||
'@typescript-eslint/typescript-estree': 8.30.1(typescript@5.8.3)
|
||||
eslint: 9.24.0(jiti@2.4.2)
|
||||
typescript: 5.8.3
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
'@typescript-eslint/visitor-keys@8.29.1':
|
||||
'@typescript-eslint/visitor-keys@8.30.1':
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.29.1
|
||||
'@typescript-eslint/types': 8.30.1
|
||||
eslint-visitor-keys: 4.2.0
|
||||
|
||||
'@ungap/structured-clone@1.3.0': {}
|
||||
|
@ -5040,7 +5040,7 @@ snapshots:
|
|||
|
||||
'@unocss/eslint-plugin@66.1.0-beta.11(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@typescript-eslint/utils': 8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@typescript-eslint/utils': 8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@unocss/config': 66.1.0-beta.11
|
||||
'@unocss/core': 66.1.0-beta.11
|
||||
'@unocss/rule-utils': 66.1.0-beta.11
|
||||
|
@ -5225,9 +5225,9 @@ snapshots:
|
|||
'@unrs/resolver-binding-win32-x64-msvc@1.5.0':
|
||||
optional: true
|
||||
|
||||
'@vitest/eslint-plugin@1.1.42(@typescript-eslint/utils@8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)(vitest@3.1.1(@types/debug@4.1.12)(@types/node@22.14.1)(jiti@2.4.2)(lightningcss@1.29.3)(terser@5.39.0)(yaml@2.7.1))':
|
||||
'@vitest/eslint-plugin@1.1.42(@typescript-eslint/utils@8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)(vitest@3.1.1(@types/debug@4.1.12)(@types/node@22.14.1)(jiti@2.4.2)(lightningcss@1.29.3)(terser@5.39.0)(yaml@2.7.1))':
|
||||
dependencies:
|
||||
'@typescript-eslint/utils': 8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@typescript-eslint/utils': 8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
eslint: 9.24.0(jiti@2.4.2)
|
||||
vitest: 3.1.1(@types/debug@4.1.12)(@types/node@22.14.1)(jiti@2.4.2)(lightningcss@1.29.3)(terser@5.39.0)(yaml@2.7.1)
|
||||
optionalDependencies:
|
||||
|
@ -5516,8 +5516,8 @@ snapshots:
|
|||
astro-eslint-parser@1.2.2:
|
||||
dependencies:
|
||||
'@astrojs/compiler': 2.11.0
|
||||
'@typescript-eslint/scope-manager': 8.29.1
|
||||
'@typescript-eslint/types': 8.29.1
|
||||
'@typescript-eslint/scope-manager': 8.30.1
|
||||
'@typescript-eslint/types': 8.30.1
|
||||
astrojs-compiler-sync: 1.1.1(@astrojs/compiler@2.11.0)
|
||||
debug: 4.4.0
|
||||
entities: 6.0.0
|
||||
|
@ -5683,7 +5683,7 @@ snapshots:
|
|||
browserslist@4.24.4:
|
||||
dependencies:
|
||||
caniuse-lite: 1.0.30001713
|
||||
electron-to-chromium: 1.5.136
|
||||
electron-to-chromium: 1.5.137
|
||||
node-releases: 2.0.19
|
||||
update-browserslist-db: 1.1.3(browserslist@4.24.4)
|
||||
|
||||
|
@ -5954,7 +5954,7 @@ snapshots:
|
|||
|
||||
duplexer@0.1.2: {}
|
||||
|
||||
electron-to-chromium@1.5.136: {}
|
||||
electron-to-chromium@1.5.137: {}
|
||||
|
||||
emmet@2.4.11:
|
||||
dependencies:
|
||||
|
@ -6075,7 +6075,7 @@ snapshots:
|
|||
dependencies:
|
||||
'@eslint-community/eslint-utils': 4.6.0(eslint@9.24.0(jiti@2.4.2))
|
||||
'@jridgewell/sourcemap-codec': 1.5.0
|
||||
'@typescript-eslint/types': 8.29.1
|
||||
'@typescript-eslint/types': 8.30.1
|
||||
astro-eslint-parser: 1.2.2
|
||||
eslint: 9.24.0(jiti@2.4.2)
|
||||
eslint-compat-utils: 0.6.5(eslint@9.24.0(jiti@2.4.2))
|
||||
|
@ -6101,7 +6101,7 @@ snapshots:
|
|||
dependencies:
|
||||
'@pkgr/core': 0.2.3
|
||||
'@types/doctrine': 0.0.9
|
||||
'@typescript-eslint/utils': 8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@typescript-eslint/utils': 8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
debug: 4.4.0
|
||||
doctrine: 3.0.0
|
||||
eslint: 9.24.0(jiti@2.4.2)
|
||||
|
@ -6164,8 +6164,8 @@ snapshots:
|
|||
|
||||
eslint-plugin-perfectionist@4.11.0(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3):
|
||||
dependencies:
|
||||
'@typescript-eslint/types': 8.29.1
|
||||
'@typescript-eslint/utils': 8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@typescript-eslint/types': 8.30.1
|
||||
'@typescript-eslint/utils': 8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
eslint: 9.24.0(jiti@2.4.2)
|
||||
natural-orderby: 5.0.0
|
||||
transitivePeerDependencies:
|
||||
|
@ -6224,11 +6224,11 @@ snapshots:
|
|||
semver: 7.7.1
|
||||
strip-indent: 4.0.0
|
||||
|
||||
eslint-plugin-unused-imports@4.1.4(@typescript-eslint/eslint-plugin@8.29.1(@typescript-eslint/parser@8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.24.0(jiti@2.4.2)):
|
||||
eslint-plugin-unused-imports@4.1.4(@typescript-eslint/eslint-plugin@8.30.1(@typescript-eslint/parser@8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.24.0(jiti@2.4.2)):
|
||||
dependencies:
|
||||
eslint: 9.24.0(jiti@2.4.2)
|
||||
optionalDependencies:
|
||||
'@typescript-eslint/eslint-plugin': 8.29.1(@typescript-eslint/parser@8.29.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
'@typescript-eslint/eslint-plugin': 8.30.1(@typescript-eslint/parser@8.30.1(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3))(eslint@9.24.0(jiti@2.4.2))(typescript@5.8.3)
|
||||
|
||||
eslint-plugin-vue@10.0.0(eslint@9.24.0(jiti@2.4.2))(vue-eslint-parser@10.1.3(eslint@9.24.0(jiti@2.4.2))):
|
||||
dependencies:
|
||||
|
|
|
@ -1,75 +1,58 @@
|
|||
<script>
|
||||
import PhotoSwipeLightbox from 'photoswipe/lightbox'
|
||||
import 'photoswipe/style.css'
|
||||
import PhotoSwipeLightbox from 'photoswipe/lightbox'
|
||||
import 'photoswipe/style.css'
|
||||
|
||||
let lightbox: PhotoSwipeLightbox | null = null
|
||||
const pswp = import('photoswipe')
|
||||
|
||||
function cleanup() {
|
||||
if (lightbox) {
|
||||
lightbox.destroy()
|
||||
lightbox = null
|
||||
}
|
||||
document.removeEventListener('astro:page-load', createPhotoSwipe)
|
||||
document.removeEventListener('astro:before-swap', cleanup)
|
||||
}
|
||||
|
||||
function createPhotoSwipe() {
|
||||
// Clean up existing instance if any
|
||||
cleanup()
|
||||
let lightbox: PhotoSwipeLightbox
|
||||
const pswp = import('photoswipe')
|
||||
|
||||
function setupPhotoSwipe() {
|
||||
const bodyElement = document.body
|
||||
if (!bodyElement.hasAttribute('data-photoswipe-initialized')) {
|
||||
lightbox = new PhotoSwipeLightbox({
|
||||
gallery: 'article img',
|
||||
gallery: 'article.heti img',
|
||||
pswpModule: () => pswp,
|
||||
closeSVG: '<svg xmlns="http://www.w3.org/2000/svg" height="2.4rem" viewBox="0 -960 960 960" width="3.8rem" fill="#A0A09F"><path d="M480-424 284-228q-11 11-28 11t-28-11q-11-11-11-28t11-28l196-196-196-196q-11-11-11-28t11-28q11-11 28-11t28 11l196 196 196-196q11-11 28-11t28 11q11 11 11 28t-11 28L536-480l196 196q11 11 11 28t-11 28q-11 11-28 11t-28-11L480-424Z"/></svg>',
|
||||
zoomSVG: '<svg xmlns="http://www.w3.org/2000/svg" height="2.4rem" viewBox="0 -960 960 960" width="3.8rem" fill="#A0A09F"><path d="M340-540h-40q-17 0-28.5-11.5T260-580q0-17 11.5-28.5T300-620h40v-40q0-17 11.5-28.5T380-700q17 0 28.5 11.5T420-660v40h40q17 0 28.5 11.5T500-580q0 17-11.5 28.5T460-540h-40v40q0 17-11.5 28.5T380-460q-17 0-28.5-11.5T340-500v-40Zm40 220q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l224 224q11 11 11 28t-11 28q-11 11-28 11t-28-11L532-372q-30 24-69 38t-83 14Zm0-80q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"/></svg>',
|
||||
padding: { top: window.innerHeight * 0.1, bottom: window.innerHeight * 0.1, left: window.innerWidth * 0.06, right: window.innerWidth * 0.06 },
|
||||
bgOpacity: 0.9,
|
||||
padding: {
|
||||
top: window.innerHeight * 0.1,
|
||||
bottom: window.innerHeight * 0.1,
|
||||
left: window.innerWidth * 0.073,
|
||||
right: window.innerWidth * 0.073,
|
||||
},
|
||||
zoom: false,
|
||||
close: false,
|
||||
wheelToZoom: true,
|
||||
arrowPrev: false,
|
||||
arrowNext: false,
|
||||
imageClickAction: 'close',
|
||||
tapAction: 'close',
|
||||
doubleTapAction: 'zoom',
|
||||
})
|
||||
|
||||
// Automatically add image dimensions
|
||||
lightbox.addFilter('domItemData', (itemData: any, element: Element) => {
|
||||
// Set image dimensions
|
||||
lightbox.addFilter('domItemData', (itemData, element) => {
|
||||
if (element instanceof HTMLImageElement) {
|
||||
// Set image source
|
||||
itemData.src = element.src
|
||||
|
||||
// Set dimensions with fallback to window size
|
||||
itemData.w = Number(element.naturalWidth || window.innerWidth)
|
||||
itemData.h = Number(element.naturalHeight || window.innerHeight)
|
||||
|
||||
// Set thumbnail source
|
||||
itemData.msrc = element.src
|
||||
}
|
||||
return itemData
|
||||
})
|
||||
|
||||
lightbox.init()
|
||||
}
|
||||
|
||||
document.addEventListener('astro:page-load', createPhotoSwipe)
|
||||
document.addEventListener('astro:before-swap', cleanup)
|
||||
bodyElement.setAttribute('data-photoswipe-initialized', 'true')
|
||||
}
|
||||
}
|
||||
|
||||
setupPhotoSwipe()
|
||||
document.addEventListener('astro:page-load', setupPhotoSwipe)
|
||||
</script>
|
||||
|
||||
<style is:global>
|
||||
.pswp__button {
|
||||
--at-apply: 'flex items-center justify-center transition';
|
||||
}
|
||||
|
||||
.pswp__button--zoom,
|
||||
.pswp__button--close {
|
||||
--at-apply: 'mt-2 lg:mt-4 active:scale-90';
|
||||
}
|
||||
|
||||
.pswp__button--zoom svg:hover,
|
||||
.pswp__button--close svg:hover {
|
||||
fill: #BEBEBE;
|
||||
}
|
||||
|
||||
.pswp__button--close {
|
||||
--at-apply: 'mr-4 lg:mr-8';
|
||||
}
|
||||
|
||||
.pswp__button--zoom {
|
||||
--at-apply: 'mr--6 lg:mr-0';
|
||||
}
|
||||
.pswp .pswp__bg {
|
||||
--at-apply: 'bg-background!'
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -3,6 +3,7 @@ import Button from '@/components/Button.astro'
|
|||
import Footer from '@/components/Footer.astro'
|
||||
import Header from '@/components/Header.astro'
|
||||
import Navbar from '@/components/Navbar.astro'
|
||||
import PhotoSwipe from '@/components/Widgets/PhotoSwipe.astro'
|
||||
import Scrollbar from '@/components/Widgets/Scrollbar.astro'
|
||||
import themeConfig from '@/config'
|
||||
import Head from '@/layouts/Head.astro'
|
||||
|
@ -48,5 +49,6 @@ const MarginBottom = isPost && themeConfig.comment?.enabled
|
|||
</div>
|
||||
<Scrollbar />
|
||||
<Button supportedLangs={supportedLangs} />
|
||||
<PhotoSwipe />
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -12,9 +12,9 @@ body {
|
|||
--at-apply: 'ios-flash-fix';
|
||||
}
|
||||
|
||||
/* article img {
|
||||
article.heti img {
|
||||
--at-apply: 'cursor-zoom-in force-gpu';
|
||||
} */
|
||||
}
|
||||
|
||||
/* View Transition with Theme Toggle >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> */
|
||||
::view-transition-new(theme-transition) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue