-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
111 lines (103 loc) · 2.41 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE html>
<html>
<head>
<title>ASCII Design</title>
<meta http-equiv="Content-Security-Policy" content="
default-src
'self';
connect-src
'self';
script-src
'self'
'unsafe-eval'
'unsafe-inline';
font-src
'self';
frame-src
'self';
img-src
'self'
data:
blob:;
style-src
'self'
'unsafe-inline';
worker-src
'self';
">
<link rel="stylesheet" type="text/css" href="canvas.css">
<style>
* { margin:0; padding:0; } /* to remove the top and left whitespace */
html, body { width:100%; height:100%; } /* just to be sure these are full screen*/
canvas {
display:block;
cursor: none;
}
.menu {
padding-left: 6px;
padding-top: 4px;
box-shadow: 0 0 10px rgba(0, 0, 0, 1);
background: rgba(255, 255, 255, 0.5);
backdrop-filter: blur(1px);
z-index: 100;
width: 100%;
position: fixed;
}
#status {
background: rgba(255, 255, 255, 0.5);
backdrop-filter: blur(1px);
z-index: 100;
width: 100%;
position: fixed;
bottom: 0;
padding: 5px;
font-family: monospace;
font-size: 20px;
height: 20px;
line-height: 20px;
}
.menu .icon {
position: relative;
margin: 4px;
padding: 2px;
display: inline-block;
border: 2px solid rgba(255,255,255,0);
width: 32px;
height: 32px;
}
.menu .icon.selected {
filter: invert(100%);
background: white;
}
.menu .icon:hover {
border: 2px solid #7c7c7c
}
</style>
<script>
function init() {
import('/ascii.design.js').then(ascii_design => {
ascii_design.init()
window['ascii_design'] = ascii_design
})
}
window.addEventListener('DOMContentLoaded',init)
</script>
<!--
<script src="ascii.design.js" charset="UTF-8"></script>
-->
</head>
<body>
<div class="menu">
<img type="image/svg+xml" src="cursor.svg" class="icon" data-tool="SelectTool" />
<img type="image/svg+xml" src="box.svg" class="icon" data-tool="BoxTool" />
<img type="image/svg+xml" src="line.svg" class="icon" data-tool="LineTool" />
<img type="image/svg+xml" src="pen.svg" class="icon" data-tool="PenTool" />
<img type="image/svg+xml" src="text.svg" class="icon" data-tool="TextTool" />
</div>
<canvas id="canvas" width="150" height="150"></canvas>
<div id="status"><span id="position">( , )</span><span id="help"></span></div>
<div id="canvasStyle">
<div id="grid"></div>
</div>
</body>
</html>