forked from LanwyWriteXU/DoIt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
244 lines (227 loc) · 8.5 KB
/
index.html
File metadata and controls
244 lines (227 loc) · 8.5 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
235
236
237
238
239
240
241
242
243
244
<!DOCTYPE html>
<html lang="zh-CN" class="light-mode">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DoIt! - 放手去做!</title>
<link rel="icon" href="icon.svg">
<link rel="stylesheet" href="style.css">
<script src="blockly.min.js"></script>
<script src="blocks.js"></script>
<script src="python_compressed.js"></script>
<!--汉化-->
<script src="zh-hans.js"></script>
</head>
<body>
<!--工具栏-->
<div class="toolbar">
<div class="toolbar-title">
<img src="asset/DoIt!.svg" alt="Logo" class="logo">
</div>
<div class="dropdown">
<button class="dropdown-btn" id="file-btn">
<img src="asset/file-icon.svg" alt="File" class="dropdown-icon">
文件
</button>
<div class="dropdown-content">
<button id="save-btn">保存</button>
<button id="new-btn">新建</button>
<button id="export-xml-btn">导出XML</button>
<button id="import-xml-btn">导入XML</button>
</div>
</div>
<div class="dropdown">
<button class="dropdown-btn" id="settings-btn">
<img src="asset/settings-icon.svg" alt="Settings" class="dropdown-icon">
设置
</button>
<div class="dropdown-content">
<button id="theme-btn">夜间模式</button>
</div>
</div>
<div class="project-name-container">
<input type="text" id="project-name" value="New Project" class="project-name-input">
</div>
<div class="about-dropdown">
<button class="about-btn">
<img src="asset/about-icon.svg" alt="About" width="24" height="24">
</button>
<div class="about-dropdown-content">
<button id="about-software-btn">关于软件</button>
<button id="about-developer-btn">关于开发者</button>
</div>
</div>
</div>
<!--侧栏,像VSCode-->
<div class="sidebar">
<div class="sidebar-buttons">
<button class="sidebar-btn" id="files-btn" title="文件">
<img src="asset/explorer-icon.svg" alt="文件">
</button>
<button class="sidebar-btn" id="debug-btn" title="Debug">
<img src="asset/debug-icon.svg" alt="Debug">
</button>
<button class="sidebar-btn" id="extensions-btn" title="扩展">
<img src="asset/extensions-icon.svg" alt="扩展">
</button>
</div>
<div class="sidebar-content-container">
<div class="sidebar-frame-container">
<iframe id="sidebar-frame" class="sidebar-frame"></iframe>
</div>
</div>
</div>
<!--Tab栏-->
<div class="tab-bar">
<!-- 左侧标签部分 -->
<div class="tab-buttons">
<button class="tab-button active">常用</button>
<button class="tab-button">高级</button>
<button class="tab-button">工具</button>
</div>
<!-- 右侧固定部分 -->
<div class="tab-right-panel">
<div class="left-buttons">
<button class="action-btn run-btn">运行</button>
<button class="action-btn stop-btn">停止</button>
</div>
<button class="collapse-btn">
<span>折叠</span>
<svg class="collapse-icon" viewBox="0 0 24 24" width="16" height="16">
<path d="M7 10l5 5 5-5z" fill="currentColor"/>
</svg>
</button>
</div>
</div>
<div class="container">
<div class="editor" id="blocklyDiv"></div>
<div class="output-container" id="outputContainer">
<div class="output-content">
<div class="output">
<div class="output-header">
<h4>生成的 Python 代码</h4>
<div>
<button id="copy-code-btn">复制代码</button>
</div>
</div>
<div id="pythonCode" class="python-code"></div>
</div>
<div class="console" id="console">
<div id="terminal"></div>
</div>
</div>
</div>
</div>
<xml id="toolbox" style="display: none">
<category name="控制" categorystyle="logic_category" data-category="控制">
<block type="controls_repeat_ext"></block>
<block type="controls_repeat"></block>
<block type="controls_whileUntil"></block>
<block type="controls_for"></block>
<block type="controls_forEach"></block>
<block type="controls_flow_statements"></block>
<block type="logic_compare"></block>
<block type="logic_operation"></block>
<block type="logic_negate"></block>
<block type="logic_boolean"></block>
<block type="logic_ternary"></block>
<block type="controls_if"></block>
<block type="controls_ifelse"></block>
</category>
<category name="运算" categorystyle="math_category" data-category="运算">
<block type="math_number"></block>
<block type="math_arithmetic"></block>
<block type="math_single"></block>
<block type="math_trig"></block>
<block type="math_round"></block>
<block type="math_constant"></block>
<block type="math_random_int"></block>
<block type="math_random_float"></block>
<block type="math_number_property"></block>
<block type="math_modulo"></block>
<block type="math_on_list"></block>
<block type="math_constrain"></block>
</category>
<category name="文本" categorystyle="text_category" data-category="文本">
<block type="text"></block>
<block type="text_print"></block>
<block type="text_join"></block>
<block type="text_append"></block>
<block type="text_length"></block>
<block type="text_isEmpty"></block>
<block type="text_indexOf"></block>
<block type="text_charAt"></block>
<block type="python_string_upper"></block>
<block type="python_string_lower"></block>
<block type="python_string_split"></block>
</category>
<category name="变量" categorystyle="variable_category" data-category="变量">
<button text="创建变量" callbackKey="CUSTOM_CREATE_VARIABLE"></button>
<block type="variables_set_dynamic"></block>
<block type="variables_get_dynamic"></block>
</category>
<category name="列表" categorystyle="list_category" data-category="列表">
<block type="lists_create_empty"></block>
<block type="python_list_create"></block>
<block type="python_list_append"></block>
<block type="python_list_join"></block>
<block type="lists_repeat"></block>
<block type="lists_reverse"></block>
<block type="lists_isEmpty"></block>
<block type="lists_length"></block>
<block type="python_list_get"></block>
<block type="python_list_set"></block>
<block type="python_list_sort"></block>
</category>
<category name="自制积木" custom="PROCEDURE" categorystyle="procedure_category" data-category="自制积木"></category>
<category name="Python" colour="250" data-category="Python">
<block type="import"></block>
<block type="code"></block>
<block type="get"></block>
</category>
<category name="文件操作" colour="290" data-category="文件操作">
<block type="python_file_open"></block>
<block type="python_file_read"></block>
<block type="python_file_write"></block>
<block type="python_file_close"></block>
</category>
<category name="PyGame" colour="230" data-category="PyGame">
<block type="pygame_init"></block>
<block type="pygame_create_window"></block>
<block type="pygame_main_loop"></block>
<block type="pygame_draw_rect"></block>
<block type="pygame_event_quit"></block>
</category>
</xml>
<!--加载preload-->
<script>
require('./preload');
</script>
<!--函数块定义代码-->
<script src="blocks/python_list.js"></script>
<script src="blocks/python_io.js"></script>
<script src="blocks/python_string.js"></script>
<script src="blocks/python_pygame.js"></script>
<script src="blocks/python_custom.js"></script>
<!--亮色和暗色主题-->
<script src="theme/day_theme.js"></script>
<script src="theme/night_theme.js"></script>
<!--一些分出来的代码-->
<script src="code/create_var.js"></script>
<!--主函数-->
<script src="script.js"></script>
<!-- 修改后的工具箱容器结构 -->
<div class="custom-toolbox-container">
<div class="blockly-toolbox-scrollable">
<!-- Blockly会自动在这里生成工具箱内容 -->
<div id="blocklyToolbox"></div>
</div>
<!-- <div class="toolbox-extension-button">
<div class="extension-btn-inner">
<div class="extension-icon"></div>
<span>扩展</span>
</div>
</div> -->
</div>
</body>
</html>