1
0
mirror of https://github.com/beestat/app.git synced 2025-05-24 02:14:03 -04:00
beestat/js/component/card/visualize_intro.js
2022-11-14 10:03:15 -05:00

50 lines
1.2 KiB
JavaScript

/**
* Visualize intro.
*
* @param {number} thermostat_id
*/
beestat.component.card.visualize_intro = function(thermostat_id) {
this.thermostat_id_ = thermostat_id;
beestat.component.card.apply(this, arguments);
};
beestat.extend(beestat.component.card.visualize_intro, beestat.component.card);
/**
* Decorate.
*
* @param {rocket.Elements} parent
*/
beestat.component.card.visualize_intro.prototype.decorate_contents_ = function(parent) {
const self = this;
const center_container = document.createElement('div');
center_container.style.textAlign = 'center';
parent.appendChild(center_container);
new beestat.component.tile()
.set_icon('plus')
.set_text([
'Get started now!',
'Create my first floor plan'
])
.set_size('large')
.set_background_color(beestat.style.color.green.dark)
.set_background_hover_color(beestat.style.color.green.light)
.render($(center_container))
.addEventListener('click', function() {
new beestat.component.modal.create_floor_plan(
self.thermostat_id_
).render();
});
};
/**
* Get the title of the card.
*
* @return {string} The title.
*/
beestat.component.card.visualize_intro.prototype.get_title_ = function() {
return 'Visualize';
};