@@ -18,36 +18,37 @@ <h1>Results</h1>
18
18
19
19
< h2 > Economic Axis: < span class ="weight-300 " id ="economic-label "> </ span > </ h2 >
20
20
< div class ="axis ">
21
- < img src ="value_images/equality.svg " height ="128pt "/>
21
+ < img id =" img-equality " src ="value_images/equality.svg " height ="128pt "/>
22
22
< div class ="bar equality " id ="bar-equality "> < div class ="text-wrapper " id ="equality "> </ div > </ div >
23
23
< div class ="bar wealth " id ="bar-wealth "> < div class ="text-wrapper " id ="wealth "> </ div > </ div >
24
- < img src ="value_images/wealth.svg " height ="128pt "/>
24
+ < img id =" img-wealth " src ="value_images/wealth.svg " height ="128pt "/>
25
25
</ div >
26
26
< h2 > Diplomatic Axis: < span class ="weight-300 " id ="diplomatic-label "> </ span > </ h2 >
27
27
< div class ="axis ">
28
- < img src ="value_images/might.svg " height ="128pt "/>
28
+ < img id =" img-might " src ="value_images/might.svg " height ="128pt "/>
29
29
< div class ="bar might " id ="bar-might "> < div class ="text-wrapper " id ="might "> </ div > </ div >
30
30
< div class ="bar peace " id ="bar-peace "> < div class ="text-wrapper " id ="peace "> </ div > </ div >
31
- < img src ="value_images/peace.svg " height ="128pt "/>
31
+ < img id =" img-peace " src ="value_images/peace.svg " height ="128pt "/>
32
32
</ div >
33
- < h2 > State Axis: < span class ="weight-300 " id ="state-label "> </ span > </ h2 >
33
+ < h2 > Civil Axis: < span class ="weight-300 " id ="state-label "> </ span > </ h2 >
34
34
< div class ="axis ">
35
- < img src ="value_images/liberty.svg " height ="128pt "/>
35
+ < img id =" img-liberty " src ="value_images/liberty.svg " height ="128pt "/>
36
36
< div class ="bar liberty " id ="bar-liberty "> < div class ="text-wrapper " id ="liberty "> </ div > </ div >
37
37
< div class ="bar authority " id ="bar-authority "> < div class ="text-wrapper " id ="authority "> </ div > </ div >
38
- < img src ="value_images/authority.svg " height ="128pt "/>
38
+ < img id =" img-authority " src ="value_images/authority.svg " height ="128pt "/>
39
39
</ div >
40
- < h2 > Society Axis: < span class ="weight-300 " id ="society-label "> </ span > </ h2 >
40
+ < h2 > Societal Axis: < span class ="weight-300 " id ="society-label "> </ span > </ h2 >
41
41
< div class ="axis ">
42
- < img src ="value_images/tradition.svg " height ="128pt "/>
42
+ < img id =" img-tradition " src ="value_images/tradition.svg " height ="128pt "/>
43
43
< div class ="bar tradition " id ="bar-tradition "> < div class ="text-wrapper " id ="tradition "> </ div > </ div >
44
44
< div class ="bar progress " id ="bar-progress "> < div class ="text-wrapper " id ="progress "> </ div > </ div >
45
- < img src ="value_images/progress.svg " height ="128pt "/>
45
+ < img id =" img-progress " src ="value_images/progress.svg " height ="128pt "/>
46
46
</ div >
47
47
< h2 > Closest Match: < span class ="weight-300 " id ="ideology-label "> </ span > </ h2 >
48
48
< p > Ideological matching is a work in progress, and is much less accurate than the values and axes.</ p >
49
- < p > You can send these results by copying and pasting the URL at the top of the page. Think your matched ideology was wrong? Want to help us calibrate the test? Send the results along with your political ideology to us at
[email protected] , or send us any comments, questions, or criticism.
</ p >
49
+ < p > You can send these results by copying and pasting the URL at the top of the page
or using the image below . Think your matched ideology was wrong? Want to help us calibrate the test? Send the results along with your political ideology to us at
[email protected] , or send us any comments, questions, or criticism.
</ p >
50
50
< hr />
51
+ < canvas id ="banner " width =800 height =600 > </ canvas >
51
52
< button class ="button " onclick ="location.href='index.html'; " style ="background-color: #2196f3; "> Back</ button > < br >
52
53
< script >
53
54
function getQueryVariable ( variable )
@@ -125,5 +126,84 @@ <h2>Closest Match: <span class="weight-300" id="ideology-label"></span></h2>
125
126
}
126
127
}
127
128
document . getElementById ( "ideology-label" ) . innerHTML = ideology
129
+
130
+ function createImage ( src , x , y , w , h ) {
131
+ img = new Image ( )
132
+ img . src = src
133
+ img . onLoad = function ( ) {
134
+ ctx . drawImage ( img , x , y , w , h )
135
+ }
136
+ }
137
+ var c = document . getElementById ( "banner" )
138
+ var ctx = c . getContext ( "2d" )
139
+ ctx . fillStyle = "#EEEEEE"
140
+ ctx . fillRect ( 0 , 0 , 800 , 600 )
141
+ window . onload = function ( ) {
142
+ img = document . getElementById ( "img-equality" )
143
+ ctx . drawImage ( img , 20 , 120 , 100 , 100 ) ;
144
+ img = document . getElementById ( "img-wealth" )
145
+ ctx . drawImage ( img , 680 , 120 , 100 , 100 )
146
+ img = document . getElementById ( "img-might" )
147
+ ctx . drawImage ( img , 20 , 240 , 100 , 100 )
148
+ img = document . getElementById ( "img-peace" )
149
+ ctx . drawImage ( img , 680 , 240 , 100 , 100 )
150
+ img = document . getElementById ( "img-liberty" )
151
+ ctx . drawImage ( img , 20 , 360 , 100 , 100 )
152
+ img = document . getElementById ( "img-authority" )
153
+ ctx . drawImage ( img , 680 , 360 , 100 , 100 )
154
+ img = document . getElementById ( "img-tradition" )
155
+ ctx . drawImage ( img , 20 , 480 , 100 , 100 )
156
+ img = document . getElementById ( "img-progress" )
157
+ ctx . drawImage ( img , 680 , 480 , 100 , 100 )
158
+ }
159
+
160
+ ctx . fillStyle = "#222222"
161
+ ctx . fillRect ( 120 , 130 , 560 , 80 )
162
+ ctx . fillRect ( 120 , 250 , 560 , 80 )
163
+ ctx . fillRect ( 120 , 370 , 560 , 80 )
164
+ ctx . fillRect ( 120 , 490 , 560 , 80 )
165
+ ctx . fillStyle = "#f44336"
166
+ ctx . fillRect ( 120 , 134 , 5.6 * equality - 2 , 72 )
167
+ ctx . fillStyle = "#00897b"
168
+ ctx . fillRect ( 682 - 5.6 * wealth , 134 , 5.6 * wealth - 2 , 72 )
169
+ ctx . fillStyle = "#ff9800"
170
+ ctx . fillRect ( 120 , 254 , 5.6 * might - 2 , 72 )
171
+ ctx . fillStyle = "#03a9f4"
172
+ ctx . fillRect ( 682 - 5.6 * peace , 254 , 5.6 * peace - 2 , 72 )
173
+ ctx . fillStyle = "#ffeb3b"
174
+ ctx . fillRect ( 120 , 374 , 5.6 * liberty - 2 , 72 )
175
+ ctx . fillStyle = "#3f51b5"
176
+ ctx . fillRect ( 682 - 5.6 * authority , 374 , 5.6 * authority - 2 , 72 )
177
+ ctx . fillStyle = "#8bc34a"
178
+ ctx . fillRect ( 120 , 494 , 5.6 * tradition - 2 , 72 )
179
+ ctx . fillStyle = "#9c27b0"
180
+ ctx . fillRect ( 682 - 5.6 * progress , 494 , 5.6 * progress - 2 , 72 )
181
+ ctx . fillStyle = "#222222"
182
+ ctx . font = "bold 80px Montserrat" ;
183
+ ctx . textAlign = "left"
184
+ ctx . fillText ( "8values" , 20 , 90 )
185
+ ctx . font = "normal 40px Montserrat" ;
186
+ ctx . textAlign = "right"
187
+ ctx . fillText ( ideology , 780 , 90 )
188
+
189
+ ctx . font = "normal 50px Montserrat" ;
190
+ ctx . textAlign = "left"
191
+ if ( equality > 30 ) { ctx . fillText ( equality + "%" , 130 , 187.5 ) }
192
+ if ( might > 30 ) { ctx . fillText ( might + "%" , 130 , 307.5 ) }
193
+ if ( liberty > 30 ) { ctx . fillText ( liberty + "%" , 130 , 427.5 ) }
194
+ if ( tradition > 30 ) { ctx . fillText ( tradition + "%" , 130 , 547.5 ) }
195
+ ctx . textAlign = "right"
196
+ if ( wealth > 30 ) { ctx . fillText ( wealth + "%" , 670 , 187.5 ) }
197
+ if ( peace > 30 ) { ctx . fillText ( peace + "%" , 670 , 307.5 ) }
198
+ if ( authority > 30 ) { ctx . fillText ( authority + "%" , 670 , 427.5 ) }
199
+ if ( progress > 30 ) { ctx . fillText ( progress + "%" , 670 , 547.5 ) }
200
+
201
+ ctx . font = "200 30px Montserrat" ;
202
+ ctx . fillText ( "8values.github.io" , 780 , 50 )
203
+ ctx . textAlign = "center"
204
+ ctx . fillText ( "Economic Axis: " + document . getElementById ( "economic-label" ) . innerHTML , 400 , 125 )
205
+ ctx . fillText ( "Diplomatic Axis: " + document . getElementById ( "diplomatic-label" ) . innerHTML , 400 , 245 )
206
+ ctx . fillText ( "Civil Axis: " + document . getElementById ( "state-label" ) . innerHTML , 400 , 365 )
207
+ ctx . fillText ( "Societal Axis: " + document . getElementById ( "society-label" ) . innerHTML , 400 , 485 )
128
208
</ script >
129
209
</ body >
0 commit comments