-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
157 lines (143 loc) · 7.99 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
<html>
<head>
<link href='https://fonts.googleapis.com/css?family=Sigmar+One|Erica+One|Merriweather:900italic,900|Titillium+Web:900,700|Black+Ops+One|Frijole|Corben:700|Cinzel+Decorative:900|Sniglet:800|Fascinate|Plaster|Fascinate+Inline|Ceviche+One|Press+Start+2P|Knewave|Shojumaru|Nosifer|Sarina|UnifrakturCook:700|Mrs+Sheppards|Arbutus|Chewy|Domine:700|Permanent+Marker|Playfair+Display+SC:700,900|Alegreya+Sans+SC:700,900,800|Berkshire+Swash|Creepster|Oleo+Script+Swash+Caps:400,700|Life+Savers:700|Trade+Winds' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<link rel="stylesheet" type="text/css" href="css/spectrum.css">
<style>
input[type="range"] {
display: inline-block;
width: 10em;
}
input[type="range"].vertical {
display: inline-block;
width: 2em;
-webkit-appearance: slider-vertical;
writing-mode: bt-lr;
height: 5em;
vertical-align: top;
}
</style>
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="js/lodash.min.js"></script>
<script src="js/angular.min.js"></script>
<script src="js/fabric.min.js"></script>
<script src="js/spectrum.js"></script>
<script src="js/app.js"></script>
<script>
$(document).ready(function () {
var colorSettings = {
flat: false,
showInput: true,
showAlpha: true,
showPalette: true,
preferredFormat: "rgb",
showSelectionPalette: true,
palette: [
["#000000", "#434343", "#666666", "#999999", "#b7b7b7", "#cccccc", "#d9d9d9", "#efefef", "#f3f3f3", "#ffffff"],
["#980000", "#ff0000", "#ff9900", "#ffff00", "#00ff00", "#00ffff", "#4a86e8", "#0000ff", "#9900ff", "#ff00ff"],
["#e6b8af", "#f4cccc", "#fce5cd", "#fff2cc", "#d9ead3", "rgb(212, 228, 230)", "#c9daf8", "#cfe2f3", "#d9d2e9", "#ead1dc"],
["#dd7e6b", "#ea9999", "#f9cb9c", "#ffe599", "#b6d7a8", "#a2c4c9", "#a4c2f4", "#9fc5e8", "#b4a7d6", "#d5a6bd"],
["#cc4125", "#e06666", "#f6b26b", "#ffd966", "#93c47d", "#76a5af", "#6d9eeb", "#6fa8dc", "#8e7cc3", "#c27ba0"],
["#a61c00", "#cc0000", "#e69138", "#f1c232", "#6aa84f", "#45818e", "#3c78d8", "#3d85c6", "#674ea7", "#a64d79"],
["#85200c", "#990000", "#b45f06", "#bf9000", "#38761d", "#134f5c", "#1155cc", "#0b5394", "#351c75", "#741b47"],
["#5b0f00", "#660000", "#783f04", "#7f6000", "#274e13", "#0c343d", "#1c4587", "#073763", "#20124d", "#4c1130"]
]
};
$("#text1col").spectrum(colorSettings);
$("#text2col").spectrum(colorSettings);
$("#text3col").spectrum(colorSettings);
$("#text4col").spectrum(colorSettings);
$("#text5col").spectrum(colorSettings);
$("#text6col").spectrum(colorSettings);
$("#topCol").spectrum(colorSettings);
$("#bottomCol").spectrum(colorSettings);
$("#bgCol").spectrum(colorSettings);
$("#borderCol").spectrum(colorSettings);
})
</script>
</head>
<body ng-app="app">
<div ng-controller="canvasCtrl" class="row">
<div class="col-sm-4 col-sm-offset-2" style="min-width: 400px; margin-top: 50px;">
<canvas id="c" width="400" height="500"
style="border: none; -webkit-user-select: none; cursor: default;"></canvas>
</div>
<div class="col-sm-4">
<table>
<tr><td>
<button ng-click="save()">Save to local storage</button><br/>
<button ng-click="load()">Load from local storage</button>
</td></tr>
<tr><td>
Set image:
<input type="file" id="imageFile" ng-model="image">
<button ng-click="loadFile()">Insert file</button>
</td></tr>
<tr><td>
Border:<br/>
<input type="range" min="0" max="30" ng-model="label.borderWidth"> Border width<br/>
Border color: <input type='text' id="borderCol" ng-model="label.border.stroke" ng-change="repaint()"/>
</td></tr>
<tr><td>
Top box color: <input type='text' id="topCol" ng-model="label.topBox.fill"
ng-change="label.topBox.stroke = label.topBox.fill; repaint()"/>
</td></tr>
<tr><td>
Bottom box color: <input type='text' id="bottomCol" ng-model="label.bottomBox.fill"
ng-change="label.bottomBox.stroke = label.bottomBox.fill; repaint()"/>
</td></tr>
<tr><td>
Background color: <input type='text' id="bgCol" ng-model="label.backgroundBox.fill"
ng-change="label.backgroundBox.stroke = label.backgroundBox.fill;repaint()"/>
</td></tr>
<tr><td>
Beer name: <input type="text" ng-model="label.text1.text" ng-change="repaint()">
<input type='text' id="text1col" ng-model="label.text1.fill"/>
Size:
<input type="range" min="10" max="50" ng-model="label.text1.fontSize" ng-change="repaint()"><br/>
Font: <select ng-change="setFont();" ng-model="label.text1.fontFamily" style="{{ 'font-family: ' + label.text1.fontFamily }}">
<option ng-repeat="font in fonts" style="{{ 'font-family: ' + font }}">{{ font }}</option>
</select>
</td></tr>
<tr><td>
Beer type: <input type="text" ng-model="label.text2.text" ng-change="repaint()">
<input type='text' id="text2col" ng-model="label.text2.fill"/>
Size: <input type="range" min="10" max="50" ng-model="label.text2.fontSize" ng-change="repaint()"><br/>
Font: <select ng-change="setFont();" ng-model="label.text2.fontFamily" style="{{ 'font-family: ' + label.text2.fontFamily }}">
<option ng-repeat="font in fonts" style="{{ 'font-family: ' + font }}">{{ font }}</option>
</td></tr>
<tr><td>
Tag line 1: <input type="text" ng-model="label.text3.text" ng-change="repaint()">
<input type='text' id="text3col" ng-model="label.text3.fill"/>
Size: <input type="range" min="10" max="50" ng-model="label.text3.fontSize" ng-change="repaint()"><br/>
Font: <select ng-change="setFont();" ng-model="label.text3.fontFamily" style="{{ 'font-family: ' + label.text3.fontFamily }}">
<option ng-repeat="font in fonts" style="{{ 'font-family: ' + font }}">{{ font }}</option>
</td></tr>
<tr><td>
Tag line 2: <input type="text" ng-model="label.text4.text" ng-change="repaint()">
<input type='text' id="text4col" ng-model="label.text4.fill"/>
Size: <input type="range" min="10" max="50" ng-model="label.text4.fontSize" ng-change="repaint()"><br/>
Font: <select ng-change="setFont();" ng-model="label.text4.fontFamily" style="{{ 'font-family: ' + label.text4.fontFamily }}">
<option ng-repeat="font in fonts" style="{{ 'font-family: ' + font }}">{{ font }}</option>
</td></tr>
<tr><td>
Alc: <input type="text" ng-model="label.text5.text" ng-change="repaint()">
<input type='text' id="text5col" ng-model="label.text5.fill"/>
Size: <input type="range" min="10" max="50" ng-model="label.text5.fontSize" ng-change="repaint()"><br/>
Font: <select ng-change="setFont();" ng-model="label.text5.fontFamily" style="{{ 'font-family: ' + label.text5.fontFamily }}">
<option ng-repeat="font in fonts" style="{{ 'font-family: ' + font }}">{{ font }}</option>
</td></tr>
<tr><td>
Vol: <input type="text" ng-model="label.text6.text" ng-change="repaint()">
<input type='text' id="text6col" ng-model="label.text6.fill"/>
Size: <input type="range" min="10" max="50" ng-model="label.text6.fontSize" ng-change="repaint()"><br/>
Font: <select ng-change="setFont();" ng-model="label.text6.fontFamily" style="{{ 'font-family: ' + label.text6.fontFamily }}">
<option ng-repeat="font in fonts" style="{{ 'font-family: ' + font }}">{{ font }}</option>
</table>
</div>
</div>
<img src="" id="image" style="display: none">
</body>
</html>