-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
192 lines (162 loc) · 7.78 KB
/
Copy pathindex.html
File metadata and controls
192 lines (162 loc) · 7.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<!DOCTYPE html>
<html lang="en">
<head>
<title>Vision Simulator</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description"
content="Vision Simulator is a web app that lets you experience how animals and people with different visual conditions perceive the world." />
<meta name="keywords"
content="vision simulator, color blindness simulator, dog vision, cat vision, color blindness, myopia, hyperopia, astigmatism" />
<meta name="author" content="Eduarda Bastos" />
<meta name="theme-color" content="#4866de" />
<meta name="robots" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1">
<meta property="og:title" content="Vision Simulator" />
<meta property="og:description"
content="Vision Simulator is a web app that lets you experience how animals and people with different visual conditions perceive the world." />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://eduardasrbastos.github.io/vision-simulator" />
<meta property="og:image" content="https://eduardasrbastos.github.io/vision-simulator/assets/images/preview.png" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Vision Simulator" />
<meta name="twitter:description"
content="Vision Simulator is a web app that lets you experience how animals and people with different visual conditions perceive the world." />
<meta name="twitter:image" content="https://eduardasrbastos.github.io/vision-simulator/assets/images/preview.png" />
<link rel="canonical" href="https://eduardasrbastos.github.io/vision-simulator" />
<link rel="stylesheet" href="styles.css" />
<link rel="icon" type="image/x-icon" href="./assets/images/favicon.ico" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
rel="stylesheet">
</head>
<body>
<header role="banner">
<h1>Vision Simulator</h1>
</header>
<main role="main">
<div class="buttons-container">
</div>
<div class="upload-container">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="upload-icon">
<path
d="M246.6 9.4c-12.5-12.5-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 109.3 192 320c0 17.7 14.3 32 32 32s32-14.3 32-32l0-210.7 73.4 73.4c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3l-128-128zM64 352c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64c0 53 43 96 96 96l256 0c53 0 96-43 96-96l0-64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 64c0 17.7-14.3 32-32 32L96 448c-17.7 0-32-14.3-32-32l0-64z" />
</svg>
<input type="file" id="fileInput" class="upload-input" accept=".png, .jpg, .jpeg" title="Upload an Image" />
<label for="fileInput" class="upload-placeholder">Upload an Image</label>
</div>
<p class="notice">Privacy Notice: All image processing happens locally on your device. No images or personal data
are stored, transmitted, or collected.</p>
<div class="image-container">
<div class="flex-container">
<span class="image-text">Cat</span>
<span class="image-text">Normal</span>
</div>
<!--
Image credit:
"Flower field" by DeltaWorks from Pixabay
https://pixabay.com/photos/flower-field-flowers-field-trees-250016/
-->
<div class="comparison-wrapper">
<div class="image-layer normal">
<img src="./assets/images/default.jpg" alt="Normal vision" fetchpriority="high" />
</div>
<div class="image-layer filtered">
<img src="./assets/images/default.jpg" alt="Simulated vision" fetchpriority="high" />
</div>
<input type="range" min="0" max="100" value="50" class="slider" aria-label="Adjust vision comparison">
<span class="arrow left">‹</span>
<span class="arrow right">›</span>
</div>
</div>
<svg width="0" height="0" style="position:absolute">
<defs>
<filter id="cat" color-interpolation-filters="sRGB">
<feGaussianBlur stdDeviation="0.9" result="blur" />
<feColorMatrix in="blur" type="matrix" values="
0.35 0.55 0.10 0 0
0.25 0.70 0.05 0 0
0.10 0.40 0.65 0 0
0 0 0 1 0" result="color" />
<feComponentTransfer in="color">
<feFuncR type="linear" slope="0.75" intercept="0.12" />
<feFuncG type="linear" slope="0.8" intercept="0.12" />
<feFuncB type="linear" slope="0.7" intercept="0.12" />
</feComponentTransfer>
</filter>
<filter id="dog" color-interpolation-filters="sRGB">
<feGaussianBlur stdDeviation="0.6" result="blur" />
<feColorMatrix in="blur" type="matrix" values="
0.4 0.6 0.0 0 0
0.3 0.7 0.0 0 0
0.05 0.45 0.7 0 0
0 0 0 1 0" result="color" />
<feComponentTransfer in="color">
<feFuncR type="linear" slope="0.9" />
<feFuncG type="linear" slope="0.9" />
<feFuncB type="linear" slope="0.85" />
</feComponentTransfer>
</filter>
<filter id="astigmatism" x="-20%" y="-20%" width="140%" height="140%" color-interpolation-filters="sRGB">
<feGaussianBlur in="SourceGraphic" stdDeviation="3 0.6" result="blur" />
<feTurbulence type="fractalNoise" baseFrequency="0 0.05" numOctaves="1" seed="4" result="noise" />
<feColorMatrix in="noise" type="matrix" result="vertNoise" values="
0 0 0 0 0
0 1 0 0 0
0 0 0 0 0
0 0 0 1 0" />
<feDisplacementMap in="blur" in2="vertNoise" scale="15" xChannelSelector="R" yChannelSelector="G"
result="displaced" />
<feTurbulence type="fractalNoise" baseFrequency="0.03 0" numOctaves="1" seed="8" result="streakNoise" />
<feColorMatrix in="streakNoise" type="matrix" result="streaks" values="
1 1 1 0 0
1 1 1 0 0
1 1 1 0 0
0 0 0 1.6 -1.1" />
<feBlend in="displaced" in2="streaks" mode="screen" result="withStreaks" />
<feComponentTransfer in="withStreaks">
<feFuncR type="linear" slope="0.88" />
<feFuncG type="linear" slope="0.88" />
<feFuncB type="linear" slope="0.88" />
</feComponentTransfer>
</filter>
<filter id="deuteranopia">
<feColorMatrix type="matrix" values="
0.367 0.861 -0.228 0 0
0.280 0.673 0.047 0 0
-0.012 0.043 0.969 0 0
0 0 0 1 0" />
</filter>
<filter id="protanopia">
<feColorMatrix type="matrix" values="
0.152 1.053 -0.205 0 0
0.115 0.786 0.099 0 0
-0.004 -0.048 1.052 0 0
0 0 0 1 0" />
</filter>
<filter id="tritanopia">
<feColorMatrix type="matrix" values="
1.255 -0.076 -0.179 0 0
-0.078 0.931 0.148 0 0
0.004 0.691 0.305 0 0
0 0 0 1 0" />
</filter>
<filter id="achromatopsia">
<feColorMatrix type="matrix" values="
0.299 0.587 0.114 0 0
0.299 0.587 0.114 0 0
0.299 0.587 0.114 0 0
0 0 0 1 0" />
</filter>
</defs>
</svg>
</main>
<footer role="contentinfo">
© <span id="year"></span>
<a href="https://github.com/EduardaSRBastos" target="_blank" rel="noopener noreferrer">Eduarda Bastos</a>. Licensed
under the MIT License.
</footer>
</body>
<script src="index.js" defer></script>
</html>