js+css实现三国杀游戏代码
代码语言:html
所属分类:游戏
代码描述:js+css实现三国杀游戏代码
下面为部分代码预览,完整代码请点击下载或在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>三国杀 - 激斗版</title>
<style>
/* --- 基础设定 --- */
:root {
--bg-color: #2b2018;
--board-bg: #42352b;
--card-bg: #f1eadd;
--highlight: #ffc107;
--red: #c0392b;
--green: #27ae60;
--blue: #2980b9;
}
@font-face { font-family: 'Brush'; src: local('KaiTi'), local('STKaiti'); }
body {
margin: 0; overflow: hidden; background: var(--bg-color);
font-family: 'Brush', serif; user-select: none;
height: 100vh; display: flex; justify-content: center; align-items: center;
}
#app {
width: 100%; max-width: 1100px; height: 98vh;
background: var(--board-bg);
border: 5px solid #5d4037; border-radius: 10px;
box-shadow: inset 0 0 50px rgba(0,0,0,0.8);
display: grid; grid-template-rows: 1fr 1.2fr 1.4fr;
position: relative;
}
/* --- 通用 UI 组件 --- */
.zone { position: relative; display: flex; justify-content: center; align-items: center; }
/* 技能标签 */
.skill-tag {
position: absolute; top: -10px; right: -10px;
background: linear-gradient(45deg, #f1c40f, #d35400);
color: #fff; font-size: 12px; padding: 2px 8px;
border-radius: 10px; border: 1px solid #fff;
box-shadow: 0 2px 5px rgba(0,0,0,0.5); z-index: 5;
animation: pulse 2s infinite;
}
/* 台词气泡 */
.bubble {
position: absolute; top: -40px; left: 50%; transform: translateX(-50%);
background: #fff; color: #000; padding: 5px 10px;
border-radius: 8px; font-size: 14px; white-space: nowrap;
border: 2px solid #333; opacity: 0; pointer-events: none;
z-index: 20; font-weight: bold; box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}
.bubble::after {
content: ''; position: absolute; bottom: -6px; left: 50%; margin-left: -6px;
border-width: 6px 6px 0; border-style: solid; border-color: #333 transparent;
}
.bubble.show { animation: popTalk 2.5s forwards; }
/* 浮动伤害数字 */
.dmg-text {
position: absolute; font-size: 40px; font-weight: bold;
pointer-events: none; z-index: 50;
text-shadow: 2px 2px 0 #000;
}
.dmg-red { color: #e74c3c; animation: floatUp 1s forwards; }
.dmg-green.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0