-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
82 lines (80 loc) · 1.93 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
<!doctype html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Scrawl</title>
<style>
body {
margin: 0; overflow: hidden;
}
#palette {
position: absolute;
top: 0; right: 0; width: 100px; bottom: 72px;
border-left: 2px inset;
overflow-y: scroll;
background: white;
}
#palette .key {
float: left;
width: 1em;
-webkit-user-select: none;
user-select: none;
}
#drawbox :hover {
cursor: pointer;
}
#drawbox {
pointer-events: all;
}
.palettebutton.active {
border: 2px inset;
}
.palettebutton.reversed svg {
transform: scale(-1, -1);
}
.palettebutton.flipped svg {
transform: scaleY(-1);
}
.palettebutton.flipped.reversed svg {
transform: scaleX(-1);
}
.palettebutton {
border: 2px outset;
margin: 4px 2px;
padding: 4px;
}
#undo {
position: absolute;
bottom: 48px; right: 0; width: 100px; height: 24px;
}
#download {
position: absolute;
bottom: 24px; right: 0; width: 100px; height: 24px;
}
#info {
position: absolute;
bottom: 0; right: 0; width: 100px; height: 24px;
}
#info a {
text-decoration: none;
color: buttontext;
}
</style>
</head>
<body>
<svg id="drawbox" xmlns="http://www.w3.org/2000/svg" version="1.1"
viewBox="0 0 1600 900" preserveAspectRatio="xMidYMid slice"
stroke="black" stroke-width="4" stroke-linecap="round">
<g class="hover" stroke-opacity="0.3">
</g>
<g class="clickables" stroke-width="32" stroke-opacity="0">
<line x1="700" y1="450" x2="900" y2="450"></line>
</g>
<line x1="700" y1="450" x2="900" y2="450"></line>
</svg>
<div id="palette">
</div>
<button id="undo" disabled>Undo</button>
<button id="download">Download svg</button>
<button id="info" onclick="this.firstChild.click()"><a href="https://github.com/sgentle/scrawl">Info + source</a></button>
<script src="scrawl.js"></script>
</body>