-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
56 lines (50 loc) · 1.61 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Lit + TS</title>
<link rel="stylesheet" href="./src/index.css" />
<script type="module" src="/src/pop-editor.ts"></script>
<script type="module" src="/src/pdf-viewer.ts"></script>
<script type="module" src="/src/object-entry.ts"></script>
<script type="module" src="/src/my-timer.ts"></script>
<style>
body, * {
margin: 0;
padding: 0;
}
main {
display: flex;
}
</style>
</head>
<body>
<!-- <my-timer duration="300"></my-timer> -->
<main>
<pop-editor
id="one"
url="https://raw.githubusercontent.com/vinodnimbalkar/svelte-pdf/369db2f9edbf5ab8c87184193e1404340729bb3a/public/sample.pdf"
fields='["hello","world"]'
></pop-editor>
</main>
<object-entry></object-entry>
</body>
<script>
document.querySelector('#one').addEventListener('modified', (event) => {
const result = document.querySelector("#result");
const main = document.querySelector('main');
if (result) {
main.removeChild(result);
}
const popEditor = document.createElement('pdf-viewer');
popEditor.setAttribute("id", "result");
popEditor.setAttribute("data", event.detail.data);
main.appendChild(popEditor)
})
document.querySelector('#one').addEventListener('pdfConfig', (event) => {
console.log(event.detail)
});
</script>
</html>