Things changed over the last years and if we keep in mind this stuff is going to be used in many web/mobile games, is it really wrong to use divs this way nowadays?
[emphasis mine]
Yes, using divs simply for the sake of producing animation is the wrong approach. It doesn't detract from the elegance or beauty of your animation, but it's simply the wrong tool for the job.
The purpose of CSS animations are to provide animations that are associated with a particular style. Adding a sliding or fade effect to a drop-down menu would be an example where CSS animations are part of a style. CSS-Tricks uses animations all over the place, such as the header menu color changes when the page loads. These effects are part of the style of the page, and are not tied-in to the markup
The example you created is strongly tied to the elements in the HTML, and none of it is meaningful content (semantically transparent). It would be better to store the animation in a separate non-looping .gif
, or SVG which can be animated and styled with CSS & JavaScript.
What are the [effects] of wrong semantics with this animation for the [end user]?
For a visually impaired user, using the wrong semantics means that they will have a confusing experience. They may have to navigate through a number of nonsensical items that exist solely for the purpose of displaying an animation. Alternatively they may skip over the animation completely and not understand content that references it.
An <img>
has an [alt]
attribute for the purpose of explaining its content in context. If you're using a bunch of <div>
s then you should be sure to add [title]
and [role="img"]
attributes on the containing <div>
(best explained in the ARIA spec).
For a sighted user, there probably wont be any issue at all. Beyond accessibility there isn't really an issue with using CSS animations as a way create a stand-alone animation. It doesn't make it a good tool to use. As an analogy, if you need to nail two boards together, you can use the handle of a screwdriver instead of a hammer. Both will get the job done under normal circumstances; however, one tool is obviously better suited for use with nails.