<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>深夜加班电脑特效</title>
<style>
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: #121212;
font-family: Arial, sans-serif;
overflow: hidden;
}
.scene {
position: relative;
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
/* 房间 */
.room {
position: relative;
width: 600px;
height: 400px;
background: #1a1a1a;
border-radius: 10px;
box-shadow: 0 0 50px rgba(0,0,0,0.8);
overflow: hidden;
}
/* 桌子 */
.desk {
position: absolute;
width: 100%;
height: 80px;
background: #2b2118;
bottom: 0;
border-top: 2px solid #3d2e1c;
}
/* 显示器 */
.monitor {
position: absolute;
width: 300px;
height: 180px;
background: #333;
top: 100px;
left: 150px;
border-radius: 5px 5px 0 0;
box-shadow: 0 0 20px rgba(0,0,0,0.5);
}
.monitor-screen {
position: absolute;
width: 280px;
height: 160px;
background: #0a0a0a;
top: 10px;
left: 10px;
overflow: hidden;
}
/* 代码文本效果 */
.code {
position: absolute;
width: 100%;
height: 100%;
color: #0f0;
font-family: 'Courier New', monospace;
font-size: 12px;
line-height: 1.5;
padding: 10px;
box-sizing: border-box;
overflow: hidden;
}
.code-line {
animation: typing 3s steps(40) infinite;
white-space: nowrap;
overflow: hidden;
}
.cursor {
display: inline-block;
width: 10px;
height: 15px;
background: #0f0;
animation: blink 1s infinite;
vertical-align: middle;
}
@keyframes typing {
from { width: 0 }
to { width: 100% }
}
@keyframes blink {
0%, 100% { opacity: 1 }
50% { opacity: 0 }
}
/* 显示器底座 */
.monitor-stand {
position: absolute;
width: 100px;
height: 20px;
background: #444;
top: 280px;
left: 250px;
}
.monitor-base {
position: absolute;
width: 150px;
height: 10px;
background: #555;
top: 300px;
left: 225px;
border-radius: 0 0 5px 5px;
}
/* 键盘 */
.keyboard {
position: absolute;
width: 250px;
height: 20px;
background: #222;
bottom: 90px;
left: 175px;
border-radius: 3px;
}
/* 咖啡杯 */
.coffee-cup {
position: absolute;
width: 40px;
height: 50px;
background: #6f4e37;
bottom: 90px;
right: 100px;
border-radius: 0 0 20px 20px;
}
.coffee {
position: absolute;
width: 36px;
height: 10px;
background: #4b3621;
top: 5px;
left: 2px;
border-radius: 50%;
animation: coffee-steam 3s infinite;
}
/* 咖啡热气 */
.steam {
position: absolute;
width: 8px;
height: 20px;
background: rgba(255,255,255,0.3);
border-radius: 50%;
animation: steam-rise 4s infinite;
}
.steam:nth-child(1) {
left: 8px;
top: -15px;
animation-delay: 0.5s;
}
.steam:nth-child(2) {
left: 18px;
top: -20px;
animation-delay: 1s;
}
.steam:nth-child(3) {
left: 28px;
top: -15px;
animation-delay: 1.5s;
}
@keyframes steam-rise {
0% {
transform: translateY(0) scale(1);
opacity: 0;
}
50% {
opacity: 0.5;
}
100% {
transform: translateY(-30px) scale(1.5);
opacity: 0;
}
}
/* 窗外月光 */
.moonlight {
position: absolute;
width: 200px;
height: 200px;
background: rgba(255,255,255,0.05);
border-radius: 50%;
top: -100px;
right: -100px;
box-shadow: 0 0 100px rgba(255,255,255,0.1);
}
/* 时钟 */
.clock {
position: absolute;
width: 50px;
height: 50px;
background: #333;
border-radius: 50%;
top: 50px;
right: 50px;
border: 2px solid #444;
}
.clock-center {
position: absolute;
width: 5px;
height: 5px;
background: #fff;
border-radius: 50%;
top: 22.5px;
left: 22.5px;
}
.clock-hour {
position: absolute;
width: 3px;
height: 15px;
background: #fff;
top: 10px;
left: 23.5px;
transform-origin: bottom center;
animation: hour-rotate 30s linear infinite;
}
.clock-minute {
position: absolute;
width: 2px;
height: 20px;
background: #fff;
top: 5px;
left: 24px;
transform-origin: bottom center;
animation: minute-rotate 5s linear infinite;
}
@keyframes hour-rotate {
from { transform: rotate(0deg) }
to { transform: rotate(360deg) }
}
@keyframes minute-rotate {
from { transform: rotate(0deg) }
to { transform: rotate(360deg) }
}
/* 底部链接 */
.footer-link {
position: fixed;
bottom: 20px;
color: rgba(255,255,255,0.5);
text-decoration: none;
font-size: 14px;
transition: color 0.3s;
}
.footer-link:hover {
color: #0f0;
text-decoration: underline;
}
</style>
</head>
<body>
<div class="scene">
<div class="room">
<div class="moonlight"></div>
<div class="desk"></div>
<div class="monitor">
<div class="monitor-screen">
<div class="code">
<div class="code-line">while (deadline > now) {</div>
<div class="code-line"> code();</div>
<div class="code-line"> drinkCoffee();</div>
<div class="code-line"> if (bugs > 0) {</div>
<div class="code-line"> debug();</div>
<div class="code-line"> }</div>
<div class="code-line">}<span class="cursor"></span></div>
</div>
</div>
</div>
<div class="monitor-stand"></div>
<div class="monitor-base"></div>
<div class="keyboard"></div>
<div class="coffee-cup">
<div class="coffee"></div>
<div class="steam"></div>
<div class="steam"></div>
<div class="steam"></div>
</div>
<div class="clock">
<div class="clock-hour"></div>
<div class="clock-minute"></div>
<div class="clock-center"></div>
</div>
</div>
</div>
</body>
</html>
深夜加班电脑特效
于 2025-06-10 13:17:01 首次发布
295

被折叠的 条评论
为什么被折叠?



