Skip to content

Commit 514131b

Browse files
committed
added ecology vs industry
1 parent 27e3480 commit 514131b

File tree

11 files changed

+85
-22
lines changed

11 files changed

+85
-22
lines changed

ideologies.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ ideologies = [
66
"b": 50,
77
"c": 50,
88
"d": 50,
9-
"e": 50
9+
"e": 50,
10+
"f": 50
1011
}
1112
}
1213
];

index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h2>What is LeftValues?</h2>
2525
There are <b><u><span id="numOfQuestions"></span></u></b> questions in the test.</p>
2626

2727
<h2>What are the values?</h2>
28-
<p>There are currently five axes, each of which has two opposing values. They are:</p>
28+
<p>There are currently six axes, each of which has two opposing values. They are:</p>
2929
<p class="value-description"><b style="color:#890000;">Revolution</b> <b>vs.</b> <b style="color:#FC5959;">Reform</b><br/>
3030
Those with a higher revolution score tend to support a radical and rapid overthrow of the capitalist system through a mass uprising. Those with a higher reform score tend to favor inducing gradual changes within capitalist structures, such as liberal democracy, with the eventual goal of reaching socialism.</p>
3131
<p class="value-description"><b style="color:#88232B;">Scientific</b> <b>vs.</b> <b style="color:#7F0037;">Utopian</b><br/>
@@ -36,6 +36,8 @@ <h2>What are the values?</h2>
3636
Those with a higher international score tend to support forming an international socialist movement, often with the eventual goal of abolishing nations. Those with a higher national score tend to prioritize building socialism within existing borders and reject the goal of a world socialist republic.</p>
3737
<p class="value-description"><b style="color:#963B33;">Party</b> <b>vs.</b> <b style="color:#7F333B;">Union</b><br/>
3838
Those with a higher party score tend to support using political parties as the basis of a socialist movement. Those with a higher union score tend to support using trade unions and other forms of mass organization as a basis of a socialist movement.</p>
39+
<p class="value-description"><b style="color:#804E00;">Industry</b> <b>vs.</b> <b style="color:#586808;">Ecology</b><br/>
40+
Those with a higher industry score tend to prioritize industrial development and self-sustainability over ecological goals. Those with a higher ecological score tend to support an environmentally oriented economy with strict ecological protections.</p>
3941
<h2>What's the "Closest Match" mean at the bottom of the results?</h2>
4042
<p>Similar to 8values, this quiz will attempt to match you with a specific leftist ideology. Some of the more minor ideologies may not be present. This is work in progress, so suggestions are welcome.</p>
4143
<h2>I don't like my scores!</h2>

questions.js

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ questions = [
77
"b": 0,
88
"c": 0,
99
"d": 0,
10-
"e": 0
10+
"e": 0,
11+
"f": 0
1112
}
1213
},
1314
{
@@ -17,7 +18,8 @@ questions = [
1718
"b": 0,
1819
"c": 0,
1920
"d": 0,
20-
"e": 0
21+
"e": 0,
22+
"f": 0
2123
},
2224
},
2325
{
@@ -27,7 +29,8 @@ questions = [
2729
"b": 0,
2830
"c": 0,
2931
"d": 0,
30-
"e": 0
32+
"e": 0,
33+
"f": 0
3134
}
3235
},
3336
{
@@ -37,7 +40,8 @@ questions = [
3740
"b": 0,
3841
"c": 0,
3942
"d": 0,
40-
"e": 0
43+
"e": 0,
44+
"f": 0
4145
}
4246
},
4347
{
@@ -47,7 +51,8 @@ questions = [
4751
"b": 0,
4852
"c": 0,
4953
"d": 0,
50-
"e": 0
54+
"e": 0,
55+
"f": 0
5156
}
5257
},
5358
{
@@ -57,7 +62,8 @@ questions = [
5762
"b": 0,
5863
"c": 0,
5964
"d": 0,
60-
"e": 0
65+
"e": 0,
66+
"f": 0
6167
}
6268
},
6369
{
@@ -67,7 +73,8 @@ questions = [
6773
"b": 0,
6874
"c": 0,
6975
"d": 0,
70-
"e": 0
76+
"e": 0,
77+
"f": 0
7178
}
7279
},
7380
{
@@ -77,7 +84,8 @@ questions = [
7784
"b": 0,
7885
"c": 0,
7986
"d": 0,
80-
"e": 0
87+
"e": 0,
88+
"f": 0
8189
}
8290
},
8391
//scientific vs utopian
@@ -88,7 +96,8 @@ questions = [
8896
"b": 10,
8997
"c": 0,
9098
"d": 0,
91-
"e": 0
99+
"e": 0,
100+
"f": 0
92101
}
93102
},
94103
{
@@ -98,7 +107,8 @@ questions = [
98107
"b": 5,
99108
"c": 0,
100109
"d": 0,
101-
"e": 0
110+
"e": 0,
111+
"f": 0
102112
}
103113
},
104114
{
@@ -108,7 +118,8 @@ questions = [
108118
"b": -10,
109119
"c": 0,
110120
"d": 0,
111-
"e": 0
121+
"e": 0,
122+
"f": 0
112123
}
113124
},
114125
{
@@ -118,7 +129,8 @@ questions = [
118129
"b": 5,
119130
"c": 0,
120131
"d": 0,
121-
"e": 0
132+
"e": 0,
133+
"f": 0
122134
}
123135
},
124136
{
@@ -128,7 +140,8 @@ questions = [
128140
"b": 10,
129141
"c": 0,
130142
"d": 0,
131-
"e": 0
143+
"e": 0,
144+
"f": 0
132145
}
133146
},
134147
{
@@ -138,7 +151,8 @@ questions = [
138151
"b": 5,
139152
"c": 0,
140153
"d": 0,
141-
"e": 0
154+
"e": 0,
155+
"f": 0
142156
}
143157
},
144158
{
@@ -148,7 +162,8 @@ questions = [
148162
"b": -10,
149163
"c": 0,
150164
"d": 0,
151-
"e": 0
165+
"e": 0,
166+
"f": 0
152167
}
153168
},
154169
{
@@ -158,7 +173,8 @@ questions = [
158173
"b": -10,
159174
"c": 0,
160175
"d": 0,
161-
"e": 0
176+
"e": 0,
177+
"f": 0
162178
}
163179
}
164180
];

quiz.html

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ <h2 style="text-align:center;" id="question-number">Loading...</h2>
4848

4949
<!-- JavaScript for the test itself -->
5050
<script>
51-
var max_a, max_b, max_c, max_d; // Max possible scores
52-
max_a = max_b = max_c = max_d = 0;
51+
var max_a, max_b, max_c, max_d, max_e, max_f; // Max possible scores
52+
max_a = max_b = max_c = max_d = max_e = max_f = 0;
5353
var a, b, c, d; // User's scores
54-
a = b = c = d = 0;
54+
a = b = c = d = e = f = 0;
5555
var qn = 0; // Question number
5656
var prev_answer = null;
5757
init_question();
@@ -60,6 +60,8 @@ <h2 style="text-align:center;" id="question-number">Loading...</h2>
6060
max_b += Math.abs(questions[i].effect.b)
6161
max_c += Math.abs(questions[i].effect.c)
6262
max_d += Math.abs(questions[i].effect.d)
63+
max_e += Math.abs(questions[i].effect.e)
64+
max_f += Math.abs(questions[i].effect.f)
6365
}
6466
function init_question() {
6567
document.getElementById("question-text").innerHTML = questions[qn].question;
@@ -79,6 +81,8 @@ <h2 style="text-align:center;" id="question-number">Loading...</h2>
7981
b += mult*questions[qn].effect.b
8082
c += mult*questions[qn].effect.c
8183
d += mult*questions[qn].effect.d
84+
e += mult*questions[qn].effect.e
85+
f += mult*questions[qn].effect.f
8286
qn++;
8387
prev_answer = mult;
8488
if (qn < questions.length) {
@@ -96,6 +100,8 @@ <h2 style="text-align:center;" id="question-number">Loading...</h2>
96100
b -= prev_answer * questions[qn].effect.b;
97101
c -= prev_answer * questions[qn].effect.c;
98102
d -= prev_answer * questions[qn].effect.d;
103+
e -= prev_answer * questions[qn].effect.e;
104+
f -= prev_answer * questions[qn].effect.f;
99105
prev_answer = null;
100106
init_question();
101107

@@ -109,6 +115,8 @@ <h2 style="text-align:center;" id="question-number">Loading...</h2>
109115
+ `&b=${calc_score(b,max_b)}`
110116
+ `&c=${calc_score(c,max_c)}`
111117
+ `&d=${calc_score(d,max_d)}`
118+
+ `&e=${calc_score(e,max_e)}`
119+
+ `&f=${calc_score(f,max_f)}`
112120
}
113121
</script>
114122
</body>

results.html

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,17 @@ <h2><span class="weight-300" id="e-label"></span></h2>
5151
<div class="bar union" id="bar-union"><div class="text-wrapper" id="union"></div></div>
5252
<img id="img-union" src="value_images/union.png" height="128pt"/>
5353
</div>
54+
<h2><span class="weight-300" id="f-label"></span></h2>
55+
<div class="axis">
56+
<img id="img-industry" src="value_images/industry.png" height="128pt"/>
57+
<div class="bar industry" id="bar-industry"><div class="text-wrapper" id="industry"></div></div>
58+
<div class="bar ecology" id="bar-ecology"><div class="text-wrapper" id="ecology"></div></div>
59+
<img id="img-ecology" src="value_images/ecology.png" height="128pt"/>
60+
</div>
5461
<h2>Closest Match: <span class="weight-300" id="ideology-label"></span></h2>
5562
<p>You can send these results by copying and pasting the URL at the top of the page or using the image below.</p>
5663
<hr/>
57-
<canvas id="banner" width=800 height=800 style="font-family:Montserrat"></canvas>
64+
<canvas id="banner" width=800 height=900 style="font-family:Montserrat"></canvas>
5865
<button class="button" onclick="location.href='index.html';" style="background-color: #2196f3;">Back</button> <br>
5966
<!-- Website visit statistics - no personal information is collected! -->
6067
<script type="text/javascript">
@@ -99,6 +106,7 @@ <h2>Closest Match: <span class="weight-300" id="ideology-label"></span></h2>
99106
cArray = ["Extremely Pro-Centralization","Pro-Centralization","Moderately Pro-Centralization","Balanced","Moderately Pro-Decentralization","Pro-Decentralization","Extremely Pro-Decentralization"]
100107
dArray = ["Extremely Internationalist","Internationalist","Moderately Internationalist","Neutral","Moderately Nationalist","Nationalist","Extremely Nationalist"]
101108
eArray = ["Extremely Pro-Party","Pro-Party","Moderately Pro-Party","Indifferent","Moderately Pro-Union","Pro-Union","Extremely Pro-Union"]
109+
fArray = ["Extremely Industrial","Industrial","Moderately Industrial","Indifferent","Moderately Ecological","Ecological","Extremely Ecological"]
102110

103111
function setLabel(val,ary) {
104112
if (val > 100) { return "" } else
@@ -117,11 +125,13 @@ <h2>Closest Match: <span class="weight-300" id="ideology-label"></span></h2>
117125
central = getQueryVariable("c")
118126
international = getQueryVariable("d")
119127
party = getQueryVariable("e")
128+
industry = getQueryVariable("f")
120129
reform = (100 - revolution).toFixed(1)
121130
utopian = (100 - scientific ).toFixed(1)
122131
decentral = (100 - central ).toFixed(1)
123132
national = (100 - international).toFixed(1)
124133
union = (100 - party).toFixed(1)
134+
ecology = (100 - industry).toFixed(1)
125135

126136
setBarValue("revolution", revolution)
127137
setBarValue("reform", reform)
@@ -133,12 +143,15 @@ <h2>Closest Match: <span class="weight-300" id="ideology-label"></span></h2>
133143
setBarValue("international", international)
134144
setBarValue("party", party)
135145
setBarValue("union", union)
146+
setBarValue("industry", industry)
147+
setBarValue("ecology", ecology)
136148

137149
document.getElementById("a-label").innerHTML = setLabel(revolution, aArray)
138150
document.getElementById("b-label").innerHTML = setLabel(scientific, bArray)
139151
document.getElementById("c-label").innerHTML = setLabel(central, cArray)
140152
document.getElementById("d-label").innerHTML = setLabel(international, dArray)
141153
document.getElementById("e-label").innerHTML = setLabel(party, eArray)
154+
document.getElementById("f-label").innerHTML = setLabel(industry, fArray)
142155

143156
ideology = ""
144157
ideodist = Infinity
@@ -149,6 +162,7 @@ <h2>Closest Match: <span class="weight-300" id="ideology-label"></span></h2>
149162
dist += Math.pow(Math.abs(ideologies[i].stats.b - scientific), 1.73856063)
150163
dist += Math.pow(Math.abs(ideologies[i].stats.d - international), 1.73856063)
151164
dist += Math.pow(Math.abs(ideologies[i].stats.e - party), 1.73856063)
165+
dist += Math.pow(Math.abs(ideologies[i].stats.f - industry), 1.73856063)
152166
if (dist < ideodist) {
153167
ideology = ideologies[i].name
154168
ideodist = dist
@@ -190,13 +204,18 @@ <h2>Closest Match: <span class="weight-300" id="ideology-label"></span></h2>
190204
ctx.drawImage(img, 20, 650, 100, 100)
191205
img = document.getElementById("img-union")
192206
ctx.drawImage(img, 680, 650, 100, 100)
207+
img = document.getElementById("img-industry")
208+
ctx.drawImage(img, 20, 770, 100, 100)
209+
img = document.getElementById("img-ecology")
210+
ctx.drawImage(img, 680, 770, 100, 100)
193211

194212
ctx.fillStyle="#222222"
195213
ctx.fillRect(120, 180, 560, 80)
196214
ctx.fillRect(120, 300, 560, 80)
197215
ctx.fillRect(120, 420, 560, 80)
198216
ctx.fillRect(120, 540, 560, 80)
199217
ctx.fillRect(120, 660, 560, 80)
218+
ctx.fillRect(120, 780, 560, 80)
200219
ctx.fillStyle="#890000"
201220
ctx.fillRect(120, 184, 5.6*revolution-2, 72)
202221
ctx.fillStyle="#FC5959"
@@ -217,6 +236,10 @@ <h2>Closest Match: <span class="weight-300" id="ideology-label"></span></h2>
217236
ctx.fillRect(120, 664, 5.6*party-2, 72)
218237
ctx.fillStyle="#7F333B"
219238
ctx.fillRect(682-5.6*union, 664, 5.6*union-2, 72)
239+
ctx.fillStyle="#804E00"
240+
ctx.fillRect(120, 784, 5.6*industry-2, 72)
241+
ctx.fillStyle="#586808"
242+
ctx.fillRect(682-5.6*ecology, 784, 5.6*ecology-2, 72)
220243
ctx.fillStyle="#222222"
221244
ctx.font="700 80px Montserrat"
222245
ctx.textAlign="left"
@@ -230,12 +253,14 @@ <h2>Closest Match: <span class="weight-300" id="ideology-label"></span></h2>
230253
if (central > 30) {ctx.fillText(central + "%", 130, 477.5)}
231254
if (international > 30) {ctx.fillText(international + "%", 130, 597.5)}
232255
if (party > 30) {ctx.fillText(party + "%", 130, 717.5)}
256+
if (industry > 30) {ctx.fillText(industry + "%", 130, 837.5)}
233257
ctx.textAlign="right"
234258
if (reform > 30) {ctx.fillText(reform + "%", 670, 237.5)}
235259
if (utopian > 30) {ctx.fillText(utopian + "%", 670, 357.5)}
236260
if (decentral > 30) {ctx.fillText(decentral + "%", 670, 477.5)}
237261
if (national > 30) {ctx.fillText(national + "%", 670, 597.5)}
238262
if (union > 30) {ctx.fillText(union + "%", 670, 717.5)}
263+
if (ecology > 30) {ctx.fillText(ecology + "%", 670, 837.5)}
239264

240265
ctx.font="300 30px Montserrat"
241266
ctx.fillText("leftvalues.github.io", 780, 60)
@@ -245,6 +270,7 @@ <h2>Closest Match: <span class="weight-300" id="ideology-label"></span></h2>
245270
ctx.fillText("" + document.getElementById("c-label").innerHTML, 400, 415)
246271
ctx.fillText("" + document.getElementById("d-label").innerHTML, 400, 535)
247272
ctx.fillText("" + document.getElementById("e-label").innerHTML, 400, 655)
273+
ctx.fillText("" + document.getElementById("f-label").innerHTML, 400, 775)
248274
}
249275
</script>
250276
</body>

style.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,16 @@ div.union {
189189
text-align: right;
190190
border-left-style: solid;
191191
}
192+
div.industry {
193+
background-color: #804E00;
194+
text-align: left;
195+
border-right-style: solid;
196+
}
197+
div.ecology {
198+
background-color: #586808;
199+
text-align: right;
200+
border-left-style: solid;
201+
}
192202
span.weight-300 {
193203
font-weight: 300;
194204
}

value_images/ecology.png

6.35 KB
Loading

value_images/icons.pdn

8.78 KB
Binary file not shown.

value_images/industry.png

5.04 KB
Loading

values.pdn

6.26 KB
Binary file not shown.

0 commit comments

Comments
 (0)