Skip to content

Commit 67ebcfd

Browse files
committed
update [release]
1 parent 230fc2c commit 67ebcfd

3 files changed

Lines changed: 50 additions & 5 deletions

File tree

public/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,7 @@ <h1 class="login-title">PortPilot <span class="ver">v1</span></h1>
284284
<button id="term-close" class="ed-btn"><span class="nav-ico-wrap" data-icon="x"></span> Kapat</button>
285285
</div>
286286
<div id="term-host" class="term-host"></div>
287+
<div id="term-resize" class="term-resize" title="Boyutlandırmak için sürükle"></div>
287288
</div>
288289
</div>
289290

public/js/terminal.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,36 @@ export function openServerTerminal(dir) {
120120
openTerminal("__host__", name, dir);
121121
}
122122

123+
// Sağ-alt köşeden sürükleyerek terminal kutusunu boyutlandır.
124+
// Kutu overlay içinde ortalandığından, köşenin imleci takip etmesi için
125+
// boyut değişimini 2× uygularız (merkez sabit kalır, iki yana büyür).
126+
function initTerminalResize() {
127+
const handle = $("term-resize");
128+
if (!handle) return;
129+
const box = handle.closest(".term-box");
130+
let sx = 0, sy = 0, sw = 0, sh = 0, dragging = false;
131+
const onMove = (e) => {
132+
if (!dragging) return;
133+
box.style.width = Math.max(360, sw + (e.clientX - sx) * 2) + "px";
134+
box.style.height = Math.max(240, sh + (e.clientY - sy) * 2) + "px";
135+
};
136+
const onUp = () => {
137+
dragging = false;
138+
document.removeEventListener("pointermove", onMove);
139+
document.removeEventListener("pointerup", onUp);
140+
if (termState) termState.onResize();
141+
};
142+
handle.addEventListener("pointerdown", (e) => {
143+
e.preventDefault();
144+
const r = box.getBoundingClientRect();
145+
sx = e.clientX; sy = e.clientY; sw = r.width; sh = r.height; dragging = true;
146+
document.addEventListener("pointermove", onMove);
147+
document.addEventListener("pointerup", onUp);
148+
});
149+
}
150+
123151
export function initTerminal() {
152+
initTerminalResize();
124153
$("term-close").addEventListener("click", closeTerminal);
125154
$("term-min").addEventListener("click", minimizeTerminal);
126155
$("term-restore").addEventListener("click", restoreTerminal);

public/style.css

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2118,18 +2118,33 @@ tr.dir .fname {
21182118
height: min(600px, 80vh);
21192119
display: flex;
21202120
flex-direction: column;
2121-
/* Kullanıcı köşeden sürükleyerek büyütüp küçültebilir */
2122-
resize: both;
2121+
position: relative;
21232122
overflow: hidden;
21242123
min-width: 360px;
21252124
min-height: 240px;
21262125
max-width: 98vw;
21272126
max-height: 94vh;
21282127
}
21292128

2130-
/* Sürükleme tutamacını biraz daha görünür yap */
2131-
.term-box::-webkit-resizer {
2132-
background: rgba(255, 255, 255, .25);
2129+
/* Sağ-alt köşede özel boyutlandırma tutamacı (terminalin üstünde) */
2130+
.term-resize {
2131+
position: absolute;
2132+
right: 0;
2133+
bottom: 0;
2134+
width: 18px;
2135+
height: 18px;
2136+
cursor: nwse-resize;
2137+
z-index: 5;
2138+
background:
2139+
linear-gradient(135deg, transparent 0 50%, rgba(255, 255, 255, .45) 50% 60%,
2140+
transparent 60% 70%, rgba(255, 255, 255, .45) 70% 80%, transparent 80%);
2141+
border-bottom-right-radius: 12px;
2142+
}
2143+
2144+
.term-resize:hover {
2145+
background:
2146+
linear-gradient(135deg, transparent 0 45%, rgba(255, 255, 255, .8) 45% 60%,
2147+
transparent 60% 70%, rgba(255, 255, 255, .8) 70% 85%, transparent 85%);
21332148
}
21342149

21352150
/* Küçültülmüş terminal çubuğu (sağ altta yüzer) */

0 commit comments

Comments
 (0)