vue3实现内置文件管理、录音、拍照、多tab浏览器、记事本等窗口的window11桌面操作系统代码,
代码语言:html
所属分类:其他
代码描述:vue3实现内置文件管理、录音、拍照、多tab浏览器、记事本等窗口的window11桌面操作系统代码,数据存储在本地。
代码标签: vue 模拟 window 桌面 操作 系统 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>Windows 11 - UI 原型 </title>
<!-- Vue 2 CDN -->
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/vue@2.6.1-dev.js"></script>
<!-- ECharts CDN (备用) -->
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/echarts.5.5.0.js"></script>
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/bootstrap-icons.1.8.1.css">
<style>
/* --- 全局与主题 --- */
:root {
--win-bg: #0d1117;
--taskbar-bg: rgba(30, 30, 30, 0.7);
--window-bg: rgba(40, 40, 40, 0.85);
--start-menu-bg: rgba(35, 35, 35, 0.85);
--accent-blue: #0078d4;
--text-color: #ffffff;
--text-secondary: #cccccc;
--border-color: rgba(128, 128, 128, 0.3);
--font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
--win-border-radius: 8px;
}
* { box-sizing: border-box; }
html, body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
overflow: hidden;
font-family: var(--font-family);
color: var(--text-color);
user-select: none;
}
#app {
height: 100%;
width: 100%;
background-size: cover;
background-position: center;
transition: background-image 0.5s ease-in-out;
}
/* --- Bootstrap Icons 样式调整 --- */
.bi {
font-size: 16px;
vertical-align: middle;
}
/* --- 登录与锁屏界面 --- */
.auth-screen {
position: absolute;
top: 0; left: 0;
width: 100%; height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
background-size: cover;
background-position: center;
backdrop-filter: blur(20px);
z-index: 10000;
}
.auth-box {
background: rgba(0, 0, 0, 0.4);
padding: 40px;
border-radius: var(--win-border-radius);
text-align: center;
border: 1px solid var(--border-color);
}
.auth-avatar { width: 100px; height: 100px; border-radius: 50%; margin-bottom: 20px; }
.auth-user { font-size: 1.5rem; margin-bottom: 20px; }
.password-input {
padding: 10px 15px;
width: 250px;
border: 1px solid var(--border-color);
background: rgba(255, 255, 255, 0.1);
color: var(--text-color);
border-radius: 5px;
font-size: 1rem;
outline: none;
}
.password-input:focus { border-color: var(--accent-blue); }
.auth-error { color: #ff7675; margin-top: 10px; height: 1em; }
/* --- 屏保 --- */
.screensaver {
position: absolute; top: 0; left: 0;
width: 100%; height: 100%;
background: #000;
z-index: 9999;
animation: screensaver-fade-in 1s ease;
}
@keyframes screensaver-fade-in { from { opacity: 0; } to { opacity: 1; } }
.screensaver-content {
position: absolute;
color: white;
font-size: 3rem;
font-weight: bold;
animation: float 20s infinite linear;
display: flex;
align-items: center;
gap: 20px;
}
@keyframes float {
0% { transform: translate(5vw, 10vh); }
25% { transform: translate(60vw, 80vh); }
50% { transform: translate(70vw, 20vh); }
75% { transform: translate(10vw, 50vh); }
100% { transform: translate(5vw, 10vh); }
}
/* --- 桌面 --- */
.desktop {
position: absolute;
top: 0; left: 0;
width: 100%; height: calc(100% - 48px); /* 减去任务栏高度 */
padding: 10px;
display: flex;
flex-direction: column;
flex-wrap: wrap;
align-content: flex-start;
gap: 5px;
}
.desktop-icon {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 90px;
height: 90px;
padding: 5px 0;
border-radius: 5px;
cursor: pointer;
border: 1px solid transparent;
}
.desktop-icon:hover { background: rgba(255, 255, 255, 0.1); }
.desktop-icon.selected { background: rgba(0, 120, 212, 0.4); border-color: rgba(0, 120, 212, 0.8); }
.desktop-icon i { font-size: 36px; margin-bottom: 5px; color: #FFCA28; } /* Default folder color */
.desktop-icon i.bi-file-earmark-text { color: #fff; } /* File color */
.desktop-icon span { font-size: 12px; text-align: center; text-shadow: 1px 1px 2px black; word-break: break-word; color: white; padding: 2px 4px; border-radius: 3px; }
.desktop-icon input {
width: 100%; text-align: center; background: #eee; color: #000; border: 1px solid var(--accent-blue); outline: none; font-size: 12px;
}
/* --- 右键菜单 --- */
.context-menu {
position: absolute;
background: var(--start-menu-bg);
backdrop-filter: blur(15px);
border: 1px solid var(--border-color);
border-radius: var(--win-border-radius);
padding: 5px;
min-width: 220px;
z-index: 5000;
}
.context-menu-item {
padding: 8px 15px;
display: flex;
align-items: center;
gap: 10px;
cursor: pointer;
border-radius: 5px;
}
.context-menu-item:hover { background: rgba(255, 255, 255, 0.1); }
.context-menu-item.disabled { color: #888; cursor: not-allowed; }
.context-menu-item.disabled:hover { background: none; }
.context-menu-separator { height: 1px; background: var(--border-color); margin: 5px; }
/* --- 任务栏 --- */
.taskbar {
position: absolute;
bottom: 0; left: 0;
width: 100%; height: 48px;
background: var(--taskbar-bg);
backdrop-filter: blur(20px);
display: flex;
justify-content: space-between;
align-items: center;
z-index: 4000;
}
.taskbar-center {
display: flex;
justify-content: center;
position: absolute;
left: 50%;
transform: translateX(-50%);
height: 100%;
}
.taskbar-item {
padding: 0 12px;
height: 100%;
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0