Add 3 files
Browse files- index.html +1 -19
- main.js +31 -0
- style.css +49 -18
index.html
CHANGED
|
@@ -1,19 +1 @@
|
|
| 1 |
-
<!
|
| 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/daisyui@3.1.6/dist/full.css" rel="stylesheet" type="text/css" /><script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/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>GPT-3 App</title></head><body><div class="prose"><h1>GPT-3 App</h1><p>Welcome to the GPT-3 App!</p><p>This app uses AlpineJS, DaisyUI, and Tailwind to create a responsive and modern interface for writing blog posts using the GPT-3 engine.</p><button class="btn" @click="generateArticles">Generate Articles</button></div></body></html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
main.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
script.
|
| 2 |
+
import { reactive } from 'alpinejs';
|
| 3 |
+
import { createRef } from 'daisyui';
|
| 4 |
+
|
| 5 |
+
const app = reactive({
|
| 6 |
+
template: '<article class="prose"><h2>New Article</h2><p>{{ generateArticles }}</p></article>',
|
| 7 |
+
generateArticles() {
|
| 8 |
+
const article = document.createElement('article');
|
| 9 |
+
article.classList.add('prose');
|
| 10 |
+
const h2 = document.createElement('h2');
|
| 11 |
+
h2.textContent = 'New Article';
|
| 12 |
+
article.appendChild(h2);
|
| 13 |
+
const p = document.createElement('p');
|
| 14 |
+
p.textContent = 'Loading articles...';
|
| 15 |
+
article.appendChild(p);
|
| 16 |
+
createRef(p, {
|
| 17 |
+
text: 'Loading articles...',
|
| 18 |
+
state: 'loading',
|
| 19 |
+
});
|
| 20 |
+
document.getElementById('article-section').appendChild(article);
|
| 21 |
+
},
|
| 22 |
+
});
|
| 23 |
+
|
| 24 |
+
createRef(document.getElementById('article-section'), {
|
| 25 |
+
text: '',
|
| 26 |
+
state: 'ready',
|
| 27 |
+
});
|
| 28 |
+
|
| 29 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 30 |
+
app.generateArticles();
|
| 31 |
+
});
|
style.css
CHANGED
|
@@ -1,28 +1,59 @@
|
|
| 1 |
body {
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
| 4 |
}
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
}
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
margin-top: 5px;
|
| 16 |
}
|
| 17 |
|
| 18 |
-
.
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
padding: 16px;
|
| 22 |
-
border: 1px solid lightgray;
|
| 23 |
-
border-radius: 16px;
|
| 24 |
}
|
| 25 |
|
| 26 |
-
.
|
| 27 |
-
|
| 28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
body {
|
| 2 |
+
font-family: Arial, sans-serif;
|
| 3 |
+
margin: 0;
|
| 4 |
+
padding: 0;
|
| 5 |
+
background-color: #f0f0f0;
|
| 6 |
}
|
| 7 |
|
| 8 |
+
.prose {
|
| 9 |
+
max-width: 500px;
|
| 10 |
+
margin: 0 auto;
|
| 11 |
+
padding: 20px;
|
| 12 |
+
background-color: white;
|
| 13 |
+
border: 1px solid #ccc;
|
| 14 |
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
| 15 |
}
|
| 16 |
|
| 17 |
+
.tips {
|
| 18 |
+
font-size: 12px;
|
| 19 |
+
text-align: center;
|
| 20 |
+
color: #aaa;
|
|
|
|
| 21 |
}
|
| 22 |
|
| 23 |
+
.tips span {
|
| 24 |
+
color: #008000;
|
| 25 |
+
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
| 26 |
}
|
| 27 |
|
| 28 |
+
.tips span:hover {
|
| 29 |
+
color: #00b300;
|
| 30 |
}
|
| 31 |
+
|
| 32 |
+
.btn {
|
| 33 |
+
display: inline-block;
|
| 34 |
+
padding: 8px 12px;
|
| 35 |
+
background-color: #007bff;
|
| 36 |
+
border: 1px solid #007bff;
|
| 37 |
+
border-radius: 5px;
|
| 38 |
+
color: white;
|
| 39 |
+
text-decoration: none;
|
| 40 |
+
cursor: pointer;
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
.btn:hover {
|
| 44 |
+
background-color: #0069d9;
|
| 45 |
+
border-color: #0069d9;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
.footer {
|
| 49 |
+
margin-top: 20px;
|
| 50 |
+
padding-top: 20px;
|
| 51 |
+
border-top: 1px solid #999;
|
| 52 |
+
text-align: center;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
.footer p {
|
| 56 |
+
margin-bottom: 0;
|
| 57 |
+
font-size: 12px;
|
| 58 |
+
color: #777;
|
| 59 |
+
}
|