js+css实现可编辑的家庭族谱编辑器设计器代码
代码语言:html
所属分类:其他
代码描述:js+css实现可编辑的家庭族谱编辑器设计器代码
代码标签: 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>
* { margin:0; padding:0; box-sizing:border-box; }
body {
font-family: "Microsoft YaHei","PingFang SC",sans-serif;
background: #f0ebe3;
min-height: 100vh;
overflow: auto;
}
/* 顶部栏 */
.top-bar {
background: linear-gradient(135deg, #5b3a29, #8b6914);
color: #f5e6c8;
padding: 12px 24px;
display: flex;
align-items: center;
justify-content: space-between;
position: sticky;
top: 0;
z-index: 100;
box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.top-bar h1 { font-size: 22px; letter-spacing: 4px; font-weight: 500; }
.top-bar .actions { display: flex; gap: 8px; }
.top-bar button {
padding: 7px 18px;
border: 1px solid rgba(255,255,255,.35);
background: rgba(255,255,255,.1);
color: #f5e6c8;
border-radius: 6px;
cursor: pointer;
font-size: 13px;
transition: .2s;
}
.top-bar button:hover { background: rgba(255,255,255,.25); }
.top-bar button.primary { background:#c9a84c; border-color:#c9a84c; color:#3a2510; font-weight:600; }
.top-bar button.primary:hover { background:#dbb85c; }
/* 画布区 */
.canvas-wrap {
overflow: auto;
padding: 40px 20px 80px;
display: flex;
justify-content: center;
}
/* 族谱树 */
.tree { display: flex; flex-direction: column; align-items: center; }
.tree ul {
display: flex;
padding-top: 30px;
position: relative;
list-style: none;
gap: 0;
}
.tree li {
display: flex;
flex-direction: column;
align-items: center;
position: relative;
padding: 0 12px;
}
/* 连线 */
.tree li::before, .tree li::after {
content: '';
position: absolute;
top: 0;
width: 50%;
height: 30px;
border-top: 2px solid #b8976a;
}
.tree li::before { right: 50%; border-right: 2px solid #b8976a; }
.tree li::after { left: 50%; border-left: 2px solid #b8976a; }
.tree li:first-child::before { border:0; }
.tree li:last-child::after { border:0; }
.tree li:only-child::before, .tree li:only-child::after { border:0; }
.tree ul > li::before { border-top: 2px solid #b8976a; }
.tree > ul > li::before, .tree > ul > li::after { border:0; }
/* 竖线到子节点 */
.tree li > ul::before {
content: '';
positio.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0