Commit
•
eb6413b
1
Parent(s):
1d0deab
Update index.html
Browse files- index.html +5 -38
index.html
CHANGED
@@ -15,9 +15,10 @@
|
|
15 |
h1 {
|
16 |
color: #2c3e50;
|
17 |
}
|
18 |
-
|
19 |
-
|
20 |
-
|
|
|
21 |
border: 1px solid #ddd;
|
22 |
}
|
23 |
</style>
|
@@ -25,41 +26,7 @@
|
|
25 |
<body>
|
26 |
<div class="container">
|
27 |
<h1>Unconscious Bias Training</h1>
|
28 |
-
<
|
29 |
</div>
|
30 |
-
<script src="pdf.js"></script>
|
31 |
-
<script src="pdf.worker.js"></script>
|
32 |
-
<script>
|
33 |
-
const url = 'https://huggingface.co/spaces/EmilyWitko/Unconscious_Bias/raw/main/Training%20%232_%20Unconscious%20Bias.pdf';
|
34 |
-
|
35 |
-
const loadingTask = pdfjsLib.getDocument(url);
|
36 |
-
loadingTask.promise.then(function(pdf) {
|
37 |
-
console.log('PDF loaded');
|
38 |
-
|
39 |
-
const pageNumber = 1;
|
40 |
-
pdf.getPage(pageNumber).then(function(page) {
|
41 |
-
console.log('Page loaded');
|
42 |
-
|
43 |
-
const scale = 1.5;
|
44 |
-
const viewport = page.getViewport({scale: scale});
|
45 |
-
|
46 |
-
const canvas = document.getElementById('pdf-viewer');
|
47 |
-
const context = canvas.getContext('2d');
|
48 |
-
canvas.height = viewport.height;
|
49 |
-
canvas.width = viewport.width;
|
50 |
-
|
51 |
-
const renderContext = {
|
52 |
-
canvasContext: context,
|
53 |
-
viewport: viewport
|
54 |
-
};
|
55 |
-
const renderTask = page.render(renderContext);
|
56 |
-
renderTask.promise.then(function () {
|
57 |
-
console.log('Page rendered');
|
58 |
-
});
|
59 |
-
});
|
60 |
-
}, function (reason) {
|
61 |
-
console.error(reason);
|
62 |
-
});
|
63 |
-
</script>
|
64 |
</body>
|
65 |
</html>
|
|
|
15 |
h1 {
|
16 |
color: #2c3e50;
|
17 |
}
|
18 |
+
.container {
|
19 |
+
text-align: center;
|
20 |
+
}
|
21 |
+
iframe {
|
22 |
border: 1px solid #ddd;
|
23 |
}
|
24 |
</style>
|
|
|
26 |
<body>
|
27 |
<div class="container">
|
28 |
<h1>Unconscious Bias Training</h1>
|
29 |
+
<iframe src="https://docs.google.com/gview?url=https://huggingface.co/spaces/EmilyWitko/Unconscious_Bias/raw/main/Training%20%232_%20Unconscious%20Bias.pdf&embedded=true" width="1000" height="800"></iframe>
|
30 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
</body>
|
32 |
</html>
|