|
|
@@ -0,0 +1,62 @@
|
|
|
+import { dom_manager } from "./functions.js";
|
|
|
+
|
|
|
+class applet {
|
|
|
+ #show;
|
|
|
+ #hide;
|
|
|
+ #current;
|
|
|
+ #animation;
|
|
|
+ #target;
|
|
|
+
|
|
|
+ #change() {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ #visible(animate = true) {
|
|
|
+ if (animate) {
|
|
|
+ this.#animation(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #unvisible(animate = true) {
|
|
|
+ if (animate) {
|
|
|
+ this.#animation(this.false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #activate() {
|
|
|
+ if (this.#hide === undefined) {
|
|
|
+ this.#show.addEventListener("click", () => this.#change());
|
|
|
+ } else {
|
|
|
+ this.#show.addEventListener("click", () => this.#visible());
|
|
|
+ this.#hide.addEventListener("click", () => this.#unvisible());
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.#current) {
|
|
|
+ this.#visible(false);
|
|
|
+ } else {
|
|
|
+ this.#unvisible(false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ constructor(target, change, current, animation) {
|
|
|
+ this.#current = current;
|
|
|
+ this.#show = change;
|
|
|
+ this.#animation = animation;
|
|
|
+ this.#target = target;
|
|
|
+ this.#hide = undefined;
|
|
|
+
|
|
|
+ this.#activate();
|
|
|
+ }
|
|
|
+
|
|
|
+ constructor(target, show, hide, current, animation) {
|
|
|
+ this.#current = current;
|
|
|
+ this.#show = show;
|
|
|
+ this.#hide = hide;
|
|
|
+ this.#animation = animation;
|
|
|
+ this.#target = target;
|
|
|
+
|
|
|
+ this.#activate();
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export { applet };
|