Spaces:
Running
Running
acecalisto3
commited on
Commit
•
e46fd23
1
Parent(s):
58ae54b
Add 3 files
Browse files- README.md +22 -6
- index.html +1 -19
- main.js +131 -0
README.md
CHANGED
@@ -1,11 +1,27 @@
|
|
1 |
---
|
|
|
2 |
title: UIKitV3 Automator
|
3 |
-
emoji: 📚
|
4 |
-
colorFrom: green
|
5 |
-
colorTo: blue
|
6 |
sdk: static
|
7 |
-
|
8 |
-
|
|
|
9 |
---
|
|
|
10 |
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
+
license: apache-2.0
|
3 |
title: UIKitV3 Automator
|
|
|
|
|
|
|
4 |
sdk: static
|
5 |
+
emoji: 👨💻
|
6 |
+
colorFrom: yellow
|
7 |
+
colorTo: green
|
8 |
---
|
9 |
+
This app takes input and automagically transforms it into UIKitV3 code straight to your clipboard for injection to the next place. The system chooses the most appropriate UIKit component to utilize for the task at hand unless you request specific components.
|
10 |
|
11 |
+
## Features
|
12 |
+
+ Automated UIKitV3 code generation
|
13 |
+
+ Customizable UIKitV3 components
|
14 |
+
+ Drag and drop functionality
|
15 |
+
+ Supports multiple design templates
|
16 |
+
+ Dark mode
|
17 |
+
|
18 |
+
## License
|
19 |
+
MIT
|
20 |
+
|
21 |
+
## Related Projects
|
22 |
+
[UIKitV3-DaisyUI](https://verbinati.github.io/UIKitV3-DaisyUI/)
|
23 |
+
[UIKitV3-DaisyUI-ThreeJS](https://verbinati.github.io/UIKitV3-DaisyUI-ThreeJS/)
|
24 |
+
|
25 |
+
Copyright
|
26 |
+
Copyright (c) 2022-2023 Verbinati
|
27 |
+
Copyright (c) 2022-2023 Alpin\piers:
|
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/[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>UIKitV3 Automator</title></head><body><main class="prose"><div x-data="{ open: false }"><button @click="open =! open">Transform</button><div x-show="open"><textarea id="input" placeholder="Paste or type your code here" rows="10" cols="50"></textarea><button id="transform">Transform</button><div id="output" placeholder="Your transformed code will appear here"></div></div></div></main></body></html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
main.js
ADDED
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import { Alpine } from 'alpinejs';
|
2 |
+
Alpine.start();
|
3 |
+
const { application } = Alpine;
|
4 |
+
application.name = "UIKitV3 Automator";
|
5 |
+
application.args = {
|
6 |
+
template: '<div x-data="{ open: false }"><button @click="open =! open">Transform</button><div x-show="open"><textarea id="input" placeholder="Paste or type your code here" rows="10" cols="50"></textarea><button id="transform">Transform</button><div id="output" placeholder="Your transformed code will appear here"></div></div></div>'
|
7 |
+
};
|
8 |
+
Alpine.gruff = function (e) {
|
9 |
+
return e.replace(/[A-Za-z0-9]+/g, function(match) {
|
10 |
+
return String.fromCharCode(65 + Math.floor(25 * Math.random()));
|
11 |
+
});
|
12 |
+
};
|
13 |
+
Alpine.vernal = function (e) {
|
14 |
+
return e.replace(/[A-Za-z0-9]+/g, function(match) {
|
15 |
+
return String.fromCharCode(65 + Math.floor(25 * Math.random()));
|
16 |
+
});
|
17 |
+
};
|
18 |
+
Alpine.darcy = function (e) {
|
19 |
+
return e.replace(/[A-Za-z0-9]+/g, function(match) {
|
20 |
+
return String.fromCharCode(65 + Math.floor(25 * Math.random()));
|
21 |
+
});
|
22 |
+
};
|
23 |
+
document.addEventListener("DOMContentLoaded", function() {
|
24 |
+
console.log("DOMContentLOADED");
|
25 |
+
let output = document.getElementById("output");
|
26 |
+
document.getElementById("transform".addEventListener("click", function() {
|
27 |
+
fetch("https://api.ukiyov3.com/v3/transform", {
|
28 |
+
method: "POST",
|
29 |
+
headers: {
|
30 |
+
"Content-Type": "application/json"
|
31 |
+
},
|
32 |
+
body: JSON.stringify({
|
33 |
+
"template": document.getElementById("template").value
|
34 |
+
})
|
35 |
+
})
|
36 |
+
.then(response => response.json())
|
37 |
+
.then(data => {
|
38 |
+
output.innerText = data.code;
|
39 |
+
});
|
40 |
+
});
|
41 |
+
document.getElementById(" Da" + Alpine.gruff(iet.querySelector('h2').innerText)).addEventListener("click", function() {
|
42 |
+
output.innerText = daisyw;
|
43 |
+
});
|
44 |
+
document.getElementById(" ven" + Alpine.vernal(iet.querySelector('h2').innerText)).addEventListener("click", function() {
|
45 |
+
output.innerText = venreal;
|
46 |
+
});
|
47 |
+
document.getElementById(" dar" + Alpine.darcy(iet.querySelector('h2').innerText)).addEventListener("click", function() {
|
48 |
+
output.innerText = darcy;
|
49 |
+
});
|
50 |
+
});
|
51 |
+
let daisyw = `<div class="flex bg-gray-100 h-screen bg-gray-100">
|
52 |
+
<div x-data="{ open: false }">
|
53 |
+
<button @click="open = !open">
|
54 |
+
<span></span>
|
55 |
+
</button>
|
56 |
+
<div x-show="open">
|
57 |
+
<div class="fixed inset-0 z-10 bg-black opacity-25"></div>
|
58 |
+
<div class="relative flex-1 w-full max-w-md ...orem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
|
59 |
+
<div class="flex flex-col">
|
60 |
+
<div class="hover:bg-red-400">
|
61 |
+
<a role="button" tabindex="0" class="px-3 py-2 hover:bg-red-400">
|
62 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="icon icon-tabler icon-tabler-circle-x" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" focusable="false" aria-hidden="true">
|
63 |
+
<path stroke-linecap="round" stroke-linejoin="round" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
64 |
+
</svg>
|
65 |
+
</a>
|
66 |
+
</div>
|
67 |
+
<div class="text-center text-gray-500 hover:text-connect-fe">
|
68 |
+
<a role="button" tabindex="0" class="px-3 py-2 hover:text-connect-fe">
|
69 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="icon icon-tabler icon-tabler-circle-x" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" focusable="false" aria-hidden="true">
|
70 |
+
<path stroke-linecap="round" stroke-linejoin="round" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
71 |
+
</svg>
|
72 |
+
</a>
|
73 |
+
</div>
|
74 |
+
</div>
|
75 |
+
</div>
|
76 |
+
</div>
|
77 |
+
</div>`;
|
78 |
+
let venreal = `<div class="flex bg-gray-100 h-screen bg-gray-100">
|
79 |
+
<div x-data="{ open: false }">
|
80 |
+
<button @click="open = !open">
|
81 |
+
<span></span>
|
82 |
+
</button>
|
83 |
+
<div x-show="open">
|
84 |
+
<div class="fixed inset-0 z-10 bg-black opacity-25"></div>
|
85 |
+
<div class="relative flex-1 w-full max-w-md ...orem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
|
86 |
+
<div class="flex flex-col">
|
87 |
+
<div class="hover:bg-red-400">
|
88 |
+
<a role="button" tabindex="0" class="px-3 py-2 hover:bg-red-400">
|
89 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="icon icon-tabler icon-tabler-circle-x" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" focusable="false" aria-hidden="true">
|
90 |
+
<path stroke-linecap="round" stroke-linejoin="round" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
91 |
+
</svg>
|
92 |
+
</a>
|
93 |
+
</div>
|
94 |
+
<div class="text-center text-gray-500 hover:text-connect-fe">
|
95 |
+
<a role="button" tabindex="0" class="px-3 py-2 hover:text-connect-fe">
|
96 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="icon icon-tabler icon-tabler-circle-x" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" focusable="false" aria-hidden="true">
|
97 |
+
<path stroke-linecap="round" stroke-linejoin="round" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
98 |
+
</svg>
|
99 |
+
</a>
|
100 |
+
</div>
|
101 |
+
</div>
|
102 |
+
</div>
|
103 |
+
</div>
|
104 |
+
</div>`;
|
105 |
+
let darcy = `<div class="flex bg-gray-100 h-screen"">
|
106 |
+
<div x-data="{ open: false }">
|
107 |
+
<button @click="open = !open">
|
108 |
+
<span></span>
|
109 |
+
</button>
|
110 |
+
<div x-show="open">
|
111 |
+
<div class="fixed inset-0 z-10 bg-black opacity-25"></div>
|
112 |
+
<div class="relative flex-1 w-full max-w-md ...orem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
|
113 |
+
<div class="flex flex-col">
|
114 |
+
<div class="hover:bg-red-400">
|
115 |
+
<a role="button" tabindex="0" class="px-3 py-2 hover:bg-red-400">
|
116 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="icon icon-tabler icon-tabler-circle-x" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" focusable="false" aria-hidden="true">
|
117 |
+
<path stroke-linecap="round" stroke-linejoin="round" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
118 |
+
</svg>
|
119 |
+
</a>
|
120 |
+
</div>
|
121 |
+
<div class="text-center text-gray-500 hover:text-connect-fe">
|
122 |
+
<a role="button" tabindex="0" class="px-3 py-2 hover:text-connect-fe">
|
123 |
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="icon icon-tabler icon-tabler-circle-x" viewBox="0 0 24 24" stroke-width="1" stroke="currentColor" focusable="false" aria-hidden="true">
|
124 |
+
<path stroke-linecap="round" stroke-linejoin="round" d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
|
125 |
+
</svg>
|
126 |
+
</a>
|
127 |
+
</div>
|
128 |
+
</div>
|
129 |
+
</div>
|
130 |
+
</div>
|
131 |
+
</div>`;
|