Magnets
Text
Put the words that take turns in {braces|like|this}.
Type
Colour
Ground
Motion
Ideas that
About this effect
Magnets spells the word that changes in fridge magnet letters: chunky, glossy plastic in four colours, each letter set down at its own slight angle with a little depth and a shadow on the door. When it is time for the next word, the letters it shares with the old one lift, slide over to their new places and drop back down; letters it does not need fall off, and the missing ones are slapped on with a bounce. A letter keeps its colour wherever it goes, so you can follow it across.
Write the words in braces, Ideas that {stick|click|last}; words that share letters make the best moves. The slot eases to each word's width, so the sentence makes room, and the heading reads as the sentence with every word listed. It is HTML and CSS, with a short script that measures where each letter of the next word goes and moves the letters with the Web Animations API.
Hold sets how long each word stays. It suits playful brands, education, kids, games and anything about words.
- Formats
- React, HTML
- No dependencies
- Built with
- CSS and a little JS
- Default font Unbounded
- Plays
- Loop, Hover
- Reduced motion
- Respected
- Shows the finished frame
Accessibility. One real heading that reads as the sentence with every word listed; the magnet letters are hidden from screen readers. Under reduced motion it stays on the first word.
Also known as fridge magnet text, anagram text animation, rearranging letters, word swap animation, letter shuffle text, playful word rotator.
Use it in anything you build, client work included, no credit needed. Don’t republish or resell the effect itself.