-
Notifications
You must be signed in to change notification settings - Fork 26
/
index.html
112 lines (85 loc) · 3.26 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 lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>My Collection</title>
<link rel="stylesheet" type="text/css" href="uv/uv.css">
<link rel="stylesheet" type="text/css" href="styles.css">
<link rel="stylesheet" type="text/css" href="https://unpkg.com/tachyons/css/tachyons.min.css" />
<script src="https://unpkg.com/iiif-gallery@0.0.28/dist/iiifgallery.js"></script>
<script src="uv/lib/offline.js"></script>
<script src="uv/helpers.js"></script>
</head>
<body>
<nav>
<h1>My Collection</h1>
</nav>
<main>
<div id="uv" class="uv"></div>
<iiif-gallery manifest="/uv-app-starter/collection/index.json"></iiif-gallery>
</main>
<script>
var uv, $uv, urlDataProvider, manifest;
function openManifest() {
window.scrollTo(0, 0);
$uv.slideDown("fast", function() {
uv.set({
root: './uv',
iiifResourceUri: manifest,
configUri: 'uv-config.json',
collectionIndex: 0,
manifestIndex: 0,
sequenceIndex: 0,
canvasIndex: 0,
locales: [
{
name: 'en-GB'
}
]
});
});
}
window.addEventListener('uvLoaded', function (e) {
$uv = $('#uv');
urlDataProvider = new UV.URLDataProvider();
var data = {
root: './uv',
iiifResourceUri: manifest,
configUri: 'uv-config.json',
collectionIndex: Number(urlDataProvider.get('c', 0)),
manifestIndex: Number(urlDataProvider.get('m', 0)),
sequenceIndex: Number(urlDataProvider.get('s', 0)),
canvasIndex: Number(urlDataProvider.get('cv', 0)),
rotation: Number(urlDataProvider.get('r', 0)),
xywh: urlDataProvider.get('xywh', ''),
locales: [
{
name: 'en-GB'
}
]
};
uv = createUV('#uv', data, urlDataProvider);
uv.on('created', function() {
Utils.Urls.setHashParameter('manifest', manifest);
});
const iiifGallery = document.querySelector('iiif-gallery');
iiifGallery.addEventListener('selectManifest', function (evt) {
manifest = evt.detail.id;
openManifest();
});
iiifGallery.addEventListener('selectCollection', function (evt) {
manifest = evt.detail.id;
openManifest();
});
// are there uv hash parameters?
manifest = Utils.Urls.getHashParameter('manifest');
if (manifest) {
openManifest();
}
}, false);
</script>
<script src="uv/uv.js"></script>
</body>
</html>