victor HF staff commited on
Commit
15d05ee
·
verified ·
1 Parent(s): 9517bfc

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +63 -19
index.html CHANGED
@@ -1,19 +1,63 @@
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
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>HTML Playground</title>
7
+ <link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
8
+ </head>
9
+ <body class="m-0 p-0">
10
+ <div class="grid grid-cols-2 w-screen h-screen divide-x divide-amber-300">
11
+ <div class="bg-gray-200">
12
+ <textarea id="code-input" class="w-full h-full font-mono p-2 resize-none"><!DOCTYPE html>
13
+ <html lang="en">
14
+ <head>
15
+ <meta charset="UTF-8">
16
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
17
+ <title>Document</title>
18
+ <style>
19
+ body {
20
+ font-family: Arial, sans-serif;
21
+ background-color: #f0f0f0;
22
+ }
23
+ h1 {
24
+ color: navy;
25
+ }
26
+ </style>
27
+ </head>
28
+ <body>
29
+ <h1>Welcome to the HTML Playground</h1>
30
+ <p id="message">Click the button to change this text.</p>
31
+ <button onclick="changeText()">Change Text</button>
32
+ <script>
33
+ function changeText() {
34
+ document.getElementById('message').innerText = 'Text changed!';
35
+ }
36
+ </script>
37
+ </body>
38
+ </html></textarea>
39
+ </div>
40
+ <div>
41
+ <iframe id="output" class="w-full h-full border-none"></iframe>
42
+ </div>
43
+ </div>
44
+ <script>
45
+ document.addEventListener('DOMContentLoaded', () => {
46
+ const codeInput = document.getElementById('code-input');
47
+ const output = document.getElementById('output');
48
+
49
+ function updateOutput() {
50
+ output.contentDocument.open();
51
+ output.contentDocument.write(codeInput.value);
52
+ output.contentDocument.close();
53
+ }
54
+
55
+ // Initial render
56
+ updateOutput();
57
+
58
+ // Update on every input
59
+ codeInput.addEventListener('input', updateOutput);
60
+ });
61
+ </script>
62
+ </body>
63
+ </html>