iOS/iMessage gradient effect, with css/svg
and good performance
Scroll down to better see the effect.
well, since I need to add some messages here so it scrolls, i might as well explain how it works
it's a bit tricky.
there's a big gradient background, that spans the entire window
the white background you see is actually being added on each message
the bubble shape itself is not a blue bubble, but a white border with a transparent center
Effectively, each message is a "window" through which one can take a peek at the background
A little trick is used to give the bubble shape to the messages.
they have an svg image as a border
using the (little known?) "border-image-source" and "border-image-slice" css properties
ok cool
why not use, like, background-attachment: fixed or something though?
for performance reasons
fixed background makes the browser redraw things every time it scrolls
while doing it this way makes the browser do only a composite operation
that's it, just move things around instead of redrawing them
that's what I gather, anyway
not completely sure
might depend on the browser, gotta test a bit more
ok cool