클론 코딩

노마드코더 : 그림판 만들기 (Vanilla JS) -1. HTML 마크업

식초 2020. 10. 29. 21:54

캔버스 /

컨트롤러 (붓 크기 조절 / 채우기 버튼, 저장 버튼 / 색상 버튼)

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <link rel="stylesheet" href="style.css" />
    <title>PaintJS</title>
  </head>
  <body>
    <!--캔버스-->
    <canvas id="jsCanvas" class="canvas"></canvas>
    <!--컨트롤러 전체-->
    <div class="controls">
      <!--붓의 크기-->
      <div class="controls__range">
        <input type="range" id="jsRange" min="0.1" max="5.0" step="0.1" />
      </div>
      <!--채우기, 저장 버튼-->
      <div class="controls__btns">
        <button id="jsMode">Fill</button>
        <button id="jsSave">Save</button>
      </div>
      <!--색상 버튼-->
      <div class="controls__colors" id="jsColors">
        <div
          class="controls__color jsColor"
          style="background-color: #2c2c2c"
        ></div>
        <div
          class="controls__color jsColor"
          style="background-color: white"
        ></div>
        <div
          class="controls__color jsColor"
          style="background-color: #ff3b30"
        ></div>
        <div
          class="controls__color jsColor"
          style="background-color: #ff9500"
        ></div>
        <div
          class="controls__color jsColor"
          style="background-color: #ffcc00"
        ></div>
        <div
          class="controls__color jsColor"
          style="background-color: #4cd963"
        ></div>
        <div
          class="controls__color jsColor"
          style="background-color: #5ac8fa"
        ></div>
        <div
          class="controls__color jsColor"
          style="background-color: #0579ff"
        ></div>
        <div
          class="controls__color jsColor"
          style="background-color: #5856d6"
        ></div>
      </div>
    </div>
    <script src="app.js"></script>
  </body>
</html>
cs