console
<!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>
/* 1. 高级感背景设计 */
body {
background: url('https://images.unsplash.com/photo-1497215728101-856f4ea42174?auto=format&fit=crop&q=80&w=1000')
no-repeat center center fixed;
background-size: cover;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
margin: 0;
font-family: "PingFang SC", sans-serif;
overflow: hidden;
}
/* 背景遮罩,增加质感 */
body::before {
content: "";
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0, 0, 0, 0.3); /* 阴影层 */
z-index: -1;
}
/* 2. 毛玻璃卡片 (Glassmorphism) */
.card {
background: rgba(255, 255, 255, 0.85);
backdrop-filter: blur(15px); /* 模糊背景 */
-webkit-backdrop-filter: blur(15px);
width: 340px;
padding: 35px;
border-radius: 30px;
box-shadow: 0 20px 50px rgba(0,0,0,0.2);
text-align: center;
border: 1px solid rgba(255, 255, 255, 0.3);
position: relative;
}
/* 音乐控制图标 */
.music-toggle {
position: absolute;
top: 20px;
right: 20px;
cursor: pointer;
font-size: 20px;
opacity: 0.6;
}
.question-title { font-size: 20px; color: #333; margin-bottom: 25px; font-weight: 600; line-height: 1.4; }
/* 选项按钮美化 */
.option-btn {
display: block;
width: 100%;
padding: 15px;
margin: 12px 0;
border: none;
border-radius: 15px;
background: rgba(255, 255, 255, 0.9);
box-shadow: 0 4px 10px rgba(0,0,0,0.05);
cursor: pointer;
transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
font-size: 15px;
color: #444;
}
.option-btn:hover {
transform: scale(1.03);
background: #00b894;
color: white;
box-shadow: 0 8px 20px rgba(0, 184, 148, 0.3);
}
/* 结果展示 */
#result-page { display: none; animation: fadeIn 0.8s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.match-rate {
background: linear-gradient(to right, #00b894, #00cec9);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-size: 56px;
font-weight: 900;
}
.tag { background: #e8f8f5; color: #00b894; padding: 6px 14px; border-radius: 50px; font-size: 13px; font-weight: 600; }
.reason-box {
background: rgba(0, 184, 148, 0.05);
border-radius: 20px;
padding: 20px;
text-align: left;
margin-top: 20px;
font-size: 14px;
color: #555;
line-height: 1.6;
}
.restart-btn {
margin-top: 25px;
background: #333;
color: white;
border: none;
padding: 12px 30px;
border-radius: 50px;
font-size: 14px;
cursor: pointer;
letter-spacing: 1px;
}
</style>
</head>
<body>
<audio id="bgMusic" loop>
<source src="https://assets.mixkit.co/music/preview/mixkit-lo-fi-night-chill-1603.mp3" type="audio/mpeg">
</audio>
<div class="card">
<div class="music-toggle" onclick="toggleMusic()">��</div>
<div id="quiz-page">
<div id="progress" style="font-size: 13px; color: #999; margin-bottom: 15px; letter-spacing: 2px;">QUIZ 01 / 03</div>
<div class="question-title" id="question">加载中...</div>
<div id="options"></div>
</div>
<div id="result-page">
<div class="match-rate" id="res-score">99%</div>
<div style="font-size: 14px; color: #888; margin-top: -10px;">MATCHED SUCCESS</div>
<h2 id="res-name" style="color: #222; margin: 20px 0 10px 0;">职场水豚</h2>
<div style="display: flex; justify-content: center; gap: 8px;" id="res-tags"></div>
<div class="reason-box" id="res-reason"></div>
<button class="restart-btn" onclick="location.reload()">RESTART</button>
</div>
</div>
<script>
const questions = [
{ q: "面对早起上班的闹钟,你的第一反应是?", options: [ {t: "安详地关掉,继续睡", s: 1}, {t: "深呼吸,思考生存的意义", s: 10}, {t: "弹射起步,我是工位的主人", s: 100} ] },
{ q: "老板在半夜突然在群里发了条消息?", options: [ {t: "假装没看到,并开启勿扰", s: 1}, {t: "内心咆哮,但还是发个收到", s: 10}, {t: "秒回:老板辛苦了,还没睡呀", s: 100} ] },
{ q: "下班时间到了,你的动作是?", options: [ {t: "光速消失在工位", s: 1}, {t: "磨蹭一会,显得很忙", s: 10}, {t: "主动问老板还有没有指示", s: 100} ] }
];
const results = [
{ min: 0, name: "职场水豚", score: "99%", tags: ["极致松弛", "定海神针"], reason: "你拥有极其稳定的精神内核。在这个喧嚣的世界,你坚持到点下班,用最优雅的姿态对抗焦虑。" },
{ min: 20, name: "职场边牧", score: "88%", tags: ["智力担当", "想拆公司"], reason: "你很高效,但容易被低效率的同事气到。你不是在工作,就是在思考如何优雅地拆掉这个烂系统。" },
{ min: 200, name: "职场战狼", score: "100%", tags: ["KPI捕手", "公司之光"], reason: "血管里流淌着浓缩咖啡。你是办公室里永不停歇的发动机,你的奋斗让所有老板都感到欣慰。" }
];
let currentStep = 0, totalScore = 0;
const music = document.getElementById('bgMusic');
function toggleMusic() {
if (music.paused) music.play();
else music.pause();
}
function showQuestion() {
const quiz = questions[currentStep];
document.getElementById('progress').innerText = `QUIZ 0${currentStep + 1} / 0${questions.length}`;
document.getElementById('question').innerText = quiz.q;
const optionsDiv = document.getElementById('options');
optionsDiv.innerHTML = '';
quiz.options.forEach(opt => {
const btn = document.createElement('button');
btn.className = 'option-btn';
btn.innerText = opt.t;
btn.onclick = () => {
if(currentStep === 0) music.play(); // 第一次点击开始播放音乐
nextStep(opt.s);
};
optionsDiv.appendChild(btn);
});
}
function nextStep(score) {
totalScore += score;
currentStep++;
if (currentStep < questions.length) showQuestion();
else showResult();
}
function showResult() {
document.getElementById('quiz-page').style.display = 'none';
document.getElementById('result-page').style.display = 'block';
const res = results.slice().reverse().find(r => totalScore >= r.min);
document.getElementById('res-score').innerText = res.score;
document.getElementById('res-name').innerText = res.name;
document.getElementById('res-reason').innerText = res.reason;
res.tags.forEach(t => {
const s = document.createElement('span'); s.className = 'tag'; s.innerText = t;
document.getElementById('res-tags').appendChild(s);
});
}
showQuestion();
</script>
</body>
</html>