Fix image PWA rounding and zoom
Browse files
web/src/app/globals.css
CHANGED
|
@@ -118,11 +118,12 @@
|
|
| 118 |
}
|
| 119 |
html,
|
| 120 |
body {
|
|
|
|
| 121 |
overscroll-behavior: none;
|
| 122 |
}
|
| 123 |
|
| 124 |
body {
|
| 125 |
-
@apply
|
| 126 |
}
|
| 127 |
}
|
| 128 |
|
|
|
|
| 118 |
}
|
| 119 |
html,
|
| 120 |
body {
|
| 121 |
+
background: #f0ebe3;
|
| 122 |
overscroll-behavior: none;
|
| 123 |
}
|
| 124 |
|
| 125 |
body {
|
| 126 |
+
@apply text-foreground;
|
| 127 |
}
|
| 128 |
}
|
| 129 |
|
web/src/app/image/components/image-results.tsx
CHANGED
|
@@ -193,12 +193,12 @@ export function ImageResults({
|
|
| 193 |
return (
|
| 194 |
<div
|
| 195 |
key={image.id}
|
| 196 |
-
className="break-inside-avoid
|
| 197 |
>
|
| 198 |
<button
|
| 199 |
type="button"
|
| 200 |
onClick={() => onOpenLightbox(successfulTurnImages, currentIndex)}
|
| 201 |
-
className="group block aspect-square w-full cursor-zoom-in overflow-hidden sm:aspect-auto"
|
| 202 |
>
|
| 203 |
<img
|
| 204 |
src={imageSrc}
|
|
|
|
| 193 |
return (
|
| 194 |
<div
|
| 195 |
key={image.id}
|
| 196 |
+
className="break-inside-avoid"
|
| 197 |
>
|
| 198 |
<button
|
| 199 |
type="button"
|
| 200 |
onClick={() => onOpenLightbox(successfulTurnImages, currentIndex)}
|
| 201 |
+
className="group block aspect-square w-full cursor-zoom-in overflow-hidden rounded-xl sm:aspect-auto"
|
| 202 |
>
|
| 203 |
<img
|
| 204 |
src={imageSrc}
|
web/src/app/layout.tsx
CHANGED
|
@@ -13,6 +13,7 @@ export const viewport: Viewport = {
|
|
| 13 |
initialScale: 1,
|
| 14 |
maximumScale: 1,
|
| 15 |
userScalable: false,
|
|
|
|
| 16 |
};
|
| 17 |
|
| 18 |
export default function RootLayout({
|
|
|
|
| 13 |
initialScale: 1,
|
| 14 |
maximumScale: 1,
|
| 15 |
userScalable: false,
|
| 16 |
+
themeColor: "#f0ebe3",
|
| 17 |
};
|
| 18 |
|
| 19 |
export default function RootLayout({
|
web/src/components/image-lightbox.tsx
CHANGED
|
@@ -58,6 +58,20 @@ export function ImageLightbox({
|
|
| 58 |
return () => window.removeEventListener("keydown", handleKeyDown);
|
| 59 |
}, [open, goPrev, goNext]);
|
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
const handleDownload = useCallback(() => {
|
| 62 |
if (!current) return;
|
| 63 |
const link = document.createElement("a");
|
|
|
|
| 58 |
return () => window.removeEventListener("keydown", handleKeyDown);
|
| 59 |
}, [open, goPrev, goNext]);
|
| 60 |
|
| 61 |
+
useEffect(() => {
|
| 62 |
+
if (!open) return;
|
| 63 |
+
|
| 64 |
+
const viewport = document.querySelector<HTMLMetaElement>('meta[name="viewport"]');
|
| 65 |
+
const previousViewport = viewport?.content;
|
| 66 |
+
viewport?.setAttribute("content", "width=device-width, initial-scale=1, maximum-scale=5, user-scalable=yes");
|
| 67 |
+
|
| 68 |
+
return () => {
|
| 69 |
+
if (viewport && previousViewport) {
|
| 70 |
+
viewport.setAttribute("content", previousViewport);
|
| 71 |
+
}
|
| 72 |
+
};
|
| 73 |
+
}, [open]);
|
| 74 |
+
|
| 75 |
const handleDownload = useCallback(() => {
|
| 76 |
if (!current) return;
|
| 77 |
const link = document.createElement("a");
|