Rename zoom controls configuration

This commit is contained in:
Sam Becker 2025-01-25 20:37:15 -06:00
parent 69b256c35c
commit d8f6fbaafb
4 changed files with 16 additions and 16 deletions

View File

@ -119,6 +119,7 @@ Application behavior can be changed by configuring the following environment var
#### Settings #### Settings
- `NEXT_PUBLIC_GRID_HOMEPAGE = 1` shows grid layout on homepage - `NEXT_PUBLIC_GRID_HOMEPAGE = 1` shows grid layout on homepage
- `NEXT_PUBLIC_DEFAULT_THEME = light | dark` sets preferred initial theme (defaults to `system` when not configured) - `NEXT_PUBLIC_DEFAULT_THEME = light | dark` sets preferred initial theme (defaults to `system` when not configured)
- `NEXT_PUBLIC_ZOOM_CONTROLS = 1` enables fullscreen photo zoom controls
- `NEXT_PUBLIC_MATTE_PHOTOS = 1` constrains the size of each photo, and enables a surrounding border (potentially useful for photos with tall aspect ratios) - `NEXT_PUBLIC_MATTE_PHOTOS = 1` constrains the size of each photo, and enables a surrounding border (potentially useful for photos with tall aspect ratios)
- `NEXT_PUBLIC_GEO_PRIVACY = 1` disables collection/display of location-based data (⚠️ re-compresses uploaded images in order to remove GPS information) - `NEXT_PUBLIC_GEO_PRIVACY = 1` disables collection/display of location-based data (⚠️ re-compresses uploaded images in order to remove GPS information)
- `NEXT_PUBLIC_ALLOW_PUBLIC_DOWNLOADS = 1` enables public photo downloads for all visitors (⚠️ may result in increased bandwidth usage) - `NEXT_PUBLIC_ALLOW_PUBLIC_DOWNLOADS = 1` enables public photo downloads for all visitors (⚠️ may result in increased bandwidth usage)
@ -127,7 +128,6 @@ Application behavior can be changed by configuring the following environment var
- `NEXT_PUBLIC_GRID_ASPECT_RATIO = 1.5` sets aspect ratio for grid tiles (defaults to `1`—setting to `0` removes the constraint) - `NEXT_PUBLIC_GRID_ASPECT_RATIO = 1.5` sets aspect ratio for grid tiles (defaults to `1`—setting to `0` removes the constraint)
- `NEXT_PUBLIC_SHOW_LARGE_THUMBNAILS = 1` ensures large thumbnails on photo grid views - `NEXT_PUBLIC_SHOW_LARGE_THUMBNAILS = 1` ensures large thumbnails on photo grid views
- `NEXT_PUBLIC_OG_TEXT_ALIGNMENT = BOTTOM` keeps OG image text bottom aligned (default is top) - `NEXT_PUBLIC_OG_TEXT_ALIGNMENT = BOTTOM` keeps OG image text bottom aligned (default is top)
- `NEXT_PUBLIC_IMAGE_ACTIONS = 1` enables fullscreen and zoom actions when clicking on an image
## Alternate storage providers ## Alternate storage providers

View File

@ -11,7 +11,7 @@ import HiddenHeader from '@/tag/HiddenHeader';
import FocalLengthHeader from '@/focal/FocalLengthHeader'; import FocalLengthHeader from '@/focal/FocalLengthHeader';
import PhotoHeader from './PhotoHeader'; import PhotoHeader from './PhotoHeader';
import { JSX } from 'react'; import { JSX } from 'react';
import { IMAGE_ACTIONS_ENABLED } from '@/site/config'; import { ZOOM_CONTROLS_ENABLED } from '@/site/config';
export default function PhotoDetailPage({ export default function PhotoDetailPage({
photo, photo,
@ -113,7 +113,7 @@ export default function PhotoDetailPage({
shouldShareSimulation={simulation !== undefined} shouldShareSimulation={simulation !== undefined}
shouldScrollOnShare={false} shouldScrollOnShare={false}
includeFavoriteInAdminMenu={includeFavoriteInAdminMenu} includeFavoriteInAdminMenu={includeFavoriteInAdminMenu}
enableImageActions={IMAGE_ACTIONS_ENABLED} enableImageActions={ZOOM_CONTROLS_ENABLED}
/>, />,
]} ]}
/> />

View File

@ -68,6 +68,7 @@ export default function SiteChecklistClient({
isGridHomepageEnabled, isGridHomepageEnabled,
hasDefaultTheme, hasDefaultTheme,
defaultTheme, defaultTheme,
areZoomControlsEnabled,
arePhotosMatted, arePhotosMatted,
isGeoPrivacyEnabled, isGeoPrivacyEnabled,
gridAspectRatio, gridAspectRatio,
@ -78,7 +79,6 @@ export default function SiteChecklistClient({
isPublicApiEnabled, isPublicApiEnabled,
isPriorityOrderEnabled, isPriorityOrderEnabled,
isOgTextBottomAligned, isOgTextBottomAligned,
isImageActionsEnabled,
// Misc // Misc
baseUrl, baseUrl,
commitSha, commitSha,
@ -538,6 +538,15 @@ export default function SiteChecklistClient({
(defaults to {'\'system\''}): (defaults to {'\'system\''}):
{renderEnvVars(['NEXT_PUBLIC_DEFAULT_THEME'])} {renderEnvVars(['NEXT_PUBLIC_DEFAULT_THEME'])}
</ChecklistRow> </ChecklistRow>
<ChecklistRow
title="Zoom controls"
status={areZoomControlsEnabled}
optional
>
Set environment variable to {'"1"'} to enable
fullscreen photo zoom controls:
{renderEnvVars(['NEXT_PUBLIC_ZOOM_CONTROLS'])}
</ChecklistRow>
<ChecklistRow <ChecklistRow
title="Photo matting" title="Photo matting"
status={arePhotosMatted} status={arePhotosMatted}
@ -613,15 +622,6 @@ export default function SiteChecklistClient({
keep OG image text bottom aligned (default is {'"top"'}): keep OG image text bottom aligned (default is {'"top"'}):
{renderEnvVars(['NEXT_PUBLIC_OG_TEXT_ALIGNMENT'])} {renderEnvVars(['NEXT_PUBLIC_OG_TEXT_ALIGNMENT'])}
</ChecklistRow> </ChecklistRow>
<ChecklistRow
title="Enable image actions"
status={isImageActionsEnabled}
optional
>
Set environment variable to {'"1"'} to enable fullscreen and zoom
actions when clicking on an image:
{renderEnvVars(['NEXT_PUBLIC_IMAGE_ACTIONS'])}
</ChecklistRow>
</Checklist> </Checklist>
</>} </>}
</div> </div>

View File

@ -184,6 +184,8 @@ export const DEFAULT_THEME =
: process.env.NEXT_PUBLIC_DEFAULT_THEME === 'light' : process.env.NEXT_PUBLIC_DEFAULT_THEME === 'light'
? 'light' ? 'light'
: 'system'; : 'system';
export const ZOOM_CONTROLS_ENABLED =
process.env.NEXT_PUBLIC_ZOOM_CONTROLS === '1';
export const MATTE_PHOTOS = export const MATTE_PHOTOS =
process.env.NEXT_PUBLIC_MATTE_PHOTOS === '1'; process.env.NEXT_PUBLIC_MATTE_PHOTOS === '1';
export const GEO_PRIVACY_ENABLED = export const GEO_PRIVACY_ENABLED =
@ -205,8 +207,6 @@ export const PRIORITY_ORDER_ENABLED =
process.env.NEXT_PUBLIC_IGNORE_PRIORITY_ORDER !== '1'; process.env.NEXT_PUBLIC_IGNORE_PRIORITY_ORDER !== '1';
export const OG_TEXT_BOTTOM_ALIGNMENT = export const OG_TEXT_BOTTOM_ALIGNMENT =
(process.env.NEXT_PUBLIC_OG_TEXT_ALIGNMENT ?? '').toUpperCase() === 'BOTTOM'; (process.env.NEXT_PUBLIC_OG_TEXT_ALIGNMENT ?? '').toUpperCase() === 'BOTTOM';
export const IMAGE_ACTIONS_ENABLED =
process.env.NEXT_PUBLIC_IMAGE_ACTIONS === '1';
// INTERNAL // INTERNAL
@ -272,6 +272,7 @@ export const CONFIG_CHECKLIST_STATUS = {
isGridHomepageEnabled: GRID_HOMEPAGE_ENABLED, isGridHomepageEnabled: GRID_HOMEPAGE_ENABLED,
hasDefaultTheme: Boolean(process.env.NEXT_PUBLIC_DEFAULT_THEME), hasDefaultTheme: Boolean(process.env.NEXT_PUBLIC_DEFAULT_THEME),
defaultTheme: DEFAULT_THEME, defaultTheme: DEFAULT_THEME,
areZoomControlsEnabled: ZOOM_CONTROLS_ENABLED,
arePhotosMatted: MATTE_PHOTOS, arePhotosMatted: MATTE_PHOTOS,
isGeoPrivacyEnabled: GEO_PRIVACY_ENABLED, isGeoPrivacyEnabled: GEO_PRIVACY_ENABLED,
gridAspectRatio: GRID_ASPECT_RATIO, gridAspectRatio: GRID_ASPECT_RATIO,
@ -283,7 +284,6 @@ export const CONFIG_CHECKLIST_STATUS = {
isPublicApiEnabled: PUBLIC_API_ENABLED, isPublicApiEnabled: PUBLIC_API_ENABLED,
isPriorityOrderEnabled: PRIORITY_ORDER_ENABLED, isPriorityOrderEnabled: PRIORITY_ORDER_ENABLED,
isOgTextBottomAligned: OG_TEXT_BOTTOM_ALIGNMENT, isOgTextBottomAligned: OG_TEXT_BOTTOM_ALIGNMENT,
isImageActionsEnabled: IMAGE_ACTIONS_ENABLED,
// MISC // MISC
baseUrl: BASE_URL, baseUrl: BASE_URL,
commitSha: VERCEL_GIT_COMMIT_SHA_SHORT, commitSha: VERCEL_GIT_COMMIT_SHA_SHORT,