Skip to content

Commit bb18101

Browse files
“mhmaidi789”JIB3377MaxWeisenmhmaidi789dieunity
authored andcommitted
Added Low contrasted accessibility
Co-authored-by: Justin Baik <bij3377@gmail.com> Co-authored-by: Max Weisenberger <germanbluemax@gmail.com> Co-authored-by: Mo Hmaidi <mhmaidi789@gmail.com> Co-authored-by: Dieu Huynh <dieuhhuynh@gmail.com>
1 parent f37b6ac commit bb18101

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/components/BrowserView/BrowserView.jsx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const BrowserView = () => {
1515
checkedMouse: false,
1616
muted: false,
1717
checkedGrayscale: false,
18+
checkedContrast: false,
1819
});
1920

2021
// Mute/Unmute webview
@@ -72,6 +73,14 @@ const BrowserView = () => {
7273
});
7374
break;
7475

76+
// Updates contrast
77+
case 'checkedContrast':
78+
setCheckBox({
79+
...checkedBoxes,
80+
checkedContrast: !checkedBoxes.checkedContrast,
81+
});
82+
break;
83+
7584
default:
7685
break;
7786
}
@@ -130,6 +139,18 @@ const BrowserView = () => {
130139
)}
131140
label="Grayscale"
132141
/>
142+
<FormControlLabel
143+
id="contrastCheckbox"
144+
control={(
145+
<Checkbox
146+
value="contrast"
147+
checked={checkedBoxes.checkedContrast}
148+
onChange={handleChangeCheckBox}
149+
name="checkedContrast"
150+
/>
151+
)}
152+
label="Low Contrast"
153+
/>
133154
<FormControlLabel
134155
id="Mute Audio Checkbox"
135156
control={(
@@ -155,7 +176,9 @@ const BrowserView = () => {
155176
id={styles.browserView}
156177
src={url}
157178
style={{
158-
filter: checkedBoxes.checkedGrayscale ? 'grayscale(100%)' : 'grayscale(0%)',
179+
// filter: checkedBoxes.checkedGrayscale ? 'grayscale(100%)' : 'grayscale(0%)',
180+
filter: checkedBoxes.checkedGrayscale && checkedBoxes.checkedContrast ? 'grayscale(100%) contrast(0.2)'
181+
: checkedBoxes.checkedGrayscale? 'grayscale(100%)': checkedBoxes.checkedContrast?'contrast(0.2)': null,
159182
pointerEvents: checkedBoxes.checkedMouse ? 'none' : 'auto',
160183
}}
161184
/>

0 commit comments

Comments
 (0)