-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
190 lines (175 loc) · 9.4 KB
/
index.html
File metadata and controls
190 lines (175 loc) · 9.4 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
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>ProStage Plotter -- Timothée D.</title>
<script src="https://unpkg.com/konva@10/konva.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
<script src="assetsList.js"></script>
<script src="base64Img.js"></script>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="sidebar-left">
<div class="panel">
<span style="display: flex; justify-content: space-between;">
<h3>Stage Plotter</h3>
<i class="fa fa-question-circle" style="font-size: 24px; cursor: pointer;" onclick="showHelp()"></i>
</span>
<input type="text" id="projName">
<div class="toggle-container">
<label style="margin:0; font-size: 10px;">Toggle ortho</label>
<label class="switch">
<input type="checkbox" id="orthoToggle" onchange="isOrtho = this.checked; updateAllCables();" checked>
<span class="slider tooltip">
<span class="tooltiptextR">Ctrl+O</span>
</span>
</label>
</div>
<button onclick="saveStage()" class="tooltip" style="position: relative;"><span class="tooltiptextR">Ctrl+S</span>Save .stage</button>
<button style="background:#444" onclick="document.getElementById('loadInput').click()">Load .stage</button>
<input type="file" id="loadInput" style="display:none" onchange="loadStage(event)" accept=".stage">
<button style="background:#007acc" onclick="addNewNote()">Add a note</button>
<div id="cable-color">
<span>
<label>XLR</label>
<input type="color" id="cable-color-xlr" value="#0000FF" style="padding: 2px;">
</span>
<span>
<label>Jack</label>
<input type="color" id="cable-color-jack" value="#000000" style="padding: 2px;">
</span>
<span>
<label>Electricity</label>
<input type="color" id="cable-color-elec" value="#FFFFFF" style="padding: 2px;">
</span>
<span>
<label>RJ45</label>
<input type="color" id="cable-color-aes" value="#FF0000" style="padding: 2px;">
</span>
<span>
<label>DMX</label>
<input type="color" id="cable-color-dmx" value="#800080" style="padding: 2px;">
</span>
</div>
</div>
<div id="library-container" style="flex-grow: 1; overflow-y: auto;"> </div>
<div class="panel" style="border-top: 1px solid #333; border-bottom: none; margin-top: auto;">
<div style="display: flex; gap: 8px;">
<button style="background:#444; font-size: 10px; padding: 5px; margin: 0;"
onclick="setAllCategories(true)">Collapse all</button>
<button style="background:#444; font-size: 10px; padding: 5px; margin: 0;" onclick="setAllCategories(false)">Expand
all</button>
</div>
</div>
<div id="color-history-list"></div>
</div>
<div id="canvas-container"></div>
<div id="sidebar-right" style="display: flex;">
<h3 id="prop-title">Stage properties</h3>
<div id="canvas-props">
<label>Background color</label>
<input type="color" id="canvas-bg-color" value="#333333" style="padding: 0px; height: 60px;">
<div class="toggle-container">
<label style="margin:0; font-size: 10px;">Toggle grid</label>
<label class="switch">
<input type="checkbox" id="gridToggle" checked onchange="toggleGrid(this.checked)">
<span class="slider"></span>
</label>
</div>
<label>Width (cm)</label>
<input type="number" id="canvas-width-cm" value="600">
<label>Height (cm)</label>
<input type="number" id="canvas-height-cm" value="400">
<!-- <label>Pixels per CM</label>
<input type="number" id="prop-px-cm" value="15" min="1" max="100">
<label>Snap size</label>
<input type="number" id="prop-snap-size" value="15" min="1" max="50"> -->
<label>Grid cell size (cm)</label>
<input type="number" id="prop-grid-size" value="20" min="1" max="100" step="1">
<div style="display: flex; justify-content: space-evenly; align-items: center;">
<label style="margin-bottom: 0;">Toggle groups display</label>
<label class="switch" style="transform: scale(0.8);">
<input type="checkbox" id="toggle-all-groups" checked onchange="toggleAllGroups(this.checked)">
<span class="slider"></span>
</label>
</div>
<div id="groups-toggles-container" class="panel" style="background: #1e1e1e;"> </div>
<button style="background:#555; margin-top:10px; position: relative;" onclick="centerStage()" class="tooltip">
<span class="tooltiptextL">Ctrl+E</span>Center stage</button>
<button style="background:#27ae60" onclick="exportScene('png')">Export to PNG</button>
<button style="background:#8e44ad" onclick="exportGearList()">Export Gear List (.txt)</button>
</div>
<div id="gear-props" style="display:none;">
<label>Nom de l'élément</label>
<input type="text" id="prop-label">
<label>Taille (cm)</label>
<input type="number" id="prop-size-cm" step="0.1">
<div id="family-inputs-container" style="margin-top: 10px; border-top: 1px solid #444; padding-top: 10px;">
</div>
</div>
<div id="cable-props" style="display:none;">
<!-- <label>Cable name</label>
<input type="text" id="cable-label"> -->
<label>Cable color</label>
<input type="color" id="cable-color-picker" style="padding: 2px;">
<div class="prop-group">
<label>Total length</label>
<input type="text" id="cable-length" readonly
style="background-color: #333; color: #2ecc71; font-weight: bold; border: 1px solid #444;">
</div>
</div>
<div id="text-props" style="display:none;">
<label>Texte de la note</label>
<textarea id="note-text-input" rows="3"
style="width:100%; background:#3c3c3c; color:white; border:1px solid #555;"></textarea>
<label>Couleur du texte</label>
<input type="color" id="note-color-picker" style="padding: 2px;">
<label>Taille de police</label>
<input type="number" id="note-size-input" min="10" max="100">
</div>
<div id="selection-actions" style="display:none;">
<button style="background:#e74c3c; margin-top:20px" id="btn-delete">Delete (Suppr)</button>
<button style="background:#444; margin-top:5px" onclick="deselectAll()">Deselect</button>
</div>
</div>
<div id="help-modal" class="hidden">
<div class="help-modal-content">
<span class="close" style="cursor: pointer;" onclick="closeHelp()">×</span>
<div id="help-content">
<div>
<h3>Main actions</h3>
<p><strong>Left Click</strong> : Select</p>
<p><strong>Drag Left Click</strong> <i>on anchor point </i>: Move anchor point</p>
<p><strong>Ctrl + Drag Left Click</strong> <i>from one anchor point to another</i> : Create cable
</p>
<p><strong>Double Click</strong> <i>on cable</i> : Create point</p>
<p><strong>Right Click</strong> <i>on cable</i> : Inverse cable angle</p>
<p><strong>Right Click</strong> <i>on cable point</i> : Remove point</p>
<p><strong>Shift + Click</strong> : Measure distance</p>
</div>
<div>
<h3>Keyboard Shortcuts</h3>
<p><strong>Ctrl + C</strong> : Copy</p>
<p><strong>Ctrl + V</strong> : Paste</p>
<p><strong>Ctrl + X</strong> : Cut</p>
<p><strong>Ctrl + Z</strong> : Undo (under construction)</p>
<p><strong>Ctrl + Y</strong> : Redo (under construction)</p>
<p><strong>Ctrl + O</strong> : Toggle orthogonal/direct routing mode</p>
<p><strong>Ctrl + E</strong> : Center stage</p>
<p><strong>Ctrl + S</strong> : Save</p>
<p><strong>Ctrl + A</strong> : Select all</p>
<p><strong>Escape</strong> : Deselect all</p>
</div>
</div>
</div>
</div>
<script src="./scripts/config.js"></script>
<script src="./scripts/events.js"></script>
<script src="./scripts/ui.js"></script>
<script src="./scripts/gears.js"></script>
<script src="./scripts/cables.js"></script>
<script src="./scripts/storage.js"></script>
</body>
</html>