Waybar uses GTK stylesheets for the theming. In theory, GTK CSS does have support for transitions and animations, which could be used in your case. But I’d say it’s a hard sell still. That aside I’ve never tried them in GTK, so I wouldn’t know if they even work in practice or how far.
I think you have a shot at this with eww
instead. But it’s harder to work with and you’ll need to make somewhat complex scripts I’d imagine.
I played with GTK’s transitions a bit, but they don’t seem to support scaling-related transitions, so I don’t think you’ll be able to do that.
I was able to make a simple one: https://files.catbox.moe/okh3zc.mp4