|
21 | 21 | this.isVisible = true;
|
22 | 22 |
|
23 | 23 | this.render();
|
24 |
| - this.hookConsole(); |
| 24 | + //this.hookConsole(); |
25 | 25 | this.toggleDevStudio();
|
26 | 26 | }
|
27 | 27 |
|
|
33 | 33 | button.close-btn { background: transparent; border: none; color: #ccc; font-size: 18px; cursor: pointer; padding: 0 6px; user-select: none; }
|
34 | 34 | button.close-btn:hover { color: white; }
|
35 | 35 | #panel { position: fixed; bottom: 0; right: 0; width: 400px; height: 80vh; max-height: 1000px; font-family: monospace; font-size: 12px; color: #fff; background: #1e1e1e; box-shadow: 0 0 10px rgba(0,0,0,0.5); border-top-left-radius: 6px; display: flex; flex-direction: column; z-index: 999999; transition: transform 0.2s ease-out, opacity 0.2s ease-out; overflow: hidden; }
|
| 36 | + #resize-handle { position: absolute; left: 0; top: 0; width: 6px; height: 100%; cursor: ew-resize; z-index: 1000001; } |
| 37 | + #resize-handle:hover { background: rgba(255, 255, 255, 0.1); } |
36 | 38 | header { background: #111; padding: 6px 10px; display: flex; align-items: center; user-select: none; border-top-left-radius: 6px; color: #eee; }
|
37 | 39 | header > .tabs { display: flex; gap: 10px; flex-grow: 1; }
|
38 | 40 | header button.tab { background: transparent; border: none; color: #ccc; cursor: pointer; padding: 4px 8px; font-size: 12px; border-bottom: 2px solid transparent; transition: border-color 0.15s ease; }
|
|
47 | 49 | ::-webkit-scrollbar-thumb:hover { background: #555; }
|
48 | 50 | </style>
|
49 | 51 | <div id="panel">
|
| 52 | + <div id="resize-handle"></div> |
50 | 53 | <div class="title">
|
51 | 54 | <div style="flex-grow: 1; align-content: center;">Breinify DevStudio</div>
|
52 | 55 | <button class="close-btn" title="Hide Breinify DevStudio">✕</button>
|
|
75 | 78 | this.$toggleButton.click(() => this.toggleDevStudio());
|
76 | 79 |
|
77 | 80 | this.$tabs.click(e => this.switchTab(e));
|
| 81 | + |
| 82 | + const $resizeHandle = this.$shadowRoot.find('#resize-handle') |
| 83 | + .data('isResizing', false); |
| 84 | + $resizeHandle.mousedown(e => { |
| 85 | + $resizeHandle.data({ |
| 86 | + isResizing: true, |
| 87 | + startX: e.clientX, |
| 88 | + startWidth: $resizeHandle.parent()[0].getBoundingClientRect().width |
| 89 | + }); |
| 90 | + |
| 91 | + $('body').css('user-select', 'none'); |
| 92 | + e.preventDefault(); |
| 93 | + }); |
| 94 | + $(document).on('mouseup blur', e => { |
| 95 | + if ($resizeHandle.data('isResizing') === true) { |
| 96 | + $resizeHandle.data('isResizing', false); |
| 97 | + $('body').css('user-select', ''); |
| 98 | + } |
| 99 | + }); |
| 100 | + $(document).mousemove(e => { |
| 101 | + if (!$resizeHandle.data('isResizing') === true) { |
| 102 | + return; |
| 103 | + } |
| 104 | + |
| 105 | + const startWidth = $resizeHandle.data('startWidth'); |
| 106 | + const dx = $resizeHandle.data('startX') - e.clientX; |
| 107 | + const newWidth = Math.min(Math.max(startWidth + dx, 200), 1000); |
| 108 | + |
| 109 | + $resizeHandle.parent().css('width', newWidth + 'px'); |
| 110 | + }); |
78 | 111 | }
|
79 | 112 |
|
80 | 113 | toggleDevStudio() {
|
|
0 commit comments