-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfragment.html
174 lines (151 loc) · 4.79 KB
/
fragment.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Krang Dataset - Fragment Viewer</title>
<meta
name="viewport"
content="width = device - width, initial-scale = 1.0, shrink-to-fit = no"
/>
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ"
crossorigin="anonymous"
/>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<link
rel="stylesheet"
href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha512-hoalWLoI8r4UszCkZ5kL8vayOGVae1oxXe/2A4AO6J9+580uKHDO3JdHb7NzwwzK5xr/Fs0W40kiNHxM9vyTtQ=="
crossorigin=""
/>
<script
src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha512-BB3hKbKWOc9Ez/TAwyWxNXeoV9c1v6FIeYiBieIWkpLjauysF18NzgR1MBNBXf8/KABdlkX68nAhlwcDFLGPCQ=="
crossorigin=""
></script>
<script src="src/main.js"></script>
<link href="src/overview.css" rel="stylesheet" />
<script>
const onLoad = async () => {
const props = new URL(document.URL).searchParams,
slideId = props.get("slideId"),
fragmentId = props.get("fragmentId");
const slides = await loadSlideCollection();
if ((globalThis?.store?.slides ?? null) !== null) {
/*
* Making the slides registry available globally once the data is downloaded
*/
globalThis.store = { ...globalThis.store, slides };
}
const { fragments } = slides[props.get("slideId")];
const { URL: fragmentURL } = fragments[fragmentId];
const positive = [
{ x: 312, y: 5723 },
{ x: 476, y: 6319 },
{ x: 861, y: 5907 },
{ x: 1688, y: 6101 },
{ x: 2517, y: 6856 },
{ x: 2723, y: 6731 },
{ x: 2780, y: 6567 },
{ x: 2425, y: 6330 },
{ x: 4475, y: 7110 },
{ x: 4684, y: 6744 },
{ x: 4744, y: 6593 },
{ x: 4869, y: 6576 },
{ x: 5372, y: 6519 },
{ x: 5895, y: 6423 },
{ x: 5677, y: 6652 },
{ x: 6038, y: 5696 },
{ x: 6026, y: 5106 },
{ x: 3692, y: 3266 },
{ x: 3654, y: 2135 },
{ x: 3456, y: 1040 },
{ x: 3648, y: 326 },
{ x: 4929, y: 823 },
{ x: 5117, y: 794 },
{ x: 6364, y: 305 },
{ x: 6283, y: 230 },
{ x: 5048, y: 309 },
{ x: 3722, y: 895 },
{ x: 1541, y: 4073 },
{ x: 123, y: 4256 },
{ x: 625, y: 774 },
{ x: 1142, y: 790 },
{ x: 2125, y: 765 },
{ x: 2303, y: 496 },
{ x: 2579, y: 747 },
{ x: 2510, y: 941 },
{ x: 3698, y: 66 },
{ x: 4396, y: 776 },
{ x: 4553, y: 35 },
{ x: 5021, y: 774 },
{ x: 4247, y: 1447 },
{ x: 4130, y: 1665 },
{ x: 3967, y: 1794 },
{ x: 3322, y: 1654 },
{ x: 3032, y: 1538 },
{ x: 2942, y: 2084 },
{ x: 2020, y: 1298 },
{ x: 1207, y: 1584 },
{ x: 1697, y: 2103 },
{ x: 1736, y: 2140 },
{ x: 1684, y: 2305 },
];
$("fragmentId").append(`Фрагмент ${fragmentId} слайда ${slideId}`);
$("#downloadfragment").append(`<a href="${fragmentURL}">Скачать</a>`);
const FragmentViewElement = $("#fragment_viewer");
const font_size = 80;
const x_offset = font_size * 0.448125;
const y_offset = font_size * 0.75;
FragmentViewElement.append(
`<img id="fragment-file" src="${fragmentURL}" />`
);
positive.forEach((point) =>
FragmentViewElement.append(
`<span
class="marker"
style="left: ${point.x - x_offset}px; top: ${
point.y - y_offset
}px; font-size: ${font_size}px;">
☉
</span>`
)
);
};
</script>
<style>
#fragment_viewer {
width: 70vw;
height: 90vh;
overflow: scroll;
position: relative;
top: 0;
left: 0;
}
#fragment {
position: relative;
top: 0;
left: 0;
}
.marker {
position: absolute;
color: greenyellow;
font-weight: bold;
}
</style>
</head>
<body onload="onLoad();">
<div class="container" style="margin-left: 5em;">
<h2 id="fragmentId"></h2>
<h3>
Фигуры митоза
<a href="/fragments.html">сменить</a>
</h3>
<div id="fragment_viewer"></div>
<div id="downloadfragment"></div>
</div>
<!-- /container -->
</body>
</html>