-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLive HTML Editor.html
More file actions
183 lines (163 loc) · 4.49 KB
/
Live HTML Editor.html
File metadata and controls
183 lines (163 loc) · 4.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Live HTML Editor</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
height: 100vh;
display: flex;
flex-direction: column;
background: #1e1e1e;
color: #d4d4d4;
}
.header {
background: #252526;
padding: 10px 20px;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #3e3e42;
}
.header h1 {
font-size: 18px;
font-weight: 500;
color: #fff;
}
.credits {
font-size: 12px;
color: #858585;
font-style: italic;
}
.container {
display: flex;
flex: 1;
overflow: hidden;
}
.editor-pane {
width: 50%;
display: flex;
flex-direction: column;
border-right: 2px solid #3e3e42;
}
.pane-header {
background: #2d2d30;
padding: 8px 15px;
font-size: 12px;
text-transform: uppercase;
letter-spacing: 1px;
color: #cccccc;
border-bottom: 1px solid #3e3e42;
}
#htmlInput {
flex: 1;
width: 100%;
background: #1e1e1e;
color: #d4d4d4;
border: none;
padding: 20px;
font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
font-size: 14px;
line-height: 1.6;
resize: none;
outline: none;
}
.preview-pane {
width: 50%;
display: flex;
flex-direction: column;
background: #fff;
}
#preview {
flex: 1;
width: 100%;
border: none;
background: #fff;
}
/* Scrollbar styling */
::-webkit-scrollbar {
width: 10px;
height: 10px;
}
::-webkit-scrollbar-track {
background: #1e1e1e;
}
::-webkit-scrollbar-thumb {
background: #424242;
border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
background: #4f4f4f;
}
</style>
</head>
<body>
<div class="header">
<h1>📝 Live HTML Editor</h1>
<span class="credits">written by sapbot with help of Kimi K2.5</span>
</div>
<div class="container">
<div class="editor-pane">
<div class="pane-header">HTML Code</div>
<textarea id="htmlInput" placeholder="Type your HTML code here..."><!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: Arial, sans-serif;
padding: 20px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.card {
background: rgba(255,255,255,0.1);
padding: 40px;
border-radius: 20px;
backdrop-filter: blur(10px);
text-align: center;
}
h1 { margin-bottom: 10px; }
p { opacity: 0.9; }
</style>
</head>
<body>
<div class="card">
<h1>Hello World! 🚀</h1>
<p>Edit the code on the left to see changes instantly!</p>
</div>
</body>
</html></textarea>
</div>
<div class="preview-pane">
<div class="pane-header">Live Preview</div>
<iframe id="preview"></iframe>
</div>
</div>
<script>
const htmlInput = document.getElementById('htmlInput');
const preview = document.getElementById('preview');
function updatePreview() {
const code = htmlInput.value;
const doc = preview.contentDocument || preview.contentWindow.document;
doc.open();
doc.write(code);
doc.close();
}
// Update preview on input
htmlInput.addEventListener('input', updatePreview);
// Initial load
updatePreview();
</script>
</body>
</html>