Check 'em out! http://tannerrogalsky.com/demoloops/
This is a framework for creating quick, looping animations in C++. It was written specially with emscripten in mind. It's not really set up to be shared but it does have a library with most of the common graphics and math code under lib/demoloop-lib
.