DreamLife_ToolBox/css/sidebar.css

95 lines
2.3 KiB
CSS
Raw Normal View History

2025-03-03 18:59:57 +08:00
/* 侧边栏 */
.sidebar {
position: fixed;
top: -30px;
left: 0;
width: 250px;
bottom: 24px;
background-color: #f4f4f4;
color: rgb(100, 99, 99); /* logo颜色 */
display: flex;
flex-direction: column;
align-items: center; /* 水平居中 */
padding: 20px;
transition: transform 0.3s ease-in-out;
z-index: 2000;
}
.logo {
font-family: 'Pacifico', cursive; /* 使用本地字体 Pacifico */
margin: 0;
padding-top: 48px;
text-align: center; /* 确保整个 logo 居中 */
display: flex;
flex-direction: column; /* 将 part1 和 part2 垂直排列 */
align-items: center; /* 确保每个部分居中 */
}
.logo .part1 {
font-size: 50px; /* "ream" 字体较大 */
}
.logo .part2 {
font-size: 40px; /* ".life" 字体较小 */
}
/* 侧边栏链接的基础样式 */
.sidebar-link {
position: relative;
font-size: 22px;
font-weight: bold;
margin-top: 48px;
color: rgb(117, 115, 115);
text-decoration: none; /* 去掉默认的下划线 */
display: inline-block;
padding: 10px 20px;
background-color: #f4f4f4;
transition: all 0.3s ease; /* 添加平滑过渡效果 */
}
/* 侧边栏链接内容的容器 */
.sidebar-link .link-content {
display: flex;
background-color: #f4f4f4;
align-items: center; /* 确保文字和图标垂直居中 */
transition: transform 0.3s ease; /* 添加平滑过渡 */
}
/* 悬停时图标和文字一起上浮 */
.sidebar-link:hover .link-content {
transform: translateY(-3px); /* 向上浮起5px */
}
/* 图标样式 */
.sidebar-link .icon {
margin-right: 10px; /* 给图标和文字之间留点空隙 */
}
/* 悬停时改变链接的颜色 */
.sidebar-link:hover {
color: #000;
}
/* 按钮文本和图标的状态样式 */
.sidebar-link.fullscreen .icon {
transform: rotate(90deg); /* 图标旋转 */
}
/* 退出全屏时的样式 */
.sidebar-link.fullscreen span {
content: "退出全屏"; /* 修改文本为"退出全屏" */
}
.sidebar {
flex: 1 1 250px; /* 允许侧边栏在可用空间内缩放 */
2025-03-03 20:40:23 +08:00
}
/* 侧边栏按钮容器 */
#sidebar {
display: flex;
flex-direction: column; /* 垂直排列按钮 */
align-items: center; /* 确保按钮水平居中 */
padding-top: 30px;
2025-03-03 18:59:57 +08:00
}