-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
255 lines (221 loc) · 7.72 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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
rel="stylesheet">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BDSM test to political compass</title>
<link rel="stylesheet" href="./style.css">
<script type="module" src="./index.js"></script>
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="BDSM test to political compass">
<meta name="twitter:description"
content="Get your political compass from your BDSM test. Actually based on research data.">
<meta name="twitter:creator" content="@angelsflyinhell">
<meta name="twitter:image" content="">
<meta name="twitter:domain" content="https://angelsflyinhell.github.io/bdsmcompass">
</head>
<body>
<!-- navbar -->
<nav class="navbar">
<div class="container">
<a
href="https://twitter.com/intent/tweet?text=I just got my my political orientation from my BDSM test.%0A%0AGet your own results here:%0Ahttps://angelsflyinhell.github.io/bdsmcompass"
>Share on Twitter</a>
<a href="https://github.com/angelsflyinhell/bdsmcompass">GitHub</a>
</div>
</nav>
<!-- main content -->
<div class="main">
<div class="content">
<h1>Get your political compass from your BDSM test.</h1>
<p>Results are based on <a href="https://knowingless.com/2021/10/26/political-compass-fetishes/amp/">data from knowingless.com</a>. To get started, get your BDSM test from <a
href="https://bdsmtest.org">bdsmtest.org</a> and paste your result <b>as text</b> into the box
below.</p>
</div>
<div class="form">
<form id="form">
<!-- optional select input-->
<div class="datapool">
<p>Select a data pool for higher accuracy results.</p>
<select name="datapool" id="datapool">
<option value="combined">Combined</option>
<option value="male">Male</option>
<option value="female">Female</option>
</select>
</div>
<!-- bdsm text data -->
<textarea name="bdsm" id="bdsm" cols="30" rows="10" placeholder="Paste your BDSM test result here"
required></textarea>
<!-- submit button -->
<button type="submit">Submit</button>
</form>
<h6>Entered data does not leave your device. We do not save or store any data. Source code available on <a
href="https://github.com/angelsflyinhell/bdsmcompass">GitHub</a>.</h6>
</div>
<!-- results -->
<div class="results" style="display: none;" id="results">
<h1>Results</h1>
<p>
Here's your estimated political orientation based on your <a
href="https://bdsmtest.org">bdsmtest.org</a> results.
Please note, that this tool is only meant for fun and is not meant to be taken seriously.
While the data is generally based on a study, a real connection between BDSM and political orientation
is not proven.
</p>
<!-- political compass render -->
<canvas id="political-compass" style="max-width: 512px; max-height: 512px;" width="1024"
height="1024"></canvas>
<div class="buttons">
<button id="download" onclick="downloadCanvasAsPNG()">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor"
style="width: 20px; height: 20px; margin-right: 10px; margin-bottom: 2px;">
<path stroke-linecap="round" stroke-linejoin="round"
d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3" />
</svg>
Save</button>
</div>
</div>
</div>
</body>
<script>
function downloadCanvasAsPNG() {
console.log("download");
var canvas = document.getElementById("political-compass");
var image = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
var link = document.createElement('a');
link.download = "political-compass.png";
link.href = image;
link.click();
}
</script>
<style>
@media (min-width: 768px) {
body {
max-width: 768px;
margin: 0 auto;
}
}
.navbar {
width: 100%;
top: 0;
left: 0;
padding: 20px 0;
z-index: 9999;
background: #fff;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
max-width: 100%;
}
.navbar .container {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
}
.navbar a {
font-size: 18px;
font-weight: 500;
color: #000;
text-decoration: none;
}
.main {
height: 100vh;
padding: 0 20px;
}
.form {
margin-top: 50px;
}
.form form {
display: flex;
flex-direction: column;
}
.form .datapool {
display: flex;
flex-direction: column;
margin-bottom: 20px;
}
.form .datapool p {
margin-bottom: 0px;
font-size: small;
color: #6b6b6b;
}
.form .datapool select {
padding: 10px;
border: 1px solid #000;
border-radius: 5px;
margin-bottom: 20px;
font-size: 16px;
font-family: 'Poppins', sans-serif;
}
.form textarea::placeholder {
font-family: 'Poppins', sans-serif;
}
.form textarea {
height: 200px;
padding: 10px;
border: 1px solid #000;
border-radius: 5px;
margin-bottom: 20px;
font-size: 16px;
font-family: 'Poppins', sans-serif;
resize: none;
}
.form button {
padding: 10px 20px;
border: 1px solid;
border-radius: 5px;
background: #932aef;
color: #fff;
font-size: 16px;
font-family: 'Poppins', sans-serif;
cursor: pointer;
}
.results {
margin-top: 50px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding-bottom: 50px;
}
.results canvas {
border-radius: 5px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}
/* rescale canvas to be responsive for smaller screens */
@media (max-width: 768px) {
.results canvas {
width: 100%;
height: auto;
}
}
.results .buttons {
margin-top: 20px;
display: flex;
flex-direction: row;
gap: 20px;
margin-left: 20px;
}
.results .buttons button {
height: 40px;
width: 150px;
padding: 10px 20px;
border: 1px solid;
border-radius: 5px;
background: #932aef;
color: #fff;
font-size: 16px;
font-family: 'Poppins', sans-serif;
cursor: pointer;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
</style>
</html>