<!doctype html>
<title>{{ slide_filename }}</title>

<style type="text/css">
html {
    overflow: hidden;
}
body {
    margin: 0;
    padding: 0;
}
div#view {
    position: absolute;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    color: white;
}
</style>

<div id="view"></div>

<script type="text/javascript" src="{{ url_for('static', filename='jquery.js') }}"></script>
<script type="text/javascript" src="{{ url_for('static', filename='openseadragon.js') }}"></script>
<script type="text/javascript">
$(document).ready(function() {
    var viewer = new OpenSeadragon({
        id: "view",
        tileSources: "{{ slide_url }}",
        prefixUrl: "{{ url_for('static', filename='images/') }}",
        showNavigator: true,
        animationTime: 0.5,
        blendTime: 0.1,
        constrainDuringPan: true,
        maxZoomPixelRatio: 2,
        minZoomLevel: 1,
        visibilityRatio: 1,
        zoomPerScroll: 2,
        timeout: 120000,
    });
    viewer.addHandler("open", function() {
        // To improve load times, ignore the lowest-resolution Deep Zoom
        // levels.  This is a hack: we can't configure the minLevel via
        // OpenSeadragon configuration options when the viewer is created
        // from DZI XML.
        viewer.source.minLevel = 8;
    });
});
</script>
