Skip to content

Commit 8b8ef87

Browse files
authored
Merge pull request 8values#134 from doamatto/hover-a11y
Improve accessibility when hovering on buttons
2 parents 32657b4 + ae8a128 commit 8b8ef87

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

Diff for: instructions.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ <h1>8values</h1>
1919
<hr>
2020
<h2 style="text-align:center;">Instructions</h2>
2121
<p class="question">You will be presented with a series of statements. For each one, click the button with your opinion on it.</p>
22-
<button class="button" onclick="location.href='quiz.html';" style="background-color: #2196f3;">Got it!</button> <br>
23-
<button class="button" onclick="location.href='index.html';" style="background-color: #f44336;">Wait, nevermind!</button> <br>
22+
<button class="button" onclick="location.href='quiz.html';">Got it!</button> <br>
23+
<button class="button disagree" onclick="location.href='index.html';">Wait, nevermind!</button> <br>
2424

2525
<!-- Website visit statistics - no personal information is collected! -->
2626
<script type="text/javascript">

Diff for: quiz.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ <h1>8values</h1>
2121
<hr>
2222
<h2 style="text-align:center;" id="question-number">Loading...</h2>
2323
<p class="question" id="question-text"></p>
24-
<button class="button" onclick="next_question( 1.0)" style="background-color: #1b5e20;">Strongly Agree</button> <br>
25-
<button class="button" onclick="next_question( 0.5)" style="background-color: #4caf50;">Agree</button> <br>
26-
<button class="button" onclick="next_question( 0.0)" style="background-color: #bbbbbb;">Neutral/Unsure</button> <br>
27-
<button class="button" onclick="next_question(-0.5)" style="background-color: #f44336;">Disagree</button> <br>
28-
<button class="button" onclick="next_question(-1.0)" style="background-color: #b71c1c;">Strongly Disagree</button> <br>
24+
<button class="button stronglyAgree" onclick="next_question( 1.0)">Strongly Agree</button> <br>
25+
<button class="button agree" onclick="next_question( 0.5)">Agree</button> <br>
26+
<button class="button neutral" onclick="next_question( 0.0)">Neutral/Unsure</button> <br>
27+
<button class="button disagree" onclick="next_question(-0.5)">Disagree</button> <br>
28+
<button class="button stronglyDisagree" onclick="next_question(-1.0)">Strongly Disagree</button> <br>
2929
<button class="small_button" onclick="prev_question()" id="back_button">Back</button>
3030
<button class="small_button_off" id="back_button_off">Back</button><br>
3131

Diff for: results.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ <h2>Closest Match: <span class="weight-300" id="ideology-label"></span></h2>
5252
<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>
5353
<hr/>
5454
<img src="" id="banner">
55-
<button class="button" onclick="location.href='index.html';" style="background-color: #2196f3;">Back</button> <br>
55+
<button class="button" onclick="location.href='index.html';">Back</button> <br>
5656
<!-- Website visit statistics - no personal information is collected! -->
5757
<script type="text/javascript">
5858
var sc_project=11325211;

Diff for: style.css

+17
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@ img.center {
8888
margin: -2px auto;
8989
cursor: pointer;
9090
}
91+
.button:hover, .button:focus { background: #1687e0; }
92+
.stronglyAgree { background: #1b5e20; }
93+
.stronglyAgree:hover, .stronglyAgree:focus { background: #154a19; }
94+
.agree { background: #4caf50; }
95+
.agree:hover, .agree:focus { background: #29942e; }
96+
.neutral { background: #949494; }
97+
.neutral:hover, .neutral:focus { background: #656565; }
98+
.disagree { background: #f44336; }
99+
.disagree:hover, .disagree:focus { background: #d6271a; }
100+
.stronglyDisagree { background: #b71c1c; }
101+
.stronglyDisagree:hover, .stronglyDisagree:focus { background: #a00e0e; }
102+
91103
.small_button, .small_button_off {
92104
background-color: #333;
93105
font-family: 'Montserrat', sans-serif;
@@ -104,6 +116,11 @@ img.center {
104116
margin: -2px auto;
105117
cursor: pointer;
106118
}
119+
120+
.small_button:hover, .small_button:focus {
121+
background: #222;
122+
}
123+
107124
.small_button_off {
108125
background-color: #ddd;
109126
color: #888;

0 commit comments

Comments
 (0)