-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
208 lines (185 loc) · 4.52 KB
/
Copy pathtypes.ts
File metadata and controls
208 lines (185 loc) · 4.52 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
export enum DeviceType {
// Apple - Modern
IPHONE_17_PRO = 'iPhone 17 Pro',
IPHONE_17_PRO_MAX = 'iPhone 17 Pro Max',
IPHONE_16_PRO = 'iPhone 16 Pro',
IPHONE_16_PRO_MAX = 'iPhone 16 Pro Max',
IPHONE_15_PRO = 'iPhone 15 Pro',
IPHONE_15_PRO_MAX = 'iPhone 15 Pro Max',
IPHONE_14_PRO = 'iPhone 14 Pro',
IPHONE_SE = 'iPhone SE',
IPAD_PRO_13 = 'iPad Pro 13"',
IPAD_PRO_11 = 'iPad Pro 11"',
// Samsung - Flagship
SAMSUNG_S24_ULTRA = 'Samsung S24 Ultra',
SAMSUNG_S24 = 'Samsung S24',
SAMSUNG_FOLD = 'Galaxy Z Fold',
// Google Pixel
PIXEL_9_PRO = 'Pixel 9 Pro',
PIXEL_9 = 'Pixel 9',
PIXEL_8_PRO = 'Pixel 8 Pro',
// Legacy (for backwards compatibility)
IPHONE_14_PLUS = 'iPhone 14 Plus',
SAMSUNG_S23 = 'Samsung S23',
ANDROID_PIXEL = 'Pixel 8 Pro',
PIXEL_7 = 'Pixel 7',
TABLET = 'iPad Pro',
}
export interface TextConfig {
title: string;
subtitle: string;
titleColor: string;
subtitleColor: string;
fontFamily: string;
alignment: 'left' | 'center' | 'right';
position: 'top' | 'bottom';
// Advanced text settings
titleSize: number; // 48-120px
subtitleSize: number; // 24-72px
titleWeight: number; // 400-800
subtitleWeight: number; // 400-700
letterSpacing: number; // -2 to 8
lineHeight: number; // 1.0 to 2.0
textShadow: boolean;
textShadowBlur: number;
textShadowColor: string;
maxWidth: number; // 50-100 (percentage)
}
// Background Types
export type BackgroundType = 'solid' | 'gradient' | 'mesh' | 'pattern' | 'image';
export type PatternType = 'dots' | 'grid' | 'lines' | 'diagonal' | 'waves';
export interface MeshPoint {
id: string;
x: number; // 0-100 percentage
y: number; // 0-100 percentage
color: string;
}
export interface MeshGradientConfig {
points: MeshPoint[];
blur: number; // 30-80
}
export interface PatternConfig {
type: PatternType;
color: string;
backgroundColor: string;
size: number; // 10-50
spacing: number; // 10-100
opacity: number; // 0-1
}
export interface BackgroundImageConfig {
src: string | null;
blur: number; // 0-20
overlayColor: string;
overlayOpacity: number; // 0-1
fit: 'cover' | 'contain' | 'fill';
}
export interface BackgroundConfig {
type: BackgroundType;
// Solid/Gradient
color1: string;
color2: string;
direction: string;
// Mesh Gradient
mesh?: MeshGradientConfig;
// Pattern
pattern?: PatternConfig;
// Image
image?: BackgroundImageConfig;
}
export interface ShadowConfig {
enabled: boolean;
color: string;
blur: number;
opacity: number;
offsetY: number;
}
export interface DeviceConfig {
id: string;
type: DeviceType;
image: string | null;
x: number;
y: number;
rotation: number;
rotateX: number;
rotateY: number;
scale: number;
shadow: ShadowConfig;
zIndex: number;
}
export interface ScreenConfig {
id: string;
devices: DeviceConfig[];
text: TextConfig;
background: BackgroundConfig;
}
export interface Template {
name: string;
description: string;
config: Partial<ScreenConfig>; // Configuration to merge
}
// Export Types
export interface ExportSize {
id: string;
name: string;
platform: 'ios' | 'android';
width: number;
height: number;
suffix: string;
}
export interface ExportConfig {
selectedSizes: string[]; // IDs of ExportSize
format: 'png' | 'jpg';
quality: number; // 0.8-1.0 for JPG
}
// Animation Types
export interface AnimationKeyframe {
time: number; // 0-1 (percentage of duration)
properties: {
x?: number;
y?: number;
rotation?: number;
rotateX?: number;
rotateY?: number;
scale?: number;
opacity?: number;
};
}
export interface AnimationPreset {
id: string;
name: string;
description: string;
duration: number; // ms
keyframes: AnimationKeyframe[];
}
export interface AnimationConfig {
enabled: boolean;
presetId: string | null;
duration: number; // ms
loop: boolean;
playbackState: 'stopped' | 'playing' | 'paused';
currentTime: number; // 0-1
}
export interface GifExportConfig {
fps: number; // 10, 15, 20, 30
quality: number; // 1-10
width: number;
height: number;
}
// Project and Screen Types (Multi-screen support)
export interface Screen {
id: string;
name: string;
order: number;
config: ScreenConfig;
thumbnail?: string; // Base64 mini preview
createdAt: number;
updatedAt: number;
}
export interface Project {
id: string;
name: string;
screens: Screen[];
activeScreenId: string;
createdAt: number;
updatedAt: number;
}