jellyfish-web/src/components/appFooter/appFooter.js
2023-07-13 02:41:18 +03:00

34 lines
723 B
JavaScript

import './appFooter.scss';
function render() {
const elem = document.createElement('div');
elem.classList.add('appfooter');
document.body.appendChild(elem);
return elem;
}
class AppFooter {
constructor() {
this.element = render();
this.add = function (elem) {
this.element.appendChild(elem);
};
this.insert = function (elem) {
if (typeof elem === 'string') {
this.element.insertAdjacentHTML('afterbegin', elem);
} else {
this.element.insertBefore(elem, this.element.firstChild);
}
};
}
destroy() {
this.element = null;
}
}
export default new AppFooter();