@simple-photo-gallery/theme-modern 2.0.16 → 2.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simple-photo-gallery/theme-modern",
3
- "version": "2.0.16",
3
+ "version": "2.0.17",
4
4
  "description": "Modern theme for Simple Photo Gallery",
5
5
  "license": "MIT",
6
6
  "author": "Vladimir Haltakov, Tomasz Rusin",
@@ -14,7 +14,7 @@
14
14
  .footer {
15
15
  padding: 2rem 1.5rem 1.5rem;
16
16
  text-align: center;
17
- background-color: transparent;
17
+ background-color: var(--section-bg-color-odd, var(--section-bg-color, #ffffff));
18
18
  }
19
19
 
20
20
  .footer__text {
@@ -40,7 +40,7 @@ const validImages = section.images.filter(
40
40
  <style>
41
41
  .gallery-section {
42
42
  padding: 1rem 1rem;
43
- background-color: var(--section-bg-color-odd, var(--section-bg-color, transparent));
43
+ background-color: var(--section-bg-color-odd, var(--section-bg-color, #ffffff));
44
44
  }
45
45
 
46
46
  .gallery-section:nth-child(even) {
@@ -145,13 +145,13 @@ const headerPhotoPath = getPhotoPath(headerImage || '', mediaBaseUrl);
145
145
  () => {
146
146
  // Final fallback failed, blurhash stays visible
147
147
  },
148
- { once: true }
148
+ { once: true },
149
149
  );
150
150
 
151
151
  // If fallback succeeds, hide blurhash
152
152
  img.addEventListener('load', hideBlurhash, { once: true });
153
153
  },
154
- { once: true }
154
+ { once: true },
155
155
  );
156
156
  })();
157
157
  </script>
@@ -168,7 +168,7 @@ const headerPhotoPath = getPhotoPath(headerImage || '', mediaBaseUrl);
168
168
  .hero {
169
169
  position: relative;
170
170
  min-height: 450px;
171
- height: 100vh;
171
+ height: var(--hero-height, 100vh);
172
172
  display: flex;
173
173
  align-items: center;
174
174
  justify-content: center;
@@ -134,6 +134,16 @@ const applySectionBackgroundColors = (params: URLSearchParams): void => {
134
134
  setCSSVar(root, '--section-bg-color-odd', parseColor(params.get('sectionBgColorOdd')));
135
135
  };
136
136
 
137
+ /**
138
+ * Applies hero height from the 'heroHeight' query parameter.
139
+ * Accepts a number (e.g., '100' for 100vh, '50' for 50vh).
140
+ */
141
+ const applyHeroHeight = (params: URLSearchParams): void => {
142
+ const value = params.get('heroHeight')?.trim();
143
+ const height = value && /^\d+(\.\d+)?$/.test(value) ? `${value}vh` : null;
144
+ setCSSVar(document.documentElement, '--hero-height', height);
145
+ };
146
+
137
147
  /**
138
148
  * Main function that applies all query parameter configurations to the page.
139
149
  * Reads URL search params and applies header visibility, background, typography, and section colors.
@@ -145,4 +155,5 @@ export const applyQueryParams = (): void => {
145
155
  applyTransparentBackground(params);
146
156
  applyTypographyColors(params);
147
157
  applySectionBackgroundColors(params);
158
+ applyHeroHeight(params);
148
159
  };