Files
2026-04-23 11:13:23 +08:00

491 lines
8.0 KiB
Plaintext

/** pages/community/index.wxss **/
page {
height: 100%;
overflow: hidden;
}
.community-page {
background-color: #F4F6F0;
height: 100vh;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* Header with User Info */
.community-header {
display: flex;
align-items: center;
padding: 24rpx 40rpx;
padding-top: calc(24rpx + env(safe-area-inset-top));
background: white;
flex-shrink: 0;
border-bottom: 2rpx solid rgba(0, 0, 0, 0.03);
}
.community-header .user-info {
display: flex;
align-items: center;
gap: 20rpx;
}
.community-header .header-avatar {
width: 80rpx;
height: 80rpx;
border-radius: 16rpx;
background: #f5f5f5;
object-fit: cover;
}
.community-header .user-name {
font-size: 34rpx;
font-weight: 700;
color: #333;
}
/* Feed Scroll Area */
.moments-feed {
flex: 1;
padding: 0 40rpx;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.moments-feed::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
}
/* Post Card */
.moment-post {
display: flex;
gap: 24rpx;
margin-top: 40rpx;
padding-bottom: 40rpx;
border-bottom: 2rpx solid #f5f5f5;
}
.moment-post:last-child {
border-bottom: none;
}
/* Avatar - WeChat Style Rounded Square */
.post-avatar {
flex-shrink: 0;
}
.avatar-square {
width: 88rpx;
height: 88rpx;
background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
color: #558B2F;
border-radius: 16rpx;
display: flex;
align-items: center;
justify-content: center;
font-weight: 700;
font-size: 36rpx;
}
/* Post Content */
.post-content {
flex: 1;
overflow: hidden;
min-width: 0;
}
.post-user-name {
color: #576b95;
font-weight: 600;
font-size: 30rpx;
margin-bottom: 12rpx;
display: block;
}
.post-text {
font-size: 30rpx;
color: #333;
line-height: 1.6;
margin-bottom: 20rpx;
display: block;
word-wrap: break-word;
}
/* Image Grid - CSS Grid Layout */
.post-images-grid {
display: grid;
gap: 8rpx;
margin-bottom: 20rpx;
border-radius: 16rpx;
overflow: hidden;
}
.post-image-item {
position: relative;
background: #f0f0f0;
overflow: hidden;
}
/* Single Image */
.grid-1 {
display: flex;
width: auto;
max-width: 70%;
}
.grid-1 .post-image-item {
width: 100%;
aspect-ratio: 16 / 9;
border-radius: 8rpx;
overflow: hidden;
}
.grid-1 .post-image-item image {
border-radius: 8rpx;
}
/* 2 or 4 Images (2 columns) */
.grid-2 {
grid-template-columns: repeat(2, 1fr);
width: 500rpx; /* Constrain width for 2 columns to look like partial grid */
}
.grid-2 .post-image-item {
aspect-ratio: 1;
}
/* 3, 5+ Images (3 columns) */
.grid-3 {
grid-template-columns: repeat(3, 1fr);
width: auto; /* Full available width */
}
.grid-3 .post-image-item {
aspect-ratio: 1;
}
/* Location */
.post-location {
font-size: 24rpx;
color: #576b95;
margin-bottom: 12rpx;
}
/* Post Meta */
.post-meta {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20rpx;
height: 44rpx;
}
.post-time {
font-size: 24rpx;
color: #a0a0a0;
}
.action-btn {
background: #f7f7f7;
border-radius: 8rpx;
width: 72rpx;
height: 44rpx;
display: flex;
align-items: center;
justify-content: center;
gap: 8rpx;
}
.action-btn:active {
background: #e8e8e8;
}
.action-dot {
width: 10rpx;
height: 10rpx;
background: #576b95;
border-radius: 50%;
}
/* Likes & Comments Box */
.likes-comments-box {
background: #f7f7f7;
border-radius: 8rpx;
padding: 20rpx 24rpx;
position: relative;
font-size: 26rpx;
color: #333;
}
.likes-comments-box::before {
content: '';
position: absolute;
top: -12rpx;
left: 24rpx;
border-width: 0 12rpx 12rpx;
border-style: solid;
border-color: transparent transparent #f7f7f7;
}
.likes-section {
display: flex;
align-items: flex-start;
gap: 12rpx;
color: #576b95;
line-height: 1.5;
}
.likes-list {
flex: 1;
font-weight: 500;
}
.like-name {
color: #576b95;
}
.divider {
height: 2rpx;
background: rgba(0, 0, 0, 0.05);
margin: 16rpx 0;
}
.comments-section {
display: flex;
flex-direction: column;
gap: 12rpx;
}
.comment-item {
line-height: 1.5;
}
.comment-user {
color: #576b95;
font-weight: 500;
}
.comment-content {
color: #333;
}
/* Empty State */
.empty-feed {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 100rpx 40rpx 60rpx;
}
.empty-scene {
position: relative;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 32rpx;
}
.empty-glow {
position: absolute;
width: 240rpx;
height: 240rpx;
border-radius: 50%;
background: radial-gradient(circle, rgba(85,139,47,0.12) 0%, transparent 70%);
animation: emptyPulse 3s ease-in-out infinite;
}
@keyframes emptyPulse {
0%, 100% { transform: scale(1); opacity: 0.7; }
50% { transform: scale(1.1); opacity: 1; }
}
.empty-emoji {
font-size: 96rpx;
position: relative;
z-index: 2;
}
.anim-breathe {
animation: breathe 3s ease-in-out infinite;
}
@keyframes breathe {
0%, 100% { transform: scale(1) translateY(0); }
50% { transform: scale(1.05) translateY(-8rpx); }
}
.empty-title {
font-size: 32rpx;
font-weight: 700;
color: #558B2F;
margin-bottom: 8rpx;
}
.empty-hint {
font-size: 26rpx;
color: #90A4AE;
margin-bottom: 36rpx;
}
.empty-cta {
display: flex;
align-items: center;
gap: 8rpx;
padding: 16rpx 40rpx;
border-radius: 40rpx;
background: linear-gradient(135deg, #558B2F, #7CB342);
color: #fff;
font-size: 28rpx;
font-weight: 600;
box-shadow: 0 6rpx 20rpx rgba(85,139,47,0.3);
transition: all 0.15s;
}
.empty-cta:active {
transform: scale(0.95);
}
/* Floating Action Button */
.floating-add-btn {
position: fixed;
right: 40rpx;
bottom: 60rpx;
background: rgba(85, 139, 47, 0.92);
backdrop-filter: blur(12px);
color: white;
padding: 20rpx 36rpx;
border-radius: 48rpx;
display: flex;
align-items: center;
gap: 10rpx;
box-shadow: 0 8rpx 28rpx rgba(85, 139, 47, 0.35);
z-index: 100;
font-size: 26rpx;
font-weight: 700;
transition: all 0.2s ease;
}
.floating-add-btn:active {
transform: scale(0.92);
}
/* WeChat Style Action Container */
.action-container {
position: relative;
display: flex;
align-items: center;
}
/* WeChat Style Action Popup */
.action-popup {
position: absolute;
right: 80rpx;
top: 50%;
transform: translateY(-50%) scaleX(0);
transform-origin: right center;
display: flex;
align-items: center;
background: #4c4c4c;
border-radius: 8rpx;
overflow: hidden;
opacity: 0;
transition: all 0.2s ease-out;
z-index: 10;
}
.action-popup.show {
transform: translateY(-50%) scaleX(1);
opacity: 1;
}
.popup-btn {
display: flex;
align-items: center;
gap: 8rpx;
padding: 16rpx 24rpx;
color: #fff;
font-size: 26rpx;
white-space: nowrap;
}
.popup-btn:active {
background: rgba(255, 255, 255, 0.1);
}
.popup-divider {
width: 2rpx;
height: 32rpx;
background: rgba(255, 255, 255, 0.2);
}
/* Comment Input Bar */
.comment-input-bar {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 1000;
transform: translateY(100%);
transition: transform 0.3s ease-out;
}
.comment-input-bar.show {
transform: translateY(0);
}
.comment-input-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.3);
}
.comment-input-content {
position: relative;
display: flex;
align-items: center;
gap: 20rpx;
padding: 20rpx 32rpx;
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
background: #f5f5f5;
border-top: 2rpx solid #e5e5e5;
}
.comment-input {
flex: 1;
height: 72rpx;
padding: 0 24rpx;
background: #fff;
border-radius: 36rpx;
font-size: 28rpx;
}
.send-btn {
padding: 16rpx 32rpx;
background: #e0e0e0;
border-radius: 8rpx;
font-size: 28rpx;
color: #999;
transition: all 0.2s;
}
.send-btn.active {
background: #558B2F;
color: #fff;
}
.send-btn:active {
opacity: 0.8;
}
.comment-expand-btn {
font-size: 26rpx;
color: #576b95;
margin-top: 8rpx;
padding: 4rpx 0;
}