Add 4 files
Browse files
README.md
CHANGED
@@ -1,11 +1,8 @@
|
|
1 |
---
|
2 |
-
|
3 |
-
|
4 |
-
colorFrom: red
|
5 |
-
colorTo: pink
|
6 |
sdk: static
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
license: apache-2.0
|
3 |
+
title: AI Chatbot that can Read PDFs
|
|
|
|
|
4 |
sdk: static
|
5 |
+
emoji: π¨βπ»
|
6 |
+
colorFrom: yellow
|
7 |
+
colorTo: green
|
8 |
+
---
|
|
index.html
CHANGED
@@ -1,19 +1,15 @@
|
|
1 |
-
|
2 |
-
<
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
</p>
|
17 |
-
</div>
|
18 |
-
</body>
|
19 |
-
</html>
|
|
|
1 |
+
<html><head><link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/full.css" rel="stylesheet" type="text/css" /><script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script><script src="https://cdn.tailwindcss.com?plugins=forms,typography,aspect-ratio"></script><script defer src="https://cdnjs.cloudflare.com/ajax/libs/three.js/0.156.1/three.min.js"></script><script type="module" src="main.js"></script><title> AI Chatbot that can Read PDFs</title></head><body>
|
2 |
+
<div class="flex justify-center items-center flex-col h-full">
|
3 |
+
<div class="flex justify-between">
|
4 |
+
<div class="flex items-end">
|
5 |
+
<h1 class="mr-4 text-xl">AI Chatbot</h1>
|
6 |
+
<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">Read PDFs</button>
|
7 |
+
</div>
|
8 |
+
<div>
|
9 |
+
<h1 class="mr-4 text-lg">PDF Reading</h1>
|
10 |
+
<button class="bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 rounded">Stop</button>
|
11 |
+
</div>
|
12 |
+
</div>
|
13 |
+
<iframe id="pdf" src="" width="100%" height="600px" frameborder="0"></iframe>
|
14 |
+
</div>
|
15 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/full.css"></script></body></html>
|
|
|
|
|
|
|
|
main.js
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Component, createElement, render } from "https://esm.sh/[email protected]"
|
2 |
+
import { ref } from "https://esm.sh/[email protected]/dist/alpinejs.global.js"
|
3 |
+
import { init } from "https://esm.sh/[email protected]/dist/full.css"
|
4 |
+
import { html } from "https://esm.sh/lit-html"
|
5 |
+
|
6 |
+
const pdf = ref()
|
7 |
+
const ctx = ref()
|
8 |
+
|
9 |
+
const app = {
|
10 |
+
setup() {
|
11 |
+
const { state, effect, watch } = this
|
12 |
+
state = { count: 0 }
|
13 |
+
effect({
|
14 |
+
message: "Started"
|
15 |
+
})
|
16 |
+
return { count: state.count }
|
17 |
+
},
|
18 |
+
html() {
|
19 |
+
const { count } = this.effect()
|
20 |
+
return html`
|
21 |
+
<div class="flex">
|
22 |
+
<button class="bg-[#0082c9] hover:bg-[#00e1d9] text-white font-bold py-2 px-4 rounded"> Read PDFs </button>
|
23 |
+
<button class="bg-[#00e1d9] hover:bg-[#0082c9] text-white font-bold py-2 px-4 rounded">Stop</button>
|
24 |
+
</div>
|
25 |
+
<div class="flex">
|
26 |
+
<iframe id="pdf" src="" width="100%" height="600px" frameborder="0"></iframe>
|
27 |
+
</div>
|
28 |
+
`
|
29 |
+
},
|
30 |
+
async mounted() {
|
31 |
+
this.pdf = this.el.querySelector("#pdf")
|
32 |
+
this.ctx = this.pdf.getContext("2d")
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
init(app)
|
style.css
CHANGED
@@ -1,28 +1,31 @@
|
|
1 |
body {
|
2 |
-
|
3 |
-
|
4 |
}
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
|
|
|
|
9 |
}
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
|
|
|
|
|
|
|
|
16 |
}
|
17 |
|
18 |
-
.
|
19 |
-
|
20 |
-
margin: 0 auto;
|
21 |
-
padding: 16px;
|
22 |
-
border: 1px solid lightgray;
|
23 |
-
border-radius: 16px;
|
24 |
}
|
25 |
|
26 |
-
.
|
27 |
-
|
28 |
-
}
|
|
|
1 |
body {
|
2 |
+
font-family: Georgia, Arial, sans-serif;
|
3 |
+
padding: 20px;
|
4 |
}
|
5 |
|
6 |
+
.flex {
|
7 |
+
display: flex;
|
8 |
+
align-items: center;
|
9 |
+
justify-content: center;
|
10 |
+
padding: 50px;
|
11 |
+
height: 100vh;
|
12 |
}
|
13 |
|
14 |
+
.button {
|
15 |
+
background-color: #0082c9;
|
16 |
+
border: none;
|
17 |
+
color: white;
|
18 |
+
padding: 15px 32px;
|
19 |
+
text-align: center;
|
20 |
+
font-size: 16px;
|
21 |
+
margin: 4px 2px;
|
22 |
+
cursor: pointer;
|
23 |
}
|
24 |
|
25 |
+
.button--green {
|
26 |
+
background-color: #00e1d9;
|
|
|
|
|
|
|
|
|
27 |
}
|
28 |
|
29 |
+
.button--blue {
|
30 |
+
background-color: #0082c9;
|
31 |
+
}
|