forked from rajun/ar-test
feat: add project constants for brand colours, button sizes and AR page defaults
This commit is contained in:
parent
023d29517c
commit
d8d472bc60
91
app/data/projects/constants.ts
Normal file
91
app/data/projects/constants.ts
Normal file
@ -0,0 +1,91 @@
|
||||
import type { SegmentedOption } from '~/components/ui/segmented-control';
|
||||
import type { ArPageLayout, ArPageSettings, ButtonCustomSize, ButtonSize, ColorPreset, LogoBackground, ProjectStatus } from '~/types/project';
|
||||
|
||||
export const PROJECTS_COLLECTION = 'projects';
|
||||
export const PROJECT_COUNTS_COLLECTION = 'project_asset_counts';
|
||||
|
||||
export const PROJECT_INTENT = {
|
||||
create: 'create',
|
||||
update: 'update',
|
||||
} as const;
|
||||
|
||||
export type ProjectIntent = (typeof PROJECT_INTENT)[keyof typeof PROJECT_INTENT];
|
||||
|
||||
export const PROJECT_STATUS_OPTIONS: SegmentedOption<ProjectStatus>[] = [
|
||||
{ value: 'active', label: 'Active' },
|
||||
{ value: 'archived', label: 'Archived' },
|
||||
];
|
||||
|
||||
// Client brand choices are data (stored per project), not theme colours
|
||||
export const DEFAULT_BRAND_COLOR = '#f97316';
|
||||
export const BRAND_COLORS: ColorPreset[] = [
|
||||
{ value: DEFAULT_BRAND_COLOR, label: 'thob orange' },
|
||||
{ value: '#3d6b4f', label: 'Forest' },
|
||||
{ value: '#2b4a6f', label: 'Navy' },
|
||||
{ value: '#c2410c', label: 'Rust' },
|
||||
{ value: '#7c3aed', label: 'Violet' },
|
||||
{ value: '#141414', label: 'Black' },
|
||||
];
|
||||
|
||||
export const DEFAULT_BUTTON_TEXT_COLOR = '#ffffff';
|
||||
export const BUTTON_TEXT_COLORS: ColorPreset[] = [
|
||||
{ value: DEFAULT_BUTTON_TEXT_COLOR, label: 'White' },
|
||||
{ value: '#141414', label: 'Ink' },
|
||||
];
|
||||
|
||||
export const BUTTON_LABEL_MAX = 32;
|
||||
|
||||
export const BUTTON_SIZE_OPTIONS: SegmentedOption<ButtonSize>[] = [
|
||||
{ value: 'sm', label: 'Small' },
|
||||
{ value: 'md', label: 'Medium' },
|
||||
{ value: 'lg', label: 'Large' },
|
||||
{ value: 'full', label: 'Full width' },
|
||||
{ value: 'custom', label: 'Custom' },
|
||||
];
|
||||
|
||||
// Preset button sizes (px); the presets are pill shaped, and "full" uses the medium height
|
||||
export const BUTTON_SIZES: Record<'sm' | 'md' | 'lg', { height: number; paddingX: number }> = {
|
||||
sm: { height: 40, paddingX: 20 },
|
||||
md: { height: 46, paddingX: 24 },
|
||||
lg: { height: 54, paddingX: 32 },
|
||||
};
|
||||
|
||||
// Allowed range for each custom measurement (px)
|
||||
export const BUTTON_CUSTOM_LIMITS = {
|
||||
height: { label: 'Height', min: 32, max: 80 },
|
||||
width: { label: 'Width', min: 80, max: 360 },
|
||||
paddingX: { label: 'Side padding', min: 0, max: 48 },
|
||||
radius: { label: 'Corner radius', min: 0, max: 40 },
|
||||
borderWidth: { label: 'Border', min: 0, max: 8 },
|
||||
} as const satisfies Record<keyof Omit<ButtonCustomSize, 'borderColor'>, { label: string; min: number; max: number }>;
|
||||
|
||||
export const BUTTON_CUSTOM_DEFAULT: ButtonCustomSize = { height: 46, width: null, paddingX: 24, radius: 23, borderWidth: 0, borderColor: '#ffffff' };
|
||||
|
||||
// The AR page as it looks today; projects that never set an option get these
|
||||
export const AR_PAGE_DEFAULTS: ArPageSettings = {
|
||||
bars: true,
|
||||
modelName: true,
|
||||
logoBacking: true,
|
||||
thobLogo: true,
|
||||
buttonSize: 'md',
|
||||
buttonCustom: BUTTON_CUSTOM_DEFAULT,
|
||||
};
|
||||
|
||||
export const AR_PAGE_TOGGLES: { key: keyof ArPageLayout; label: string; hint: string }[] = [
|
||||
{ key: 'bars', label: 'Top and bottom bars', hint: 'Off lets the model fill the whole screen.' },
|
||||
{ key: 'modelName', label: 'Model name', hint: 'Shown under the logo.' },
|
||||
{ key: 'logoBacking', label: 'Logo backing', hint: 'The rounded background behind the logo. Off shows the logo on its own.' },
|
||||
{ key: 'thobLogo', label: 'thob logo', hint: 'The “t.” mark at the top right.' },
|
||||
];
|
||||
|
||||
// Logo backing presets; the values match the light/dark logo chip theme colours
|
||||
export const LOGO_BACKGROUND_PRESETS: Record<LogoBackground, ColorPreset> = {
|
||||
light: { value: '#ffffff', label: 'Light' },
|
||||
dark: { value: '#151517', label: 'Dark' },
|
||||
};
|
||||
|
||||
export const LOGO_MAX_BYTES = 2 * 1024 * 1024;
|
||||
export const LOGO_RASTER_MAX_SIZE = 1024;
|
||||
export const LOGO_TYPES = { png: 'image/png', webp: 'image/webp', svg: 'image/svg+xml' } as const;
|
||||
|
||||
export const SAMPLE_MODEL_NAME = 'Sample model';
|
||||
Loading…
x
Reference in New Issue
Block a user