Spaces:
Running
Running
Commit ·
ccf9d60
1
Parent(s): 7993c74
Add 2 files
Browse files- app.js +50 -0
- index.html +1 -19
app.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* This is the Imagens Generator homepage */
|
| 2 |
+
|
| 3 |
+
let alpinejs = undefined;
|
| 4 |
+
let daisysUI = undefined;
|
| 5 |
+
let tailwind = undefined;
|
| 6 |
+
let threejs = undefined;
|
| 7 |
+
|
| 8 |
+
document.addEventListener("DOMContentLoaded", async () => {
|
| 9 |
+
// Get references to the libraries
|
| 10 |
+
alpinejs = new Alpine();
|
| 11 |
+
daisysUI = new DaisyUI();
|
| 12 |
+
tailwind = new Tailwind((contentContainer, attributes) => {
|
| 13 |
+
// Do something when the tailwind is ready
|
| 14 |
+
});
|
| 15 |
+
threejs = new THREE();
|
| 16 |
+
|
| 17 |
+
// Create the layout
|
| 18 |
+
const layout = <article className="prose">
|
| 19 |
+
<h1><a href="#" tabIndex={-1}>It works!</a></h1>
|
| 20 |
+
<p>This is the <a href="index.html">Imagens Generator</a> homepage.</p>
|
| 21 |
+
</article>;
|
| 22 |
+
|
| 23 |
+
// Render the layout
|
| 24 |
+
const contentContainer = document.querySelector("#app");
|
| 25 |
+
contentContainer.innerHTML = layout;
|
| 26 |
+
alpinejs.addDirective({name: "oninit", callback: () => {
|
| 27 |
+
// Custom behavior for the AlpineJS oninit directive
|
| 28 |
+
}});
|
| 29 |
+
daisysUI.addDirective("daisy-button", () => {
|
| 30 |
+
// Custom behavior for the daisy-button directive
|
| 31 |
+
});
|
| 32 |
+
tailwind.addDirective("tailwind-directive", () => {
|
| 33 |
+
// Custom behavior for the tailwind-directive directive
|
| 34 |
+
});
|
| 35 |
+
threejs.addDirective("threejs-directive", () => {
|
| 36 |
+
// Custom behavior for the threejs-directive directive
|
| 37 |
+
});
|
| 38 |
+
alpinejs.addEvent("@loading", () => {
|
| 39 |
+
// Do something when AlpineJS is loading
|
| 40 |
+
});
|
| 41 |
+
daisysUI.addEvent("@loading", () => {
|
| 42 |
+
// Do something when DaisyUI is loading
|
| 43 |
+
});
|
| 44 |
+
tailwind.addEvent("@loading", () => {
|
| 45 |
+
// Do something when Tailwind is loading
|
| 46 |
+
});
|
| 47 |
+
threejs.addEvent("@loading", () => {
|
| 48 |
+
// Do something when three.js is loading
|
| 49 |
+
});
|
| 50 |
+
});
|
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>Imagens Generator</title><meta name="viewport" content="width=device-width, initial-scale=1.0," /></head><body></body></html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|