Skip to content

Commit

Permalink
feat: change ui structure
Browse files Browse the repository at this point in the history
  • Loading branch information
EGRrqq committed Feb 6, 2024
1 parent 04caf66 commit 5319310
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { MouseController, TouchController } from "./canvasController/inputs";
import { Pen, ToolsController } from "./canvasController/tools";
import { CacheController } from "./canvasController/canvasData/cache";
import {
Dropdown,
clearBtnController,
openBtnController,
saveBtnController,
} from "./uiController";
import { loadData, saveData } from "./canvasController/canvasData/manipulate";
import { formatDate } from "./canvasController/helpers";
import { WindowData } from "./canvasController/windowData/windowDataController";
import { Dropdown } from "./uiController/menu";

const board = document.getElementById("board") as HTMLCanvasElement;
const boardController = new CanvasController(board);
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions src/uiController/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Dropdown } from "./Dropdown";
19 changes: 2 additions & 17 deletions src/uiController/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,2 @@
import { UiBtnController } from "./UiBtnController";

const openBtn = document.getElementById(
"menu__open"
) as HTMLButtonElement;

const saveBtn = document.getElementById(
"menu__save"
) as HTMLButtonElement;

const clearBtn = document.getElementById(
"menu__clear"
) as HTMLButtonElement;

export const openBtnController = new UiBtnController(openBtn);
export const saveBtnController = new UiBtnController(saveBtn);
export const clearBtnController = new UiBtnController(clearBtn);
export * from "./menu";
export * from "./components";
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ interface IUiBtnController {
onClick(callback: () => void): void;
}

export class UiBtnController implements IUiBtnController {
export class MenuBtnController implements IUiBtnController {
#canvasBtn: HTMLButtonElement;

constructor(btn: HTMLButtonElement) {
Expand Down
10 changes: 9 additions & 1 deletion src/uiController/menu/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
export { Dropdown } from "./Dropdown";
import { MenuBtnController } from "./MenuBtnController";

const openBtn = document.getElementById("menu__open") as HTMLButtonElement;
const saveBtn = document.getElementById("menu__save") as HTMLButtonElement;
const clearBtn = document.getElementById("menu__clear") as HTMLButtonElement;

export const openBtnController = new MenuBtnController(openBtn);
export const saveBtnController = new MenuBtnController(saveBtn);
export const clearBtnController = new MenuBtnController(clearBtn);

0 comments on commit 5319310

Please sign in to comment.