-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
230 lines (215 loc) · 10.8 KB
/
index.html
File metadata and controls
230 lines (215 loc) · 10.8 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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Book Cover Creator</title>
<link rel="stylesheet" href="index.css">
<script type="text/javascript" src="jquery.min.js"></script>
</head>
<body>
<input type="file" id="file-template" hidden accept="image/*">
<input type="file" id="file-back" hidden accept="image/*">
<input type="file" id="file-spine" hidden accept="image/*">
<input type="file" id="file-front" hidden accept="image/*">
<input type="file" id="file-overlay-img" hidden accept="image/*">
<div class="sidebar">
<div style="display:flex; align-items:center; justify-content:space-between;">
<h2>Cover Creator</h2>
<div id="render-spinner" class="loader"></div>
</div>
<div id="panel-layout" class="sidebar-section active">
<div class="params-grid">
<div class="control-group">
<label>Width (in)</label>
<input type="number" id="finalWidth" step="0.01">
</div>
<div class="control-group">
<label>Height (in)</label>
<input type="number" id="finalHeight" step="0.01">
</div>
<div class="control-group">
<label>Spine Width (in)</label>
<input type="number" id="spineWidth" step="0.01">
</div>
<div class="control-group">
<label>DPI</label>
<input type="number" id="dpi" step="1" min="72" value="300">
</div>
<div class="control-group">
<label>Spine Shade</label>
<input type="number" id="spineAlphaMultiplier" step="0.1">
</div>
<div class="control-group">
<label>Shade Curve</label>
<input type="number" id="spineAlphaPower" step="0.1">
</div>
<div class="control-group full">
<label><span>Opacity</span><span id="opacityVal">75%</span></label>
<input type="range" id="previewAlpha" min="0" max="1" step="0.01">
</div>
</div>
<h3>Base Layers</h3>
<div class="zones-container">
<div class="drop-zone zone-medium is-template" id="dz-template" onclick="triggerFile('file-template')">
<p>Background Template</p>
<div class="info-block" id="info-template"><div class="src-info">Default Loaded</div></div>
</div>
<div class="drop-zone zone-large" id="dz-back" onclick="triggerFile('file-back')">
<p>Back Cover</p>
<div class="info-block" id="info-back"></div>
</div>
<div class="offset-control">
<div class="slider-row">
<div>
<div class="offset-label"><span>Offset</span><span id="lbl-backOffset">0%</span></div>
<input type="range" id="backOffset" min="-25" max="25" step="0.5" value="0">
</div>
<div>
<div class="offset-label"><span>Zoom</span><span id="lbl-backZoom">100%</span></div>
<input type="range" id="backZoom" min="100" max="200" step="0.5" value="100">
</div>
</div>
</div>
<div class="drop-zone zone-medium" id="dz-spine" onclick="triggerFile('file-spine')">
<p>Spine</p>
<div class="info-block" id="info-spine"></div>
</div>
<div class="drop-zone zone-large" id="dz-front" onclick="triggerFile('file-front')">
<p>Front Cover</p>
<div class="info-block" id="info-front"></div>
</div>
<div class="offset-control">
<div class="slider-row">
<div>
<div class="offset-label"><span>Offset</span><span id="lbl-frontOffset">0%</span></div>
<input type="range" id="frontOffset" min="-25" max="25" step="0.5" value="0">
</div>
<div>
<div class="offset-label"><span>Zoom</span><span id="lbl-frontZoom">100%</span></div>
<input type="range" id="frontZoom" min="100" max="200" step="0.5" value="100">
</div>
</div>
</div>
</div>
<div class="btn-group">
<div class="btn-tool" onclick="addTextOverlay()">+ Add Text</div>
<div class="btn-tool" onclick="document.getElementById('file-overlay-img').click()">+ Add Image</div>
</div>
<button class="btn-download" onclick="downloadCanvas()">Download JPG</button>
</div>
<div id="panel-overlay" class="sidebar-section">
<button class="btn-back" onclick="deselectOverlay()">← Back to Layout</button>
<h3 id="overlay-title">Text Properties</h3>
<div class="control-group" id="group-text-content">
<label>Text Content</label>
<input type="text" id="prop-text-content">
</div>
<!-- Text Stroke / Image Outline -->
<div id="group-outline">
<h3>Stroke</h3>
<div class="params-grid">
<div class="control-group">
<label>Color</label>
<input type="color" id="prop-outline-color" value="#000000">
</div>
<div class="control-group">
<label>Size</label>
<input type="number" id="prop-outline-size" step="0.5" min="0">
</div>
<div class="control-group full">
<label>Opacity</label>
<input type="range" id="prop-outline-opacity" min="0" max="1" step="0.1">
</div>
</div>
</div>
<h3>Shadow</h3>
<div class="params-grid">
<div class="control-group">
<label>Color</label>
<input type="color" id="prop-shadow-color" value="#000000">
</div>
<div class="control-group">
<label>Blur/Size</label>
<input type="number" id="prop-shadow-size" step="1" min="0">
</div>
<div class="control-group full">
<label>Opacity</label>
<input type="range" id="prop-shadow-opacity" min="0" max="1" step="0.1">
</div>
</div>
<!-- Border -->
<h3>Border</h3>
<div class="params-grid" id="group-border">
<div class="control-group">
<label>Color</label>
<input type="color" id="prop-border-color" value="#ffffff">
</div>
<div class="control-group">
<label>Size</label>
<input type="number" id="prop-border-size" step="0.5" min="0">
</div>
<div class="control-group full">
<label>Opacity</label>
<input type="range" id="prop-border-opacity" min="0" max="1" step="0.1">
</div>
<div class="control-group full">
<label>Corner Radius</label>
<input type="number" id="prop-corner-radius" step="1" min="0">
</div>
<div class="control-group full">
<label>Padding</label>
<input type="number" id="prop-padding" step="1" min="0">
</div>
</div>
<div id="group-text-bg">
<h3>Background</h3>
<div class="params-grid">
<div class="control-group">
<label>Type</label>
<select id="prop-bg-type">
<option value="none">None</option>
<option value="solid">Solid</option>
<option value="gradient">Gradient</option>
</select>
</div>
<div class="control-group">
<label>Color 1</label>
<input type="color" id="prop-bg-color1" value="#000000">
</div>
<div class="control-group">
<label>Color 2</label>
<input type="color" id="prop-bg-color2" value="#ffffff">
</div>
<div class="control-group">
<label>Direction</label>
<select id="prop-bg-direction">
<option value="vertical">Vertical</option>
<option value="horizontal">Horizontal</option>
<option value="diag1">Diag ↘</option>
<option value="diag2">Diag ↗</option>
</select>
</div>
</div>
</div>
<div style="margin-top:20px;">
<button class="btn-tool" style="background:#a32323; border:none; width:100%;" onclick="deleteSelectedOverlay()">Delete Item</button>
</div>
</div>
</div>
<div class="main-area" id="main-area">
<div id="canvas-wrapper">
<canvas id="previewCanvas"></canvas>
</div>
</div>
<svg style="display:none">
<symbol id="icon-dots" viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" /></symbol>
<symbol id="icon-left" viewBox="0 0 24 24"><path d="M3 15h18v-2H3v2zm0 4h12v-2H3v2zm0-8h18V9H3v2zm0-6v2h18V5H3z" /></symbol>
<symbol id="icon-center" viewBox="0 0 24 24"><path d="M7 15v2h10v-2H7zm-4 6h18v-2H3v2zm0-8h18v-2H3v2zm4-6v2h10V7H7zM3 3v2h18V3H3z" /></symbol>
<symbol id="icon-right" viewBox="0 0 24 24"><path d="M3 21h18v-2H3v2zm6-4h12v-2H9v2zm-6-4h18V9H3v2zm6-6v2h12V5H9z" /></symbol>
<symbol id="icon-full" viewBox="0 0 24 24"><path d="M3 21h18v-2H3v2zm0-4h18v-2H3v2zm0-4h18V9H3v2zm0-4h18V5H3v2zm0-4v2h18V3H3z" /></symbol>
</svg>
<!-- must load last -->
<script type="text/javascript" src="index.js"></script>
</body>
</html>