]>
git.r.bdr.sh - rbdr/heart/blob - js/app.js
63990dc1bbca0e80e7cabea851b2f39b35503a34
3 // Sets up the application
9 internals
.onLoad
= () => {
11 const mainElement
= window
.document
.getElementById('heart-app-entry-point');
12 const heartRenderer
= new HeartRenderer();
14 heartRenderer
.render(mainElement
);
15 heartRenderer
.activate();
17 window
.addEventListener('resize', heartRenderer
.resize
.bind(heartRenderer
));
18 window
.addEventListener('blur', heartRenderer
.stopFollowingMouse
.bind(heartRenderer
));
19 window
.addEventListener('focus', heartRenderer
.startFollowingMouse
.bind(heartRenderer
));
22 * Exported global object. This will contain the instance of the heart
23 * renderer being used. It is set up on load.
27 * @property {HeartRenderer} heartRenderer The instance of the heart renderer being used.
34 window
.addEventListener('load', internals
.onLoad
);