-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
56 lines (49 loc) · 1.23 KB
/
types.ts
File metadata and controls
56 lines (49 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
export type AspectRatio = '16:9' | '9:16' | '4:3' | '3:4' | '1:1' | 'auto';
export type FrameStyle = 'default' | 'glass' | 'stack';
export interface GradientStop {
color: string;
position: number;
}
export interface AppState {
// Image
imageSrc: string | null;
imageName: string;
// Canvas
aspectRatio: AspectRatio;
padding: number; // 0 to 100
borderRadius: number; // 0 to 100
shadow: number; // 0 to 100
frameStyle: FrameStyle;
// Background
bgType: 'solid' | 'gradient';
bgColor: string;
gradientStart: string;
gradientEnd: string;
gradientAngle: number;
noiseOpacity: number; // 0 to 1 (Intensity)
noiseRoughness: number; // 0 to 1 (Texture size/coarseness)
}
export const ASPECT_RATIOS: { [key in AspectRatio]: number } = {
'16:9': 16 / 9,
'9:16': 9 / 16,
'4:3': 4 / 3,
'3:4': 3 / 4,
'1:1': 1,
'auto': 0, // Special case
};
export const DEFAULT_STATE: AppState = {
imageSrc: null,
imageName: 'mockup',
aspectRatio: 'auto',
padding: 10,
borderRadius: 10,
shadow: 0,
frameStyle: 'default',
bgType: 'gradient',
bgColor: '#18181b',
gradientStart: '#bdc3c7', // Silver
gradientEnd: '#2c3e50', // Dark Blue
gradientAngle: 135,
noiseOpacity: 0.1,
noiseRoughness: 0.4,
};