forked from UniversalViewer/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.html
194 lines (156 loc) · 6 KB
/
template.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
184
185
186
187
188
189
190
191
192
193
194
<!doctype html>
<html lang="en" class="no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="http://html5-templates.com/" />
<title>Example page for Universal Player</title>
<meta name="description" content="Simple HTML5 Page layout template with header, footer, sidebar etc.">
<link rel="stylesheet" href="template-style.css">
<link rel="stylesheet" type="text/css" href="uv/uv.css">
<script src="uv/lib/offline.js"></script>
<script src="uv/helpers.js"></script>
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> -->
<script src="https://rawgit.com/edsilv/utils/master/dist/utils.min.js"></script>
</head>
<body>
<header>
<div id="logo">Logo area</div>
<nav>
<ul>
<li><a href="/">Home</a>
<li><a href="#">Sounds</a>
<li><a href="#">Menu item</a>
<li><a href="#">Menu item</a>
</ul>
</nav>
</header>
<section>
<strong>An example of where the Universal player could sit in the page.</strong>
</section>
<section id="pageContent">
<img id="poster" width="200" />
<button id="play">Play</button>
<button id="pause">Pause</button>
<div id="viewer" class="viewer expandable">
<div id="uv" class="uv"></div>
<!-- <iframe id="uv" class="expandable" allowfullscreen frameborder="0" allowtransparency="true"></iframe> -->
<!-- <br><button id="expando" class="expand">expand</button> -->
</div>
<main role="main">
<article>
<h2>Sound file title</h2>
<p>Lorem ipsum dolor sit amet, nonumes voluptatum mel ea, cu case ceteros cum. Novum commodo malorum vix ut. Dolores consequuntur in ius, sale electram dissentiunt quo te. Cu duo omnes invidunt, eos eu mucius fabellas. Stet facilis ius te, quando voluptatibus eos in. Ad vix mundi alterum, integre urbanitas intellegam vix in.</p>
</article>
<article>
<h2>Illud mollis moderatius</h2>
<p>Eum facete intellegat ei, ut mazim melius usu. Has elit simul primis ne, regione minimum id cum. Sea deleniti dissentiet ea. Illud mollis moderatius ut per, at qui ubique populo. Eum ad cibo legimus, vim ei quidam fastidii.</p>
</article>
</main>
<aside>
<div>Another sound file</div>
<div>Another sound file</div>
<div>Another sound file</div>
</aside>
</section>
<footer>
<div class="viewer">Placeholder for Universal viewer at bottom of the page</div>
<p>© You can copy and edit and publish this template but please leave a link to our website | <a href="http://html5-templates.com/" target="_blank" rel="nofollow">HTML5 Templates</a></p>
</footer>
<script type="text/javascript">
var uv, $uv, urlDataProvider, manifest;
window.addEventListener('uvLoaded', function (e) {
$uv = $('#uv');
urlDataProvider = new UV.URLDataProvider();
var data = {
root: './uv',
configUri: 'template-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', ''),
rangeId: urlDataProvider.get('rid', ''),
locales: [
{
name: 'en-GB'
}
]
};
uv = createUV('#uv', data, urlDataProvider);
uv.on('created', function() {
Utils.Urls.setHashParameter('manifest', manifest);
// poster image
var posterimage = uv.extension.helper.getPosterImage();
$('#poster').prop('src', posterimage);
});
// are there uv hash parameters?
manifest = Utils.Urls.getHashParameter('manifest');
if (manifest) {
uv.set(Object.assign(data, {
iiifResourceUri: manifest
}));
}
}, false);
$('#play').on('click', function() {
uv.extension.centerPanel.avcomponent.play();
});
$('#pause').on('click', function() {
uv.extension.centerPanel.avcomponent.pause();
});
/*
$(function() {
var isLocalhost = document.location.href.indexOf('localhost') !== -1;
var $uv = $('#uv');
var $viewer = $('#viewer');
var uvurl = (isLocalhost) ? '/examples/uv/uv.html#?' : '/uv/uv.html#?';
// are there uv hash parameters?
var manifest = Utils.Urls.getHashParameter('manifest');
var rangeId = Utils.Urls.getHashParameter('rid');
if (manifest) {
uvurl += 'manifest=' + manifest;
if (rangeId) {
uvurl += '&rid=' + rangeId;
}
uvurl += '&config=' + ((isLocalhost) ? '/examples/template-config.json' : '/template-config.json');
// $uv.on('load', function() {
// $uv.contents().find('head')
// .append($('<style> .uv{ background-color: transparent !important; } .canvas-container{ background-color: transparent !important; } </style>'));
// });
$uv.prop('src', uvurl);
}
$('#expando').on('click', function() {
if ($('#expando').hasClass('expand')) {
$('.expandable').each(function() {
$(this).animate({height: '640px'}, 600, function() {
$('#expando').removeClass('expand').addClass('collapse');
$('#expando').text('collapse');
});
});
} else {
$('.expandable').each(function() {
$(this).animate({height: '220px'}, 600, function() {
$('#expando').removeClass('collapse').addClass('expand');
$('#expando').text('expand');
});
});
}
});
function resize() {
var width = $viewer.width();
var height = $viewer.height();
$uv.width(width);
$uv.height(height);
}
$(window).on('resize' ,function() {
resize();
});
resize();
});
*/
</script>
<script src="uv/uv.js"></script>
</body>
</html>