-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
234 lines (219 loc) · 18.3 KB
/
index.html
File metadata and controls
234 lines (219 loc) · 18.3 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Code Previewer</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/theme/dracula.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/theme/default.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/theme/material.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/theme/monokai.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/theme/nord.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/theme/eclipse.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/theme/idea.min.css">
</head>
<body>
<div class="container">
<header class="app-header" role="banner">
<div>
<p class="app-eyebrow">Frontend Playground</p>
<h1>HTML Previewer</h1>
<p class="app-subtitle">Build, organize, and preview full web projects in one streamlined workspace.</p>
</div>
<span class="app-status-pill" aria-label="Application mode">Local-first</span>
</header>
<main class="main-content">
<div id="multi-file-container" class="editor-container">
<div class="files-header">
<span>Files</span>
<div class="files-header__buttons">
<div class="settings-menu" id="settings-menu">
<button id="settings-btn" class="files-header__action-btn settings-btn" aria-label="Open settings"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="2" y1="4" x2="14" y2="4"/><line x1="2" y1="8" x2="14" y2="8"/><line x1="2" y1="12" x2="14" y2="12"/><circle cx="5" cy="4" r="1.5" fill="currentColor"/><circle cx="10" cy="8" r="1.5" fill="currentColor"/><circle cx="7" cy="12" r="1.5" fill="currentColor"/></svg> Settings</button>
</div>
<button id="clear-all-files-btn" class="files-header__action-btn clear-all-files-btn" aria-label="Clear all files"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M3 4h10l-1 10H4L3 4z"/><path d="M1 4h14"/><path d="M6 4V2.5a.5.5 0 0 1 .5-.5h3a.5.5 0 0 1 .5.5V4"/><line x1="6.5" y1="7" x2="6.5" y2="11"/><line x1="9.5" y1="7" x2="9.5" y2="11"/></svg> Clear All</button>
<button id="import-zip-btn" class="files-header__action-btn import-zip-btn" aria-label="Import archive project"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M8 1L14 4v8l-6 3L2 12V4l6-3z"/><path d="M8 8v7"/><path d="M2 4l6 4 6-4"/></svg> Import Archive</button>
<button id="export-zip-btn" class="files-header__action-btn export-zip-btn" aria-label="Export project as ZIP"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M8 1L14 4v8l-6 3L2 12V4l6-3z"/><path d="M8 8v7"/><path d="M2 4l6 4 6-4"/></svg> Export ZIP</button>
<button id="import-file-btn" class="files-header__action-btn import-file-btn" aria-label="Import file"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M1.5 3.5h4l2 2h7v8h-13v-10z"/></svg> Import</button>
<button id="import-folder-btn" class="files-header__action-btn import-file-btn" aria-label="Import folder"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M1.5 3.5h4l2 2h7v8h-13v-10z"/><path d="M5 3.5V1.5h4v2"/></svg> Import Folder</button>
<button id="add-folder-btn" class="files-header__action-btn add-folder-btn" aria-label="Add new folder">+ New Folder</button>
<button id="add-file-btn" class="files-header__action-btn add-file-btn" aria-label="Add new file">+ New File</button>
</div>
</div>
<div class="main-html-selector" id="main-html-selector" style="display: none;">
<label id="main-html-label" for="main-html-select">Main HTML file:</label>
<div class="main-html-dropdown" id="main-html-dropdown">
<button type="button" id="main-html-dropdown-trigger" class="main-html-dropdown-trigger" aria-haspopup="listbox" aria-expanded="false" aria-labelledby="main-html-label main-html-dropdown-trigger">Auto-detect</button>
<ul id="main-html-dropdown-list" class="main-html-dropdown-list" role="listbox" aria-labelledby="main-html-label" tabindex="-1" hidden></ul>
</div>
<select id="main-html-select" aria-label="Select main HTML file for preview" class="visually-hidden-select">
<option value="">Auto-detect</option>
</select>
</div>
<section class="workspace-layout" aria-label="Project workspace">
<nav id="file-tree-container" class="file-tree-container" aria-label="File explorer"></nav>
<div class="editor-grid" role="region" aria-label="Code editors"></div>
</section>
</div>
<div class="controls">
<button id="preview-modal-btn" class="btn">Preview in Modal</button>
<button id="preview-tab-btn" class="btn">Open in New Tab</button>
</div>
</main>
</div>
<div id="preview-modal" class="modal-overlay" role="dialog" aria-modal="true" aria-labelledby="modal-title" aria-hidden="true">
<div class="modal-content">
<div class="modal-header">
<h2 id="modal-title">Preview</h2>
<div class="modal-controls">
<button id="refresh-preview-btn" class="toggle-console-btn" aria-label="Refresh preview content"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M13 3v4H9"/><path d="M3 13v-4h4"/><path d="M4.1 6.1A5 5 0 0 1 13 7"/><path d="M11.9 9.9A5 5 0 0 1 3 9"/></svg> Refresh</button>
<button id="toggle-console-btn" class="toggle-console-btn" aria-label="Toggle console visibility"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="2.5" width="10" height="12" rx="1"/><path d="M5.5 2.5V2a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 .5.5v.5"/><line x1="5.5" y1="7" x2="10.5" y2="7"/><line x1="5.5" y1="9.5" x2="10.5" y2="9.5"/><line x1="5.5" y1="12" x2="8.5" y2="12"/></svg> Console</button>
<button id="dock-preview-btn" class="toggle-console-btn" aria-label="Dock preview panel"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="1.5" y="2" width="13" height="12" rx="1"/><line x1="10" y1="2" x2="10" y2="14"/></svg> Dock</button>
<button class="close-btn" aria-label="Close preview modal">×</button>
</div>
</div>
<div class="modal-body">
<iframe id="preview-frame" sandbox="allow-scripts allow-same-origin" title="Code Preview"></iframe>
<div id="console-resize-divider" class="console-resize-divider" style="display:none;" aria-hidden="true"></div>
<div id="modal-console-panel" class="modal-console-panel hidden" aria-hidden="true">
<div class="console-header">
<span>Console</span>
<button id="clear-console-btn" class="clear-btn" aria-label="Clear console output">Clear</button>
</div>
<div id="console-output" role="log" aria-live="polite"></div>
</div>
</div>
</div>
</div>
<div id="preview-dock-divider" class="preview-dock-divider" aria-hidden="true" hidden></div>
<div id="code-modal" class="modal-overlay" role="dialog" aria-modal="true" aria-labelledby="code-modal-title" aria-hidden="true">
<div class="modal-content">
<div class="modal-header">
<h2 id="code-modal-title">Code View</h2>
<div class="modal-controls">
<button id="code-modal-dock-btn" class="toggle-console-btn" aria-label="Dock expanded code view to the left of preview" title="Dock expanded code view to left" hidden><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="1.5" y="2" width="13" height="12" rx="1"/><line x1="10" y1="2" x2="10" y2="14"/></svg> Dock Left</button>
<button id="code-modal-search-btn" class="toggle-console-btn" aria-label="Search in code" title="Search in code" aria-expanded="false"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="6.5" cy="6.5" r="4.5"/><line x1="10" y1="10" x2="14.5" y2="14.5"/></svg> Search</button>
<button class="close-btn" aria-label="Close code modal">×</button>
</div>
</div>
<div class="modal-body">
<div id="code-modal-search" class="code-modal-search" hidden>
<input type="search" id="code-modal-search-input" placeholder="Search in this file" aria-label="Search in expanded code view">
<button id="code-modal-search-next-btn" type="button" aria-label="Find next match">Next</button>
<button id="code-modal-search-close-btn" type="button" aria-label="Close search"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="3" x2="13" y2="13"/><line x1="13" y1="3" x2="3" y2="13"/></svg></button>
</div>
<div id="code-modal-editor-container">
<textarea id="code-modal-editor"></textarea>
</div>
<p id="code-modal-file-meta" class="code-modal-file-meta" aria-live="polite"></p>
</div>
</div>
</div>
<div id="media-modal" class="modal-overlay" role="dialog" aria-modal="true" aria-labelledby="media-modal-title" aria-hidden="true">
<div class="modal-content">
<div class="modal-header">
<h2 id="media-modal-title">Media Preview</h2>
<div class="modal-controls">
<button class="close-btn" aria-label="Close media modal">×</button>
</div>
</div>
<div class="modal-body">
<div id="media-modal-content"></div>
</div>
</div>
</div>
<!-- Settings Modal -->
<div id="settings-modal" class="modal-overlay settings-modal-overlay" role="dialog" aria-modal="true" aria-labelledby="settings-modal-title" aria-hidden="true" hidden>
<div class="modal-content settings-modal-content">
<div class="modal-header">
<h2 id="settings-modal-title"><svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="2" y1="4" x2="14" y2="4"/><line x1="2" y1="8" x2="14" y2="8"/><line x1="2" y1="12" x2="14" y2="12"/><circle cx="5" cy="4" r="1.5" fill="currentColor"/><circle cx="10" cy="8" r="1.5" fill="currentColor"/><circle cx="7" cy="12" r="1.5" fill="currentColor"/></svg> Editor Settings</h2>
<button class="close-btn" aria-label="Close settings">×</button>
</div>
<div class="modal-body settings-modal-body">
<div class="settings-grid">
<div class="settings-section">
<h3 class="settings-section-title">Display</h3>
<label class="settings-option" for="setting-line-numbers">
<input type="checkbox" id="setting-line-numbers" checked>
<span>Line numbers</span>
</label>
<label class="settings-option" for="setting-line-wrap">
<input type="checkbox" id="setting-line-wrap">
<span>Line wrap</span>
</label>
<label class="settings-option" for="setting-auto-format">
<input type="checkbox" id="setting-auto-format">
<span>Auto-format while typing</span>
</label>
</div>
<div class="settings-section">
<h3 class="settings-section-title">Appearance</h3>
<label class="settings-option settings-select" for="setting-font-size">
<span>Font size</span>
<select id="setting-font-size">
<option value="12">12px</option>
<option value="13">13px</option>
<option value="14" selected>14px</option>
<option value="15">15px</option>
<option value="16">16px</option>
<option value="18">18px</option>
</select>
</label>
<label class="settings-option settings-select" for="setting-editor-theme">
<span>Editor theme</span>
<select id="setting-editor-theme">
<option value="dracula" selected>Dracula</option>
<option value="default">Default</option>
<option value="material">Material</option>
<option value="monokai">Monokai</option>
<option value="nord">Nord</option>
<option value="eclipse">Eclipse</option>
<option value="idea">Idea</option>
</select>
</label>
</div>
<div class="settings-section">
<h3 class="settings-section-title">Indentation</h3>
<label class="settings-option settings-select" for="setting-tab-size">
<span>Tab size</span>
<select id="setting-tab-size">
<option value="2">2</option>
<option value="4" selected>4</option>
<option value="8">8</option>
</select>
</label>
<label class="settings-option" for="setting-indent-with-tabs">
<input type="checkbox" id="setting-indent-with-tabs">
<span>Indent with tabs</span>
</label>
</div>
<div class="settings-section">
<h3 class="settings-section-title">Editing</h3>
<label class="settings-option" for="setting-auto-close-brackets">
<input type="checkbox" id="setting-auto-close-brackets" checked>
<span>Auto-close brackets</span>
</label>
<label class="settings-option" for="setting-match-brackets">
<input type="checkbox" id="setting-match-brackets" checked>
<span>Match brackets</span>
</label>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/mode/xml/xml.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/mode/javascript/javascript.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/mode/css/css.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/mode/htmlmixed/htmlmixed.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/addon/edit/closetag.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/js-beautify/js/lib/beautify.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/js-beautify/js/lib/beautify-css.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/js-beautify/js/lib/beautify-html.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jszip/dist/jszip.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/pako/dist/pako.min.js"></script>
<script src="script.js"></script>
</body>
</html>