Maintainable way to concatenate strings in JS and vendor prefixes
Changing the many bubble_css += lines to a single long concatenation spanning multiple lines would be an improvement.

Even more improvement would be using a template framework,
for example moustache.

If you don't want to depend on a framework,
you could cook up something simple.
For example, use a single string with markups like {{ bubble_in_ms }},
and create a utility function that takes the template string and a dictionary of key-value pairs to replace in the template.