-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
95 lines (76 loc) · 3.25 KB
/
index.html
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Paint Online</title>
<style>
html, body{
max-height:100vh !important;
max-width:100vw !important;
overflow: hidden;
}
#formDropDown {
max-width: 100%;
height: 40px;
display: flex;
justify-content: space-around;
padding-bottom: 10px;
}
#paintArea{
cursor: url(./cursor/Pencil_Normal_select.cur), auto;
}
</style>
</head>
<body>
<div id="main-content">
<div class="canvasWrapper">
<canvas id="paintArea" width="800px" height="800px"></canvas>
<form action="#" class="dropdown-menu" id="formDropDown" aria-labelledby="dropdownMenuButton">
<div class="dropdown-item">
<label for="color-input">Cor do pincel</label>
<input type="color" name="color-input" value="#d721e2" id="color-input">
</div>
<div class="dropdown-item">
<label for="al-color">Cores aleatórias<label>
<input type="checkbox" name="al-color-radio" id="al-color">
</div>
<div class="dropdown-item">
<label for="formControlRange">Espessura</label>
<input type="range" class="form-control-range" id="widthline-range" min="1" max="20" value="9">
</div>
<div class="dropdown-item">
<label for="eraser-check">Modo borracha<label>
<input type="checkbox" name="eraser-check" id="eraser-check">
</div>
<div class="dropdown-item">
<button class="btn btn-primary" id="clearAll">apagar tudo</button>
</div>
</form>
</div>
</div>
<script>
function createScriptTag(src){
let scriptEl = document.createElement('script')
scriptEl.src = src
document.body.appendChild(scriptEl)
return null
}
window.animationFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame
})()
window.onload = ()=>{
const $canvas = document.querySelector('#paintArea')
createScriptTag('scripts/aplication.js')
createScriptTag('scripts/paint.js')
if(window.innerWidth < 768){
window.isInMobile = true
}
}
</script>
</body>
</html>