-
Notifications
You must be signed in to change notification settings - Fork 3
/
v0.7.html
692 lines (653 loc) · 30.7 KB
/
v0.7.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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
<!DOCTYPE html>
<html>
<head>
<title>Kinklist</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="//code.jquery.com/jquery-2.1.4.min.js"></script>
<style>
body {
font-family: 'Verdana', 'Arial';
font-size: 12px;
}
table {
border-collapse: collapse;
min-width: 385px;
margin-bottom: 10px;
}
th {
border: solid #999 1px;
border-right: none;
margin: 0px;
padding: 4px;
background-color: #666;
color: #FFF;
}
th.choicesCol {
box-sizing: border-box;
width: 125px;
}
th + th {
border-left: none;
}
th:last-child {
border-right: solid #999 1px;
}
td {
border-left: solid #999 1px;
border-bottom: solid #999 1px;
border-right: solid #999 1px;
margin: 0px;
padding: 4px;
}
td + td {
border-left-style: none;
}
.choice {
box-sizing: border-box;
width: 15px;
height: 15px;
opacity: 0.35;
overflow: hidden;
text-indent: 100px;
border: solid #000 1px;
border-radius: 50%;
outline-style: none!important;
vertical-align: middle;
display: inline-block;
cursor: pointer;
transition: all 0.3s ease-in-out;
font-size: 0;
padding: 0;
}
.choice + .choice {
margin-left: 5px;
}
.choices .choice:hover {
opacity: 0.75;
}
.choice.selected {
opacity: 1;
border-width: 2px;
}
.choice.notEntered {
background-color: #FFF;
}
.choice.favorite {
background-color: #FE6BB4;
}
.choice.like {
background-color: #23FD22;
}
.choice.okay {
background-color: #FDFD6B;
}
.choice.maybe {
background-color: #DB6C00;
}
.choice.no {
background-color: #920000;
}
.legend {
vertical-align: middle;
font-size: 14px;
}
.legend div {
display: inline-block;
}
.legend .choice {
opacity: 1;
cursor: default;
margin-bottom: 2px;
}
#ExportWrapper {
width: 580px;
height: 36px;
}
#URL {
display: none;
position: absolute;
top: 3px;
box-sizing: border-box;
width: 300px;
height: 30px;
border-radius: 4px;
border: solid #CCC 1px;
font-size: 16px;
padding: 10px;
text-align: center;
color: #666;
font-weight: bold;
}
#Export {
position: absolute;
left: 310px;
box-sizing: border-box;
color: #FFF;
text-transform: uppercase;
background-color: #4980ae;
width: 150px;
height: 36px;
font-size: 18px;
border-style: none;
border-radius: 4px;
cursor: pointer;
transition: all 0.3s ease-in-out;
}
#Export:hover {
opacity: 0.85;
}
#Loading {
display: none;
overflow: visible;
line-height: 26px;
font-size: 16px;
color: #999;
font-weight: bold;
position: absolute;
top: 4px;
left: 220px;
}
#Loading:before {
content: '';
position: absolute;
box-sizing: border-box;
width: 26px;
height: 26px;
border-radius: 50%;
border: solid #999 2px;
border-top-color: transparent;
border-left-color: #CCC;
border-right-color: #666;
animation: spin .5s infinite linear;
margin-left: -40px;
}
@media (min-width: 1700px) {
.kinkCategory {
position: absolute;
margin-top: 40px;
margin-left: 10px;
}
.kinkCategory.cat-bodies { left: 000px; top: 000px; }
.kinkCategory.cat-clothing { left: 000px; top: 225px; }
.kinkCategory.cat-groupings { left: 000px; top: 525px; }
.kinkCategory.cat-general { left: 400px; top: 000px; }
.kinkCategory.cat-assPlay { left: 400px; top: 550px; }
.kinkCategory.cat-kinksBdsm { left: 800px; top: 000px; }
.kinkCategory.cat-pain { left: 1200px; top: 000px; }
.kinkCategory.cat-extreme { left: 1200px; top: 425px; }
.legend {
position: absolute;
top: 22px;
left: 130px;
}
.legend div {
width: 130px;
}
#ExportWrapper {
position: absolute;
top: 10px;
left: 1120px;
}
}
@media (max-width: 1700px) and (min-width: 800px) {
.kinkCategory {
position: absolute;
margin-top: 80px;
margin-left: 10px;
}
.kinkCategory.cat-bodies { left: 000px; top: 000px; }
.kinkCategory.cat-clothing { left: 000px; top: 225px; }
.kinkCategory.cat-groupings { left: 000px; top: 525px; }
.kinkCategory.cat-general { left: 000px; top: 775px; }
.kinkCategory.cat-assPlay { left: 000px; top: 1325px; }
.kinkCategory.cat-pain { left: 000px; top: 1525px; }
.kinkCategory.cat-kinksBdsm { left: 400px; top: 000px; }
.kinkCategory.cat-extreme { left: 400px; top: 1425px; }
.legend div {
width: 130px;
padding-bottom: 10px;
}
#ExportWrapper {
position: absolute;
top: 10px;
left: 325px;
}
}
@media (max-width: 800px) and (min-width: 600px) {
table {
width: 500px;
}
.legend div {
width: 180px;
padding-bottom: 10px;
padding-left: 10px;
}
#ExportWrapper {
position: relative;
margin-top: 10px;
margin-left: 40px;
}
}
@media (max-width: 599px) {
body {
font-size: 10px;
}
table {
min-width: 345px;
}
.legend div {
width: 150px;
padding-bottom: 10px;
padding-left: 10px;
}
#ExportWrapper {
position: relative;
margin-top: 10px;
margin-left: 0px;
width: 345px;
}
#URL {
left: 155px;
width: 190px;
font-size: 10px;
}
#Export {
left: 0px;
}
#Loading {
left: 230px;
}
}
@keyframes spin {
0% {transform: rotate(0deg);}
100% {transform: rotate(-360deg);}
}
</style>
</head>
<body>
<h1>Kink list</h1>
<div class="legend">
<div><span class="choice notEntered"></span> Not Entered</div>
<div><span class="choice favorite"></span> Favorite</div>
<div><span class="choice like"></span> Like</div>
<div><span class="choice okay"></span> Okay</div>
<div><span class="choice maybe"></span> Maybe</div>
<div><span class="choice no"></span> No</div>
</div>
<div id="ExportWrapper">
<input type="text" id="URL">
<button id="Export">Export</button>
<div id="Loading">Loading</div>
</div>
<div id="InputList"></div>
<script>
$(function(){
var imgurClientId = '9db53e5936cd02f';
var colors = {
"Not entered": "#FFFFFF",
"Favorite": "#FE6BB4",
"Like": "#23FD22",
"Okay": "#FDFD6B",
"Maybe": "#DB6C00",
"No": "#920000"
};
var level = {
"Not entered": "notEntered",
"Favorite": "favorite",
"Like": "like",
"Okay": 'okay',
"Maybe": "maybe",
"No": "no"
};
var kinks = {
"Bodies": {
fields: ['General'],
groups: [['Skinny', 'Chubby', 'Small breasts', 'Large breasts', 'Small cocks', 'Large cocks']]
},
"Clothing": {
fields: ['Self', 'Partner'],
groups: [['Clothed sex', 'Lingerie', 'Stockings', 'Heels', 'Leather', 'Latex', 'Uniforms', 'Socks', 'Cross-dressing']]
},
"Groupings": {
fields: ['General'],
groups: [['MM', 'FF', 'MF', 'MMF, MFM', 'FFM, FMF', 'Gangbang', 'Orgy']]
},
"General": {
fields: ['Giving', 'Receiving'],
groups: [['Voice: soft', 'Voice: rough/raspy', 'Kindness', 'Kissing', 'Caressing touches', 'Handjobs', 'Pussy fingering', 'Blowjobs', 'Deep throat', 'Swallowing', 'Facials', 'Cunnilingus', 'Face-sitting', 'Toys', 'Edging', 'Teasing', 'JOI, SI', 'Orgasm denial', 'Vaginal fisting']]
},
"Ass play": {
fields: ['Giving', 'Receiving'],
groups: [['Anal toys', 'Anal sex, pegging', 'Rimming', 'Double penetration', 'Anal fisting']]
},
"Kinks, BDSM": {
fields: ['Giving', 'Receiving'],
groups: [
['Male dom', 'Female domme', 'Power exchange', 'Master / slave', 'Master / pet', 'Servitude', 'Humiliation', 'Degradation', 'Name-calling', 'Bondage, light', 'Bondage, heavy', 'Encasement' ,'Discipline', 'Blackmail / Coercion', 'Rape', 'Kidnapping', 'Forced orgasm', 'Chastity', 'Drunken sex', 'Forced clothing', 'Cum play', 'Extreme cum play', 'Glory hole', 'Sleep play', 'Sounding'],
['Begging', 'Cock worship', 'Pussy worship', 'Foot worship', 'Body worship', 'Tickling', 'Sensation play', 'E-stim', 'Breath-play', 'Choking', 'Gags', 'Collars', 'Leashes'],
['Incest', 'Impregnation', 'Pregnancy', 'Lactation', 'Feet', 'Feminization', 'Petplay', 'Ageplay', 'Cheating', 'Cuckold / Cuckqueen', 'Exhibitionism', 'Voyeurism', 'Furry']
]
},
"Pain": {
fields: ['Giving', 'Receiving'],
groups: [['Light pain', 'Heavy pain', 'Nipple clamps', 'Clothes pins', 'Spanking', 'Cock/Ball slapping', 'Pussy slapping', 'Hard spanking', 'Caning', 'Flogging', 'Beating', 'Hot Wax', 'Scratching', 'Biting']]
},
"Extreme": {
fields: ['Giving', 'Receiving'],
groups: [['Cutting', 'Blood', 'Piss', 'Scat', 'Diapers', 'Bestiality', 'Vore', 'Necrophilia', 'Torture']]
}
};
var log = function(val, base) {
return Math.log(val) / Math.log(base);
};
var strToClass = function(str){
var className = "";
str = str.toLowerCase();
var validChars = 'abcdefghijklmnopqrstuvwxyz';
var newWord = false;
for(var i = 0; i < str.length; i++) {
var chr = str[i];
if(validChars.indexOf(chr) >= 0) {
if(newWord) chr = chr.toUpperCase();
className += chr;
newWord = false;
}
else {
newWord = true;
}
}
return className;
}
var inputKinks = {
createCategory: function(name){
return $('<div class="kinkCategory">').addClass('cat-' + strToClass(name)).data('category', name).append($('<h2>').text(name));
},
createGroup: function(fields){
var $table = $('<table class="kinkGroup">');
var $thead = $('<thead>').appendTo($table);
for(var i = 0; i < fields.length; i++) {
$('<th>').addClass('choicesCol').text(fields[i]).appendTo($thead);
}
$('<th>').appendTo($thead);
return $table;
},
createChoice: function(){
var $container = $('<div>').addClass('choices');
var levels = Object.keys(level);
for(var i = 0; i < levels.length; i++) {
$('<button>')
.addClass('choice')
.addClass(level[levels[i]])
.data('level', levels[i])
.data('levelInt', i)
.attr('title', levels[i])
.appendTo($container)
.on('click', function(){
$container.find('button').removeClass('selected');
$(this).addClass('selected');
});
}
return $container;
},
createKink: function(fields, name){
var $row = $('<tr>').data('kink', name).addClass('kinkRow');
for(var i = 0; i < fields.length; i++) {
var $choices = inputKinks.createChoice();
$choices.data('field', fields[i]);
$('<td>').append($choices).appendTo($row);
}
$('<td>').text(name).appendTo($row);
return $row;
},
init: function(){
$('#InputList').empty();
var kinkCats = Object.keys(kinks);
for(var i = 0; i < kinkCats.length; i++) {
var catName = kinkCats[i];
var $category = inputKinks.createCategory(catName);
var fields = kinks[catName].fields;
var groups = kinks[catName].groups;
for(var j = 0; j < groups.length; j++) {
var $group = inputKinks.createGroup(fields);
var kinkArr = groups[j];
for(var k = 0; k < kinkArr.length; k++) {
$group.append(inputKinks.createKink(fields, kinkArr[k]));
}
$category.append($group);
}
$('#InputList').append($category);
}
$('#InputList').find('button.choice').on('click', function(){
location.hash = inputKinks.updateHash();
});
inputKinks.parseHash();
$('#Export').on('click', inputKinks.export);
$('#URL').on('click', function(){ this.select(); })
},
hashChars: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.=+*^!@",
maxPow: function(base, maxVal) {
var maxPow = 1;
for(var pow = 1; Math.pow(base, pow) <= maxVal; pow++){
maxPow = pow;
}
return maxPow;
},
prefix: function(input, len, char){
while(input.length < len) {
input = char + input;
}
return input;
},
exportData: {
positions: {
'Bodies': [[10, 80]],
'Clothing': [[10, 285]],
'Groupings': [[10, 550]],
'General': [[260, 100]],
'Ass play': [[260, 630]],
'Kinks, BDSM': [[510, 100], [760, 100], [760, 465]],
'Pain': [[1010, 100]],
'Extreme': [[1010, 505]]
}
},
drawLegend: function(context){
context.font = "bold 13px Arial";
context.fillStyle = '#000000';
var levels = Object.keys(colors);
for(var i = 0; i < levels.length; i++) {
context.beginPath();
context.arc(480 + (i * 120), 20, 8, 0, 2 * Math.PI, false);
context.strokeStyle = '#000000'
context.lineWidth = 1;
context.stroke();
context.fillStyle = colors[levels[i]];
context.fill();
context.fillStyle = '#000000';
context.fillText(levels[i], 495 + (i * 120), 25);
}
},
export: function(){
$('#Loading').fadeIn();
$('#URL').fadeOut();
var username = '(' + prompt("Please enter your name") + ')';
if(username === '()') username = '';
var canvas = document.createElement('canvas');
canvas.width = 1200;
canvas.height = 750;
//$('body').append($(canvas));
var context = canvas.getContext('2d');
context.fillStyle = '#FFFFFF';
context.fillRect(0, 0, context.width, context.height);
context.font = "bold 24px Arial";
context.fillStyle = '#000000';
context.fillText('Kinklist ' + username, 5, 25);
inputKinks.drawLegend(context);
$('#InputList .kinkCategory').each(function(){
var $cat = $(this);
var category = $cat.data('category');
var titleX = inputKinks.exportData.positions[category][0][0];
var titleY = inputKinks.exportData.positions[category][0][1] - 45;
context.fillStyle = '#000000';
if(kinks[category].fields.length > 1) {
var fieldsStr = kinks[category].fields.join(', ');
var subTitleX = titleX;
var subTitleY = titleY + 20;
context.font = "italic 12px Arial";
context.fillText(fieldsStr, subTitleX, subTitleY);
}
else {
titleY += 20;
}
context.font = "bold 18px Arial";
context.fillText(category, titleX, titleY);
var grpId = 0;
// Everything inside gets small font
context.font = "12px Arial";
$cat.find('.kinkGroup').each(function(){
var $grp = $(this);
var rowId = 0;
$grp.find('.kinkRow').each(function(){
var $kinkRow = $(this);
var grpPos = inputKinks.exportData.positions[category][grpId];
var pos = [grpPos[0], grpPos[1] + (rowId * 25)];
var kink = $kinkRow.data('kink');
var $fields = $kinkRow.find('.choices');
$fields.each(function(){
var $field = $(this);
var field = $field.data('field');
var fieldIndex = $field.closest('td').index();
var level = $field.find('.selected').data('level');
if(!level) level = "Not entered";
context.beginPath();
context.arc(pos[0] + 10 + (fieldIndex * 20), pos[1] - 4, 8, 0, 2 * Math.PI, false);
context.stroke();
context.fillStyle = colors[level];
context.fill();
});
context.fillStyle = '#000000';
context.fillText(kink,pos[0] + 5 + ($fields.length * 20),pos[1]);
rowId++;
});
grpId++;
});
});
// canvas
// Send to imgur
$.ajax({
url: 'https://api.imgur.com/3/image',
type: 'POST',
headers: {
// Your application gets an imgurClientId from Imgur
Authorization: 'Client-ID ' + imgurClientId,
Accept: 'application/json'
},
data: {
// convert the image data to base64
image: canvas.toDataURL().split(',')[1],
type: 'base64'
},
success: function(result) {
$('#Loading').hide();
var url = 'https://i.imgur.com/' + result.data.id + '.png';
$('#URL').val(url).fadeIn();
}
});
},
encode: function(base, input){
var hashBase = inputKinks.hashChars.length;
var outputPow = inputKinks.maxPow(hashBase, Number.MAX_SAFE_INTEGER);
var inputPow = inputKinks.maxPow(base, Math.pow(hashBase, outputPow));
var output = "";
var numChunks = Math.ceil(input.length / inputPow);
var inputIndex = 0;
for(var chunkId = 0; chunkId < numChunks; chunkId++) {
var inputIntValue = 0;
for(var pow = 0; pow < inputPow; pow++) {
var inputVal = input[inputIndex++];
if(typeof inputVal === "undefined") break;
var val = inputVal * Math.pow(base, pow);
inputIntValue += val;
}
var inputIntValueCopy = inputIntValue;
var outputCharValue = "";
while(inputIntValue > 0) {
var maxPow = Math.floor(log(inputIntValue, hashBase));
var powVal = Math.pow(hashBase, maxPow);
var charInt = Math.floor(inputIntValue / powVal);
var subtract = charInt * powVal;
var char = inputKinks.hashChars[charInt];
outputCharValue += char;
inputIntValue -= subtract;
}
var chunk = inputKinks.prefix(outputCharValue, outputPow, inputKinks.hashChars[0]);
output += chunk;
}
return output;
},
decode: function(base, output){
var hashBase = inputKinks.hashChars.length;
var outputPow = inputKinks.maxPow(hashBase, Number.MAX_SAFE_INTEGER);
var values = [];
var numChunks = Math.max(output.length / outputPow)
for(var i = 0; i < numChunks; i++){
var chunk = output.substring(i * outputPow, (i + 1) * outputPow);
var chunkValues = inputKinks.decodeChunk(base, chunk);
for(var j = 0; j < chunkValues.length; j++) {
values.push(chunkValues[j]);
}
}
return values;
},
decodeChunk: function(base, chunk){
var hashBase = inputKinks.hashChars.length;
var outputPow = inputKinks.maxPow(hashBase, Number.MAX_SAFE_INTEGER);
var inputPow = inputKinks.maxPow(base, Math.pow(hashBase, outputPow));
var chunkInt = 0;
for(var i = 0; i < chunk.length; i++) {
var char = chunk[i];
var charInt = inputKinks.hashChars.indexOf(char);
var pow = chunk.length - 1 - i;
var intVal = Math.pow(hashBase, pow) * charInt;
chunkInt += intVal;
}
var chunkIntCopy = chunkInt;
var output = [];
for(var pow = inputPow - 1; pow >= 0; pow--) {
var posBase = Math.floor(Math.pow(base, pow));
var posVal = Math.floor(chunkInt / posBase);
var subtract = posBase * posVal;
output.push(posVal);
chunkInt -= subtract;
}
output.reverse();
return output;
},
updateHash: function(){
var hashValues = [];
$('#InputList .choices').each(function(){
var $this = $(this);
var lvlInt = $this.find('.selected').data('levelInt');
if(!lvlInt) lvlInt = 0;
hashValues.push(lvlInt);
});
return inputKinks.encode(Object.keys(colors).length, hashValues);
},
parseHash: function(){
var hash = location.hash.substring(1);
if(hash.length < 10) return;
var values = inputKinks.decode(Object.keys(colors).length, hash);
var valueIndex = 0;
$('#InputList .choices').each(function(){
var $this = $(this);
var value = values[valueIndex++];
$this.children().eq(value).addClass('selected');
});
}
};
inputKinks.init();
window.inputKinks = inputKinks;
});
</script>
</body>
</html>