Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@
</div>

<div id="terminal-container-wrapper" class="terminal-container-wrapper">
<div class="terminal-resize-handle" id="terminal-resize-handle"></div>
<div class="terminal-header" id="terminal-header">
<div class="terminal-title">
<i class="fas fa-terminal"></i>
Expand Down
2 changes: 1 addition & 1 deletion public/mobile-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
}

.font-size-control {
gap: 4px;
gap: 0;
}

.terminal-control-btn {
Expand Down
36 changes: 25 additions & 11 deletions public/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,22 @@ function closeTerminal() {
}

function initializeTerminalResize() {
const resizeHandle = document.getElementById("terminal-resize-handle");
const terminalHeader = document.getElementById("terminal-header");
const legacyResizeHandle = document.getElementById("terminal-resize-handle");
const resizeHandle = terminalHeader || legacyResizeHandle;
const terminalWrapper = document.getElementById("terminal-container-wrapper");
const mainContent = document.querySelector(".main-content");
let isResizing = false;
let startX, startY, initialWidth, initialHeight;

if (!resizeHandle || !terminalWrapper) return;

const isHorizontalResize = () => resizeHandle.classList.contains("resize-left");

resizeHandle.addEventListener("mousedown", (e) => {
if (e.target.closest("button, input, select, textarea, a")) {
return;
}

isResizing = true;
startX = e.clientX;
startY = e.clientY;
Expand All @@ -184,7 +193,7 @@ function initializeTerminalResize() {
document.addEventListener("mouseup", stopResize);
e.preventDefault();

if (resizeHandle.classList.contains("resize-left")) {
if (isHorizontalResize()) {
document.body.style.cursor = "ew-resize";
} else {
document.body.style.cursor = "ns-resize";
Expand All @@ -197,7 +206,7 @@ function initializeTerminalResize() {
function handleResize(e) {
if (!isResizing) return;

if (resizeHandle.classList.contains("resize-left")) {
if (isHorizontalResize()) {
const deltaX = startX - e.clientX;
const newWidth = Math.max(
200,
Expand Down Expand Up @@ -2085,7 +2094,9 @@ class SettingsManager {

document.body.setAttribute("data-layout", layoutMode);

const resizeHandle = document.getElementById("terminal-resize-handle");
const terminalHeader = document.getElementById("terminal-header");
const legacyResizeHandle = document.getElementById("terminal-resize-handle");
const resizeHandle = terminalHeader || legacyResizeHandle;
const terminalWrapper = document.getElementById(
"terminal-container-wrapper",
);
Expand All @@ -2094,12 +2105,15 @@ class SettingsManager {
const fileExplorer = document.querySelector(".file-explorer");

if (resizeHandle && terminalWrapper) {
resizeHandle.classList.remove(
"resize-top",
"resize-bottom",
"resize-left",
"resize-right",
);
[terminalHeader, legacyResizeHandle].forEach((handle) => {
if (!handle) return;
handle.classList.remove(
"resize-top",
"resize-bottom",
"resize-left",
"resize-right",
);
});

terminalWrapper.style.position = "";
terminalWrapper.style.width = "";
Expand Down
98 changes: 50 additions & 48 deletions public/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -244,18 +244,18 @@ select:focus {
.path-bar {
flex: 1 1 auto;
display: flex;
gap: 0; /* remove gap so CD hugs the input */
gap: 0;
min-width: 0;
}

#path-input {
flex: 1;
font-size: 12px;
border-radius: 4px 0 0 4px; /* left corners only */
border-radius: 4px 0 0 4px;
}

#cd-btn {
border-radius: 0 4px 4px 0; /* right corners only */
border-radius: 0 4px 4px 0;
border-left: 1px solid rgba(255,255,255,0.06);
}
.toolbar .topbar-sort-controls {
Expand Down Expand Up @@ -931,15 +931,7 @@ select:focus {
}

.terminal-resize-handle {
height: 8px;
cursor: ns-resize;
background: transparent;
border-top: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 8px 8px 0 0;
}

.terminal-resize-handle:hover {
background: rgba(64, 160, 255, 0.3);
display: none !important;
}

.terminal-header {
Expand All @@ -948,13 +940,22 @@ select:focus {
align-items: center;
padding: 8px 16px;
background: rgba(24, 26, 32, calc(var(--glass-opacity) / 100));
border: 1px solid rgba(255, 255, 255, 0.03);
border: none;
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
backdrop-filter: blur(var(--glass-blur)) saturate(1.1);
-webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.1);
border-radius: 8px 8px 0 0;
flex-shrink: 0;
}

.terminal-header.resize-top {
cursor: ns-resize;
}

.terminal-header.resize-left {
cursor: ew-resize;
}

#terminal-title {
color: var(--text-secondary);
font-size: 11px;
Expand Down Expand Up @@ -1017,47 +1018,59 @@ select:focus {
align-items: center;
}

.font-size-controls {
.font-size-control {
display: flex;
align-items: center;
gap: 4px;
background: rgba(255, 255, 255, 0.05);
border-radius: 4px;
padding: 2px;
gap: 0;
background: var(--bg-secondary);
border-radius: 8px;
padding: 0;
overflow: hidden;
}

.font-size-btn {
background: none;
.font-size-control .terminal-control-btn.font-btn {
background: var(--bg-secondary);
border: none;
color: var(--text-secondary);
width: 24px;
height: 24px;
border-radius: 2px;
width: 32px;
height: 32px;
border-radius: 0;
padding: 0;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
font-weight: bold;
transition: all 0.2s ease;
backdrop-filter: none;
-webkit-backdrop-filter: none;
}

.font-size-btn:hover {
.font-size-control .terminal-control-btn.font-btn:hover {
background: rgba(255, 255, 255, 0.1);
color: var(--text-primary);
}

.font-size-btn:active {
.font-size-control .terminal-control-btn.font-btn:active {
transform: scale(0.95);
}

.font-size-display {
color: var(--text-tertiary);
#font-size-display {
color: rgba(233, 238, 246, 0.95);
font-size: 10px;
min-width: 24px;
font-weight: 600;
min-width: 42px;
height: 32px;
text-align: center;
padding-left: 5px;
padding-right: 5px;
display: flex;
align-items: center;
justify-content: center;
padding-left: 8px;
padding-right: 8px;
background: var(--bg-secondary);
backdrop-filter: none;
-webkit-backdrop-filter: none;
}

#terminal-close {
Expand All @@ -1084,6 +1097,12 @@ select:focus {
border-radius: 0 0 8px 8px;
}

.xterm-glassy .xterm {
box-sizing: border-box;
padding-left: 8px;
padding-top: 6px;
}

#terminal-content {
height: calc(100% - 32px);
padding: 12px;
Expand Down Expand Up @@ -1593,21 +1612,8 @@ select:focus {
position: relative;
}

[data-layout="split"] .terminal-resize-handle {
width: 4px;
height: 100%;
[data-layout="split"] .terminal-header.resize-left {
cursor: ew-resize;
background: transparent;
border: none;
border-radius: 0;
position: absolute;
left: 0;
top: 0;
z-index: 10;
}

[data-layout="split"] .terminal-resize-handle:hover {
background: rgba(64, 160, 255, 0.3);
}

[data-layout="floating"] .terminal-container-wrapper {
Expand Down Expand Up @@ -1648,10 +1654,6 @@ select:focus {
border-radius: 8px !important;
}

[data-layout="terminal-only"] .terminal-resize-handle {
display: none;
}

[data-file-style="compact"] .file-item {
padding: 6px 28px;
font-size: 11px;
Expand Down
Loading