Skip to content

Commit 0f0a1b0

Browse files
committed
feat(a11y): wrap visual block in semantic container and add ARIA roles
1 parent dd011e7 commit 0f0a1b0

File tree

3 files changed

+29
-23
lines changed

3 files changed

+29
-23
lines changed

TODO.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
- [x] refactor(css): extract repeated colors and sizes into CSS variables
66
- [x] style(a11y): add prefers-reduced-motion support
77
- [x] refactor(controls): pause animations by default and toggle with a state class
8-
- [ ] perf(animation): replace blur filter with a soft radial/gradient overlay
9-
- [ ] feat(a11y): wrap the visual block in a semantic container
10-
- [ ] feat(a11y): <main> with ARIA role img and label
11-
- [ ] feat(a11y): decorative elements hidden from screen readers
12-
- [ ] perf(css): mark glare as non-interactive
8+
- [x] feat(a11y): wrap the visual block in a semantic container
9+
- [x] feat(a11y): <main> with ARIA role img and label
10+
- [x] feat(a11y): decorative elements hidden from screen readers
11+
- [x] perf(css): mark glare as non-interactive
1312
- [ ] fix(layout): center the record player itself with top/left 50% and transform
1413
- [ ] fix(animation): record spins via the record surface, not the label
1514
- [ ] fix(arm): join the tonearm bar and lower
@@ -25,7 +24,7 @@
2524
- [ ] feat(animation): add needle drop effect on play start
2625
- [ ] feat(ui): make tonearm, record, spindle, and stylus more realistic
2726
- [ ] feat(record): add vinyl groove texture
28-
- [ ] feat(record): add surface reflection
27+
2928
- [ ] feat(spindle): add metallic texture
3029
- [ ] feat(chassis): add wooden base for the player
3130
- [ ] feat(shadow): add shadow under the record player

index.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,21 @@
1010
</head>
1111

1212
<body>
13-
<div class="record-player">
14-
<div class="record-player__platter">
15-
<div class="record-player__record">
16-
<div class="record-player__glare"></div>
17-
<div class="record-player__label">
13+
<main role="img" aria-label="CSS illustration of a vinyl record player with a spinning record and tonearm.">
14+
<div class="record-player" aria-hidden="true">
15+
<div class="record-player__platter">
16+
<div class="record-player__record">
17+
<div class="record-player__glare"></div>
18+
<div class="record-player__label">
19+
</div>
1820
</div>
1921
</div>
22+
<div class="record-player__arm">
23+
<div class="record-player__arm-bar"></div>
24+
<div class="record-player__arm-bar--lower"></div>
25+
</div>
2026
</div>
21-
<div class="record-player__arm">
22-
<div class="record-player__arm-bar"></div>
23-
<div class="record-player__arm-bar--lower"></div>
24-
</div>
25-
</div>
27+
</main>
2628
</body>
2729

2830
</html>

style.css

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,22 @@
165165
height: 100%;
166166
width: 100%;
167167
filter: blur(2vh);
168+
/* softens the glare edges */
169+
pointer-events: none;
170+
/* non-interactive decorative layer */
171+
user-select: none;
168172
}
169173

174+
/* Glare shapes simulate reflection */
170175
.record-player__glare::before {
171176
content: "";
172177
height: 100%;
173178
width: 100%;
174179
position: absolute;
175180
background-color: var(--glare-strong);
176181
clip-path: polygon(100% 0, 100% 50%, 0 50%, 0 100%);
182+
/* a soft diagonal glare */
183+
/* animation applied when .is-playing is present */
177184
}
178185

179186
.record-player__glare::after {
@@ -183,6 +190,8 @@
183190
position: absolute;
184191
background-color: var(--glare-weak);
185192
clip-path: polygon(0 0, 50% 0, 50% 100%, 100% 100%);
193+
/* a softer diagonal glare */
194+
/* animation applied when .is-playing is present */
186195
}
187196

188197
/* Tonearm */
@@ -308,8 +317,7 @@
308317
}
309318
}
310319

311-
/* components consolidated above */
312-
320+
/* a small positive rotation to simulate teetering */
313321
@keyframes teeter {
314322
0% {
315323
transform: rotate(0deg);
@@ -324,6 +332,7 @@
324332
}
325333
}
326334

335+
/* a small negative rotation to simulate teetering */
327336
@keyframes teeter-flip {
328337
0% {
329338
transform: rotate(0deg);
@@ -338,8 +347,6 @@
338347
}
339348
}
340349

341-
/* components consolidated above */
342-
343350
@keyframes move-init {
344351
from {
345352
transform: rotate(-82deg);
@@ -362,6 +369,4 @@
362369
100% {
363370
transform: rotate(-75deg);
364371
}
365-
}
366-
367-
/* components consolidated above */
372+
}

0 commit comments

Comments
 (0)