-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
228 lines (210 loc) · 8.95 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Designer</title>
<link rel="stylesheet" href="css/w2ui-1.5.rc1.min.css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/solid.css"
integrity="sha384-osqezT+30O6N/vsMqwW8Ch6wKlMofqueuia2H7fePy42uC05rm1G+BUPSd2iBSJL" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/fontawesome.css"
integrity="sha384-BzCy2fixOYd0HObpx3GMefNqdbA7Qjcc91RgYeDjrHTIEXqiF00jKvgQG0+zY/7I" crossorigin="anonymous">
<link rel="stylesheet" href="designer.css">
<script src="https://unpkg.com/tippy.js@3/dist/tippy.all.min.js"></script>
<link rel="stylesheet" href="css/tiptheme.css">
<link href='https://fonts.googleapis.com/css?family=Montez|Lobster|Josefin+Sans|Shadows+Into+Light|Pacifico|Amatic+SC:700|Orbitron:400,900|Rokkitt|Righteous|Dancing+Script:700|Bangers|Chewy|Sigmar+One|Architects+Daughter|Abril+Fatface|Covered+By+Your+Grace|Kaushan+Script|Gloria+Hallelujah|Satisfy|Lobster+Two:700|Comfortaa:700|Cinzel|Courgette'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/cropper.css">
<script src="libsjs/jquery-3.3.1.min.js"></script>
<script src="libsjs/w2ui-1.5.rc1.min.js"></script>
<script src="libsjs/fabric.js"></script>
<script src="libsjs/cropper.js"></script>
<script src="libsjs/qrcode.min.js"></script>
<script src="libsjs/download.js"></script>
<script src="https://unpkg.com/jspdf@latest/dist/jspdf.min.js"></script>
<script src="libsjs/aligning_guidelines.js"></script>
<script src="libsjs/centering_guidelines.js"></script>
<script src="libsjs/rulez.min.js"></script>
</head>
<body>
<div id="Designer">
<div id="ToolsArea"></div>
<div id="DesignerArea">
<svg id="toprulersvg" xmlns="http://www.w3.org/2000/svg"></svg>
<svg id="leftrulersvg" xmlns="http://www.w3.org/2000/svg"></svg>
<canvas id="PrintableCanvas" width="680" height="398"></canvas>
<div id="SafeArea"></div>
</div>
<div id="TextPropertyArea" style="display: none"></div>
<div id="ImagePropertyArea" style="display: none"></div>
<div id="MorePropertyArea" style="display: none"></div>
<div id="StarPropertyArea" style="display: none"></div>
<div id="BGPropertyArea"></div>
<div id="Sides"></div>
<!-- Text Edit popup-->
<div id="texteditpopup" style="display: none; width: 400px; height: 300px; overflow: hidden">
<div rel="title">
Edit Text
</div>
<div rel="body" style="padding: 10px; line-height: 150%">
<div class="menu-container">
<div id="specialcharlist" class="button-container">
</div>
</div>
<textarea id="inputtext" oninput="updateTextValue(this.value)" onkeyup="checkForInputText(event)">
</textarea>
</div>
<div rel="buttons">
<button class="w2ui-btn" onclick="w2popup.close()">Close</button>
</div>
</div>
<!-- Image Crop popup-->
<div id="imagecroppopup" style="display: none; ">
<div rel="title">
Edit Image
</div>
<div rel="body" style="padding: 10px;height: 100%; width: 100%;">
<img id="croptarget" src="">
</div>
<div rel="buttons">
<button class="w2ui-btn" onclick="w2popup.close()">Close</button>
</div>
</div>
<!-- New Imge input from local file-->
<input id="localimageinput" type="file" style="display: none"/>
<!-- Replace Imge input from local file-->
<input id="replacelocalimageinput" type="file" style="display: none"/>
<!-- Change BG input from local file-->
<input id="changebgfromlocalinput" type="file" style="display: none"/>
<!-- Arrow popup-->
<div id="arrowpopup" style="display: none; width: 400px; height: 300px; overflow: hidden">
<div rel="title">
Select an Arrow
</div>
<div rel="body" style="padding: 10px; ">
<div class="menu-container">
<div id="arrowcharlist" class="arrow-container">
</div>
</div>
</div>
</div>
<!-- QR popup-->
<div id="qrpopup" style="display: none; ">
<div rel="title">
Select an Arrow
</div>
<div rel="body" style="padding: 10px; ">
<div class="menu-container">
<input id="qrtext" type="text" value="https://sample.com" style="width:100%; margin: auto;"/>
<hr>
<div id="qrcode" style="margin: auto;"></div>
</div>
</div>
</div>
<!-- Design Load input from local file-->
<input id="designfromlocalinput" type="file" style="display: none"/>
<!-- ---------- must be last element ------------ -->
<div id="LoadingOverlay">
<div id="LoadingOverlayContent">Please Wait ...</div>
</div>
</div>
</body>
<script src="designerjs/buildcanvas.js"></script>
<script src="designerjs/buildmaintools.js"></script>
<script src="designerjs/buildpropertybar.js"></script>
<script src="designerjs/buildsidetools.js"></script>
<script>
var fonts = ["Montez", "Lobster", "Josefin Sans", "Shadows Into Light", "Pacifico", "Amatic SC", "Orbitron", "Rokkitt", "Righteous", "Dancing Script", "Bangers", "Chewy", "Sigmar One", "Architects Daughter", "Abril Fatface", "Covered By Your Grace", "Kaushan Script", "Gloria Hallelujah", "Satisfy", "Lobster Two", "Comfortaa", "Cinzel", "Courgette"];
var schlist = ['‚', 'ƒ', '„', '…', '†', '‡', 'ˆ', '‰', 'Š', '‹', 'Œ', '‘', '’', '“', '”', '•', '–', '—', '˜', '™', 'š', '›', 'œ', 'Ÿ', '¡', '¢', '£', '¤', '¥', '¦', '§', '¨', '©', 'ª', '«', '¬', '®', '¯', '°', '±', '²', '³', '´', '¶',
'·', '¸', '¹', 'º', '»', '¼', '½', '¾', '¿', 'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç', 'È', 'É', 'Ê', 'Ë', 'Ì', 'Í', 'Î', 'Ï', 'Ð', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö', '×', 'Ø', 'Ù', 'Ú', 'Û', 'Ü', 'Ý', 'Þ', 'ß', 'à', 'á', 'â', 'ã', 'ä', 'å',
'æ', 'ç', 'è', 'é', 'ê', 'ë', 'ì', 'í', 'î', 'ï', 'ð', 'ñ', 'ò', 'ó', 'ô', 'õ', 'ö', '÷', 'ø', 'ù', 'ú', 'û', 'ü', 'ý', 'þ', 'ÿ', '€', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', '<', '>', '?', '^', '_', '`', '~', '₩', ' '];
// the main canvas
let canvas = null;
let BGImage = null;
let imgcropper = null;
let qrcode = null;
window.enableShortKey = true;
let areConfig = {
width: 680,
height: 398,
safeAreaMargin: 24,
printableAreaMargin: 44,
};
$(function () {
buildcanvas();
buildtoolbar();
buildpropertybar();
buildsidebar();
// rilers
// top ruler
document.getElementById('toprulersvg').style.width = areConfig.width + 'px'; // bring up and over canvas
let toprulez = new Rulez({
element: document.getElementById('toprulersvg'),
divisions: [
{
pixelGap: 5,
lineLength: 5,
},
{
pixelGap: 50,
lineLength: 10,
},
{
pixelGap: 100,
lineLength: 20,
}
],
texts: [
{
pixelGap: 50
}
] });
toprulez.render();
// left ruler
document.getElementById('leftrulersvg').style.height = areConfig.height + 'px'; // bring up and over canvas
let leftrulez = new Rulez({
element: document.getElementById('leftrulersvg'),
layout: 'vertical',
textDefaults: {
rotation: 90
},
divisions: [
{
pixelGap: 5,
lineLength: 5,
},
{
pixelGap: 50,
lineLength: 10,
},
{
pixelGap: 100,
lineLength: 20,
}
],
texts: [
{
pixelGap: 50
}
]
});
leftrulez.render();
});
$(document).ready(function () {
tippy('#DesignerArea', {
content: "Safety Line, <a id='safetylineinfo' href='http://www.google.com'>More info</a>",
distance: -(areConfig.printableAreaMargin + areConfig.safeAreaMargin) + 7,
interactive: true,
delay: 0,
arrow: true,
// arrowType: 'round',
size: 'small',
// hideOnClick: false,
showOnInit: true,
theme: "light-border",
trigger: 'mouseenter focus',
// trigger: 'manual',
// animation: 'scale'
});
});
</script>
</html>