Enter and exit canvas event

Open console to see events - the canvas is only animating while in view

Scroll down

Example done

More examples