-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
256 lines (247 loc) · 13.2 KB
/
index.html
File metadata and controls
256 lines (247 loc) · 13.2 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
245
246
247
248
249
250
251
252
253
254
255
256
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flowchart Maker - MiladLabs</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="app-container">
<header class="header">
<div class="header-left">
<h1>Flowchart Maker</h1>
<span class="subtitle">by MiladLabs</span>
</div>
<div class="header-actions">
<button class="btn btn-secondary" id="undoBtn" title="Undo (Ctrl+Z)">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M3 7v6h6"></path>
<path d="M21 17a9 9 0 00-9-9 9 9 0 00-6 2.3L3 13"></path>
</svg>
</button>
<button class="btn btn-secondary" id="redoBtn" title="Redo (Ctrl+Y)">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 7v6h-6"></path>
<path d="M3 17a9 9 0 019-9 9 9 0 016 2.3l3 2.7"></path>
</svg>
</button>
<button class="btn btn-secondary" id="historyBtn" title="History">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"></circle>
<polyline points="12 6 12 12 16 14"></polyline>
</svg>
</button>
<button class="btn btn-secondary" id="saveBtn" title="Save">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M19 21H5a2 2 0 01-2-2V5a2 2 0 012-2h11l5 5v11a2 2 0 01-2 2z"></path>
<polyline points="17 21 17 13 7 13 7 21"></polyline>
<polyline points="7 3 7 8 15 8"></polyline>
</svg>
</button>
<button class="btn btn-secondary" id="loadBtn" title="Load">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"></path>
<polyline points="7 10 12 15 17 10"></polyline>
<line x1="12" y1="15" x2="12" y2="3"></line>
</svg>
</button>
<button class="btn btn-secondary" id="exportPngBtn" title="Export PNG">
<svg width="20" height="20" 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>
<circle cx="8.5" cy="8.5" r="1.5"></circle>
<polyline points="21 15 16 10 5 21"></polyline>
</svg>
</button>
<button class="btn btn-secondary" id="exportSvgBtn" title="Export SVG">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polyline points="16 18 22 12 16 6"></polyline>
<polyline points="8 6 2 12 8 18"></polyline>
</svg>
</button>
<button class="btn btn-secondary" id="helpBtn" title="Help">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10"></circle>
<path d="M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3"></path>
<line x1="12" y1="17" x2="12.01" y2="17"></line>
</svg>
</button>
<button class="btn btn-secondary" id="themeToggle" title="Toggle Theme">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
</button>
</div>
</header>
<div class="main-content">
<aside class="toolbar" id="toolbar">
<div class="toolbar-header">
<h3>Nodes</h3>
<button class="btn-icon" id="toggleToolbar">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</button>
</div>
<div class="toolbar-items">
<div class="toolbar-item" data-node-type="start" draggable="true">
<div class="node-preview start-node"></div>
<span>Start/End</span>
</div>
<div class="toolbar-item" data-node-type="process" draggable="true">
<div class="node-preview process-node"></div>
<span>Process</span>
</div>
<div class="toolbar-item" data-node-type="decision" draggable="true">
<div class="node-preview decision-node"></div>
<span>Decision</span>
</div>
<div class="toolbar-item" data-node-type="io" draggable="true">
<div class="node-preview io-node"></div>
<span>Input/Output</span>
</div>
<div class="toolbar-item" data-node-type="connector" draggable="true">
<div class="node-preview connector-node"></div>
<span>Connector</span>
</div>
<div class="toolbar-item" data-node-type="custom" draggable="true">
<div class="node-preview custom-node"></div>
<span>Custom</span>
</div>
</div>
</aside>
<div class="canvas-container">
<div class="canvas-controls">
<button class="btn btn-sm" id="fitToScreenBtn">Fit</button>
<button class="btn btn-sm" id="zoomInBtn">+</button>
<span id="zoomLevel">100%</span>
<button class="btn btn-sm" id="zoomOutBtn">-</button>
<button class="btn btn-sm" id="resetZoomBtn">Reset</button>
<button class="btn btn-sm" id="toggleGridBtn">Grid</button>
<button class="btn btn-sm" id="toggleSnapBtn">Snap</button>
</div>
<canvas id="canvas"></canvas>
<div id="selectionBox" class="selection-box"></div>
<div id="contextMenu" class="context-menu"></div>
</div>
<aside class="inspector" id="inspector">
<div class="inspector-header">
<h3>Properties</h3>
<button class="btn-icon" id="toggleInspector">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</button>
</div>
<div class="inspector-content" id="inspectorContent">
<p class="no-selection">Select a node to edit properties</p>
</div>
</aside>
</div>
</div>
<div class="modal" id="helpModal">
<div class="modal-content">
<div class="modal-header">
<h2>Quick Help</h2>
<button class="btn-icon" id="closeHelp">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div>
<div class="modal-body">
<h3>Keyboard Shortcuts</h3>
<ul>
<li><kbd>Ctrl/Cmd + Z</kbd> - Undo</li>
<li><kbd>Ctrl/Cmd + Y</kbd> - Redo</li>
<li><kbd>Ctrl/Cmd + D</kbd> - Duplicate selected</li>
<li><kbd>Delete/Backspace</kbd> - Delete selected</li>
<li><kbd>Shift + Click</kbd> - Multi-select</li>
<li><kbd>Double Click</kbd> - Edit node text</li>
<li><kbd>Ctrl/Cmd + A</kbd> - Select all</li>
</ul>
<h3>Actions</h3>
<ul>
<li>Drag nodes from toolbar to canvas</li>
<li>Click toolbar item to add at center</li>
<li>Drag nodes to move them</li>
<li>Drag node corners to resize</li>
<li>Click and drag from connection handles to create connectors</li>
<li>Right-click and drag to pan canvas</li>
<li>Zoom with mouse wheel or pinch</li>
<li>Right-click nodes for context menu</li>
</ul>
</div>
</div>
</div>
<div class="modal" id="saveModal">
<div class="modal-content">
<div class="modal-header">
<h2>Save Flowchart</h2>
<button class="btn-icon" id="closeSave">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div>
<div class="modal-body">
<input type="text" id="saveFileName" placeholder="Enter filename" class="input" value="flowchart">
<button class="btn btn-primary" id="downloadJson">Download JSON</button>
</div>
</div>
</div>
<div class="modal" id="loadModal">
<div class="modal-content">
<div class="modal-header">
<h2>Load Flowchart</h2>
<button class="btn-icon" id="closeLoad">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div>
<div class="modal-body">
<input type="file" id="loadFile" accept=".json" class="input">
<button class="btn btn-primary" id="loadFromStorage">Load from Auto-save</button>
</div>
</div>
</div>
<div class="modal" id="historyModal">
<div class="modal-content modal-large">
<div class="modal-header">
<h2>Flowchart History</h2>
<button class="btn-icon" id="closeHistory">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div>
<div class="modal-body">
<div class="history-actions">
<input type="text" id="historySearch" placeholder="Search flowcharts..." class="input">
<button class="btn btn-secondary" id="clearHistoryBtn">Clear All History</button>
</div>
<div id="historyList" class="history-list"></div>
</div>
</div>
</div>
<input type="text" id="textEditor" class="text-editor" style="display: none;">
<script src="script.js"></script>
</body>
</html>