@saluzi/saluzi-edu 0.1.69 → 0.1.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +141 -53
- package/dist/parade/web/cube.js +27 -8
- package/dist/parade/web/index.html +21 -1
- package/package.json +1 -1
package/dist/parade/web/cube.js
CHANGED
|
@@ -203,23 +203,42 @@ document.addEventListener('contextmenu', function (e) {
|
|
|
203
203
|
ctxMenu.style.top = e.clientY + 'px'
|
|
204
204
|
})
|
|
205
205
|
|
|
206
|
-
// Frameless window drag via IPC (Electron). Left-click
|
|
207
|
-
//
|
|
208
|
-
//
|
|
209
|
-
//
|
|
206
|
+
// Frameless window drag + corner resize via IPC (Electron). Left-click on
|
|
207
|
+
// the body starts a move-drag; left-click on a .corner-handle starts a
|
|
208
|
+
// proportional resize. The main process polls the cursor and moves/resizes
|
|
209
|
+
// the window until mouseup. Right-click is left untouched so 'contextmenu'
|
|
210
|
+
// fires normally and the Close menu works.
|
|
211
|
+
var isResizing = false
|
|
210
212
|
if (window.parade && typeof window.parade.startDrag === 'function') {
|
|
211
213
|
document.addEventListener('mousedown', function (e) {
|
|
212
214
|
if (e.button !== 0) return // left button only
|
|
213
215
|
if (e.target.closest('#ctx-menu')) return // don't drag from menu
|
|
214
|
-
|
|
216
|
+
var cornerEl = e.target.closest('[data-corner]')
|
|
217
|
+
if (cornerEl && typeof window.parade.startResize === 'function') {
|
|
218
|
+
isResizing = true
|
|
219
|
+
window.parade.startResize(cornerEl.dataset.corner)
|
|
220
|
+
} else {
|
|
221
|
+
isResizing = false
|
|
222
|
+
window.parade.startDrag()
|
|
223
|
+
}
|
|
215
224
|
})
|
|
216
225
|
document.addEventListener('mouseup', function (e) {
|
|
217
226
|
if (e.button !== 0) return
|
|
218
|
-
window.parade.
|
|
227
|
+
if (isResizing && typeof window.parade.stopResize === 'function') {
|
|
228
|
+
window.parade.stopResize()
|
|
229
|
+
} else {
|
|
230
|
+
window.parade.stopDrag()
|
|
231
|
+
}
|
|
232
|
+
isResizing = false
|
|
219
233
|
})
|
|
220
|
-
// If the mouse leaves the window while dragging, stop too.
|
|
234
|
+
// If the mouse leaves the window while dragging/resizing, stop too.
|
|
221
235
|
window.addEventListener('blur', function () {
|
|
222
|
-
window.parade.
|
|
236
|
+
if (isResizing && typeof window.parade.stopResize === 'function') {
|
|
237
|
+
window.parade.stopResize()
|
|
238
|
+
} else {
|
|
239
|
+
window.parade.stopDrag()
|
|
240
|
+
}
|
|
241
|
+
isResizing = false
|
|
223
242
|
})
|
|
224
243
|
}
|
|
225
244
|
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
The cube canvas inside auto-syncs its buffer to the display size, so the
|
|
38
38
|
cube renders correctly at any window dimension. */
|
|
39
39
|
#cube-stage {
|
|
40
|
-
flex: 0 0 43%; /* ~
|
|
40
|
+
flex: 0 0 43%; /* ~95px of 220px, but proportional so it scales */
|
|
41
41
|
height: 100%;
|
|
42
42
|
position: relative;
|
|
43
43
|
background:
|
|
@@ -177,6 +177,21 @@
|
|
|
177
177
|
z-index: 100;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
+
/* ---- Corner resize handles ----
|
|
181
|
+
Invisible 12x12px hit areas in each corner. Cursor changes to the
|
|
182
|
+
directional resize icon on hover; left-click-and-drag proportionally
|
|
183
|
+
resizes the window (aspect-locked) via IPC to the electron main process. */
|
|
184
|
+
.corner-handle {
|
|
185
|
+
position: fixed;
|
|
186
|
+
width: 12px;
|
|
187
|
+
height: 12px;
|
|
188
|
+
z-index: 200;
|
|
189
|
+
}
|
|
190
|
+
.corner-tl { top: 0; left: 0; cursor: nwse-resize; }
|
|
191
|
+
.corner-tr { top: 0; right: 0; cursor: nesw-resize; }
|
|
192
|
+
.corner-bl { bottom: 0; left: 0; cursor: nesw-resize; }
|
|
193
|
+
.corner-br { bottom: 0; right: 0; cursor: nwse-resize; }
|
|
194
|
+
|
|
180
195
|
/* ---- Context menu ---- */
|
|
181
196
|
#ctx-menu {
|
|
182
197
|
display: none;
|
|
@@ -223,6 +238,11 @@
|
|
|
223
238
|
<div class="ctx-item" id="ctx-close">Close</div>
|
|
224
239
|
</div>
|
|
225
240
|
<div id="ws-status" title="WS: connecting"></div>
|
|
241
|
+
<!-- Corner resize handles: invisible hit areas at each corner -->
|
|
242
|
+
<div class="corner-handle corner-tl" data-corner="tl"></div>
|
|
243
|
+
<div class="corner-handle corner-tr" data-corner="tr"></div>
|
|
244
|
+
<div class="corner-handle corner-bl" data-corner="bl"></div>
|
|
245
|
+
<div class="corner-handle corner-br" data-corner="br"></div>
|
|
226
246
|
<script src="cube.js"></script>
|
|
227
247
|
</body>
|
|
228
248
|
</html>
|