原生js+css实现一个适合程序员开发者的webos操作系统ui交互效果代码
代码语言:html
所属分类:布局界面
代码描述:原生js+css实现一个适合程序员开发者的webos操作系统ui交互效果代码
代码标签: 原生 js css 适合 程序员 开发者 webos 操作系统 ui 交互
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DevOS - 程序员操作系统</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Consolas', 'Monaco', monospace;
overflow: hidden;
background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
height: 100vh;
}
/* 桌面背景 */
#desktop {
width: 100%;
height: calc(100vh - 50px);
position: relative;
background-image:
linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
background-size: 50px 50px;
}
/* 桌面图标 */
.desktop-icon {
width: 80px;
padding: 10px;
text-align: center;
cursor: pointer;
position: absolute;
color: white;
transition: background 0.3s;
border-radius: 8px;
user-select: none;
}
.desktop-icon:hover {
background: rgba(255, 255, 255, 0.2);
}
.desktop-icon .icon {
font-size: 40px;
margin-bottom: 5px;
}
.desktop-icon .label {
font-size: 12px;
text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}
/* 窗口样式 */
.window {
position: absolute;
min-width: 400px;
min-height: 300px;
background: #1e1e1e;
border-radius: 8px;
box-shadow: 0 10px 40px rgba(0,0,0,0.5);
display: flex;
flex-direction: column;
overflow: hidden;
z-index: 100;
}
.window.maximized {
width: 100% !important;
height: calc(100vh - 50px) !important;
top: 0 !important;
left: 0 !important;
border-radius: 0;
}
.window.minimized {
display: none;
}
.window-header {
background: #2d2d2d;
padding: 10px 15px;
display: flex;
justify-content: space-between;
align-items: center;
cursor: move;
border-bottom: 1px solid #3e3e3e;
}
.window-title {
color: #fff;
font-size: 14px;
display: flex;
align-items: center;
gap: 8px;
}
.window-controls {
display: flex;
gap: 8px;
}
.window-btn {
width: 12px;
height: 12px;
border-radius: 50%;
cursor: pointer;
transition: filter 0.2s;
}
.window-btn:hover {
filter: brightness(1.2);
}
.btn-close { background: #ff5f56; }
.btn-minimize { background: #ffbd2e; }
.btn-maximize { background: #27c93f; }
.window-content {
flex: 1;
overflow: auto;
color: #d4d4d4;
background: #1e1e1e;
}
/* 任务栏 */
#taskbar {
height: 50px;
background: rgba(30, 30, 30, 0.95);
backdrop-filter: blur(10px);
display: flex;
align-items: center;
padding: 0 15px;
gap: 10px;
border-top: 1px solid rgba(255,255,255,0.1);
position: relative;
z-index: 1000;
}
#start-button {
width: 40px;
height: 40px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
font-size: 20px;
transition: transform 0.2s;
}
#start-button:hover {
transform: scale(1.1);
}
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0