Spaces:
Running

DomeZ commited on
Commit
d0fb528
·
1 Parent(s): 8fdadea

Add 2 files

Browse files
Files changed (2) hide show
  1. index.html +12 -19
  2. main.js +25 -0
index.html CHANGED
@@ -1,19 +1,12 @@
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/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>Automatic Group Translator</title></head><body class="h-full"><div class="h-full bg-gray-100 flex justify-center">
2
+ <div class="rounded-full absolute right-0 bottom-0 w-24 h-24 border-2 border-gray-500 hover:border-gray-900"></div>
3
+ <div class="flex flex-col justify-center p-2">
4
+ <header class="px-4 py-2 font-bold text-gray-700">Automatic Group Translator</header>
5
+ <main class="flex justify-center overflow-hidden">
6
+ <div id="main" class="h-full w-full bg-gray-100"></div>
7
+ </main>
8
+ <footer class="px-4 py-2 text-xs text-center text-gray-500">&copy;2023 Automatic Group Translator</footer>
9
+ </div>
10
+ </div></body></html>
11
+
12
+ # In style.css:
 
 
 
 
 
 
 
main.js ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Get elements
3
+ */
4
+ const form = document.querySelector("form");
5
+
6
+ const langSelect = document.querySelectorAll("select");
7
+
8
+ const message = document.querySelector("input[type='text']");
9
+
10
+ const submitButton = document.querySelector("input[type='submit']");
11
+
12
+ /**
13
+ * Event listener
14
+ */
15
+ from.addEventListener("submit", (e) => {
16
+ e.preventDefault();
17
+ const lang1 = langSelect[0].value;
18
+ const lang2 = langSelect[1].value;
19
+ const lang3 = langSelect[2].value;
20
+ const lang4 = langSelect[3].value;
21
+ const lang5 = langSelect[4].value;
22
+ const text = message.value;
23
+
24
+ // Translation code goes here
25
+ });