abdullahalivv commited on
Commit
9506587
Β·
verified Β·
1 Parent(s): f88001d

Create index.html

Browse files
Files changed (1) hide show
  1. index.html +113 -0
index.html ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>DeepSeek Web Builder</title>
7
+ <style>
8
+ body {
9
+ margin: 0;
10
+ font-family: 'Segoe UI', sans-serif;
11
+ display: flex;
12
+ flex-direction: column;
13
+ height: 100vh;
14
+ background: #f9f9f9;
15
+ }
16
+
17
+ .container {
18
+ display: flex;
19
+ flex: 1;
20
+ overflow: hidden;
21
+ }
22
+
23
+ .code-panel {
24
+ width: 50%;
25
+ background-color: #1e1e1e;
26
+ color: #fff;
27
+ padding: 10px;
28
+ box-sizing: border-box;
29
+ overflow-y: auto;
30
+ }
31
+
32
+ .code-panel pre {
33
+ white-space: pre-wrap;
34
+ word-wrap: break-word;
35
+ }
36
+
37
+ .preview-panel {
38
+ width: 50%;
39
+ background: #fff;
40
+ border-left: 2px solid #ddd;
41
+ }
42
+
43
+ iframe {
44
+ width: 100%;
45
+ height: 100%;
46
+ border: none;
47
+ }
48
+
49
+ .input-bar {
50
+ display: flex;
51
+ padding: 10px;
52
+ border-top: 1px solid #ccc;
53
+ background: #fff;
54
+ }
55
+
56
+ .input-bar input {
57
+ flex: 1;
58
+ padding: 10px;
59
+ font-size: 16px;
60
+ border: 1px solid #ccc;
61
+ border-radius: 6px;
62
+ }
63
+
64
+ .input-bar button {
65
+ padding: 10px 20px;
66
+ margin-left: 10px;
67
+ background-color: #ff2b82;
68
+ color: white;
69
+ border: none;
70
+ border-radius: 6px;
71
+ cursor: pointer;
72
+ }
73
+
74
+ h2 {
75
+ margin-top: 10px;
76
+ color: #999;
77
+ font-weight: 400;
78
+ }
79
+ </style>
80
+ </head>
81
+ <body>
82
+ <div class="container">
83
+ <div class="code-panel">
84
+ <h2>Generated Code</h2>
85
+ <pre id="codeDisplay">Waiting for your prompt...</pre>
86
+ </div>
87
+ <div class="preview-panel">
88
+ <iframe id="previewFrame"></iframe>
89
+ </div>
90
+ </div>
91
+ <div class="input-bar">
92
+ <input type="text" id="userInput" placeholder="✨ Ask me to create a modern, animated website or app..." />
93
+ <button onclick="sendPrompt()">➀</button>
94
+ </div>
95
+
96
+ <script>
97
+ function sendPrompt() {
98
+ const prompt = document.getElementById("userInput").value;
99
+ fetch("/generate", {
100
+ method: "POST",
101
+ headers: { "Content-Type": "application/json" },
102
+ body: JSON.stringify({ prompt: prompt })
103
+ })
104
+ .then(res => res.json())
105
+ .then(data => {
106
+ document.getElementById("codeDisplay").textContent = data.code;
107
+ const blob = new Blob([data.code], { type: "text/html" });
108
+ document.getElementById("previewFrame").src = URL.createObjectURL(blob);
109
+ });
110
+ }
111
+ </script>
112
+ </body>
113
+ </html>