Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Animated emojis only animated on hover on the web interface
By default GoToSocial will display animated emojis on the web interface. Since v0.17.0, GoToSocial has made it to respect when you have `prefers-reduced-motion` setting enabled on your system. What my change does is duplicate the emoji img tag, one with the classname `.emoji.original` and one with the classname `.emoji.static`, with the static version's `src` being set to `staticURL` like for the prefers reduced motion version. In order for this to work, you need to add to CSS somewhere such as your custom CSS or in web assets (or the global custom CSS when that is implemented: ``` .emoji.original { display: none; } picture:hover .emoji.static { display: none } picture:hover .emoji.original { display: inline-block } ``` This will hide the static emoji when you hover/tap and show the original emoji instead so it'll animate on hover when it's an animated emoji. This isn't a perfect solution, that it needs to load the original version when you hover, but it is a very minimal and JS free solution. This still respects the `prefers-reduced-motion` set by the system, whilst also offering Mastodon web interface default behaviour by animated emojis only animating on hover/tap, so a flashing/fast paced emoji present in a thread isn't going to cause discomfort when viewing said thread on the web interface.
- Loading branch information