EC2 website & project proposal init
This commit is contained in:
1 parent
8af93058df
commit
916ee92f90
17 files changed
+340
-14
No files matched your search
@@ -0,0 +1,27 @@
|
||||
class ColorButtonsApp {
|
||||
constructor(backgroundElement, statusElement) {
|
||||
this.backgroundElement = backgroundElement;
|
||||
this.statusElement = statusElement;
|
||||
}
|
||||
|
||||
setColor(color) {
|
||||
this.backgroundElement.style.backgroundColor = color;
|
||||
this.statusElement.textContent = `Current background: ${color}`;
|
||||
}
|
||||
|
||||
connectButton(button, color) {
|
||||
button.addEventListener("click", () => this.setColor(color));
|
||||
}
|
||||
|
||||
initialize() {
|
||||
this.connectButton(document.getElementById("blueBtn"), "blue");
|
||||
this.connectButton(document.getElementById("redBtn"), "red");
|
||||
}
|
||||
}
|
||||
|
||||
const application = new ColorButtonsApp(
|
||||
document.body,
|
||||
document.getElementById("status"),
|
||||
);
|
||||
|
||||
application.initialize();
|
||||
Reference in new issue
Block a user