-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
112 lines (93 loc) · 2.06 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="%1/node_modules/viewerjs/dist/viewer.js"></script>
<link rel="stylesheet" href="%1/node_modules/viewerjs/dist/viewer.css" />
<style>
html, body {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
background: %3;
}
img {
display: none;
background: %3;
}
.viewer-container {
background: %3;
}
.viewer-fullscreen, .viewer-fullscreen-exit {
display: none;
}
</style>
</head>
<body>
<div>
<img id="image" src="%2">
</div>
<script type="text/javascript">
// View an image
const viewer = new Viewer(document.getElementById('image'), {
inline: true,
navbar: false,
transition: false,
toolbar: {
zoomIn: 4,
zoomOut: 4,
oneToOne: 4,
reset: 4,
rotateLeft: 4,
rotateRight: 4,
flipHorizontal: 4,
flipVertical: 4,
},
view() {
viewer.full();
},
});
function rotateLeft() {
viewer.rotate(-90);
}
function rotateRight() {
viewer.rotate(90);
}
function rotateHorizontal() {
viewer.rotate(180);
}
function zoomOut() {
viewer.zoom(-0.1, true);
}
function zoomIn() {
viewer.zoom(0.1, true);
}
function zoomReset() {
viewer.reset();
}
function zoomToggle() {
viewer.toggle();
}
function flipHorizontal() {
viewer.scaleX(-viewer.imageData.scaleX || -1);
}
function flipVertical() {
viewer.scaleY(-viewer.imageData.scaleY || -1);
}
function moveLeft() {
viewer.move(-10, 0);
}
function moveRight() {
viewer.move(10, 0);
}
function moveUp() {
viewer.move(0, -10);
}
function moveDown() {
viewer.move(0, 10);
}
</script>
</body>
</html>