-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
77 lines (63 loc) · 2.42 KB
/
script.js
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
M.AutoInit();
M.toast({
html: "Nope, we do not use cookies, you don't need to agree to shit, thanks for using our service",
});
var thicknessSelector = document.getElementById('thickness-slider');
var lengthSelector = document.getElementById('length-slider');
var hardnessSelector = document.getElementById('hardness-slider');
var thicknessOutput = document.getElementById('thicknessOutput');
var lengthOutput = document.getElementById('lengthOutput');
var hardnessOutput = document.getElementById('hardnessOutput');
var thicknessNumber = document.getElementById('thickness-number');
var lengthNumber = document.getElementById('length-number');
var hardnessNumber = document.getElementById('hardness-number');
var tweetNow = document.getElementById('tweet-now');
var thickness = 0;
var length = 0;
var hardness = 0;
const selector = '█';
const background = '░';
thicknessOutput.innerText = calculateBar(thickness);
lengthOutput.innerText = calculateBar(length);
hardnessOutput.innerText = calculateBar(hardness);
tweetNow.href = buildTweet();
thicknessNumber.innerText = thickness;
lengthNumber.innerText = length;
hardnessNumber.innerText = hardness;
thicknessSelector.addEventListener('input', (e) => {
thickness = thicknessSelector.value;
thicknessOutput.innerText = calculateBar(thickness);
tweetNow.href = buildTweet();
thicknessNumber.innerText = thickness;
});
lengthSelector.addEventListener('input', (e) => {
length = lengthSelector.value;
lengthOutput.innerText = calculateBar(length);
tweetNow.href = buildTweet();
lengthNumber.innerText = length;
});
hardnessSelector.addEventListener('input', (e) => {
hardness = hardnessSelector.value;
hardnessOutput.innerText = calculateBar(hardness);
tweetNow.href = buildTweet();
hardnessNumber.innerText = hardness;
});
function calculateBar(number) {
var result = '';
for (let i = 0; i <= 10; i++) {
result += i == number ? selector : background;
}
return result;
}
function buildTweet() {
var result =
'https://twitter.com/intent/tweet?text=(っ◔◡◔)っ ♥ desired %23PeePeeSettings ♥%0A%0A';
result += 'thiccness:%0A';
result += calculateBar(thickness) + '%0A';
result += 'length:%0A';
result += calculateBar(length) + '%0A';
result += 'hardness:%0A';
result += calculateBar(hardness) + '%0A%0A';
result += 'Make your own with https://ppsettings.codingneko.com';
return result;
}