Skip to content

Commit 02f6cce

Browse files
author
jacoknapp
committed
Merge pull request 'Adding some ios safari optimizations' (#9) from dev into main
Reviewed-on: https://gitea.knapp/jacoknapp/EternalVows/pulls/9
2 parents 41c6ff6 + a67127c commit 02f6cce

File tree

4 files changed

+101
-23
lines changed

4 files changed

+101
-23
lines changed

.github/workflows/docker.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,47 @@ on:
33
push:
44
branches: ["**"]
55
tags: ["v*"]
6+
schedule:
7+
- cron: '0 0 * * 3'
68
permissions:
79
contents: read
810
packages: write
911
env:
1012
IMAGE_NAME: ${{ github.repository }}
1113
REGISTRY_GHCR: ghcr.io
1214
REGISTRY_DOCKER: docker.io
15+
# Branches to run when triggered by schedule (JSON array string). Update as needed.
16+
SCHEDULE_BRANCHES: '["main","dev"]'
1317
jobs:
18+
# Prepare a dynamic branch matrix so schedule can target multiple branches without duplicating workflows
19+
prepare-matrix:
20+
runs-on: ubuntu-latest
21+
outputs:
22+
branches: ${{ steps.set.outputs.branches }}
23+
steps:
24+
- name: Compute branch matrix
25+
id: set
26+
shell: bash
27+
run: |
28+
set -euo pipefail
29+
if [ "${{ github.event_name }}" = "schedule" ]; then
30+
echo "branches=${{ env.SCHEDULE_BRANCHES }}" >> "$GITHUB_OUTPUT"
31+
else
32+
echo "branches=[\"${{ github.ref_name }}\"]" >> "$GITHUB_OUTPUT"
33+
fi
34+
1435
build-and-push:
1536
runs-on: ubuntu-latest
37+
needs: prepare-matrix
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
branch: ${{ fromJSON(needs.prepare-matrix.outputs.branches) }}
1642
steps:
1743
- name: Checkout
1844
uses: actions/checkout@v4
45+
with:
46+
ref: ${{ matrix.branch }}
1947

2048
- name: Set up Node.js
2149
uses: actions/setup-node@v4
@@ -91,6 +119,8 @@ jobs:
91119
type=sha,prefix=sha-,format=short
92120
type=ref,event=tag
93121
type=ref,event=branch
122+
# On scheduled runs, also tag with the matrix branch name
123+
type=raw,value=${{ matrix.branch }},enable=${{ github.event_name == 'schedule' }}
94124
type=raw,value=latest,enable={{is_default_branch}}
95125
96126
- name: Login to external GHCR

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ Edit `config/config.json`. All fields are optional; unset sections/buttons are h
6767
- Optional color palette: `ui.colors` or top-level `colors`.
6868
- Supported keys: `accent1`, `accent2`, `accent3`, `text`, `ink`, `bgOverlay`, `border`, `card`, `maxw`, `blur`.
6969
- Values are CSS colors or raw CSS for `blur` (e.g., `saturate(140%) blur(6px)`) and unit values for `maxw` (e.g., `1024px`).
70+
- Background (fallback when photos aren’t visible): `ui.background` or top-level `background`.
71+
- Keys: `baseTop`, `baseBottom`, `radial1`, `radial2` (CSS colors).
72+
- Alternate keys also accepted in `ui.colors` for convenience: `bgBaseTop`, `bgBaseBottom`, `bgRadial1`, `bgRadial2` (or kebab-case `bg-base-top`, etc.).
73+
- Defaults to a warm golden palette if not provided.
7074

7175
Example (default with multiple venues):
7276

@@ -106,6 +110,12 @@ Example (default with multiple venues):
106110
"card": "rgba(255,255,255,0.08)",
107111
"maxw": "1024px",
108112
"blur": "saturate(140%) blur(6px)"
113+
},
114+
"background": {
115+
"baseTop": "#2d2616",
116+
"baseBottom": "#1f1a10",
117+
"radial1": "rgba(234, 200, 94, 0.45)",
118+
"radial2": "rgba(255, 239, 189, 0.38)"
109119
}
110120
}
111121
}

config/config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@
9191
"card": "rgba(255,255,255,0.08)",
9292
"maxw": "1024px",
9393
"blur": "saturate(140%) blur(6px)"
94+
},
95+
"background": {
96+
"baseTop": "#2d2616",
97+
"baseBottom": "#1f1a10",
98+
"radial1": "rgba(234, 200, 94, 0.45)",
99+
"radial2": "rgba(255, 239, 189, 0.38)"
94100
}
95101
}
96102
}

index.html

Lines changed: 55 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
6+
<meta name="theme-color" content="#131a25" />
7+
<meta name="theme-color" content="#131a25" media="(prefers-color-scheme: dark)" />
8+
<meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)" />
69
<title>Wedding of Partner A &amp; Partner B</title>
710
<meta name="description" content="Join us for our wedding celebration!" />
811
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@@ -43,7 +46,7 @@
4346
--btn-gap: clamp(0.4rem, 0.35rem + 0.4vw, 0.8rem);
4447
}
4548
* { box-sizing: border-box }
46-
html, body { margin:0; height:100%; background:#101010; color:var(--text); line-height:1.65; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif; }
49+
html, body { margin:0; height:100%; background:#131a25; color:var(--text); line-height:1.65; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif; }
4750
html { scroll-behavior: smooth; }
4851
body::before, body::after {
4952
content:""; position: fixed; width: 260px; height: 260px; z-index: 1; pointer-events:none; opacity:.55; mix-blend-mode: screen; filter: drop-shadow(0 10px 20px rgba(0,0,0,.25));
@@ -52,11 +55,16 @@
5255
body::before { top: 0; left: 0; transform: translate(-10%,-10%) rotate(0deg); }
5356
body::after { bottom: 0; right: 0; transform: translate(10%,10%) rotate(180deg); }
5457
.bg { position: fixed; inset: 0; overflow:hidden; z-index:0;
55-
/* Lighter gradient fallback so the page isn't black before photos load */
58+
/* Configurable golden gradient fallback using CSS variables */
5659
background:
57-
radial-gradient(1200px circle at 75% 10%, rgba(163,188,214,0.40), transparent 55%),
58-
radial-gradient(900px circle at 15% 85%, rgba(247,237,220,0.35), transparent 50%),
59-
linear-gradient(180deg, #1b2230, #131a25);
60+
radial-gradient(1200px circle at 75% 10%, var(--bg-r1, rgba(234, 200, 94, 0.45)), transparent 55%),
61+
radial-gradient(900px circle at 15% 85%, var(--bg-r2, rgba(255, 239, 189, 0.38)), transparent 50%),
62+
/* Deep warm base to keep good contrast with white text */
63+
linear-gradient(180deg, var(--bg-base-top, #2d2616), var(--bg-base-bottom, #1f1a10));
64+
}
65+
/* iOS: ensure background covers when toolbar collapses */
66+
@supports (height: 100lvh) {
67+
.ios .bg { inset: 0; min-height: 100lvh; }
6068
}
6169
#content { position: relative; z-index: 2; }
6270
.bg-slide { position:absolute; inset:0; background-position:center; background-size:cover; opacity:0; transition: opacity 1.2s ease-in-out; will-change: opacity; }
@@ -68,6 +76,11 @@
6876
@supports (height: 100dvh) {
6977
header.hero { min-height: 100dvh; }
7078
}
79+
/* On iOS Safari prefer dynamic viewport height for exact fit; add 1px to avoid rounding gap */
80+
@supports (height: 100dvh) {
81+
.ios header.hero { min-height: calc(100dvh + 1px); }
82+
}
83+
/* Background already covers the safe area using 100lvh; no extra offset needed */
7184
.hero .inner {
7285
position:relative; z-index:2; width:min(92vw, 840px);
7386
background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.06));
@@ -151,8 +164,17 @@
151164
.loading { text-align:center; padding:2rem; opacity:.9; }
152165
.hide { display:none !important; }
153166
</style>
154-
</head>
155-
<body>
167+
</head>
168+
<body>
169+
<script>
170+
(function(){
171+
try {
172+
var ua = navigator.userAgent || navigator.platform || "";
173+
var isIOS = /iPad|iPhone|iPod/.test(ua) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
174+
if (isIOS) document.documentElement.classList.add('ios');
175+
} catch {}
176+
})();
177+
</script>
156178
<div class="bg" id="bg"></div>
157179
<div id="loading" class="loading">Loading details…</div>
158180

@@ -246,22 +268,32 @@ <h2>FAQ</h2>
246268

247269
// Theme colors -> CSS variables
248270
function applyThemeColors(cfg) {
249-
const colors = cfg?.ui?.colors || cfg?.colors; if (!colors) return;
250271
const root = document.documentElement;
251-
const pick = (...k) => { for (const key of k) { const v = colors[key]; if (typeof v === 'string' && v.trim()) return v.trim(); } };
252-
const map = [
253-
['--accent-1', pick('accent1','accent-1')],
254-
['--accent-2', pick('accent2','accent-2')],
255-
['--accent-3', pick('accent3','accent-3')],
256-
['--text', pick('text')],
257-
['--ink', pick('ink')],
258-
['--bg-overlay', pick('bgOverlay','bg-overlay')],
259-
['--border', pick('border')],
260-
['--card', pick('card')],
261-
];
262-
for (const [css, val] of map) if (val) root.style.setProperty(css, val);
263-
const maxw = pick('maxw','maxWidth'); if (maxw) root.style.setProperty('--maxw', typeof maxw === 'number' ? `${maxw}px` : maxw);
264-
const blur = pick('blur'); if (blur) root.style.setProperty('--blur', blur);
272+
const colors = cfg?.ui?.colors || cfg?.colors || {};
273+
const pickFrom = (obj, ...keys) => {
274+
for (const k of keys) { const v = obj?.[k]; if (typeof v === 'string' && v.trim()) return v.trim(); }
275+
};
276+
const setVar = (name, value) => { if (typeof value === 'string' && value.trim()) root.style.setProperty(name, value.trim()); };
277+
// Existing color variables
278+
setVar('--accent-1', pickFrom(colors, 'accent1','accent-1'));
279+
setVar('--accent-2', pickFrom(colors, 'accent2','accent-2'));
280+
setVar('--accent-3', pickFrom(colors, 'accent3','accent-3'));
281+
setVar('--text', pickFrom(colors, 'text'));
282+
setVar('--ink', pickFrom(colors, 'ink'));
283+
setVar('--bg-overlay',pickFrom(colors, 'bgOverlay','bg-overlay'));
284+
setVar('--border', pickFrom(colors, 'border'));
285+
setVar('--card', pickFrom(colors, 'card'));
286+
const maxw = pickFrom(colors, 'maxw','maxWidth'); if (maxw) root.style.setProperty('--maxw', typeof maxw === 'number' ? `${maxw}px` : maxw);
287+
const blur = pickFrom(colors, 'blur'); if (blur) root.style.setProperty('--blur', blur);
288+
289+
// Background customization from colors or ui.background/background
290+
// Accept both flat keys in colors and nested object with keys: baseTop, baseBottom, radial1, radial2
291+
const bgCfg = (cfg?.ui?.background || cfg?.background || {});
292+
const bgColors = { ...colors, ...bgCfg };
293+
setVar('--bg-base-top', pickFrom(bgColors, 'bgBaseTop','bg-base-top','baseTop','top'));
294+
setVar('--bg-base-bottom', pickFrom(bgColors, 'bgBaseBottom','bg-base-bottom','baseBottom','bottom'));
295+
setVar('--bg-r1', pickFrom(bgColors, 'bgRadial1','bg-r1','radial1','r1'));
296+
setVar('--bg-r2', pickFrom(bgColors, 'bgRadial2','bg-r2','radial2','r2'));
265297
}
266298

267299
// Buttons

0 commit comments

Comments
 (0)