So you want to show off your portfolio website and you want to add some fancy graphics to show off your Javascript skills. What better way than by adding a fancy "typewriter effect" to show the world your multi-faceted personality?
It's nice, sure! But there's a problem. And it has to do with accessibility.
Simply put, blind people visiting your website with screen readers, just can't see what the hell you've written on that section.
Here's an example, using VoiceOver on Safari for iOS:
Transcript: "Coffee underscore. Heading level 1"
That is pretty horrible! And it's probably already on your website! How do we fix it? Let's see!
Let's say the HTML code for your typewriter effect:
If you use a screen reader, it would result in the effect shown above. To fix this we're going to use two ARIA attributes: "aria-label" and "aria-hidden":
aria-label - to make the screen reader say what we want
aria-hidden - to make the screen reader skip the typewriter text
When you use a website or an app, a lot of things are going on in the background in order to give its users what they're looking for.
Things are being carried out and the result of these things depend on other things.
One of these things that influence how an app behaves, is the information that it has on hand. For example:
💿 The user's name so the app can give a personalised greeting.
💿 The list of tasks in a to-do list so the app can list them, add things or remove things from it.
If you're learning Javascript, sooner or later you'll come across the forEach() and map() functions. It is quite often that there is some confusion about what each one does.