Skip to content

Commit 6464975

Browse files
authored
Merge pull request #1351 from donneypr/colour_contrast_loss
added new visual simulation for colour contrast loss
2 parents 62eb106 + f5b1fbd commit 6464975

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

desktop-app/src/common/deviceList.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,45 @@ export const defaultDevices: Device[] = [
298298
isTouchCapable: true,
299299
isMobileCapable: true,
300300
},
301+
{
302+
id: '10022',
303+
name: 'iPhone 16',
304+
width: 393,
305+
height: 852,
306+
dpr: 3,
307+
capabilities: ['touch', 'mobile'],
308+
userAgent:
309+
'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1',
310+
type: 'phone',
311+
isTouchCapable: true,
312+
isMobileCapable: true,
313+
},
314+
{
315+
id: '10023',
316+
name: 'iPhone 16 Plus',
317+
width: 430,
318+
height: 932,
319+
dpr: 3,
320+
capabilities: ['touch', 'mobile'],
321+
userAgent:
322+
'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Mobile/15E148 Safari/604.1',
323+
type: 'phone',
324+
isTouchCapable: true,
325+
isMobileCapable: true,
326+
},
327+
{
328+
id: '10024',
329+
name: 'iPhone 16 Pro',
330+
width: 393,
331+
height: 852,
332+
dpr: 3,
333+
capabilities: ['touch', 'mobile'],
334+
userAgent:
335+
'Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0 Mobile/15E148 Safari/604.1',
336+
type: 'phone',
337+
isTouchCapable: true,
338+
isMobileCapable: true,
339+
},
301340
{
302341
id: '20001',
303342
name: 'Nexus 4',

desktop-app/src/renderer/components/Previewer/Device/ColorBlindnessTools/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ export const ColorBlindnessTools = ({ webview }: Props) => {
159159
top: -75vmax;
160160
}`,
161161
[SIMULATIONS.FAR]: `body { filter: blur(2px); }`,
162+
[SIMULATIONS.COLOR_CONTRAST_LOSS]: `body { filter: grayscale(0.5) contrast(0.8); }`,
162163
};
163164
const css = impairments[visualImpairment.toLowerCase()];
164165
let js = null;

desktop-app/src/renderer/components/VisionSimulationDropDown/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export const SIMULATIONS = {
5454
FAR: 'farsightedness',
5555
GLAUCOME: 'glaucoma',
5656
SOLARIZE: 'solarize',
57+
COLOR_CONTRAST_LOSS: 'color-contrast-loss',
5758
};
5859

5960
export const RED_GREEN = [
@@ -68,6 +69,7 @@ export const VISUAL_IMPAIRMENTS = [
6869
SIMULATIONS.CATARACT,
6970
SIMULATIONS.FAR,
7071
SIMULATIONS.GLAUCOME,
72+
SIMULATIONS.COLOR_CONTRAST_LOSS,
7173
];
7274
export const SUNLIGHT = [SIMULATIONS.SOLARIZE];
7375

0 commit comments

Comments
 (0)