@teipublisher/pb-components
Version:
Collection of webcomponents underlying TEI Publisher
115 lines (100 loc) • 4.36 kB
HTML
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes"/>
<title>pb-view Demo</title>
<script src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script><script type="module" src="../pb-components-bundle.js"></script>
</head>
<body>
<pb-demo-snippet>
<template>
<style type="text/css">
body {
--paper-fab-background: #35424b;
}
demo-snippet {
position: relative;
}
main {
height: 70vh;
overflow: auto;
display: flex;
justify-content: center;
position: relative;
}
pb-drawer {
background-color: #f0f0f0;
--pb-drawer-width: 33vw;
}
pb-drawer ul {
list-style-type: none;
margin: 0;
padding: 0;
}
pb-drawer li {
margin-bottom: 10px;
}
pb-drawer pb-link {
display: block;
margin-left: 34px;
}
pb-drawer [slot="collapse-trigger"] > pb-link {
margin-left: 0;
}
pb-drawer ul ul {
padding-left: 20px;
}
.toolbar {
padding: 10px 0;
}
pb-navigation {
position: fixed;
bottom: 45%;
--paper-fab-background: #35424b;
color: white;
}
pb-navigation[direction=backward] {
left: 20px;
}
pb-navigation[direction=forward] {
right: 20px;
}
pb-load ul {
list-style: none;
margin-left: 0;
}
pb-link a {
text-decoration: none;
color: #222222;
}
</style>
<pb-page endpoint="https://teipublisher.com/exist/apps/tei-publisher" api-version="1.0.0" url-path="query">
<pb-document id="document1" path="test/kant_rvernunft_1781.TEI-P5.xml" odd="dta"></pb-document>
<div class="toolbar">
<paper-icon-button id="tocToggle" class="toc-toggle" icon="icons:view-list"></paper-icon-button>
</div>
<pb-progress></pb-progress>
<pb-drawer id="toc" toggle="tocToggle" class="tocDrawer" emit="toc" subscribe="transcription">
<div class="drawer-content">
<h3>
<pb-i18n key="document.contents">Contents</pb-i18n>
</h3>
<pb-load url="api/document/{doc}/contents?target=transcription&icons=true" src="document1" expand subscribe="toc" load-once>Loading...</pb-load>
</div>
</pb-drawer>
<main>
<!-- Navigate to previous page -->
<pb-navigation direction="backward" keyboard="left" emit="transcription" subscribe="transcription">
<paper-fab icon="icons:chevron-left"></paper-fab>
</pb-navigation>
<pb-view id="view1" src="document1" view="page" append-footnotes emit="transcription" subscribe="transcription"></pb-view>
<!-- Navigate to next page -->
<pb-navigation direction="forward" keyboard="right" emit="transcription" subscribe="transcription">
<paper-fab icon="icons:chevron-right"></paper-fab>
</pb-navigation>
</main>
</pb-page>
</template>
</pb-demo-snippet>
</body>
</html>