colurwindows / static /css /desktop.css
WACATW's picture
Upload 8 files
1db5bc8 verified
Raw History Blame Contribute Delete
21.1 kB
* {
margin: 0;
padding: 0;
box-sizing: border-box;
user-select: none;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
overflow: hidden;
height: 100vh;
width: 100vw;
}
/* 桌面背景 */
.desktop {
width: 100%;
height: 100%;
background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #667eea 100%);
position: relative;
overflow: hidden;
}
.desktop::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background:
radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.2) 0%, transparent 50%),
radial-gradient(circle at 50% 50%, rgba(100, 200, 255, 0.1) 0%, transparent 70%);
pointer-events: none;
}
/* 桌面图标 */
.desktop-icons {
position: absolute;
top: 20px;
left: 20px;
display: flex;
flex-direction: column;
gap: 20px;
z-index: 1;
}
.desktop-icon {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
cursor: pointer;
padding: 10px;
border-radius: 8px;
transition: all 0.2s ease;
width: 80px;
}
.desktop-icon:hover {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
}
.desktop-icon:active {
background: rgba(255, 255, 255, 0.2);
}
.icon-wrapper {
width: 48px;
height: 48px;
display: flex;
align-items: center;
justify-content: center;
font-size: 32px;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}
.icon-browser {
color: #4fc3f7;
}
.icon-about {
color: #81c784;
}
.icon-fullscreen {
color: #ffb74d;
}
.desktop-icon span {
color: white;
font-size: 12px;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
text-align: center;
line-height: 1.3;
}
/* 窗口 */
.window {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -55%);
width: 90%;
max-width: 1100px;
height: 80%;
max-height: 700px;
background: #f5f5f5;
border-radius: 12px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
display: flex;
flex-direction: column;
overflow: hidden;
z-index: 10;
transition: all 0.3s ease;
}
.window.maximized {
top: 0;
left: 0;
transform: none;
width: 100%;
height: calc(100% - 48px);
max-width: none;
max-height: none;
border-radius: 0;
}
.window.minimized {
transform: translate(-50%, 100vh) scale(0.1);
opacity: 0;
pointer-events: none;
}
/* 窗口标题栏 */
.window-header {
background: linear-gradient(180deg, #2d2d2d 0%, #1e1e1e 100%);
padding: 8px 12px;
display: flex;
align-items: center;
justify-content: space-between;
cursor: move;
min-height: 40px;
}
.window-title {
display: flex;
align-items: center;
gap: 8px;
color: #fff;
font-size: 13px;
font-weight: 500;
}
.window-title i {
color: #4fc3f7;
}
.window-controls {
display: flex;
gap: 6px;
}
.window-btn {
width: 28px;
height: 28px;
border: none;
border-radius: 6px;
background: rgba(255, 255, 255, 0.1);
color: #fff;
cursor: pointer;
transition: all 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
font-size: 11px;
}
.window-btn:hover {
background: rgba(255, 255, 255, 0.2);
}
.window-btn.close:hover {
background: #e81123;
}
.window-btn.minimize:hover {
background: #3a3a3a;
}
.window-btn.maximize:hover {
background: #3a3a3a;
}
/* 标签页栏 */
.tabs-bar {
background: #1e1e1e;
padding: 4px 8px 0 8px;
display: flex;
align-items: center;
gap: 4px;
border-bottom: 1px solid #333;
}
.tabs-container {
display: flex;
gap: 2px;
flex: 1;
overflow-x: auto;
scrollbar-width: thin;
}
.tabs-container::-webkit-scrollbar {
height: 4px;
}
.tabs-container::-webkit-scrollbar-track {
background: transparent;
}
.tabs-container::-webkit-scrollbar-thumb {
background: rgba(255, 255, 255, 0.2);
border-radius: 2px;
}
.tab {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
background: #2d2d2d;
color: #ccc;
font-size: 12px;
cursor: pointer;
border-radius: 6px 6px 0 0;
min-width: 150px;
max-width: 200px;
transition: all 0.2s ease;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.tab:hover {
background: #3a3a3a;
}
.tab.active {
background: #f5f5f5;
color: #333;
}
.tab-title {
flex: 1;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.tab-close {
width: 18px;
height: 18px;
border: none;
background: transparent;
color: inherit;
cursor: pointer;
border-radius: 3px;
display: flex;
align-items: center;
justify-content: center;
font-size: 10px;
opacity: 0.7;
}
.tab-close:hover {
background: rgba(0, 0, 0, 0.1);
opacity: 1;
}
.new-tab-btn {
width: 28px;
height: 28px;
border: none;
background: transparent;
color: #ccc;
cursor: pointer;
border-radius: 6px;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s ease;
}
.new-tab-btn:hover {
background: rgba(255, 255, 255, 0.1);
color: #fff;
}
/* 浏览器工具栏 */
.browser-toolbar {
background: #f5f5f5;
padding: 8px 12px;
display: flex;
align-items: center;
gap: 12px;
border-bottom: 1px solid #ddd;
}
.nav-buttons {
display: flex;
gap: 4px;
}
.nav-btn {
width: 32px;
height: 32px;
border: none;
border-radius: 6px;
background: transparent;
color: #666;
cursor: pointer;
transition: all 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
}
.nav-btn:hover {
background: #e0e0e0;
color: #333;
}
.nav-btn:active {
background: #d0d0d0;
}
.url-bar {
flex: 1;
display: flex;
align-items: center;
background: #fff;
border: 1px solid #ddd;
border-radius: 20px;
padding: 4px 4px 4px 12px;
transition: all 0.2s ease;
}
.url-bar:focus-within {
border-color: #2196f3;
box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}
.url-icon {
color: #4caf50;
margin-right: 8px;
font-size: 12px;
}
.url-bar input {
flex: 1;
background: transparent;
border: none;
color: #333;
font-size: 13px;
outline: none;
padding: 4px 0;
}
.url-bar input::placeholder {
color: #999;
}
.go-btn {
width: 28px;
height: 28px;
border: none;
border-radius: 50%;
background: #2196f3;
color: white;
cursor: pointer;
transition: all 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
font-size: 11px;
}
.go-btn:hover {
background: #1976d2;
transform: scale(1.05);
}
.toolbar-right {
display: flex;
gap: 4px;
}
/* 浏览器视口 */
.browser-viewport {
flex: 1;
background: #fff;
position: relative;
overflow: hidden;
cursor: crosshair;
}
.screenshot-container {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.screenshot-img {
width: 100%;
height: 100%;
object-fit: contain;
display: block;
}
/* 加载遮罩 */
.loading-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(255, 255, 255, 0.9);
display: flex;
align-items: center;
justify-content: center;
z-index: 10;
transition: opacity 0.3s ease;
}
.loading-overlay.hidden {
opacity: 0;
pointer-events: none;
}
.loading-content {
text-align: center;
}
.loading-icon {
font-size: 36px;
color: #2196f3;
margin-bottom: 12px;
}
.loading-text {
font-size: 14px;
color: #666;
}
/* 键盘捕获(隐藏) */
.keyboard-capture {
position: absolute;
opacity: 0;
pointer-events: none;
}
/* 状态栏 */
.status-bar {
background: #f5f5f5;
padding: 6px 12px;
display: flex;
gap: 20px;
border-top: 1px solid #ddd;
font-size: 11px;
color: #666;
}
.status-item {
display: flex;
align-items: center;
gap: 6px;
}
.status-item i {
color: #999;
font-size: 10px;
}
.status-item span {
max-width: 300px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* 任务栏 */
.taskbar {
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 48px;
background: rgba(30, 30, 30, 0.95);
backdrop-filter: blur(20px);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 8px;
z-index: 100;
border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.taskbar-left {
display: flex;
align-items: center;
}
.start-btn {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 16px;
background: transparent;
border: none;
color: #fff;
cursor: pointer;
border-radius: 6px;
transition: all 0.2s ease;
font-size: 13px;
font-weight: 500;
}
.start-btn:hover {
background: rgba(255, 255, 255, 0.1);
}
.start-btn i {
color: #4fc3f7;
font-size: 18px;
}
.taskbar-center {
flex: 1;
display: flex;
justify-content: center;
}
.taskbar-items {
display: flex;
gap: 4px;
}
.taskbar-item {
display: flex;
align-items: center;
gap: 8px;
padding: 6px 16px;
background: rgba(255, 255, 255, 0.05);
border: none;
color: #fff;
cursor: pointer;
border-radius: 6px;
transition: all 0.2s ease;
font-size: 12px;
border-bottom: 2px solid transparent;
}
.taskbar-item:hover {
background: rgba(255, 255, 255, 0.1);
}
.taskbar-item.active {
background: rgba(255, 255, 255, 0.15);
border-bottom-color: #4fc3f7;
}
.taskbar-right {
display: flex;
align-items: center;
gap: 12px;
}
.system-tray {
display: flex;
gap: 10px;
color: #ccc;
font-size: 12px;
}
.clock {
color: #fff;
font-size: 12px;
padding: 4px 8px;
border-radius: 4px;
cursor: pointer;
transition: all 0.2s ease;
}
.clock:hover {
background: rgba(255, 255, 255, 0.1);
}
/* 开始菜单 */
.start-menu {
position: absolute;
bottom: 56px;
left: 8px;
width: 320px;
background: rgba(30, 30, 30, 0.98);
backdrop-filter: blur(20px);
border-radius: 12px;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
z-index: 200;
display: none;
overflow: hidden;
border: 1px solid rgba(255, 255, 255, 0.1);
}
.start-menu.show {
display: block;
animation: slideUp 0.2s ease;
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.start-menu-header {
padding: 20px;
display: flex;
align-items: center;
gap: 12px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.user-avatar {
width: 48px;
height: 48px;
border-radius: 50%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 20px;
}
.user-name {
color: #fff;
font-size: 14px;
font-weight: 600;
margin-bottom: 2px;
}
.user-status {
color: #4caf50;
font-size: 12px;
display: flex;
align-items: center;
gap: 4px;
}
.user-status::before {
content: '';
width: 6px;
height: 6px;
border-radius: 50%;
background: #4caf50;
}
.start-menu-apps {
padding: 12px;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
}
.app-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
padding: 16px 8px;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
color: #fff;
}
.app-item:hover {
background: rgba(255, 255, 255, 0.1);
}
.app-icon {
font-size: 28px;
margin-bottom: 4px;
}
.app-item span {
font-size: 11px;
text-align: center;
}
.start-menu-footer {
padding: 12px 20px;
border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.power-btn {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 12px;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
color: #ccc;
font-size: 12px;
}
.power-btn:hover {
background: rgba(255, 255, 255, 0.1);
color: #fff;
}
.power-btn i {
color: #f44336;
}
/* Toast */
.toast {
position: fixed;
top: 20px;
right: 20px;
z-index: 1000;
transform: translateX(120%);
transition: transform 0.3s ease;
}
.toast.show {
transform: translateX(0);
}
.toast-content {
background: rgba(0, 0, 0, 0.9);
backdrop-filter: blur(10px);
padding: 12px 20px;
border-radius: 10px;
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
display: flex;
align-items: center;
gap: 10px;
font-size: 13px;
font-weight: 500;
color: #fff;
border: 1px solid rgba(255, 255, 255, 0.1);
}
.toast-icon.success {
color: #4caf50;
}
.toast-icon.error {
color: #f44336;
}
.toast-icon.info {
color: #2196f3;
}
/* 关于对话框 */
.about-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: none;
align-items: center;
justify-content: center;
z-index: 1000;
}
.about-modal.show {
display: flex;
}
.about-content {
background: #fff;
border-radius: 16px;
padding: 32px;
width: 90%;
max-width: 400px;
text-align: center;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
animation: modalIn 0.3s ease;
}
@keyframes modalIn {
from {
opacity: 0;
transform: scale(0.9);
}
to {
opacity: 1;
transform: scale(1);
}
}
.about-header {
margin-bottom: 20px;
}
.about-icon {
font-size: 48px;
color: #2196f3;
margin-bottom: 12px;
}
.about-header h2 {
font-size: 22px;
color: #333;
font-weight: 600;
}
.about-body {
margin-bottom: 24px;
}
.about-body p {
color: #666;
font-size: 14px;
line-height: 1.6;
margin-bottom: 8px;
}
.about-features {
display: flex;
justify-content: center;
gap: 24px;
margin-top: 20px;
}
.feature {
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
}
.feature i {
font-size: 24px;
color: #2196f3;
}
.feature span {
font-size: 12px;
color: #666;
}
.about-close {
padding: 10px 32px;
background: #2196f3;
color: white;
border: none;
border-radius: 8px;
font-size: 14px;
cursor: pointer;
transition: all 0.2s ease;
}
.about-close:hover {
background: #1976d2;
transform: translateY(-1px);
}
/* 全屏模式 */
.desktop.fullscreen .taskbar,
.desktop.fullscreen .desktop-icons,
.desktop.fullscreen .start-menu {
display: none;
}
.desktop.fullscreen .window {
top: 0;
left: 0;
transform: none;
width: 100%;
height: 100%;
max-width: none;
max-height: none;
border-radius: 0;
}
/* 桌面图标新增样式 */
.icon-folder {
color: #ffb74d;
}
.icon-docs {
color: #81c784;
}
.icon-notepad {
color: #ba68c8;
}
/* 文件管理器窗口 */
.file-manager-window {
width: 700px;
height: 500px;
}
.fm-toolbar {
background: #f5f5f5;
padding: 8px 12px;
display: flex;
align-items: center;
gap: 8px;
border-bottom: 1px solid #ddd;
}
.fm-btn {
width: 32px;
height: 32px;
border: none;
border-radius: 6px;
background: transparent;
color: #666;
cursor: pointer;
transition: all 0.2s ease;
display: flex;
align-items: center;
justify-content: center;
font-size: 13px;
}
.fm-btn:hover {
background: #e0e0e0;
color: #333;
}
.fm-path {
flex: 1;
background: #fff;
border: 1px solid #ddd;
border-radius: 6px;
padding: 6px 12px;
font-size: 13px;
color: #333;
margin: 0 8px;
}
.fm-actions {
display: flex;
gap: 4px;
}
.fm-content {
flex: 1;
background: #fff;
overflow-y: auto;
padding: 16px;
display: flex;
flex-wrap: wrap;
align-content: flex-start;
gap: 16px;
}
.fm-loading {
width: 100%;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
color: #999;
font-size: 14px;
padding: 40px;
}
.fm-loading i {
color: #2196f3;
}
.fm-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
width: 80px;
padding: 10px;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
}
.fm-item:hover {
background: #e3f2fd;
}
.fm-item.selected {
background: #bbdefb;
}
.fm-item-icon {
font-size: 36px;
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}
.fm-item-icon.folder {
color: #ffb74d;
}
.fm-item-icon.file {
color: #90caf9;
}
.fm-item-icon.text {
color: #a5d6a7;
}
.fm-item-name {
font-size: 12px;
color: #333;
text-align: center;
word-break: break-all;
line-height: 1.3;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.fm-status-bar {
background: #f5f5f5;
padding: 6px 12px;
border-top: 1px solid #ddd;
font-size: 11px;
color: #666;
}
/* 记事本窗口 */
.notepad-window {
width: 600px;
height: 450px;
}
.notepad-menu {
background: #f5f5f5;
padding: 4px 8px;
display: flex;
gap: 4px;
border-bottom: 1px solid #ddd;
}
.menu-item {
padding: 6px 12px;
font-size: 12px;
color: #333;
cursor: pointer;
border-radius: 4px;
transition: all 0.2s ease;
display: flex;
align-items: center;
gap: 6px;
}
.menu-item:hover {
background: #e0e0e0;
}
.menu-item i {
font-size: 11px;
color: #666;
}
.notepad-content {
flex: 1;
background: #fff;
overflow: hidden;
}
.notepad-content textarea {
width: 100%;
height: 100%;
border: none;
outline: none;
resize: none;
padding: 12px;
font-size: 14px;
font-family: 'Consolas', 'Monaco', monospace;
line-height: 1.6;
color: #333;
}
.notepad-content textarea::placeholder {
color: #ccc;
}
.notepad-status-bar {
background: #f5f5f5;
padding: 6px 12px;
border-top: 1px solid #ddd;
font-size: 11px;
color: #666;
}
/* 模态对话框 */
.modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: none;
align-items: center;
justify-content: center;
z-index: 2000;
}
.modal.show {
display: flex;
}
.modal-content {
background: #fff;
border-radius: 12px;
width: 90%;
max-width: 360px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
animation: modalIn 0.2s ease;
overflow: hidden;
}
.modal-header {
padding: 16px 20px;
border-bottom: 1px solid #eee;
}
.modal-header h3 {
font-size: 16px;
color: #333;
font-weight: 600;
}
.modal-body {
padding: 20px;
}
.modal-body input {
width: 100%;
padding: 10px 12px;
border: 1px solid #ddd;
border-radius: 8px;
font-size: 14px;
color: #333;
outline: none;
transition: all 0.2s ease;
}
.modal-body input:focus {
border-color: #2196f3;
box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}
.modal-body input::placeholder {
color: #999;
}
.save-path {
margin-bottom: 12px;
font-size: 13px;
color: #666;
}
.save-path span:last-child {
color: #333;
font-weight: 500;
}
.modal-footer {
padding: 12px 20px;
border-top: 1px solid #eee;
display: flex;
justify-content: flex-end;
gap: 10px;
}
.btn {
padding: 8px 20px;
border: none;
border-radius: 6px;
font-size: 13px;
cursor: pointer;
transition: all 0.2s ease;
font-weight: 500;
}
.btn-secondary {
background: #f5f5f5;
color: #666;
}
.btn-secondary:hover {
background: #e0e0e0;
color: #333;
}
.btn-primary {
background: #2196f3;
color: #fff;
}
.btn-primary:hover {
background: #1976d2;
}
/* 响应式 */
@media (max-width: 768px) {
.desktop-icons {
display: none;
}
.window {
width: 95%;
height: 85%;
}
.file-manager-window,
.notepad-window {
width: 95%;
height: 75%;
}
.tabs-container {
max-width: 200px;
}
.tab {
min-width: 100px;
max-width: 120px;
}
.start-menu {
width: calc(100% - 16px);
left: 8px;
}
.taskbar-item span {
display: none;
}
.system-tray {
display: none;
}
}