1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-04 15:09:16 +02:00
epub.js/examples/basic.html
2014-11-17 19:22:37 -05:00

110 lines
1.9 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>EPUB.js Basic Example</title>
<script src="../dist/epub.js"></script>
<style type="text/css">
body {
margin: 0;
background: #fafafa;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
color: #333;
height: 100%;
height: 100%;
/* position: absolute; */
}
#viewer {
display: block;
width: 100%;
height: 100%;
text-align: center;
position: absolute;
top: 0;
left: 0;
}
#viewer > div {
/*padding: 0 25% 0 25%;*/
}
#viewer .epub-view {
background: white;
box-shadow: 0 0 4px #ccc;
margin: 10px;
padding: 20px;
width: 50% !important;
}
#viewer .epub-view iframe {
width: 100% !important;
}
#prev {
left: 40px;
}
#next {
right: 40px;
}
.arrow {
position: fixed;
top: 50%;
margin-top: -32px;
font-size: 64px;
color: #E2E2E2;
font-family: arial, sans-serif;
font-weight: bold;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
.arrow:hover {
color: #777;
}
.arrow:active {
color: #000;
}
#toc {
display: block;
margin: 10px auto;
}
</style>
</head>
<body>
<div id="viewer"></div>
<script>
var currentSectionIndex = 8;
// Load the opf
var book = ePub("../books/moby-dick/OPS/package.opf");
var rendition = book.renderTo("viewer", { width: "100%" });
var displayed = rendition.display(currentSectionIndex);
displayed.then(function(renderer){
// -- do stuff
});
// Navigation loaded
book.loaded.navigation.then(function(toc){
// console.log(toc);
});
</script>
</body>
</html>