Files
ptp/layouts/partials/preload-images.html
T
Kirik 6269d3323c Implement adaptive background images for mobile and desktop
- Add desktop.webp (2732x1535) for desktop devices and mobile.webp (556x1535) for mobile
- Create adaptive-background.css with media queries (max-width: 736px for mobile)
- Update config.toml to use desktop.webp as default background
- Modify htmlhead.html to include adaptive-background.css
- Update preload-images.html for responsive image preloading
- Optimize background loading based on device screen width

Both images include overlay.png and gradient overlay for consistent design.
Mobile version (124 KB) is 5.8x lighter than desktop version (716 KB).
2025-11-12 19:53:54 +01:00

13 lines
496 B
HTML

<!-- Preload critical images for better performance -->
{{- with .Params.image }}
<link rel="preload" as="image" href="{{ . }}">
{{- end }}
{{- if .IsHome }}
<!-- Preload background images for adaptive loading -->
<link rel="preload" as="image" href="images/desktop.webp" media="(min-width: 737px)">
<link rel="preload" as="image" href="images/mobile.webp" media="(max-width: 736px)">
<!-- Fallback preload -->
<link rel="preload" as="image" href="{{ .Site.Params.backgroundPath }}">
{{- end }}