MZ786 commited on
Commit
97bda00
β€’
1 Parent(s): e93abe2

Add 4 files

Browse files
Files changed (4) hide show
  1. README.md +6 -9
  2. index.html +15 -19
  3. main.js +36 -0
  4. style.css +22 -19
README.md CHANGED
@@ -1,11 +1,8 @@
1
  ---
2
- title: AI Chatbot That Can Read PDFs
3
- emoji: 🏒
4
- colorFrom: red
5
- colorTo: pink
6
  sdk: static
7
- pinned: false
8
- license: mit
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
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
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
- padding: 2rem;
3
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
4
  }
5
 
6
- h1 {
7
- font-size: 16px;
8
- margin-top: 0;
 
 
 
9
  }
10
 
11
- p {
12
- color: rgb(107, 114, 128);
13
- font-size: 15px;
14
- margin-bottom: 10px;
15
- margin-top: 5px;
 
 
 
 
16
  }
17
 
18
- .card {
19
- max-width: 620px;
20
- margin: 0 auto;
21
- padding: 16px;
22
- border: 1px solid lightgray;
23
- border-radius: 16px;
24
  }
25
 
26
- .card p:last-child {
27
- margin-bottom: 0;
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
+ }