-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
260 lines (205 loc) · 10.4 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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Tattoo Simulator is web-based 3D tattoo placement application. Upload your own designs and get inspired to try new tattoo ideas on your skin."/>
<link rel="stylesheet" type="text/css" href="css/jquery.fullPage.css"/>
<link rel="stylesheet" type="text/css" href="css/button.min.css">
<link rel="stylesheet" type="text/css" href="css/icon.min.css">
<link rel="stylesheet" type="text/css" href="css/popup.min.css">
<link rel="stylesheet" type="text/css" href="css/nouislider.min.css">
<link rel="stylesheet" type="text/css" href="css/dropzone.css">
<link rel="stylesheet" type="text/css" href="css/style.css"/>
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:200,300,400" rel="stylesheet">
<title>Tattoo Simulator</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.fullPage.min.js"></script>
<script src="js/nouislider.min.js"></script>
<script src="js/dropzone.js"></script>
</head>
<body>
<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-90417615-1', 'auto');
ga('send', 'pageview');
</script>
<div id="fullpage">
<div class="section" id="section_0">
<div class="name">
<h1>Tattoo<br>·<br>Simulator</h1>
</div>
<div class="hero">
<h3>Want inspiration and ideas for tattoo designs or placement?</h3>
<h2>Tattoo Simulator lets you generate 3D images out of your drawings without installing any mobile tattoo app.</h2>
<button onclick="$.fn.fullpage.moveSectionDown()" class="ui button" id="next">
<p>Start Tattoo!</p>
</button>
</div>
<div class="social">
<i onclick="window.open('http://www.instagram.com/tattoosim')" class="inverted instagram icon"></i>
<i onclick="window.open('mailto: [email protected]')" class="inverted mail icon"></i>
<i onclick="window.open('http://www.tattoosim.com')" class="inverted home icon"></i>
</div>
</div>
<div class="section" id="section_1">
<!-- GUI START -->
<div id="gui">
<div class="container" >
<button class="ui button tips" id="plus" data-tooltip="Zoom In" data-position="bottom center">
<i class="black zoom icon"></i>
</button>
<button class="ui button tips" id="minus" data-tooltip="Zoom Out" data-position="bottom center">
<i class="black zoom out icon"></i>
</button>
</div>
<div class="container">
<button class="ui button tips" id="add" data-tooltip="Add Tattoo" data-position="bottom center">
<i class="black checkmark icon"></i>
</button>
<button class="ui button tips" id="remove" data-tooltip="Remove Tattoo" data-position="bottom center">
<i class="black remove icon"></i>
</button>
</div>
<div class="container slider">
<button class="ui button transform" disabled id="scale_value"></button>
<div class="sliders tips" id="scale_slider" data-tooltip="Tattoo Scale" data-position="bottom center"></div>
<button class="ui button transform" disabled id="rotation_value"></button>
<div class="sliders tips" id="rotation_slider" data-tooltip="Tattoo Rotation" data-position="bottom center"></div>
</div>
<div class="container image">
<form id="dropzone" action="" class="dropzone needsclick dz-clickable">
<i class="black cloud upload icon"></i>
<div class="dz-message needsclick">Drop image here or click to upload</div>
</form>
</div>
<div class="container slider">
<button class="ui button transform" disabled id="cam_updown_value"></button>
<div class="sliders tips" id="cam_updown_slider" data-tooltip="Camera Up / Down" data-position="bottom center"></div>
<button class="ui button transform" disabled id="cam_leftright_value"></button>
<div class="sliders tips" id="cam_leftright_slider" data-tooltip="Camera Left / Right" data-position="bottom center">
</div>
</div>
<div class="container">
<button class="ui button tips" id="hide" data-tooltip="Hide Helper" data-position="bottom center">
<i class="black hide icon"></i>
</button>
<button class="ui button tips" id="trash" data-tooltip="Clear Tattoos" data-position="bottom center">
<i class="black trash outline icon"></i>
</button>
</div>
</div>
<!-- GUI END -->
<div id="aframe">
<div id="loading"></div>
<div id="loading_gif"></div>
<iframe id="iframe" src="/aframe/aframe_tattoo.html"></iframe>
</div>
</div>
<!--<div class="section fp-auto-height" id="section_2">
<div class="footer"></div>
</div>-->
</div>
<script>
// INIT
var anchorIndex;
$(document).ready(function() {
$('#fullpage').fullpage({
navigation: true,
navigationPosition: 'right',
navigationTooltips: ['Intro', 'Design', 'Footer'],
afterLoad: function(anchorLink, index){
anchorIndex = index;
if (index == 2) {
//console.log("INIT LOAD");
}
}
});
var initMoveDelay = 5000;
setTimeout(function() {
if (anchorIndex === 1) {
$.fn.fullpage.moveSectionDown();
}
}, initMoveDelay);
});
</script>
<script>
// SLIDERS //
updateValue = (slider, value, handle = 0) => {
values = slider.noUiSlider.get();
values = parseInt(values);
value.dataset.value = values;
}
noUiSlider.create(scale_slider, {
start: 100,
step: 2,
connect: [true, false],
range: {
'min': 0,
'max': 100
}
});
scale_slider.noUiSlider.on('update', function() {
updateValue(scale_slider, scale_value);
});
noUiSlider.create(rotation_slider, {
start: 0,
step: 5,
connect: [false, false],
range: {
'min': -180,
'max': 180
}
});
rotation_slider.noUiSlider.on('update', function() {
updateValue(rotation_slider, rotation_value);
});
// CAM MOVE //
noUiSlider.create(cam_updown_slider, {
start: 0.975 * 5,
//step: 0.1,
padding: 0,
connect: [true, false],
range: {
'min': 0,
'max': 10
}
});
cam_updown_slider.noUiSlider.on('update', function() {
updateValue(cam_updown_slider, cam_updown_value);
});
noUiSlider.create(cam_leftright_slider, {
start: 0,
step: 5,
connect: [false, false],
range: {
'min': -180,
'max': 180
}
});
cam_leftright_slider.noUiSlider.on('update', function() {
updateValue(cam_leftright_slider, cam_leftright_value);
});
// DROPZONE
Dropzone.options.dropzone = {
url: "/",
accept: function (file, done) {
done('Here you can write anything');
$('.dz-preview').last().toggleClass('dz-error dz-success');
var evt = document.createEvent("CustomEvent");
evt.initCustomEvent("MyEventType", true, true, file);
window.dispatchEvent(evt);
},
init: function() {
this.on("addedfile", function() {
if (this.files[1]!=null){
this.removeFile(this.files[0]);
}
});
}
};
</script>
</body>
</html>