-
Notifications
You must be signed in to change notification settings - Fork 19
/
index.html
197 lines (192 loc) · 8.13 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
<!DOCTYPE html>
<html>
<head lang='en'>
<meta charset='UTF-8'>
<title>Sweaterify</title>
<meta name="description" content="Knit sweater generator - turn an image into a sweater. Made with ❤ by @kosamari">
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="icon" type="image/vnd.microsoft.icon" href="favicon.ico">
<meta property="og:title" content="Sweaterify">
<meta property="og:image" content="https://kosamari.github.io/sweaterify/assets/img/media.jpg"/>
<meta property="og:description" content="Knit sweater generator - turn an image into a sweater. Made with ❤ by @kosamari">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:creator" content="@kosamari">
<meta name="twitter:title" content="Sweaterify">
<meta name="twitter:description" content="Knit sweater generator - turn an image into a sweater. Made with ❤ by @kosamari">
<meta name="twitter:image:src" content="https://kosamari.github.io/sweaterify/assets/img/media.jpg">
<meta itemprop="name" content="Sweaterify">
<meta itemprop="description" content= "Knit sweater generator - turn an image into a sweater. Made with ❤ by @kosamari">
<meta itemprop="image" content="https://kosamari.github.io/sweaterify/assets/img/media.jpg">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel='stylesheet' type='text/css' href='assets/css/main.css'/>
<script src="assets/js/jscolor.min.js" type="text/javascript"></script>
</head>
<body>
<header>
<h1>Sweaterify</h1>
<div>
<h2>Turn an image into a sweater. Made with <span class="red">❤</span> by <a href="https://twitter.com/kosamari" title="twitter link to @kosamari">@kosamari</a></h2>
<div id="announcement">
<div>
👋 Looking for the Ugly Browser Christmas pattern? <a href="https://github.com/kosamari/sweaterify/tree/master/sad_and_offline_wallpaper" title="Ugly Browser Christmas Wallpapers">Download wallpapers</a>, or order <a href="https://teespring.com/sweaterify-sad-offline" title="link to teespring">a Sweatshirt/Tshirt</a>... or make one yourself!
</div>
</div>
<div>
</header>
<div id="container">
<div id="menu">
<div>
<input type="file" name="file" id="file" accept="image/*" >
<label for="file">Upload an image</label>
</div>
<div id="canvas-guide-title">
<div>
Drag red rectangle to change position
</div>
<canvas id="canvas-guide"></canvas>
</div>
<div class="tabs">
<div class="tab">
<input type="radio" id="tab-repeat" name="mode" value="repeat">
<label for="tab-repeat">Holiday</label>
</div>
<div class="tab">
<input type="radio" id="tab-dither" name="mode" value="dither" >
<label for="tab-dither">Halftone</label>
</div>
<div class="tab">
<input type="radio" id="tab-posterize" name="mode" value="posterize">
<label for="tab-posterize">Poster</label>
</div>
</div>
<div id="repeat-menu">
<div class="menu-title">Number of Repeat</div>
<select id="repeatsize">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5" selected>5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select>
</div>
<div id="color-num-menu">
<div class="menu-title">Number of Colors</div>
<select id="colorsize">
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</div>
<div id="invert-menu">
<label for="invert" class="menu-title">Invert image colors</label>
<input type="checkbox" id="invert" value="1">
</div>
<div class="slider-menu">
<div class="menu-title">Yarn Type</div>
<input id="guage" type="range" min="80" max="200" step="10" value="140"/>
<div class="slider-guide">
<div>bulkey</div>
<div>super fine</div>
</div>
</div>
<div class="slider-menu">
<div class="menu-title">Image Adjustment</div>
<input id="brightness" type="range" min="-254" max="254" value="0" step="5"/>
<div class="slider-guide">
<div>dark</div>
<div>bright</div>
</div>
</div>
<div class="menu-title">Color Settings</div>
<div id="color-menu">
<div class="color-menu-item">
<div class="color-item">
<small>arm & neck</small>
</div>
<div class="color-item">
<input type="radio" name="parts" value="0">
</div>
<div class="color-item">
<input type="radio" name="parts" value="3">
</div>
<div class="color-item">
<input type="radio" name="parts" value="1">
</div>
<div class="color-item">
<input type="radio" name="parts" value="2">
</div>
</div>
<div class="color-menu-item">
<div class="color-item">
<small>background</small>
</div>
<div class="color-item">
<input type="radio" name="fill" value="0">
</div>
<div class="color-item">
<input type="radio" name="fill" value="3">
</div>
<div class="color-item">
<input type="radio" name="fill" value="1">
</div>
<div class="color-item">
<input type="radio" name="fill" value="2">
</div>
</div>
<div class="color-menu-item">
<div class="color-item">
<small>color</small>
</div>
<div class="color-item">
<input id="color0" class="jscolor color-pick">
</div>
<div class="color-item">
<input id="color3" class="jscolor color-pick">
</div>
<div class="color-item">
<input id="color1" class="jscolor color-pick">
</div>
<div class="color-item">
<input id="color2" class="jscolor color-pick">
</div>
</div>
</div>
<button id="color-reset">reset colors</button>
<br><br>
</div>
<div id="sweater">
<div>
<canvas id="canvas"></canvas>
</div>
<div>
<button id="download" class="download-btn" disabled="true">Download Sweater PNG</button>
<button id="download-pattern" class="download-btn" disabled="true">Download Pattern CSV</button>
<button id="download-svg" class="download-btn" disabled="true">Download SVG (experimental)</button>
<button id="download-wallpaper" class="download-btn" disabled="true">Download as Wallpaper</button>
</div>
</div>
</div>
<a id="download-link" hidden></a>
<img src="assets/img/patterntop.png" alt="" id="pattern-img-top" hidden>
<img src="assets/img/patternbottom.png" alt="" id="pattern-img-bottom" hidden>
<script src="assets/js/main.min.js" type="text/javascript"></script>
<script>
if (navigator.serviceWorker) {
navigator.serviceWorker.register('/sweaterify/sw.js', {scope: '/sweaterify/'})
}
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-88945135-1', 'auto');
ga('send', 'pageview');
</script>
</body>
</html>