]> git.r.bdr.sh - rbdr/heart/blob - js/app.js
Merge branch 'release/1.0.0' into develop
[rbdr/heart] / js / app.js
1 'use strict';
2
3 // Sets up the application
4
5 ((window) => {
6
7 const internals = {};
8
9 internals.onLoad = () => {
10
11 const mainElement = window.document.getElementById('heart-app-entry-point');
12 const heartRenderer = new HeartRenderer();
13
14 heartRenderer.render(mainElement);
15 heartRenderer.activate();
16
17 window.addEventListener('resize', heartRenderer.resize.bind(heartRenderer));
18
19 /**
20 * Exported global object. This will contain the instance of the heart
21 * renderer being used. It is set up on load.
22 *
23 * @name App
24 * @type Object
25 * @property {HeartRenderer} heartRenderer The instance of the heart renderer being used.
26 */
27 window.App = {
28 heartRenderer
29 };
30 };
31
32 window.addEventListener('load', internals.onLoad);
33 })(window);