Skip to content

Commit

Permalink
refac : querySelector 사용
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellol77 committed Jul 30, 2024
1 parent 318553c commit 80de80a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion frontend/src/controller/canvasController.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ import bubble3 from "../assets/images/bubble3.png";
import bubble4 from "../assets/images/bubble4.png";
import io from "socket.io-client";
import bubblePop from "../assets/audio/bubblePop.mp3";
import { $ } from "../utils/querySelector";

export default class CanvasController {
constructor() {
this.socket = io(process.env.SOCKET_IP, { path: "/api/*" });
this.canvas = document.getElementById("canvas");
this.canvas = $("#canvas");
this.canvas.width = window.innerWidth;
this.canvas.height = window.innerHeight;
this.ctx = this.canvas.getContext("2d");
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/controller/inputController.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import io from "socket.io-client";
import { $ } from "../utils/querySelector";

export default class InputController {
constructor() {
this.input = document.getElementById("message_input");
this.button = document.getElementById("message_submit_button");
this.input = $("#message_input");
this.button = $("#message_submit_button");
this.socket = io(process.env.SOCKET_IP, { path: "/api/*" });
}

Expand Down

0 comments on commit 80de80a

Please sign in to comment.