mirror of
https://github.com/imfing/hextra.git
synced 2025-09-16 00:26:40 -04:00
feat(image-zoom): add minimal image zoom functionality
- Introduced CSS for image zoom overlay and image styling. - Implemented JavaScript for handling image zoom interactions, including overlay creation and close functionality. - Updated configuration to enable image zoom feature in site parameters. - Added partial for including image zoom assets in the layout.
This commit is contained in:
@@ -13,3 +13,10 @@
|
||||
{{- if (.Store.Get "hasAsciinema") -}}
|
||||
{{- partial "scripts/asciinema.html" . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Image zoom */}}
|
||||
{{- with site.Params.imageZoom }}
|
||||
{{- if .enable }}
|
||||
{{- partial "scripts/image-zoom.html" $ -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
13
layouts/_partials/scripts/image-zoom.html
Normal file
13
layouts/_partials/scripts/image-zoom.html
Normal file
@@ -0,0 +1,13 @@
|
||||
{{/* Optional minimal image zoom assets */}}
|
||||
{{- $js := resources.Get "js/image-zoom.js" -}}
|
||||
{{- $css := resources.Get "css/components/image-zoom.css" -}}
|
||||
|
||||
{{- if hugo.IsProduction -}}
|
||||
{{- $js = $js | minify | fingerprint -}}
|
||||
{{- $css = $css | minify | fingerprint -}}
|
||||
{{- end -}}
|
||||
|
||||
|
||||
<link rel="preload" href="{{ $css.RelPermalink }}" as="style" integrity="{{ $css.Data.Integrity }}" />
|
||||
<link href="{{ $css.RelPermalink }}" rel="stylesheet" integrity="{{ $css.Data.Integrity }}" />
|
||||
<script defer src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}"></script>
|
Reference in New Issue
Block a user