feat: initial commit of next_term modern linux terminal
This commit is contained in:
@@ -0,0 +1,139 @@
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: var(--font-sans);
|
||||
background: transparent;
|
||||
color: var(--text-main);
|
||||
height: 100vh;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
#app {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100vh;
|
||||
background: var(--bg-app);
|
||||
backdrop-filter: blur(24px) saturate(140%);
|
||||
-webkit-backdrop-filter: blur(24px) saturate(140%);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--border-radius-lg);
|
||||
overflow: hidden;
|
||||
box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
|
||||
}
|
||||
|
||||
/* 顶部无边框拖拽标题栏 */
|
||||
.titlebar {
|
||||
height: var(--titlebar-height);
|
||||
background: var(--bg-titlebar);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
-webkit-app-region: drag; /* 允许窗口拖拽 */
|
||||
position: relative;
|
||||
z-index: 100;
|
||||
padding: 0 8px;
|
||||
}
|
||||
|
||||
.titlebar-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
-webkit-app-region: no-drag;
|
||||
}
|
||||
|
||||
.app-brand {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
color: var(--accent-color);
|
||||
padding: 0 8px;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.app-brand-icon {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
.titlebar-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
-webkit-app-region: no-drag;
|
||||
}
|
||||
|
||||
.btn-icon {
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: var(--text-muted);
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: var(--border-radius-sm);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
.btn-icon:hover {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
color: var(--text-bright);
|
||||
}
|
||||
|
||||
.btn-icon:active {
|
||||
transform: scale(0.95);
|
||||
}
|
||||
|
||||
/* 窗口控制按钮 (最小化、最大化、关闭) */
|
||||
.window-controls {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
margin-left: 6px;
|
||||
-webkit-app-region: no-drag;
|
||||
}
|
||||
|
||||
.win-btn {
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: var(--text-muted);
|
||||
width: 32px;
|
||||
height: 28px;
|
||||
border-radius: var(--border-radius-sm);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
.win-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
color: var(--text-bright);
|
||||
}
|
||||
|
||||
.win-btn.close:hover {
|
||||
background: #f7768e;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
/* 主内容区 */
|
||||
.main-viewport {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: transparent;
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
/* 底部状态栏 */
|
||||
.statusbar {
|
||||
height: var(--statusbar-height);
|
||||
background: var(--bg-titlebar);
|
||||
border-top: 1px solid var(--border-color);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 12px;
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
z-index: 50;
|
||||
}
|
||||
|
||||
.statusbar-left,
|
||||
.statusbar-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.statusbar-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.statusbar-item.clickable {
|
||||
cursor: pointer;
|
||||
padding: 2px 6px;
|
||||
border-radius: var(--border-radius-sm);
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
.statusbar-item.clickable:hover {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
color: var(--text-bright);
|
||||
}
|
||||
|
||||
.status-dot {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
background: #9ece6a;
|
||||
box-shadow: 0 0 6px rgba(158, 206, 106, 0.6);
|
||||
}
|
||||
|
||||
/* 模态框遮罩层 */
|
||||
.modal-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: rgba(0, 0, 0, 0.55);
|
||||
backdrop-filter: blur(4px);
|
||||
display: none;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
padding-top: 12vh;
|
||||
z-index: 1000;
|
||||
animation: fadeIn 0.15s ease;
|
||||
}
|
||||
|
||||
.modal-overlay.active {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
/* 快速命令面板 (Command Palette) */
|
||||
.command-palette {
|
||||
width: 520px;
|
||||
max-width: 90vw;
|
||||
background: var(--bg-app);
|
||||
border: 1px solid var(--border-active);
|
||||
border-radius: var(--border-radius-md);
|
||||
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow);
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.palette-input-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12px 16px;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.palette-input {
|
||||
flex: 1;
|
||||
background: transparent;
|
||||
border: none;
|
||||
outline: none;
|
||||
color: var(--text-bright);
|
||||
font-size: 14px;
|
||||
font-family: var(--font-sans);
|
||||
}
|
||||
|
||||
.palette-list {
|
||||
max-height: 280px;
|
||||
overflow-y: auto;
|
||||
padding: 6px;
|
||||
}
|
||||
|
||||
.palette-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 8px 12px;
|
||||
border-radius: var(--border-radius-sm);
|
||||
color: var(--text-main);
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
transition: all 0.1s ease;
|
||||
}
|
||||
|
||||
.palette-item.selected,
|
||||
.palette-item:hover {
|
||||
background: var(--accent-color);
|
||||
color: #0f141c;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.palette-item-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.palette-shortcut {
|
||||
font-size: 11px;
|
||||
opacity: 0.7;
|
||||
font-family: var(--font-mono);
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
padding: 2px 6px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
/* 设置弹窗 */
|
||||
.settings-modal {
|
||||
width: 560px;
|
||||
max-width: 90vw;
|
||||
background: var(--bg-app);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--border-radius-lg);
|
||||
box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.settings-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 14px 20px;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.settings-header h3 {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: var(--text-bright);
|
||||
}
|
||||
|
||||
.settings-body {
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 16px;
|
||||
max-height: 480px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.setting-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.setting-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
.setting-label {
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
color: var(--text-bright);
|
||||
}
|
||||
|
||||
.setting-desc {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.setting-control select,
|
||||
.setting-control input[type="text"],
|
||||
.setting-control input[type="number"] {
|
||||
background: var(--bg-tab-inactive);
|
||||
border: 1px solid var(--border-color);
|
||||
color: var(--text-bright);
|
||||
padding: 6px 10px;
|
||||
border-radius: var(--border-radius-sm);
|
||||
font-size: 12px;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.setting-control select:focus,
|
||||
.setting-control input:focus {
|
||||
border-color: var(--border-active);
|
||||
}
|
||||
|
||||
/* 终端内搜索条 */
|
||||
.search-bar {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 20px;
|
||||
background: var(--bg-titlebar);
|
||||
border: 1px solid var(--border-active);
|
||||
border-radius: var(--border-radius-md);
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
|
||||
display: none;
|
||||
align-items: center;
|
||||
padding: 4px 8px;
|
||||
gap: 6px;
|
||||
z-index: 200;
|
||||
animation: slideDown 0.15s ease;
|
||||
}
|
||||
|
||||
.search-bar.active {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
background: transparent;
|
||||
border: none;
|
||||
outline: none;
|
||||
color: var(--text-bright);
|
||||
font-size: 12px;
|
||||
width: 160px;
|
||||
}
|
||||
|
||||
.search-count {
|
||||
font-size: 11px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
|
||||
@keyframes slideDown {
|
||||
from { transform: translateY(-10px); opacity: 0; }
|
||||
to { transform: translateY(0); opacity: 1; }
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/* 分屏视图与窗格容器 */
|
||||
.tab-view {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.tab-view.active {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.split-container {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.split-container.horizontal {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.split-container.vertical {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.split-pane {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border: 1px solid transparent;
|
||||
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
||||
min-width: 120px;
|
||||
min-height: 80px;
|
||||
}
|
||||
|
||||
.split-pane.focused {
|
||||
border-color: var(--border-active);
|
||||
box-shadow: inset 0 0 0 1px var(--border-active), 0 0 12px var(--accent-glow);
|
||||
}
|
||||
|
||||
.terminal-wrapper {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 6px 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.xterm {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.xterm-viewport {
|
||||
overflow-y: auto !important;
|
||||
}
|
||||
|
||||
/* 分割线 */
|
||||
.split-divider {
|
||||
background: var(--border-color);
|
||||
z-index: 10;
|
||||
transition: background 0.2s ease;
|
||||
}
|
||||
|
||||
.split-container.horizontal > .split-divider {
|
||||
width: 2px;
|
||||
cursor: col-resize;
|
||||
}
|
||||
|
||||
.split-container.vertical > .split-divider {
|
||||
height: 2px;
|
||||
cursor: row-resize;
|
||||
}
|
||||
|
||||
.split-divider:hover {
|
||||
background: var(--accent-color);
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
/* 标签栏 */
|
||||
.tab-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
overflow-x: auto;
|
||||
scrollbar-width: none;
|
||||
max-width: calc(100vw - 320px);
|
||||
}
|
||||
|
||||
.tab-bar::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 4px 10px;
|
||||
height: 28px;
|
||||
background: var(--bg-tab-inactive);
|
||||
border-radius: var(--border-radius-sm);
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
border: 1px solid transparent;
|
||||
transition: all 0.15s ease;
|
||||
white-space: nowrap;
|
||||
max-width: 180px;
|
||||
min-width: 90px;
|
||||
}
|
||||
|
||||
.tab-item:hover {
|
||||
background: var(--bg-tab-hover);
|
||||
color: var(--text-main);
|
||||
}
|
||||
|
||||
.tab-item.active {
|
||||
background: var(--bg-tab-active);
|
||||
color: var(--text-bright);
|
||||
border-color: var(--border-active);
|
||||
box-shadow: 0 0 10px var(--accent-glow);
|
||||
}
|
||||
|
||||
.tab-icon {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.tab-title {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tab-close {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border-radius: 50%;
|
||||
opacity: 0;
|
||||
transition: all 0.12s ease;
|
||||
}
|
||||
|
||||
.tab-item:hover .tab-close,
|
||||
.tab-item.active .tab-close {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.tab-close:hover {
|
||||
opacity: 1 !important;
|
||||
background: rgba(255, 255, 255, 0.15);
|
||||
color: #f7768e;
|
||||
}
|
||||
|
||||
.new-tab-btn {
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: var(--text-muted);
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
border-radius: var(--border-radius-sm);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
.new-tab-btn:hover {
|
||||
background: rgba(255, 255, 255, 0.08);
|
||||
color: var(--accent-color);
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
:root {
|
||||
--font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
||||
--font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', 'Courier New', monospace;
|
||||
|
||||
/* 基础设计变量 */
|
||||
--bg-app: rgba(22, 22, 30, 0.88);
|
||||
--bg-titlebar: rgba(16, 16, 22, 0.92);
|
||||
--bg-tab-active: rgba(36, 40, 59, 0.95);
|
||||
--bg-tab-inactive: rgba(26, 27, 38, 0.6);
|
||||
--bg-tab-hover: rgba(34, 36, 54, 0.8);
|
||||
--border-color: rgba(255, 255, 255, 0.08);
|
||||
--border-active: #7aa2f7;
|
||||
--text-main: #c0caf5;
|
||||
--text-muted: #565f89;
|
||||
--text-bright: #ffffff;
|
||||
--accent-color: #7aa2f7;
|
||||
--accent-glow: rgba(122, 162, 247, 0.35);
|
||||
|
||||
--titlebar-height: 38px;
|
||||
--statusbar-height: 26px;
|
||||
--border-radius-sm: 4px;
|
||||
--border-radius-md: 8px;
|
||||
--border-radius-lg: 12px;
|
||||
|
||||
--terminal-font-size: 14px;
|
||||
--terminal-line-height: 1.25;
|
||||
}
|
||||
|
||||
/* Tokyo Night */
|
||||
[data-theme="tokyo-night"] {
|
||||
--bg-app: rgba(26, 27, 38, 0.92);
|
||||
--bg-titlebar: rgba(22, 22, 30, 0.96);
|
||||
--bg-tab-active: rgba(36, 40, 59, 0.98);
|
||||
--bg-tab-inactive: rgba(26, 27, 38, 0.6);
|
||||
--border-color: rgba(122, 162, 247, 0.15);
|
||||
--border-active: #7aa2f7;
|
||||
--text-main: #c0caf5;
|
||||
--text-muted: #565f89;
|
||||
--accent-color: #7aa2f7;
|
||||
--accent-glow: rgba(122, 162, 247, 0.3);
|
||||
}
|
||||
|
||||
/* Catppuccin Mocha */
|
||||
[data-theme="catppuccin"] {
|
||||
--bg-app: rgba(30, 30, 46, 0.92);
|
||||
--bg-titlebar: rgba(24, 24, 37, 0.96);
|
||||
--bg-tab-active: rgba(49, 50, 68, 0.98);
|
||||
--bg-tab-inactive: rgba(30, 30, 46, 0.6);
|
||||
--border-color: rgba(203, 166, 247, 0.15);
|
||||
--border-active: #cba6f7;
|
||||
--text-main: #cdd6f4;
|
||||
--text-muted: #6c7086;
|
||||
--accent-color: #cba6f7;
|
||||
--accent-glow: rgba(203, 166, 247, 0.3);
|
||||
}
|
||||
|
||||
/* Dracula */
|
||||
[data-theme="dracula"] {
|
||||
--bg-app: rgba(40, 42, 54, 0.92);
|
||||
--bg-titlebar: rgba(33, 34, 44, 0.96);
|
||||
--bg-tab-active: rgba(68, 71, 90, 0.98);
|
||||
--bg-tab-inactive: rgba(40, 42, 54, 0.6);
|
||||
--border-color: rgba(189, 147, 249, 0.15);
|
||||
--border-active: #bd93f9;
|
||||
--text-main: #f8f8f2;
|
||||
--text-muted: #6272a4;
|
||||
--accent-color: #ff79c6;
|
||||
--accent-glow: rgba(255, 121, 198, 0.3);
|
||||
}
|
||||
|
||||
/* One Dark */
|
||||
[data-theme="one-dark"] {
|
||||
--bg-app: rgba(40, 44, 52, 0.92);
|
||||
--bg-titlebar: rgba(33, 37, 43, 0.96);
|
||||
--bg-tab-active: rgba(53, 59, 69, 0.98);
|
||||
--bg-tab-inactive: rgba(40, 44, 52, 0.6);
|
||||
--border-color: rgba(97, 175, 239, 0.15);
|
||||
--border-active: #61afef;
|
||||
--text-main: #abb2bf;
|
||||
--text-muted: #5c6370;
|
||||
--accent-color: #61afef;
|
||||
--accent-glow: rgba(97, 175, 239, 0.3);
|
||||
}
|
||||
|
||||
/* Cyberpunk Neon */
|
||||
[data-theme="cyberpunk"] {
|
||||
--bg-app: rgba(13, 18, 30, 0.94);
|
||||
--bg-titlebar: rgba(9, 12, 20, 0.98);
|
||||
--bg-tab-active: rgba(26, 35, 58, 0.98);
|
||||
--bg-tab-inactive: rgba(13, 18, 30, 0.6);
|
||||
--border-color: rgba(0, 255, 204, 0.2);
|
||||
--border-active: #00ffcc;
|
||||
--text-main: #e2f0fb;
|
||||
--text-muted: #4e6a88;
|
||||
--accent-color: #ff007f;
|
||||
--accent-glow: rgba(255, 0, 127, 0.4);
|
||||
}
|
||||
Reference in New Issue
Block a user