<!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: #0a0a1a;
overflow: hidden;
font-family: Arial, sans-serif;
}
.scene {
position: relative;
width: 800px;
height: 600px;
background: #12122a;
border-radius: 10px;
box-shadow: 0 0 30px rgba(0, 0, 50, 0.8);
overflow: hidden;
}
.desk {
position: absolute;
bottom: 0;
width: 100%;
height: 150px;
background: #1a1a1a;
}
.monitor {
position: absolute;
width: 400px;
height: 250px;
background: #000;
border: 15px solid #333;
border-radius: 10px;
top: 100px;
left: 50%;
transform: translateX(-50%);
box-shadow: 0 0 30px rgba(0, 150, 255, 0.5);
}
.screen {
position: absolute;
width: 100%;
height: 100%;
background: #0a1a2a;
overflow: hidden;
}
.code {
position: absolute;
color: #0af;
font-family: 'Courier New', monospace;
font-size: 14px;
line-height: 1.5;
white-space: pre;
top: 10px;
left: 20px;
animation: codeScroll 20s linear infinite;
}
.keyboard {
position: absolute;
width: 350px;
height: 30px;
background: #222;
bottom: 160px;
left: 50%;
transform: translateX(-50%);
border-radius: 5px;
}
.coffee {
position: absolute;
width: 60px;
height: 80px;
background: #5a3a22;
bottom: 160px;
right: 100px;
border-radius: 5px 5px 0 0;
}
.coffee-cup {
position: absolute;
width: 50px;
height: 60px;
background: #fff;
bottom: 0;
left: 5px;
border-radius: 0 0 5px 5px;
}
.coffee-liquid {
position: absolute;
width: 100%;
height: 50px;
background: #4a2c10;
bottom: 0;
border-radius: 0 0 5px 5px;
animation: coffeeSteam 3s infinite ease-in-out;
}
.steam {
position: absolute;
width: 8px;
height: 30px;
background: rgba(255, 255, 255, 0.8);
border-radius: 10px;
filter: blur(5px);
animation: steamRise 4s infinite ease-in;
}
.clock {
position: absolute;
width: 80px;
height: 80px;
background: #222;
border-radius: 50%;
top: 50px;
right: 50px;
border: 5px solid #333;
}
.clock-face {
position: absolute;
width: 60px;
height: 60px;
background: #111;
border-radius: 50%;
top: 10px;
left: 10px;
}
.clock-hour {
position: absolute;
width: 4px;
height: 20px;
background: #fff;
top: 10px;
left: 28px;
transform-origin: bottom center;
animation: clockMove 12s linear infinite;
}
.clock-minute {
position: absolute;
width: 2px;
height: 30px;
background: #fff;
top: 0;
left: 29px;
transform-origin: bottom center;
animation: clockMove 1s linear infinite;
}
.moon {
position: absolute;
width: 100px;
height: 100px;
background: #f5f5dc;
border-radius: 50%;
top: 50px;
left: 50px;
box-shadow: 0 0 30px #f5f5dc;
}
.stars {
position: absolute;
width: 100%;
height: 100%;
}
.star {
position: absolute;
background: #fff;
border-radius: 50%;
animation: twinkle 2s infinite alternate;
}
.star:nth-child(1) {
width: 2px;
height: 2px;
top: 20%;
left: 15%;
animation-delay: 0s;
}
.star:nth-child(2) {
width: 3px;
height: 3px;
top: 30%;
left: 80%;
animation-delay: 0.5s;
}
.star:nth-child(3) {
width: 1px;
height: 1px;
top: 60%;
left: 25%;
animation-delay: 1s;
}
.star:nth-child(4) {
width: 2px;
height: 2px;
top: 70%;
left: 70%;
animation-delay: 1.5s;
}
.star:nth-child(5) {
width: 3px;
height: 3px;
top: 40%;
left: 50%;
animation-delay: 0.8s;
}
.link {
position: absolute;
bottom: 20px;
left: 0;
width: 100%;
text-align: center;
}
.link a {
color: #0af;
text-decoration: none;
font-size: 14px;
background: rgba(0, 50, 100, 0.5);
padding: 8px 15px;
border-radius: 20px;
transition: all 0.3s;
}
.link a:hover {
background: rgba(0, 100, 200, 0.7);
}
@keyframes codeScroll {
0% {
transform: translateY(0);
}
100% {
transform: translateY(-80%);
}
}
@keyframes coffeeSteam {
0%, 100% {
height: 50px;
}
50% {
height: 45px;
}
}
@keyframes steamRise {
0% {
transform: translateY(0) scale(1);
opacity: 0;
}
10% {
opacity: 0.5;
}
90% {
opacity: 0.5;
}
100% {
transform: translateY(-50px) scale(0.5);
opacity: 0;
}
}
@keyframes clockMove {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
@keyframes twinkle {
0% {
opacity: 0.3;
}
100% {
opacity: 1;
}
}
</style>
</head>
<body>
<div class="scene">
<div class="stars">
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
</div>
<div class="moon"></div>
<div class="desk"></div>
<div class="monitor">
<div class="screen">
<div class="code">
function lateNightWork() {
while(true) {
const coffee = drinkCoffee();
const code = writeCode();
if (energy <= 0) {
drinkMoreCoffee();
} else if (bugs > 0) {
fixBugs();
} else {
writeMoreCode();
}
if (sun.isRising()) {
realizeDeadlineIsClose();
panic();
}
}
}
</div>
</div>
</div>
<div class="keyboard"></div>
<div class="coffee">
<div class="coffee-cup">
<div class="coffee-liquid"></div>
<div class="steam" style="left: 10px; animation-delay: 0s;"></div>
<div class="steam" style="left: 25px; animation-delay: 1s;"></div>
<div class="steam" style="left: 40px; animation-delay: 2s;"></div>
</div>
</div>
<div class="clock">
<div class="clock-face">
<div class="clock-hour"></div>
<div class="clock-minute"></div>
</div>
</div>
<div class="link">
</div>
</div>
</body>
</html>
295

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



