book-min/miniprogram/components/reader/reader.wxss

402 lines
6.1 KiB
Plaintext
Raw Normal View History

2024-12-18 16:15:08 +08:00
.reader {
height: 100vh;
background: #f4ecd8;
position: relative;
overflow: hidden;
}
/* 顶部工具栏 */
.toolbar {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 88rpx;
background: rgba(0,0,0,0.7);
display: flex;
align-items: center;
padding: 0 30rpx;
transition: all 0.3s;
z-index: 100;
}
.toolbar.hidden {
transform: translateY(-100%);
}
.back, .menu {
color: #fff;
font-size: 40rpx;
padding: 20rpx;
}
.title {
flex: 1;
color: #fff;
font-size: 32rpx;
text-align: center;
}
/* 阅读区域 */
.content {
height: 100vh;
padding: 0rpx 0rpx 0rpx;
box-sizing: border-box;
display: flex;
flex-direction: column;
width: 100%;
max-width: 700rpx;
margin: 0 auto;
}
.chapter-title {
font-size: 36rpx;
font-weight: bold;
color: #333;
margin: 20rpx 0;
text-align: center;
}
.page-content {
flex: 1;
line-height: 1.8;
text-align: justify;
overflow: hidden;
white-space: pre-wrap;
padding: 0;
width: 100%;
box-sizing: border-box;
}
.page-content text {
text-indent: 2em;
line-height: 1.8;
}
.page-number {
text-align: center;
color: #999;
font-size: 24rpx;
padding: 20rpx 0;
}
/* 底部页码 */
.page-info {
text-align: center;
color: #999;
font-size: 24rpx;
padding: 10rpx 0;
}
/* 底部评论区域 */
.bottom-section {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: #fff;
border-top: 1rpx solid #eee;
padding: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.bookmark-btn {
color: #666;
font-size: 28rpx;
padding: 10rpx 20rpx;
}
.add-bookmark {
color: #666;
font-size: 28rpx;
padding: 10rpx 20rpx;
display: flex;
align-items: center;
}
.add-bookmark .close {
margin-left: 10rpx;
font-size: 24rpx;
}
/* 评论列表 */
.comment-list {
padding: 20rpx;
background: #fff;
border-top: 1rpx solid #eee;
}
.comment-item {
padding: 20rpx 0;
border-bottom: 1rpx solid #eee;
font-size: 28rpx;
color: #333;
}
.comment-time {
font-size: 24rpx;
color: #999;
margin-top: 10rpx;
}
/* 底部工具栏 */
.bottom-toolbar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: rgba(0,0,0,0.7);
transition: all 0.3s;
z-index: 100;
padding-bottom: env(safe-area-inset-bottom);
}
.toolbar-top {
height: 100rpx;
display: flex;
align-items: center;
justify-content: space-around;
}
.toolbar-bottom {
height: 60rpx;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 40rpx;
border-top: 1rpx solid rgba(255, 255, 255, 0.1);
}
.prev, .next, .settings {
color: #fff;
font-size: 28rpx;
padding: 20rpx 40rpx;
}
.progress {
color: #fff;
font-size: 28rpx;
}
.current-time, .reading-progress {
color: rgba(255, 255, 255, 0.6);
font-size: 24rpx;
}
/* 设置面板 */
.settings-panel {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: #fff;
transform: translateY(100%);
transition: all 0.3s;
z-index: 999;
border-radius: 20rpx 20rpx 0 0;
padding-bottom: env(safe-area-inset-bottom);
}
.settings-panel.show {
transform: translateY(0);
}
.settings-header {
height: 88rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 30rpx;
border-bottom: 1rpx solid #eee;
}
.settings-header .close {
font-size: 40rpx;
color: #999;
padding: 20rpx;
}
.settings-content {
padding: 30rpx;
}
.setting-item {
margin-bottom: 40rpx;
}
.setting-item text {
font-size: 28rpx;
color: #666;
margin-bottom: 20rpx;
display: block;
}
/* 字体大小控制 */
.font-size-control {
display: flex;
align-items: center;
justify-content: space-between;
background: #f7f7f7;
border-radius: 12rpx;
padding: 20rpx;
margin-top: 16rpx;
}
.size-btn {
width: 80rpx;
height: 80rpx;
border: none;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
color: #333;
background: #fff;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
}
.current-size {
font-size: 28rpx;
color: #333;
}
/* 主题列表 */
.theme-list {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 20rpx;
margin-top: 16rpx;
}
.theme-item {
aspect-ratio: 1;
border-radius: 12rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 24rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
transition: all 0.3s;
}
.theme-item.active {
transform: scale(1.05);
box-shadow: 0 4rpx 12rpx rgba(25, 137, 250, 0.2);
}
/* 亮度调节 */
.brightness-slider {
margin-top: 16rpx;
padding: 0 12rpx;
}
.brightness-slider slider {
margin: 0;
}
.mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
opacity: 0;
visibility: hidden;
transition: all 0.3s;
z-index: 998;
}
.mask.show {
opacity: 1;
visibility: visible;
}
/* 目录菜单 */
.menu-panel {
position: fixed;
top: 0;
right: 0;
bottom: 0;
width: 80%;
background: #fff;
transform: translateX(100%);
transition: all 0.3s;
z-index: 999;
display: flex;
flex-direction: column;
}
.menu-panel.show {
transform: translateX(0);
}
.menu-header {
height: 88rpx;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 30rpx;
border-bottom: 1rpx solid #eee;
}
.menu-header .close {
font-size: 40rpx;
color: #999;
padding: 20rpx;
}
.chapter-list {
flex: 1;
overflow-y: auto;
}
.chapter-item {
padding: 30rpx;
border-bottom: 1rpx solid #eee;
color: #333;
font-size: 28rpx;
}
.chapter-item.active {
color: #1989fa;
background: rgba(25, 137, 250, 0.1);
}
/* 文本选择菜单 */
.text-menu {
position: fixed;
background: rgba(0,0,0,0.8);
border-radius: 8rpx;
padding: 10rpx 0;
transform: translate(-50%, -100%);
opacity: 0;
visibility: hidden;
transition: all 0.2s;
z-index: 999;
}
.text-menu.show {
opacity: 1;
visibility: visible;
}
.menu-item {
color: #fff;
font-size: 28rpx;
padding: 16rpx 30rpx;
white-space: nowrap;
}
.menu-item:active {
background: rgba(255,255,255,0.1);
}
.reading-time {
font-size: 24rpx;
color: #fff;
margin-right: 20rpx;
}