Skip to content

Commit

Permalink
in-survey accessibility enhancements (#436)
Browse files Browse the repository at this point in the history
* in-survey accessibility enhancements

* update stylesheets

* update soccer handling
  • Loading branch information
JoeArmani authored May 16, 2024
1 parent 10ca3bf commit 650fa70
Show file tree
Hide file tree
Showing 9 changed files with 1,043 additions and 505 deletions.
268 changes: 242 additions & 26 deletions ActiveLogic.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#questionnaire {
font-family: Ariel, sans-serif;
font-family: Arial, sans-serif;
height: 70%;
border: solid 2px black;
padding: 20px;
Expand All @@ -11,27 +11,25 @@

#thankYou,
.question {
margin: 10px 0px;
margin: 5px 0px;
display: none;
}

#thankYou.active,
.question.active {
padding-top: 5px;
display: block;
}

/* .previous {
float: left;
.question p {
margin-bottom: 1em;
}

.next {
float: right;
.question.active p b {
font-family: 'Monserrat', sans-serif;
font-weight: bold;
}

.submit {
float: right;
} */

/* this is an answer with a text area...*/

.freeresponse {
Expand All @@ -47,30 +45,58 @@
width: auto;
}

#loadingIndicator {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 9999;
}

.spinner {
border: 16px solid #f3f3f3;
border-top: 16px solid #3498db;
border-radius: 50%;
width: 120px;
height: 120px;
animation: spin 2s linear infinite;
}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

.freeresponse textarea,
input[type="text"] {
flex-grow: 1;
}


/* CSS for grids... */
.quest-grid{
/* CSS for grids... '.quest-grid' impacts all grids and list grids. '.quest-grid.table-layout' (increased specificity) handles the new table-based grids. */
/* CSS for ALL (list and table) Grids... */
.quest-grid {
width: 100%;
display: grid;
grid-template-columns: auto repeat(12,minmax(0px,auto));

font-family:Arial, Helvetica, sans-serif;
border-collapse: collapse;
table-layout: fixed;
font-family: Arial, Helvetica, sans-serif;
font-size: medium;
overflow-x: auto;
gap: 1px;
overflow-y: visible;
margin-top: 10px;
}

.quest-grid * {
padding: 4px;
text-align: center;
}

/* CSS for LIST grids... TODO: the list CSS is deprecated. */
.quest-grid {
display: grid;
grid-template-columns: auto repeat(12,minmax(0px,auto));
overflow-x: auto;
gap: 1px;
overflow-y: visible;
}

.quest-grid > .nr {
grid-column-start: 1;
text-align: start;
Expand All @@ -83,8 +109,6 @@ ul.quest-grid{
min-width: min-content;
}



@media screen and (min-width: 576px) {
ul.quest-grid input{
display: inline;
Expand All @@ -95,7 +119,6 @@ ul.quest-grid{
}
}


/**
I chose 576px because this matches the default breakpoint
for bootstrap -xs
Expand All @@ -105,7 +128,7 @@ for bootstrap -xs
display: block;
width:100%;
}
ul.quest-grid{
ul.quest-grid {
min-width: min-content;
list-style-type: none;
text-align: left;
Expand All @@ -128,9 +151,202 @@ for bootstrap -xs

ul.quest-grid li.nr:not(:first-child){
padding-top: 10px;
}
}

/* CSS for TABLE grids... */
.quest-grid.table-layout {
display: inline-table;
}

.quest-grid.table-layout tr {
width: auto;
display: table-row;
}

.quest-grid.table-layout th, .quest-grid.table-layout td {
padding: 5px;
text-align: center;
vertical-align: middle;
height: 50px;
position: relative;
background-color: transparent;
border: none;
}

.quest-grid.table-layout th.nr, .quest-grid.table-layout td.nr {
font-weight: bold;
text-align: left;
}

.quest-grid.table-layout input[type="radio"] {
display: none;
}

/* Additional styles to ensure the label is large enough to comfortably contain the circles */
.quest-grid.table-layout .custom-label {
position: relative;
height: 50px;
min-width: 50px;
color: transparent;
background-color: transparent;
cursor: pointer;
border: none;
outline: none;
}

/* Styling for the custom label to always have an unfilled circle */
.quest-grid.table-layout .custom-label::before {
content: '';
display: block;
width: 26px;
height: 26px;
border: 2px solid #cccccc;
border-radius: 50%; /* Circle */
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background-color: transparent;
}

.quest-grid.table-layout .custom-label:hover {
background-color: transparent;
border: none;
outline: none;
}

/* Hover effect for the label */
.quest-grid .custom-label:hover::before {
border-color: #1c5d86;
box-shadow: 0 0 8px #ccc;
}

/* Styling for when the radio button is checked */
.quest-grid.table-layout input[type="radio"]:checked + .custom-label::after {
content: '';
display: block;
width: 20px;
height: 20px;
border-radius: 50%; /* Circle */
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
background-color: #327ABB;
}

.quest-grid.table-layout input[type="radio"]:checked + .custom-label {
border: none;
background-color: transparent;
color: transparent;
}

@media screen and (min-width: 576px) {
/* Emphasize the first table column. Then let the browser calculate the width for the remaining columns */
.quest-grid.table-layout th:first-child, .quest-grid td:first-child {
width: 35%;
font-weight: bold;
}
}

/**
I chose 576px because this matches the default breakpoint
for bootstrap -xs
**/
@media screen and (max-width: 576px) {
.quest-grid.table-layout, .quest-grid.table-layout thead, .quest-grid.table-layout td {
display: block;
}

.quest-grid.table-layout .custom-label {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: transparent;
cursor: pointer;
display: block;
}

.quest-grid.table-layout tbody {
display: flex;
flex-direction: column;
}

.quest-grid.table-layout thead tr {
position: absolute;
top: -9999px;
left: -9999px;
}

.quest-grid.table-layout tr {
display: flex;
flex-direction: column;
border: 1px solid #a3a3a3;
border-radius: 4px;
margin-top: 10px;
padding: 5px;
}

.quest-grid.table-layout td {
display: block;
width: 100%;
margin-bottom: 3px;
text-align: center;
min-height: 100px;
height: auto;
padding: 5px;
cursor: pointer;
background-color: #f4f4f4;
color: #333;
font-size: 16px;
border-radius: 4px;
position: relative;
}

.quest-grid.table-layout td:hover {
background-color: #e0e0e0;
color: #333;
}

.quest-grid.table-layout input[type="radio"]:checked + .custom-label::after {
display: none;
}

.quest-grid.table-layout .custom-label::before {
display: none;
}

.quest-grid.table-layout td input[type="radio"]:checked + .custom-label {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #327ABB;
color: white;
display: flex;
align-items: center;
text-align: center;
justify-content: center;
padding: 0 5px;
box-sizing: border-box;
z-index: 1;
text-transform: none;
line-height: normal;
}


}
.quest-grid.table-layout td::before {
content: attr(data-header);
font-size: 16px;
color: #333;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100%;
padding: 0 3px;
}
}
Loading

0 comments on commit 650fa70

Please sign in to comment.