DreamLife_ToolBox/css/max_width.css

81 lines
2.0 KiB
CSS
Raw Normal View History

2025-03-03 18:59:57 +08:00
/* 响应式设计 */
@media (max-width: 768px) {
#fullscreen-button {
display: none; /* 小屏幕隐藏头部全屏按钮 */
}
#sidebar-fullscreen-button {
display: flex; /* 小屏幕显示侧边栏全屏按钮 */
}
#search-input {
position: absolute;
2025-03-03 18:59:57 +08:00
width: 50%; /* 设置宽度为屏幕的50% */
padding: 5px 15px;
top: 72px;
2025-03-03 18:59:57 +08:00
left: 50%; /* 使搜索框居中 */
2025-03-26 13:52:39 +08:00
z-index: 1000;
2025-03-03 18:59:57 +08:00
}
#search-input:hover,
#search-input:focus {
2025-03-26 13:52:39 +08:00
width: 60%;
padding: 5px 20px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
2025-03-03 18:59:57 +08:00
}
/* 小屏幕时侧边栏 */
.sidebar {
2025-03-26 13:52:39 +08:00
width: 80%;
2025-03-03 18:59:57 +08:00
bottom: 0;
transform: translateX(-100%); /* 默认隐藏侧边栏 */
2025-03-26 13:52:39 +08:00
z-index: 2000;
2025-03-03 18:59:57 +08:00
}
.sidebar.open {
transform: translateX(0);
bottom: 0;
2025-03-26 13:52:39 +08:00
width: 80%; /* 侧边栏在打开时宽度为80% */
2025-03-03 18:59:57 +08:00
}
.logo {
padding-top: 72px !important;
}
2025-03-03 18:59:57 +08:00
/* 小屏幕时主内容区 */
.main-content {
2025-03-26 14:09:25 +08:00
margin-left: 0px; /* 小屏幕时移除左边距 */
margin-right: 0px; /* 小屏幕时右边距减小 */
margin-top: 80px; /* 小屏幕时稍微减小上边距 */
2025-03-03 18:59:57 +08:00
}
/* 小屏幕时头部 */
header {
2025-03-26 13:52:39 +08:00
height: 40px;
justify-content: space-between;
align-items: center;
z-index: 3000;
2025-03-03 18:59:57 +08:00
}
/* 小屏幕时菜单按钮 */
header .toggle-menu {
display: block; /* 在小屏幕时显示菜单按钮 */
font-size: 24px;
background: none;
border: none;
color: rgb(235, 10, 10);
cursor: pointer;
position: absolute;
2025-03-26 13:52:39 +08:00
top: 10px;
right: 14px;
2025-03-03 18:59:57 +08:00
transition: transform 0.3s ease-in-out; /* 添加平滑过渡效果 */
}
/* 悬停效果,按钮背景颜色变化 */
header .toggle-menu:hover {
2025-03-26 13:52:39 +08:00
background-color: rgba(235, 10, 10, 0.1);
2025-03-03 18:59:57 +08:00
}
#logo_head {
width: 100%;
}
2025-03-03 18:59:57 +08:00
}