-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
183 lines (166 loc) · 4.08 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="author" content="" />
<meta name="viewport" content="width=device-width">
<title></title>
<style type="text/css">
* {
box-sizing: border-box;
}
body, html {
position: relative;
margin: 0;
padding: 0;
font-family: monospace;
}
main {
display: flex;
overflow: hidden;
}
.plotbox {
position: relative;
display: block;
width: 100%;
height: 100vh;
background-color: #fff;
overflow: scroll;
flex: 1;
}
.plotbox svg {
position: absolute;
top: 50px;
left: 50px;
width: 100%;
height: 100%;
}
.plotbox svg path {
fill: rgba(111, 155, 255, 0.23);
stroke: blue;
stroke-width: 0.035;
}
.plotbox svg path.active {
fill: transparent;
stroke: #ff3030;
}
button {
font-family: monospace;
}
.image {
pointer-events: none;
opacity: 0.1;
margin: 50px;
}
.plotpoints {
width: 330px;
height: 100vh;
border-left: 1px solid #d4d4d4;
overflow: hidden;
padding: 20px;
display: flex;
flex-direction: column;
}
.plotpoints p {
margin-top: 0;
}
.plotpoints pre {
margin: 0;
overflow: scroll;
background-color: #f9f9f9;
}
.plotpoints .buttons {
padding: 20px 0;
}
.plotpoints code {
display: block;
height: 100%;
padding: 10px;
width: 100%;
}
.zoom-controls {
position: absolute;
top: 10px;
right: 340px;
display: flex;
z-index: 1;
}
button {
cursor: pointer;
}
.zoom-controls button {
margin-right: 5px;
margin-left: 5px;
}
.results {
margin-top: 10px;
flex: 1;
overflow: scroll;
}
.result label {
display: flex;
padding: 10px;
background-color: #f9f9f9;
border-bottom: 1px solid #d4d4d4;
cursor: pointer;
}
.result label span:first-child {
flex: 1;
text-decoration: underline;
}
.result label:hover span:first-child,
.result.active span:first-child {
text-decoration: none;
}
.result.active label {
font-weight: bold;
}
.result label span:last-child:before {
content: '+';
}
.result.active label span:last-child:before {
content: '-';
}
.result pre {
display: none;
}
.result.active pre {
display: block;
}
</style>
</head>
<body>
<main>
<div class="zoom-controls">
zoom:
<button class="zoom-out">-</button>
<button class="zoom-in">+</button>
</div>
<div class="plotbox">
<svg viewBox="0 0 100 100" preserveAspectRatio="none"></svg>
<img src="" class="image">
</div>
<div class="plotpoints">
<p>
<strong>Click</strong> to draw panels.<br>
<strong>Press enter</strong> to close the panel path.
<br> While drawing <strong>shift-click</strong> to undo last point.
<br> After drawing <strong>Shift-click</strong> on a panel to delete it.<br>
<strong>Press shift-+/-</strong> to zoom in or out.
</p>
<div class="results"></div>
<div class="buttons">
<button class="copy-button">Copy data</button>
<button class="clear-button">Clear current panels</button>
</div>
<label>
Upload manga files
<input type="file" class="upload-files" name="files[]" accept="image/*" multiple>
</label>
</div>
</main>
<script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.5.13/clipboard.min.js"></script>
<script src="panels.js"></script>
</body>
</html>