forked from esperanc/Py5Script
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathide.html
More file actions
178 lines (158 loc) · 10.9 KB
/
ide.html
File metadata and controls
178 lines (158 loc) · 10.9 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Py5Script</title>
<link rel="icon" type="image/x-icon" href="./favicon.ico">
<!-- CSS -->
<link rel="stylesheet" href="css/style.css?v=2">
<link rel="stylesheet" href="css/ide.css?v=2">
<!-- Dependencies -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.32.3/ace.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lz-string/1.5.0/lz-string.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
</head>
<body>
<header>
<h1><a href="https://github.com/esperanc/Py5Script"><img id="header-logo" src="logo_dark.png" alt="Py5Script" style="height: 40px; vertical-align: top;"></a></h1>
<div id="project-name-container">
<span id="project-name">My Project</span>
<button id="rename-btn" title="Rename Project" class="icon-btn">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg>
</button>
</div>
<div style="flex: 1;"></div>
<!-- Controls -->
<button id="run-btn" class="action-btn btn-run" title="Run Sketch">
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" stroke="none"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>
</button>
<button id="view-btn" class="action-btn btn-view" title="Open in View Mode">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path><polyline points="15 3 21 3 21 9"></polyline><line x1="10" y1="14" x2="21" y2="3"></line></svg>
</button>
<button id="stop-btn" class="action-btn btn-stop" title="Stop Sketch">
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" stroke="none"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect></svg>
</button>
<div class="separator"></div>
<button id="new-btn" class="action-btn btn-new">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path><polyline points="13 2 13 9 20 9"></polyline></svg> New
</button>
<button id="open-btn" class="action-btn btn-open">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path></svg> Open
</button>
<div class="separator"></div>
<button id="download-btn" class="action-btn btn-download">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg> Download
</button>
<button id="load-btn" class="action-btn btn-upload">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="17 8 12 3 7 8"></polyline><line x1="12" y1="3" x2="12" y2="15"></line></svg> Upload
</button>
<button id="share-btn" class="action-btn btn-share">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path></svg> Share
</button>
<button id="settings-btn" class="icon-btn btn-settings" title="Settings">
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>
</button>
<input type="file" id="file-input" accept=".py,.zip,.vert,.frag,.glsl,.txt,.json,.csv,.md,.toml">
<input type="file" id="upload-input" multiple>
</header>
<main>
<div id="file-panel">
<div id="file-list-header">
<span>FILES</span>
<button id="upload-file-btn" title="Upload File" class="icon-btn">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="17 8 12 3 7 8"></polyline><line x1="12" y1="3" x2="12" y2="15"></line></svg>
</button>
<button id="add-file-btn" title="New File" class="icon-btn">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>
</button>
</div>
<ul id="file-list"></ul>
</div>
<div id="editor-container">
<div id="editor-top-bar">
<button id="toggle-sidebar-btn" title="Toggle File Panel" class="icon-btn">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="9" y1="3" x2="9" y2="21"></line></svg>
</button>
<span id="current-file-label">sketch.py</span>
</div>
<div id="editor"></div>
<div id="image-viewer" style="display:none; justify-content:center; align-items:center; background:#1e1e1e; height:100%; overflow:hidden;">
<img id="preview-image" style="max-width:90%; max-height:90%; object-fit:contain; border:1px solid #444;" src="">
</div>
<div id="h-resizer"></div>
<div id="console-container">
<div id="console-header">
<span>Console</span>
<button id="clear-console" style="padding: 2px 6px; font-size: 10px; background: #666; color: white; border: 1px solid #777; cursor: pointer;">Clear</button>
</div>
<div id="console-content"></div>
</div>
</div>
<div id="v-resizer"></div>
<div id="preview-container">
<iframe id="runner-frame"></iframe>
</div>
</main>
<!-- Overlay for Modals -->
<div id="modal-overlay"></div>
<!-- Settings Modal -->
<div id="settings-modal" class="modal-dialog">
<h2 style="margin-top:0;">Settings</h2>
<div style="margin-bottom: 10px;">
<label style="color:#eee; display:block; margin-bottom:5px;">Theme</label>
<select id="setting-theme" style="width:100%; padding:5px; background:#444; color:#fff; border:1px solid #555;">
<option value="dark">Dark</option>
<option value="light">Light</option>
</select>
</div>
<div style="margin-bottom: 10px;">
<label style="color:#eee; display:block; margin-bottom:5px;">Font Size (px)</label>
<input type="number" id="setting-fontsize" style="width:100%; padding:5px; background:#444; color:#fff; border:1px solid #555;" min="10" max="32">
</div>
<div style="margin-bottom: 10px;">
<label style="color:#eee; display:flex; align-items:center;">
<input type="checkbox" id="setting-softtabs" style="margin-right:10px;"> Soft Tabs (Spaces)
</label>
</div>
<div style="margin-bottom: 15px;">
<label style="color:#eee; display:flex; align-items:center;">
<input type="checkbox" id="setting-invisibles" style="margin-right:10px;"> Show Invisibles
</label>
</div>
<div style="text-align: right;">
<button id="close-settings-btn" style="background: #555;">Close</button>
</div>
</div>
<!-- Projects Modal -->
<div id="projects-modal" class="modal-dialog">
<div style="display:flex; align-items:center; justify-content:space-between; margin-bottom:12px;">
<h2 style="margin:0;">Open Project</h2>
<button id="sort-toggle-btn" title="Toggle sort order" style="background:#444; border:1px solid #666; color:#ccc; border-radius:4px; padding:4px 10px; cursor:pointer; font-size:0.8em;">Sort: Date</button>
</div>
<div id="project-list-container" style="max-height: 350px; overflow-y: auto; margin-bottom: 10px; border: 1px solid #555; background: #222;">
<ul id="project-list" style="list-style: none; padding: 0; margin: 0;"></ul>
</div>
<div style="text-align: right;">
<button id="close-projects-btn" style="background: #555;">Close</button>
</div>
</div>
<!-- Rename/Save As Modal -->
<div id="rename-modal" class="modal-dialog">
<h2 style="margin-top:0;">Project Name</h2>
<div style="margin-bottom: 15px;">
<input type="text" id="rename-input" style="width:100%; padding:8px; box-sizing:border-box; background:#222; color:#fff; border:1px solid #555; border-radius:4px;" placeholder="Enter project name...">
</div>
<div style="display: flex; gap: 10px; justify-content: flex-end;">
<button id="cancel-rename-btn" style="background: #555;">Cancel</button>
<button id="save-as-btn" class="btn-open" style="background: #6f42c1;">Save As</button>
<button id="confirm-rename-btn" class="btn-run" style="background: #28a745;">Rename</button>
</div>
</div>
<!-- Application Logic -->
<script src="js/settings.js?v=13"></script>
<script src="js/name_generator.js?v=13"></script>
<script src="js/project_manager.js?v=13"></script>
<script src="js/share_utils.js?v=13"></script>
<script src="js/ide_ui.js?v=13"></script>
</body>
</html>