mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Snow fullscreen effect implemented
This commit is contained in:
29
tilorswift/js/dialog/elements/Checkbox.js
Normal file
29
tilorswift/js/dialog/elements/Checkbox.js
Normal file
@@ -0,0 +1,29 @@
|
||||
export class Checkbox
|
||||
{
|
||||
constructor(label, name, isChecked = false)
|
||||
{
|
||||
this.name = name;
|
||||
|
||||
this.htmlElement = document.createElement('div');
|
||||
|
||||
this.onClick = () => {};
|
||||
|
||||
this.checkbox = document.createElement('input');
|
||||
this.checkbox.type = 'checkbox';
|
||||
this.checkbox.checked = isChecked;
|
||||
this.checkbox.onclick = () => {
|
||||
this.onClick();
|
||||
}
|
||||
|
||||
this.htmlLabel = document.createElement('label');
|
||||
this.htmlLabel.innerText = label;
|
||||
|
||||
this.htmlElement.appendChild(this.checkbox);
|
||||
this.htmlElement.appendChild(this.htmlLabel);
|
||||
}
|
||||
|
||||
isChecked()
|
||||
{
|
||||
return this.checkbox.checked;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user