Polish /social H5: Ways order, dock, mobile sheets, and chat/date touch UX.

Add dedicated h5.css so group chat leads CTAs, orbit stays compact on phones, and composer/actions clear the bottom dock.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Eric 2026-11-01 22:43:27 +08:00
parent efb408162d
commit da22814584
27 changed files with 2353 additions and 180 deletions

View File

@ -11,6 +11,7 @@ import "@social/app/studio.css";
import "@social/app/motion.css";
import "@social/app/depth.css";
import "@social/app/vivid.css";
import "@social/app/h5.css";
import SocialExperience from "@social/components/SocialExperience";
export const metadata = {

View File

@ -155,6 +155,7 @@ export type NomadroRemoteConfig = {
meetups?: Array<Record<string, unknown>>;
gigs?: Array<Record<string, unknown>>;
};
socialWayGroup?: string;
socialWayChat?: string;
socialWayDate?: string;
socialWayCafe?: string;
@ -394,6 +395,7 @@ export const DEFAULT_REMOTE_CONFIG: NomadroRemoteConfig = {
socialOnlineTitle: "随时,聊得来",
socialOfflineTitle: "同城,见一面",
socialTeamTitle: "一起,做点事",
socialWayGroup: "群组聊天",
socialWayChat: "开视频聊聊",
socialWayDate: "认识一下",
socialWayCafe: "找个地方见面",

View File

@ -732,7 +732,7 @@ html[data-theme="light"] .social-ambient {
}
.social-home .connection-ways {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
grid-template-columns: repeat(5, minmax(0, 1fr));
gap: 12px;
margin-top: -8px;
margin-bottom: 28px;
@ -803,10 +803,13 @@ html[data-theme="light"] .social-ambient {
background: linear-gradient(120deg, #7aefe4, #4ecdc4);
}
@media (max-width: 900px) {
@media (max-width: 1200px) and (min-width: 901px) {
.social-home .connection-ways {
grid-template-columns: repeat(2, minmax(0, 1fr));
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
@media (max-width: 900px) {
.social-home .connection-hero {
padding-top: 108px;
min-height: auto;
@ -820,10 +823,6 @@ html[data-theme="light"] .social-ambient {
}
@media (max-width: 560px) {
.social-home .connection-ways {
grid-template-columns: 1fr 1fr;
gap: 10px;
}
.social-composer-toolbar .social-nick-label {
order: 3;
width: 100%;
@ -1398,6 +1397,265 @@ html[data-theme="light"] .social-ambient {
}
}
/* —— Apply / contribute forms —— */
.social-apply {
display: grid;
gap: 16px;
}
.social-apply-hero {
display: grid;
gap: 8px;
padding: 14px 16px;
border-radius: 16px;
border: 1px solid color-mix(in srgb, var(--sx-mint, #5ce1d6) 28%, transparent);
background:
radial-gradient(circle at 12% 0%, #5ce1d61a, transparent 55%),
color-mix(in srgb, var(--bg-primary) 70%, transparent);
}
.social-apply-hero strong {
font-size: 1.15rem;
letter-spacing: -0.03em;
}
.social-apply-kind {
display: inline-flex;
width: fit-content;
min-height: 26px;
align-items: center;
padding: 0 10px;
border-radius: 999px;
background: #5ce1d61a;
color: var(--sx-mint, #5ce1d6);
font-size: 11px;
font-weight: 650;
}
.social-apply-progress {
display: grid;
gap: 8px;
}
.social-apply-progress-track {
display: block;
height: 8px;
border-radius: 999px;
background: #ffffff10;
overflow: hidden;
}
.social-apply-progress-track > i {
display: block;
height: 100%;
border-radius: inherit;
background: linear-gradient(90deg, #5ce1d6, #ffe66d);
transition: width 0.35s ease;
}
.social-apply-progress > small {
font-size: 12px;
color: var(--text-muted);
}
.social-apply-prompts {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: 8px;
}
.social-apply-chip {
border: 1px solid #ffffff18;
background: #ffffff08;
color: var(--text-secondary);
border-radius: 999px;
min-height: 32px;
padding: 0 12px;
font: inherit;
font-size: 12px;
cursor: pointer;
}
.social-apply-chip:hover {
border-color: #5ce1d644;
color: #5ce1d6;
}
.social-apply-done {
display: grid;
gap: 12px;
justify-items: start;
padding: 8px 2px 4px;
}
.social-apply-done-mark {
display: grid;
place-items: center;
width: 48px;
height: 48px;
border-radius: 16px;
background: #5ce1d622;
color: #5ce1d6;
}
.social-apply-done strong {
font-size: 1.2rem;
letter-spacing: -0.03em;
}
.social-apply-summary {
display: flex;
flex-wrap: wrap;
gap: 8px;
align-items: center;
padding: 10px 12px;
border-radius: 12px;
background: #ffffff08;
border: 1px solid #ffffff12;
}
.social-apply-summary em {
font-style: normal;
font-weight: 650;
}
.social-contribute-btn {
margin-left: auto;
}
.social-event-bars {
gap: 4px !important;
height: 64px !important;
}
.social-event-bars i {
display: block;
width: 3px;
border-radius: 2px;
opacity: 1 !important;
background: linear-gradient(to top, #4ecdc41f, #4ecdc4a3) !important;
animation: connection-audio 1.55s ease-in-out infinite !important;
}
.social-event-card.event-1 .social-event-bars i {
background: linear-gradient(to top, #ff6b6b1f, #ff6b6ba3) !important;
}
.social-event-art.is-live {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 12px;
}
.social-event-art.is-live .social-video-grid {
margin-left: auto;
}
.social-event-body .social-meetup-faces {
margin: 0 0 10px;
}
.social-event-body .social-meetup-faces > * {
border-color: #0c0c0f;
}
.social-live-faces {
justify-content: center;
margin: 14px 0 18px;
}
.social-live-faces > em {
color: #7aefe4;
}
.social-date-hint.is-alive {
display: flex;
align-items: center;
justify-content: center;
gap: 14px;
flex-wrap: wrap;
}
.social-date-hint-side {
font-weight: 650;
font-size: 12px;
}
.social-date-hint-side.pass {
color: #94a3b8;
animation: social-date-hint-nudge 2.4s ease-in-out infinite;
}
.social-date-hint-side.like {
color: #ff8f8f;
animation: social-date-hint-nudge 2.4s ease-in-out infinite 0.35s;
}
.social-date-actions.is-alive .social-date-act.like:not(:disabled) {
animation: social-date-act-glow 2.6s ease-in-out infinite;
}
@keyframes social-date-hint-nudge {
0%,
100% {
opacity: 0.55;
transform: translateX(0);
}
50% {
opacity: 1;
transform: translateX(3px);
}
}
@keyframes social-date-act-glow {
0%,
100% {
box-shadow: 0 0 0 0 #ff6b6b00;
}
50% {
box-shadow: 0 0 0 8px #ff6b6b18;
}
}
.social-profile-meter {
margin-left: auto;
font-size: 12px;
font-weight: 700;
color: #7aefe4;
}
.social-chat-bar-tools {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px;
}
.social-chat-presence {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 12px;
margin: 0 16px 10px;
padding: 10px 14px;
border-radius: 16px;
border: 1px solid #5ce1d628;
background:
radial-gradient(circle at 0% 50%, #5ce1d618, transparent 45%),
color-mix(in srgb, var(--sx-glass, #12141a) 88%, transparent);
}
.social-chat-presence-avs {
display: flex;
}
.social-chat-presence-avs > * {
margin-left: -8px;
border: 2px solid #0c0c0f;
border-radius: 999px;
}
.social-chat-presence-avs > *:first-child {
margin-left: 0;
}
.social-chat-presence > p {
display: inline-flex;
align-items: center;
gap: 6px;
margin: 0;
font-size: 12px;
color: var(--text-muted);
}
.social-chat-presence > p strong {
color: #7aefe4;
}
.social-chat-presence-link {
margin-left: auto;
font-size: 12px;
font-weight: 650;
color: #7aefe4;
text-decoration: none;
}
.social-chat-presence-link:hover {
text-decoration: underline;
}
@media (max-width: 720px) {
.social-chat-presence {
margin: 0 10px 8px;
}
.social-chat-presence-link {
margin-left: 0;
}
.social-chat-bar-tools {
width: 100%;
}
}
@media (prefers-reduced-motion: reduce) {
.social-workspace .social-card,
.social-workspace .social-panel,
@ -1413,7 +1671,9 @@ html[data-theme="light"] .social-ambient {
.social-people-chip:hover {
transform: none;
}
.social-live-radar i {
animation: none;
.social-live-radar i,
.social-date-hint-side,
.social-date-actions.is-alive .social-date-act.like {
animation: none !important;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -594,7 +594,7 @@
position: relative;
z-index: 1;
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-template-columns: repeat(5, minmax(0, 1fr));
gap: 12px;
margin-bottom: 40px;
}
@ -1022,11 +1022,40 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
min-height: 88px;
padding-bottom: 18px;
margin-bottom: 10px;
color: var(--connection-mint);
}
.connection-meetup-art.is-live {
flex-wrap: wrap;
min-height: 108px;
}
.connection-meetup-art.is-live .social-video-grid {
margin-left: auto;
}
.social-meetup-faces {
display: flex;
align-items: center;
gap: 0;
margin: 2px 0 8px;
}
.social-meetup-faces > * {
margin-left: -6px;
border: 2px solid color-mix(in srgb, var(--connection-surface, #12141a) 90%, #000);
border-radius: 999px;
}
.social-meetup-faces > *:first-child {
margin-left: 0;
}
.social-meetup-faces > em {
margin-left: 8px;
font-style: normal;
font-size: 11px;
font-weight: 600;
color: var(--panel-accent, var(--connection-mint));
}
.connection-meetup-number {
font-family: var(--font-display);
font-size: 62px;
@ -1048,11 +1077,11 @@
border-radius: 2px;
background: linear-gradient(to top, #4ecdc41f, #4ecdc4a3);
transform-origin: center;
animation: connection-audio 2s ease-in-out infinite;
animation-play-state: paused;
animation: connection-audio 1.55s ease-in-out infinite;
animation-play-state: running;
}
.social-panel:hover .connection-audio-bars i {
animation-play-state: running;
animation-duration: 1.05s;
}
.social-home #meetup .social-panel:nth-child(2) {
--panel-accent: var(--connection-coral);
@ -1633,13 +1662,11 @@
display: none;
}
.connection-ways {
grid-template-columns: repeat(2, 1fr);
gap: 8px;
margin-bottom: 30px;
margin-bottom: 24px;
}
.connection-way {
min-height: 72px;
padding: 14px 14px;
min-height: 64px;
padding: 14px;
gap: 12px;
}
.connection-way-icon {

View File

@ -1363,6 +1363,45 @@
background: rgba(255, 107, 107, 0.12);
transform: rotate(12deg);
}
.social-date-photo-dots {
position: absolute;
top: 10px;
left: 50%;
z-index: 4;
display: flex;
gap: 5px;
transform: translateX(-50%);
pointer-events: none;
}
.social-date-photo-dots i {
width: 28px;
height: 3px;
border-radius: 999px;
background: #ffffff44;
}
.social-date-photo-dots i.is-on {
background: #fff;
}
.social-date-photo-hit {
position: absolute;
top: 0;
z-index: 5;
width: 28%;
height: 42%;
border: 0;
padding: 0;
background: transparent;
cursor: pointer;
}
.social-date-photo-hit.is-prev {
left: 0;
}
.social-date-photo-hit.is-next {
right: 0;
}
.social-date-photo-hit:disabled {
cursor: default;
}
.social-date-online-pill {
position: absolute;
top: 18px;

View File

@ -71,6 +71,20 @@
margin-top: 8px;
margin-bottom: 36px;
}
.social-home .connection-ways.is-alive .connection-way {
animation: social-way-in 0.55s ease both;
animation-delay: var(--stagger, 0ms);
}
@keyframes social-way-in {
from {
opacity: 0;
transform: translateY(12px);
}
to {
opacity: 1;
transform: none;
}
}
.social-home .connection-way {
position: relative;
min-height: 128px;
@ -530,6 +544,132 @@ html[data-theme="light"] .social-workspace .nav-group-panel {
transform: translate(-50%, calc(-50% - 8px)) rotate(-2deg) scale(1.03);
box-shadow: 0 28px 60px #ff6b6b33;
}
.social-home .social-date-hero.is-alive .social-date-hero-card-0 {
animation: social-date-hero-float 4.2s ease-in-out infinite;
}
.social-home .social-date-hero.is-alive .social-date-hero-card-1 {
animation: social-date-hero-sway-l 5s ease-in-out infinite;
}
.social-home .social-date-hero.is-alive .social-date-hero-card-2 {
animation: social-date-hero-sway-r 5.4s ease-in-out infinite;
}
.social-home .social-date-hero.is-alive .social-date-hero-cta {
animation: social-date-hero-cta-pulse 2.2s ease-in-out infinite;
}
.social-home .social-date-hero.is-alive .social-date-hero-steps li {
animation: social-date-hero-chip 3.6s ease-in-out infinite;
}
.social-home .social-date-hero.is-alive .social-date-hero-steps li:nth-child(2) {
animation-delay: 0.35s;
}
.social-home .social-date-hero.is-alive .social-date-hero-steps li:nth-child(3) {
animation-delay: 0.7s;
}
.social-home .social-date-hero-deck::before,
.social-home .social-date-hero-deck::after {
content: "←";
position: absolute;
top: 46%;
z-index: 4;
width: 36px;
height: 36px;
display: grid;
place-items: center;
border-radius: 999px;
border: 1px solid #ff7a7244;
background: #ff7a7222;
color: #ffb4b0;
font-size: 14px;
font-weight: 700;
pointer-events: none;
opacity: 0.55;
animation: social-date-hero-hint 2.8s ease-in-out infinite;
}
.social-home .social-date-hero-deck::before {
left: 4%;
content: "←";
}
.social-home .social-date-hero-deck::after {
right: 4%;
content: "→";
animation-delay: 0.4s;
border-color: #4ecdc444;
background: #4ecdc422;
color: #7aefe4;
}
@keyframes social-date-hero-float {
0%,
100% {
transform: translate(-50%, -50%) translateX(calc((0 - 1) * 34px))
rotate(-6deg) translateY(0);
}
50% {
transform: translate(-50%, -50%) translateX(calc((0 - 1) * 34px))
rotate(-3deg) translateY(-10px);
}
}
@keyframes social-date-hero-sway-l {
0%,
100% {
transform: translate(-50%, -50%) translateX(0) rotate(0deg);
}
50% {
transform: translate(-50%, -50%) translateX(-6px) rotate(-2deg);
}
}
@keyframes social-date-hero-sway-r {
0%,
100% {
transform: translate(-50%, -50%) translateX(34px) rotate(6deg);
}
50% {
transform: translate(-50%, -50%) translateX(40px) rotate(8deg);
}
}
@keyframes social-date-hero-cta-pulse {
0%,
100% {
transform: scale(1);
box-shadow: 0 10px 24px #ff6b6b44;
}
50% {
transform: scale(1.06);
box-shadow: 0 14px 32px #ff6b6b66;
}
}
@keyframes social-date-hero-chip {
0%,
100% {
transform: translateY(0);
border-color: #ff7a7233;
}
50% {
transform: translateY(-2px);
border-color: #ff7a7266;
}
}
@keyframes social-date-hero-hint {
0%,
100% {
opacity: 0.35;
transform: translateY(-50%) scale(0.95);
}
50% {
opacity: 0.85;
transform: translateY(-50%) scale(1.05);
}
}
@media (prefers-reduced-motion: reduce) {
.social-home .social-date-hero.is-alive .social-date-hero-card-0,
.social-home .social-date-hero.is-alive .social-date-hero-card-1,
.social-home .social-date-hero.is-alive .social-date-hero-card-2,
.social-home .social-date-hero.is-alive .social-date-hero-cta,
.social-home .social-date-hero.is-alive .social-date-hero-steps li,
.social-home .social-date-hero-deck::before,
.social-home .social-date-hero-deck::after {
animation: none !important;
}
}
.social-home .social-date-hero-online {
position: absolute;
top: 14px;
@ -781,7 +921,7 @@ html[data-theme="light"] .social-workspace .nav-group-panel {
border: 1px solid var(--sx-fog, #ffffff18);
background: #ffffff08;
}
.social-together-tabs span {
.social-together-tabs :is(span, a) {
min-height: 32px;
padding: 0 12px;
display: inline-grid;
@ -789,8 +929,9 @@ html[data-theme="light"] .social-workspace .nav-group-panel {
border-radius: 999px;
font-size: 12px;
color: var(--text-muted, #9aa3af);
text-decoration: none;
}
.social-together-tabs span.is-on {
.social-together-tabs :is(span, a).is-on {
background: linear-gradient(120deg, #4ecdc4, #7aefe4);
color: #062525;
font-weight: 600;

View File

@ -274,6 +274,9 @@ export default function AttractiveRoster({ onJoin }: { onJoin: () => void }) {
<Link href={socialPath("/date")} className="btn btn-ghost">
去左右滑认识
</Link>
<Link href={socialPath("/chat")} className="btn btn-ghost">
进群组聊天
</Link>
<button type="button" className="btn btn-ghost" onClick={onJoin}>
加入社区
</button>

View File

@ -362,12 +362,21 @@ export default function CafeDirectory() {
return (
<SiteShell title="见一面">
<PageIntro title="同城,见一面" accent="城市与咖啡馆">
<DemoBadge>
{catalog.source === "remote" ? "最新地点" : "先看看这些地方"}
</DemoBadge>
<div className="social-actions">
<DemoBadge>
{catalog.source === "remote" ? "最新地点" : "先看看这些地方"}
</DemoBadge>
<Link className="social-btn" href={socialPath("/people")}>
找同城的人
</Link>
<Link className="social-btn" href={socialPath("/chat")}>
<MessageCircle size={14} />
群组约见面
</Link>
</div>
</PageIntro>
<p className="social-muted reveal" style={{ marginBottom: 16 }}>
先选城市,找到同城的人,再挑一家咖啡馆出来坐坐。
<p className="social-muted social-event-lead reveal">
先选城市 → 找到同城的人 → 再挑一家咖啡馆出来坐坐。
</p>
<div className="social-cafe-cities reveal">
<CityDirectory compact />

View File

@ -1,7 +1,7 @@
"use client";
import Link from "next/link";
import { ArrowUpRight, Hash, MessageCircle } from "lucide-react";
import { ArrowUpRight, Hash, MessageCircle, Radio, Users } from "lucide-react";
import SiteShell from "./SiteShell";
import { DemoBadge, PageIntro } from "./SocialUI";
import { socialPath } from "@social/lib/socialPath";
@ -15,10 +15,13 @@ export default function ChannelDirectory() {
SEED_CHANNELS[0];
return (
<SiteShell title="大家聊天">
<PageIntro title="大家聊天" accent="打个招呼">
<PageIntro title="大家聊天" accent="群组 · 文字">
<DemoBadge>一个聊天室,简单好找</DemoBadge>
</PageIntro>
<section className="social-panel social-channel-solo">
<p className="social-muted social-event-lead reveal">
先在群里打个招呼;想开麦或开视频,再去「随时,聊得来」。
</p>
<section className="social-panel social-channel-solo reveal">
<div className="social-card-top">
<span className="social-card-ico">
<MessageCircle size={25} strokeWidth={1.5} />
@ -33,7 +36,15 @@ export default function ChannelDirectory() {
</div>
<div className="social-card-actions">
<Link href={socialPath("/chat")} className="social-btn primary">
进入聊天室 <ArrowUpRight size={14} />
进入群聊 <ArrowUpRight size={14} />
</Link>
<Link href={socialPath("/meetup")} className="social-btn">
<Radio size={14} />
语音 / 视频场
</Link>
<Link href={socialPath("/team")} className="social-btn">
<Users size={14} />
找搭子
</Link>
</div>
</section>

View File

@ -7,8 +7,11 @@ import {
CheckCheck,
CornerUpLeft,
Hash,
Heart,
Radio,
Send,
Smile,
Users,
Wifi,
WifiOff,
X,
@ -20,15 +23,19 @@ import { socialPath } from "@social/lib/socialPath";
import { useSocialChat } from "@social/lib/useSocialChat";
import { useLocalState } from "@social/lib/useLocalState";
import { loadJson } from "@social/lib/storage";
import { MOCK_ROSTER } from "@social/lib/rosterMock";
import SocialAvatar from "./SocialAvatar";
/** 全站唯一聊天室频道(分类页暂时隐藏) */
export const SOCIAL_CHAT_ID = "general";
const EMOJIS = ["👋", "☕", "🌍", "✨", "🙌", "❤️", "💻", "🌴"];
const EMOJIS = ["👋", "☕", "🌍", "✨", "🙌", "❤️", "💻", "🌴", "🚀", "🌙"];
const STARTERS = [
"大家好,第一次来,我在…",
"有人一起找 cowork 吗?",
"下一站想去哪座城?",
"刚左右滑认识了几位,来打个招呼~",
"有人晚上开麦闲聊吗?",
];
const STATUS = {
connecting: "正在连上…",
@ -69,6 +76,25 @@ export function Conversation({
setDraft(intro.slice(0, 2000));
}, [channelId, setDraft]);
useEffect(() => {
const vv = window.visualViewport;
if (!vv) return;
const sync = () => {
document.documentElement.style.setProperty(
"--vv-offset",
`${Math.max(0, window.innerHeight - vv.height - vv.offsetTop)}px`,
);
};
sync();
vv.addEventListener("resize", sync);
vv.addEventListener("scroll", sync);
return () => {
vv.removeEventListener("resize", sync);
vv.removeEventListener("scroll", sync);
document.documentElement.style.removeProperty("--vv-offset");
};
}, []);
useEffect(() => {
const thread = threadRef.current;
if (!thread) return;
@ -101,6 +127,19 @@ export function Conversation({
setReply(null);
}
atBottom.current = true;
try {
navigator.vibrate?.(10);
} catch {
/* ignore */
}
requestAnimationFrame(() => {
const thread = threadRef.current;
if (thread)
thread.scrollTo({
top: thread.scrollHeight,
behavior: "smooth",
});
});
composerRef.current?.focus();
};
@ -154,8 +193,8 @@ export function Conversation({
{!chat.messages.length && (
<EmptyState
emoji="💬"
title="这里还很安静"
description="点一句现成的话,或自己写一句打个招呼。网络不好时,话会先留在你这边。"
title="群里还很安静"
description="点一句现成的话,或自己写一句。网络不好时,话会先留在你这边。"
>
<div className="social-chat-starters">
{STARTERS.map((starter) => (
@ -172,6 +211,16 @@ export function Conversation({
</button>
))}
</div>
<div className="social-actions" style={{ marginTop: 12 }}>
<Link className="social-btn" href={socialPath("/date")}>
<Heart size={14} />
先去认识一下
</Link>
<Link className="social-btn" href={socialPath("/meetup")}>
<Radio size={14} />
看看语音视频场
</Link>
</div>
</EmptyState>
)}
{chat.messages.map((message) => (
@ -360,6 +409,7 @@ export default function ChatWorkspace() {
SEED_CHANNELS.find((item) => item.id === SOCIAL_CHAT_ID) ||
SEED_CHANNELS[0];
const id = channel?.id || SOCIAL_CHAT_ID;
const online = MOCK_ROSTER.filter((m) => m.online).slice(0, 6);
return (
<div className="social-root social-live-root social-skin social-chat-live social-chat-solo">
<header className="social-live-bar social-chat-live-bar">
@ -369,15 +419,39 @@ export default function ChatWorkspace() {
首页
</Link>
<div>
<strong>大家聊天</strong>
<strong>群组聊天</strong>
<p className="social-muted">
{channel?.topic || "游民闲聊"} · 打个招呼就好
{channel?.topic || "游民闲聊"} · 大家一起聊,不是私信
</p>
</div>
<DemoBadge>能连上就实时聊 · 不行就先留在你这边</DemoBadge>
</div>
<ShareButton path={socialPath("/chat")} title="游民社区聊天室" />
<div className="social-chat-bar-tools">
<Link className="social-btn" href={socialPath("/date")}>
<Heart size={14} />
认识一下
</Link>
<Link className="social-btn" href={socialPath("/meetup")}>
<Radio size={14} />
语音视频
</Link>
<ShareButton path={socialPath("/chat")} title="游民社区群组聊天" />
</div>
</header>
<div className="social-chat-presence reveal">
<div className="social-chat-presence-avs" aria-hidden>
{online.map((m) => (
<SocialAvatar key={m.id} src={m.avatar} size={28} lazy />
))}
</div>
<p>
<Users size={13} />
<strong>{online.length}+</strong> 位在线气味 · 进群打个招呼就好
</p>
<Link href={socialPath("/people")} className="social-chat-presence-link">
看看是谁
</Link>
</div>
<div className="social-live-stage layout-chat">
<Conversation key={id} channelId={id} />
</div>

View File

@ -219,10 +219,10 @@ export function CommunityJoin() {
{[
{
icon: MessageCircle,
title: "大家聊天",
desc: "跟大家打个招呼",
title: "群组聊天",
desc: "先进群打个招呼,混个脸熟",
href: socialPath("/chat"),
cta: "去聊聊",
cta: "进群聊",
},
{
icon: Heart,
@ -241,9 +241,9 @@ export function CommunityJoin() {
{
icon: Radio,
title: "开视频聊聊",
desc: "开摄像头,面对面认识",
desc: "群组热身后,开麦或开视频",
href: socialPath("/meetup"),
cta: "去开视频",
cta: "去聊聊",
},
].map((item) => (
<article className="social-card social-onboarding-card" key={item.title}>

View File

@ -8,6 +8,7 @@ import {
Coffee,
Globe2,
Heart,
MessageCircle,
MoveUpRight,
Play,
Radio,
@ -92,15 +93,21 @@ export default function ConnectionHero({
>
{copy.socialJoinCta} <ArrowUpRight size={19} />
</button>
<Link className="connection-film" href={socialPath("/chat")}>
<span>
<Users size={13} />
</span>
群组聊天
</Link>
<Link className="connection-film" href={socialPath("/date")}>
<span>
<Heart size={13} />
</span>
先去认识一下
认识一下
</Link>
<button
ref={triggerRef}
className="connection-film"
className="connection-film connection-film-story"
type="button"
onClick={() => setVideoOpen(true)}
>
@ -354,11 +361,11 @@ export function ConnectionWays({ copy }: { copy: SocialLandingCopy }) {
const ways = [
{
id: "01",
href: "/meetup",
icon: Radio,
title: copy.socialWayChat,
sub: copy.socialOnlineTitle,
cta: "去聊聊",
href: "/chat",
icon: MessageCircle,
title: copy.socialWayGroup,
sub: "大家一起聊 · 先打个招呼",
cta: "进群聊",
className: "mint",
},
{
@ -372,6 +379,15 @@ export function ConnectionWays({ copy }: { copy: SocialLandingCopy }) {
},
{
id: "03",
href: "/meetup",
icon: Radio,
title: copy.socialWayChat,
sub: "聊天群组 · 语音视频",
cta: "去聊聊",
className: "mint",
},
{
id: "04",
href: "/coffeechat",
icon: Coffee,
title: copy.socialWayCafe,
@ -380,7 +396,7 @@ export function ConnectionWays({ copy }: { copy: SocialLandingCopy }) {
className: "yellow",
},
{
id: "04",
id: "05",
href: "/team",
icon: Users,
title: copy.socialWayTeam,
@ -390,12 +406,16 @@ export function ConnectionWays({ copy }: { copy: SocialLandingCopy }) {
},
];
return (
<div className="container connection-ways" aria-label="选择连接方式">
{ways.map((way) => (
<div
className="container connection-ways is-alive"
aria-label="选择连接方式"
>
{ways.map((way, index) => (
<Link
href={socialPath(way.href)}
className={`connection-way ${way.className}`}
key={way.id}
style={{ ["--stagger" as string]: `${index * 70}ms` }}
>
<span className="connection-way-index">{way.id}</span>
<span className="connection-way-icon">

View File

@ -34,7 +34,8 @@ const SWIPE_KEY = "social-date-swipes";
const HISTORY_KEY = "social-date-history";
const LIKE_KEY = "social-roster-likes";
const LIKES_CHANGED = "social-roster-likes-changed";
const THRESHOLD = 110;
const THRESHOLD_DESKTOP = 110;
const THRESHOLD_MOBILE = 78;
type SwipeStore = Record<string, Decision>;
type HistoryEntry = { id: string; decision: Decision };
@ -133,6 +134,11 @@ export default function DateClient() {
if (busy.current || fly) return;
busy.current = true;
setFly({ id: member.id, dir: decision });
try {
navigator.vibrate?.(decision === "like" ? [12, 30, 12] : 8);
} catch {
/* ignore */
}
window.setTimeout(() => {
setSwipes((prev) => ({ ...prev, [member.id]: decision }));
setHistory((prev) => [...prev, { id: member.id, decision }]);
@ -189,8 +195,12 @@ export default function DateClient() {
if (!dragging.current || !current || fly) return;
dragging.current = false;
const x = dragRef.current.x;
if (x > THRESHOLD) commit(current, "like");
else if (x < -THRESHOLD) commit(current, "pass");
const threshold =
typeof window !== "undefined" && window.matchMedia("(max-width: 900px)").matches
? THRESHOLD_MOBILE
: THRESHOLD_DESKTOP;
if (x > threshold) commit(current, "like");
else if (x < -threshold) commit(current, "pass");
else {
setDrag({ x: 0, y: 0, active: false });
dragRef.current = { x: 0, y: 0 };
@ -236,8 +246,13 @@ export default function DateClient() {
}, [current, commit, undo]);
const rotate = drag.x / 18;
const likeOpacity = Math.min(1, Math.max(0, drag.x / THRESHOLD));
const passOpacity = Math.min(1, Math.max(0, -drag.x / THRESHOLD));
const stampThreshold =
typeof window !== "undefined" &&
window.matchMedia("(max-width: 900px)").matches
? THRESHOLD_MOBILE
: THRESHOLD_DESKTOP;
const likeOpacity = Math.min(1, Math.max(0, drag.x / stampThreshold));
const passOpacity = Math.min(1, Math.max(0, -drag.x / stampThreshold));
return (
<div className="social-root social-live-root social-skin social-date-root">
@ -305,7 +320,11 @@ export default function DateClient() {
/>
</div>
) : null}
<div className="social-date-deck" aria-live="polite">
<div
className="social-date-deck"
aria-live="polite"
style={{ touchAction: "none" }}
>
{!current && (
<div className="social-date-empty">
<span aria-hidden style={{ fontSize: 36 }}>
@ -323,6 +342,10 @@ export default function DateClient() {
<RotateCcw size={15} />
再来一轮
</button>
<Link className="social-btn" href={socialPath("/chat")}>
<MessageCircle size={15} />
先去群组聊聊
</Link>
{liked.length > 0 && (
<button
type="button"
@ -374,10 +397,12 @@ export default function DateClient() {
)}
</div>
<p className="social-date-hint" aria-hidden={!current}>
拖卡片左右滑 · 或点下面按钮 · 撤销用 ⌘/Ctrl+Z
<p className="social-date-hint is-alive" aria-hidden={!current}>
<span className="social-date-hint-side pass">← 划走</span>
<span>拖卡片左右滑 · 或点下面按钮</span>
<span className="social-date-hint-side like">想认识 →</span>
</p>
<div className="social-date-actions">
<div className="social-date-actions is-alive">
<button
type="button"
className="social-date-act pass"
@ -448,17 +473,11 @@ export default function DateClient() {
</div>
<p>{matchMember.lookingFor}</p>
<p className="social-muted">
「想认识」会先记在你这边。下面可以去聊天室打个招呼——是大家一起聊,不是一对一私信。
「想认识」会先记在你这边。去群组打个招呼吧——是大家一起聊,不是一对一私信。
</p>
<div className="social-actions">
<Link
className="social-btn primary"
href={socialPath(`/people/${matchMember.id}`)}
>
看看 TA
</Link>
<Link
className="social-btn"
href={socialPath(
`/chat?intro=${encodeURIComponent(
`嗨 ${matchMember.name}!刚看到你,想聊聊「${matchMember.tags[0] || "远程生活"}」。`,
@ -466,7 +485,13 @@ export default function DateClient() {
)}
>
<MessageCircle size={15} />
去打招呼
进群组打招呼
</Link>
<Link
className="social-btn"
href={socialPath(`/people/${matchMember.id}`)}
>
看看 TA
</Link>
<button
type="button"
@ -512,6 +537,10 @@ export default function DateClient() {
))}
</div>
<div className="social-actions">
<Link className="social-btn primary" href={socialPath("/chat")}>
<MessageCircle size={14} />
进群组聊天
</Link>
<Link className="social-btn" href={socialPath("/people")}>
回去看看大家
</Link>
@ -532,7 +561,13 @@ export default function DateClient() {
}
function DateCardFace({ member }: { member: SocialRosterMember }) {
const cover = member.gallery?.[0] || member.avatar;
const photos = useMemo(() => {
const list = [member.avatar, ...(member.gallery || [])].filter(Boolean);
return Array.from(new Set(list));
}, [member.avatar, member.gallery]);
const [photoIndex, setPhotoIndex] = useState(0);
const cover = photos[Math.min(photoIndex, photos.length - 1)] || member.avatar;
return (
<>
<div
@ -542,6 +577,37 @@ function DateCardFace({ member }: { member: SocialRosterMember }) {
aria-label={member.name}
/>
<div className="social-date-gradient" aria-hidden />
{photos.length > 1 ? (
<>
<div className="social-date-photo-dots" aria-hidden>
{photos.map((src, i) => (
<i key={src} className={i === photoIndex ? "is-on" : ""} />
))}
</div>
<button
type="button"
className="social-date-photo-hit is-prev"
aria-label="上一张照片"
disabled={photoIndex <= 0}
onPointerDown={(e) => e.stopPropagation()}
onClick={(e) => {
e.stopPropagation();
setPhotoIndex((i) => Math.max(0, i - 1));
}}
/>
<button
type="button"
className="social-date-photo-hit is-next"
aria-label="下一张照片"
disabled={photoIndex >= photos.length - 1}
onPointerDown={(e) => e.stopPropagation()}
onClick={(e) => {
e.stopPropagation();
setPhotoIndex((i) => Math.min(photos.length - 1, i + 1));
}}
/>
</>
) : null}
{member.online ? (
<span className="social-date-online-pill">现在在线</span>
) : null}

View File

@ -8,9 +8,10 @@ import {
Clock3,
Globe2,
MessageCircle,
Video,
Radio,
} from "lucide-react";
import SiteShell from "./SiteShell";
import SocialAvatar from "./SocialAvatar";
import {
BookmarkButton,
DemoBadge,
@ -24,6 +25,7 @@ import { useLocalState } from "@social/lib/useLocalState";
import { socialPath } from "@social/lib/socialPath";
import { resolveSocialCatalog } from "@social/lib/resolveCatalog";
import { useSocialConfig } from "./SocialExperience";
import { MOCK_ROSTER } from "@social/lib/rosterMock";
export default function EventDirectory() {
const config = useSocialConfig();
@ -43,13 +45,13 @@ export default function EventDirectory() {
);
return (
<SiteShell title="开视频聊聊">
<PageIntro title="随时,聊得来" accent="开视频">
<PageIntro title="随时,聊得来" accent="群组 · 语音视频">
<DemoBadge>
{catalog.source === "remote" ? "最新场次" : "先看看有哪些场"}
</DemoBadge>
</PageIntro>
<p className="social-muted social-event-lead reveal">
几个人一起开摄像头见面聊天,比只打字更近一点。
先进聊天群组热热身,再开语音或视频见面——比只打字更近一点。
</p>
<div className="social-toolbar reveal">
<SearchField
@ -88,22 +90,43 @@ export default function EventDirectory() {
key={event.id}
style={{ ["--stagger" as string]: `${index * 70}ms` }}
>
<div className="social-event-art is-video" aria-hidden="true">
<div className="social-event-art is-live" aria-hidden="true">
<span>{String(index + 1).padStart(2, "0")}</span>
<div className="social-video-grid social-video-grid-sm">
{Array.from({ length: 4 }, (_, i) => (
<span key={i} className="social-video-tile is-ghost" />
<div className="connection-audio-bars social-event-bars">
{Array.from({ length: 12 }, (_, n) => (
<i
key={n}
style={{
height: `${10 + ((n * 19 + index * 11) % 48)}px`,
animationDelay: `${n * -0.12}s`,
}}
/>
))}
</div>
<Video size={26} strokeWidth={1.3} />
<div className="social-video-grid social-video-grid-sm">
{MOCK_ROSTER.slice(index, index + 4).map((p) => (
<span key={p.id} className="social-video-tile">
<SocialAvatar src={p.avatar} size={32} lazy />
</span>
))}
</div>
<Radio size={22} strokeWidth={1.3} />
</div>
<div className="social-event-body">
<div className="social-card-top">
<span className="social-badge live">
{event.mode === "hybrid" ? "线上+线下" : "线上见面"}
{event.mode === "hybrid"
? "群组 · 可线下"
: "聊天群组 · 语音视频"}
</span>
<span className="social-badge">可以先看看</span>
</div>
<div className="social-meetup-faces" aria-hidden>
{MOCK_ROSTER.slice(index + 2, index + 6).map((p) => (
<SocialAvatar key={p.id} src={p.avatar} size={22} lazy />
))}
<em>+{5 + index} 想参加</em>
</div>
<h2>{event.title}</h2>
<p className="social-event-time">
<Clock3 size={14} />
@ -124,7 +147,7 @@ export default function EventDirectory() {
className="social-btn primary"
href={socialPath(`/meetup/${event.id}`)}
>
去开视频 <ArrowUpRight size={15} />
进入聊聊 <ArrowUpRight size={15} />
</Link>
<BookmarkButton
id={event.id}

View File

@ -15,8 +15,8 @@ import {
ArrowUpRight,
BookOpen,
Heart,
Radio,
Sparkles,
Video,
} from "lucide-react";
import { TEAM_KIND_LABEL, SEED_EBOOKS, SEED_VIDEOS } from "@social/lib/seed";
import { resolveSocialCatalog } from "@social/lib/resolveCatalog";
@ -31,9 +31,10 @@ const DEFAULT_PROMO =
const PATH = [
{ href: "#people", label: "想见的人", emoji: "👋" },
{ href: "#date", label: "认识一下", emoji: "💕" },
{ href: "#meetup", label: "开视频", emoji: "📹" },
{ href: "#meetup", label: "聊得来", emoji: "📡" },
{ href: "#cities", label: "见一面", emoji: "🌆" },
{ href: "#team", label: "一起做事", emoji: "🚀" },
{ href: "/chat", label: "群聊", emoji: "💬", external: true },
] as const;
const ROLE_EMOJI: Record<string, string> = {
@ -140,21 +141,41 @@ export default function HomeClient() {
<nav className="social-path" aria-label="本页导航">
<div className="container">
<div className="social-path-track reveal">
{PATH.map((p) => (
<a
key={p.href}
href={p.href}
className="social-path-link"
aria-current={
activeSection === p.href.slice(1) ? "location" : undefined
}
>
<span className="social-path-emoji" aria-hidden>
{p.emoji}
</span>
{p.label}
</a>
))}
{PATH.map((p) => {
const external = "external" in p && p.external;
const href = external ? socialPath(p.href) : p.href;
if (external) {
return (
<Link
key={p.href}
href={href}
className="social-path-link"
>
<span className="social-path-emoji" aria-hidden>
{p.emoji}
</span>
{p.label}
</Link>
);
}
return (
<a
key={p.href}
href={href}
className="social-path-link"
aria-current={
activeSection === p.href.slice(1)
? "location"
: undefined
}
>
<span className="social-path-emoji" aria-hidden>
{p.emoji}
</span>
{p.label}
</a>
);
})}
</div>
</div>
</nav>
@ -167,7 +188,7 @@ export default function HomeClient() {
aria-label="认识一下"
>
<div className="container">
<div className="social-date-hero reveal">
<div className="social-date-hero reveal is-alive">
<div className="social-date-hero-copy">
<span className="section-tag">
<span>认识一下</span>
@ -261,17 +282,17 @@ export default function HomeClient() {
<div className="section-header reveal">
<SectionSpark label="meetup" />
<span className="section-tag">
<span>开视频</span>
<span>{meetups.length} 场可看</span>
<span>聊天群组</span>
<span>语音 · 视频</span>
</span>
<h2>
<span className="social-title-emoji" aria-hidden>
📹
📡
</span>
{landingCopy.socialOnlineTitle}
</h2>
<p>
几个人一起开摄像头见面,比只打字更近一点。
先进聊天群组热热身,再开语音或视频见面。
「想参加」会先记在你这边。
</p>
</div>
@ -283,12 +304,23 @@ export default function HomeClient() {
style={{ ["--stagger" as string]: `${i * 80}ms` }}
>
<div
className="connection-meetup-art is-video"
className="connection-meetup-art is-live"
aria-hidden="true"
>
<span className="connection-meetup-number">
0{i + 1}
</span>
<div className="connection-audio-bars">
{Array.from({ length: 14 }, (_, n) => (
<i
key={n}
style={{
height: `${12 + ((n * 17 + i * 13) % 48)}px`,
animationDelay: `${n * -0.15}s`,
}}
/>
))}
</div>
<div className="social-video-grid">
{MOCK_ROSTER.slice(i, i + 4).map((p) => (
<span key={p.id} className="social-video-tile">
@ -296,21 +328,29 @@ export default function HomeClient() {
</span>
))}
</div>
<Video size={22} strokeWidth={1.3} />
<Radio size={22} strokeWidth={1.3} />
</div>
<div className="social-panel-meta">
<span>{m.city === "Online" ? "线上见面" : m.city}</span>
<span>
{m.city === "Online" ? "群组 · 语音视频" : m.city}
</span>
<time>
{m.date} · {m.time}
</time>
</div>
<div className="social-meetup-faces" aria-hidden>
{MOCK_ROSTER.slice(i + 1, i + 5).map((p) => (
<SocialAvatar key={p.id} src={p.avatar} size={24} lazy />
))}
<em>+{6 + i} 想参加</em>
</div>
<h3>{m.title}</h3>
<p>进来开摄像头,和几位新朋友面对面聊</p>
<p>群里打个招呼 → 开麦 / 开视频 → 认识新朋友</p>
<Link
className="btn btn-primary btn-sm"
href={socialPath(`/meetup/${m.id}`)}
>
去开视频
进入聊聊
<ArrowUpRight size={14} />
</Link>
</article>
@ -321,7 +361,7 @@ export default function HomeClient() {
看看全部
</Link>
<Link href={socialPath("/chat")} className="btn btn-ghost">
去文字聊天
文字群聊
</Link>
<button
type="button"
@ -400,9 +440,18 @@ export default function HomeClient() {
</p>
</div>
<div className="social-together-tabs reveal" aria-hidden>
<span className="is-on">找搭子</span>
<span>共创</span>
<div className="social-together-tabs reveal" role="tablist">
<Link
href={socialPath("/team")}
className="is-on"
role="tab"
aria-selected="true"
>
找搭子
</Link>
<Link href={socialPath("/ebook")} role="tab" aria-selected="false">
共创
</Link>
</div>
<div className="social-panel-grid social-panel-grid-3">

View File

@ -9,6 +9,8 @@ import { resolveSocialCatalog } from "@social/lib/resolveCatalog";
import { useSocialChat } from "@social/lib/useSocialChat";
import { useSocialConfig } from "./SocialExperience";
import { SocialMobileDock } from "./SocialNavigation";
import SocialAvatar from "./SocialAvatar";
import { MOCK_ROSTER } from "@social/lib/rosterMock";
type Layout = "split" | "video" | "chat";
@ -231,18 +233,26 @@ export default function MeetupLiveClient({ meetupId }: { meetupId: string }) {
<i />
<span>LIVE</span>
</div>
<h2>准备开视频见面</h2>
<h2>群组 · 语音视频</h2>
<p>
{preferEmbed
? "麦克风和摄像头先关着,进去后再打开就好。"
: "这里暂时不能直接嵌视频,点下面会跳转到视频页面。"}
? "先听群里聊几句也行;麦克风和摄像头先关着,进去后再打开。"
: "这里暂时不能直接嵌视频,点下面会跳转到语音视频页。"}
</p>
<div className="social-meetup-faces social-live-faces" aria-hidden>
{MOCK_ROSTER.filter((m) => m.online)
.slice(0, 5)
.map((m) => (
<SocialAvatar key={m.id} src={m.avatar} size={28} lazy />
))}
<em>有人想参加 · 随时可进</em>
</div>
<button
type="button"
className="social-btn primary"
onClick={() => startVideo()}
>
开始见面
进入聊聊
</button>
<p className="social-muted">
「想参加」还不等于已经约好 · 随时可以离开回去看别的场

View File

@ -116,17 +116,17 @@ export default function PeopleClient() {
)}
</div>
<div className="social-toolbar social-people-cta-bar">
<Link className="social-btn primary" href={socialPath("/chat")}>
进群组聊天
</Link>
<Link className="social-btn coral" href={socialPath("/date")}>
去左右滑认识
</Link>
<Link className="social-btn primary" href={socialPath("/roster")}>
<Link className="social-btn" href={socialPath("/roster")}>
<Sparkles size={15} /> 写写我的介绍
</Link>
<Link className="social-btn" href={socialPath("/chat")}>
去大家聊天
</Link>
<Link className="social-btn" href={socialPath("/meetup")}>
去开视频
语音视频场
</Link>
</div>
</SiteShell>

View File

@ -158,11 +158,14 @@ export default function PeopleProfileClient({ id }: { id: string }) {
href={socialPath(`/chat?intro=${intro}`)}
>
<MessageCircle size={15} />
去打招呼
进群组打招呼
</Link>
<Link className="social-btn" href={socialPath("/meetup")}>
<Video size={15} />
去开视频
语音视频场
</Link>
<Link className="social-btn" href={socialPath("/date")}>
去左右滑
</Link>
<BookmarkButton
id={member.id}

View File

@ -149,15 +149,24 @@ export default function ProfileStudio() {
};
return (
<SiteShell title="我的介绍">
<PageIntro title="我的介绍">
<Link className="social-btn" href={socialPath("/people")}>
看看大家那边
</Link>
<PageIntro title="我的介绍" accent="让别人认识你">
<div className="social-actions">
<Link className="social-btn" href={socialPath("/people")}>
看看大家那边
</Link>
<Link className="social-btn" href={socialPath("/date")}>
去左右滑
</Link>
</div>
</PageIntro>
<p className="social-muted social-event-lead reveal">
写得越完整,别人越容易想认识你。草稿会先留在本机。
</p>
<div className="social-profile-studio">
<section className="social-panel social-panel-fx reveal">
<div className="social-section-label">
<span>{sync === "synced" ? "已保存" : "草稿还在你这边"}</span>
<span className="social-profile-meter">{complete}/5</span>
</div>
<form
className="social-form"
@ -283,13 +292,16 @@ export default function ProfileStudio() {
`/chat?intro=${encodeURIComponent(`大家好,我是${profile.name || "新朋友"},目前在${profile.city || "探索中"}。${profile.bio || "很高兴认识大家!"}`)}`,
)}
>
去聊天室打招呼 <ArrowUpRight size={15} />
进群组打招呼 <ArrowUpRight size={15} />
</Link>
<Link className="social-btn" href={socialPath("/people")}>
看发现页
</Link>
<Link className="social-btn" href={socialPath("/date")}>
去约会
去认识一下
</Link>
<Link className="social-btn" href={socialPath("/meetup")}>
语音视频场
</Link>
</div>
</section>

View File

@ -1,13 +1,16 @@
"use client";
import Link from "next/link";
import { useState } from "react";
import { useRef, useState, type FormEvent } from "react";
import {
ArrowUpRight,
BookOpen,
Film,
MessageCircle,
PenLine,
Play,
Send,
Users,
} from "lucide-react";
import SiteShell from "./SiteShell";
import {
@ -65,10 +68,142 @@ function ResourcePlayer({ source }: { source: string }) {
);
}
function ContributeForm({
kind,
onClose,
}: {
kind: Kind;
onClose: () => void;
}) {
const books = kind === "ebook";
const [draft, setDraft] = useLocalState(`cocreate-draft:${kind}`, {
name: "",
contact: "",
title: "",
note: "",
});
const [sent, setSent] = useLocalState(`cocreate-sent:${kind}`, false);
const [busy, setBusy] = useState(false);
const lock = useRef(false);
const update = (key: keyof typeof draft, value: string) => {
setDraft((c) => ({ ...c, [key]: value }));
setSent(false);
};
const submit = (event: FormEvent) => {
event.preventDefault();
if (lock.current || !draft.name.trim() || !draft.contact.trim()) return;
lock.current = true;
setBusy(true);
window.setTimeout(() => {
setSent(true);
setBusy(false);
lock.current = false;
}, 420);
};
if (sent) {
return (
<div className="social-apply-done">
<span className="social-apply-done-mark" aria-hidden>
<PenLine size={20} />
</span>
<strong>意向已记下</strong>
<p>
先留在你这边。有网或运营看到后,会再联系你聊聊怎么一起做。
</p>
<div className="social-actions">
<Link className="social-btn primary" href={socialPath("/team")}>
<Users size={14} />
去找搭子
</Link>
<button type="button" className="social-btn" onClick={onClose}>
关闭
</button>
</div>
</div>
);
}
return (
<div className="social-apply">
<div className="social-apply-hero">
<span className="social-apply-kind">{books ? "小册" : "视频 / 访谈"}</span>
<strong>想一起做内容?</strong>
<p className="social-role-brief">
写个主题或素材想法就行。不用一次写完,先表达兴趣。
</p>
</div>
<form
className="social-form social-apply-form"
onSubmit={submit}
>
<fieldset disabled={busy} className="social-fieldset">
<label>
怎么称呼你
<input
required
maxLength={64}
placeholder="昵称"
value={draft.name}
onChange={(e) => update("name", e.target.value)}
/>
</label>
<label>
联系方式
<input
required
maxLength={120}
placeholder="邮箱 / 微信…"
value={draft.contact}
onChange={(e) => update("contact", e.target.value)}
/>
</label>
<label>
主题 / 暂定标题
<input
maxLength={120}
placeholder={books ? "想写的小册方向" : "想拍 / 想聊的话题"}
value={draft.title}
onChange={(e) => update("title", e.target.value)}
/>
</label>
<label>
一句话介绍
<textarea
rows={4}
maxLength={1200}
placeholder="你有什么素材、经验,或想找谁一起做…"
value={draft.note}
onChange={(e) => update("note", e.target.value)}
/>
</label>
</fieldset>
<div className="social-actions">
<button
type="submit"
className="social-btn primary"
disabled={busy || !draft.name.trim() || !draft.contact.trim()}
>
<Send size={14} />
{busy ? "保存中…" : "提交意向"}
</button>
<button type="button" className="social-btn" onClick={onClose}>
取消
</button>
</div>
<small className="social-muted">
草稿离线也能写。提交不等于立刻上线,只是先把想法放进来。
</small>
</form>
</div>
);
}
export default function ResourceLibrary({ kind }: { kind: Kind }) {
const [query, setQuery] = useState("");
const [savedOnly, setSavedOnly] = useState(false);
const [selected, setSelected] = useState<string | null>(null);
const [contributeOpen, setContributeOpen] = useState(false);
const config = useSocialConfig();
const [saved] = useLocalState<string[]>(`saved-${kind}`, []);
const books = kind === "ebook";
@ -100,6 +235,13 @@ export default function ResourceLibrary({ kind }: { kind: Kind }) {
>
<PageIntro {...COPY[kind]}>
<div className="social-actions social-cocreate-switch">
<Link
className="social-btn"
href={socialPath("/team")}
>
<Users size={14} />
找搭子
</Link>
<Link
className={`social-btn${books ? " primary" : ""}`}
href={socialPath("/ebook")}
@ -117,6 +259,9 @@ export default function ResourceLibrary({ kind }: { kind: Kind }) {
</DemoBadge>
</div>
</PageIntro>
<p className="social-muted social-event-lead reveal">
小册和视频都算「共创」——先逛逛现成的,也可以提交你想做的主题。
</p>
<div className="social-toolbar reveal">
<SearchField
value={query}
@ -140,6 +285,14 @@ export default function ResourceLibrary({ kind }: { kind: Kind }) {
>
收藏 · {saved.length}
</button>
<button
type="button"
className="social-btn primary social-contribute-btn"
onClick={() => setContributeOpen(true)}
>
<PenLine size={14} />
我想投稿
</button>
</div>
</div>
<div
@ -211,7 +364,7 @@ export default function ResourceLibrary({ kind }: { kind: Kind }) {
</article>
))}
{!shown.length && (
<EmptyState title="没有内容" description="换关键词或看全部。">
<EmptyState title="没有内容" description="换关键词,或提交你想做的主题。">
<button
type="button"
className="social-btn"
@ -222,6 +375,14 @@ export default function ResourceLibrary({ kind }: { kind: Kind }) {
>
重置筛选
</button>
<button
type="button"
className="social-btn primary"
onClick={() => setContributeOpen(true)}
>
<PenLine size={14} />
我想投稿
</button>
</EmptyState>
)}
</div>
@ -258,6 +419,11 @@ export default function ResourceLibrary({ kind }: { kind: Kind }) {
</div>
</SocialDialog>
)}
{contributeOpen && (
<SocialDialog title="共创意向" onClose={() => setContributeOpen(false)}>
<ContributeForm kind={kind} onClose={() => setContributeOpen(false)} />
</SocialDialog>
)}
</SiteShell>
);
}

View File

@ -1,12 +1,16 @@
"use client";
import { useMemo, useRef, useState, type FormEvent } from "react";
import Link from "next/link";
import {
ArrowUpRight,
BookOpen,
BriefcaseBusiness,
Check,
Globe2,
HeartHandshake,
Send,
Sparkles,
} from "lucide-react";
import SiteShell from "./SiteShell";
import {
@ -22,8 +26,16 @@ import { socialApi } from "@social/lib/api";
import { useLocalState } from "@social/lib/useLocalState";
import { resolveSocialCatalog } from "@social/lib/resolveCatalog";
import { useSocialConfig } from "./SocialExperience";
import { socialPath } from "@social/lib/socialPath";
import type { SocialGig, SocialTeamKind } from "@social/lib/types";
const NOTE_PROMPTS = [
"做过类似项目…",
"每周可投入…",
"作品在这里…",
"想一起做成…",
] as const;
function ApplicationForm({ gig }: { gig: SocialGig }) {
const [draft, setDraft] = useLocalState(`gig-draft:${gig.id}`, {
name: "",
@ -37,6 +49,10 @@ function ApplicationForm({ gig }: { gig: SocialGig }) {
const [status, setStatus] = useState("");
const [busy, setBusy] = useState(false);
const lock = useRef(false);
const filled =
Number(Boolean(draft.name.trim())) +
Number(Boolean(draft.contact.trim())) +
Number(Boolean(draft.note.trim()));
const update = (key: keyof typeof draft, value: string) => {
setDraft((current) => ({ ...current, [key]: value }));
setDelivery("draft");
@ -60,38 +76,93 @@ function ApplicationForm({ gig }: { gig: SocialGig }) {
note: draft.note.trim(),
});
setDelivery("sent");
setStatus("申请已提交到社区。具体职责、机会是否开放,请以后续沟通为准。");
setStatus("申请已提交。对方看到后会再联系你——先不急。");
} catch {
setDelivery("local");
setStatus("申请已保存在当前设备,尚未提交。联网后可以重试。");
setStatus("申请已先留在本机。有网后再点一次即可重试。");
} finally {
lock.current = false;
setBusy(false);
}
};
return (
<>
<div className="social-tags">
<span>{TEAM_KIND_LABEL[gig.kind || "parttime"]}</span>
<span>{gig.pay}</span>
<span>{gig.remote ? "线上也能做" : "可以见面做"}</span>
if (delivery === "sent") {
return (
<div className="social-apply-done">
<span className="social-apply-done-mark" aria-hidden>
<Check size={22} strokeWidth={2.4} />
</span>
<strong>已表达兴趣</strong>
<p>{status || "对方看到后会再联系你。"}</p>
<div className="social-apply-summary">
<em>{gig.title}</em>
<span>{TEAM_KIND_LABEL[gig.kind || "parttime"]}</span>
</div>
<div className="social-actions">
<Link className="social-btn primary" href={socialPath("/chat")}>
去群里打个招呼
</Link>
<Link className="social-btn" href={socialPath("/ebook")}>
<BookOpen size={14} />
逛逛共创
</Link>
<button
type="button"
className="social-btn"
onClick={() => {
setDelivery("draft");
setStatus("可以再改一版后提交。");
}}
>
再投一份
</button>
</div>
</div>
<p className="social-role-brief">{gig.role}</p>
{gig.tags.length ? (
);
}
return (
<div className="social-apply">
<div className="social-apply-hero">
<span className="social-apply-kind">
{TEAM_KIND_LABEL[gig.kind || "parttime"]}
</span>
<strong>{gig.title}</strong>
<p className="social-role-brief">{gig.role}</p>
<div className="social-tags">
{gig.tags.map((tag) => (
<span>{gig.pay}</span>
<span>{gig.remote ? "线上也能做" : "可以见面做"}</span>
{gig.tags.slice(0, 4).map((tag) => (
<span key={tag}>{tag}</span>
))}
</div>
) : null}
<p>介绍一下你想参与的原因,附上作品或经验,让对方更容易了解你。</p>
<form className="social-form" onSubmit={(event) => void submit(event)}>
</div>
<div
className="social-apply-progress"
aria-label={`已填 ${filled} / 3`}
>
<span className="social-apply-progress-track">
<i style={{ width: `${(filled / 3) * 100}%` }} />
</span>
<small>
{filled === 0
? "先简单介绍自己"
: filled < 3
? `还差 ${3 - filled} 项(简介可选)`
: "可以提交了"}
</small>
</div>
<form className="social-form social-apply-form" onSubmit={(e) => void submit(e)}>
<fieldset disabled={busy} className="social-fieldset">
<label>
怎么称呼你
<input
required
maxLength={64}
autoComplete="nickname"
placeholder="昵称或真名都行"
value={draft.name}
onChange={(event) => update("name", event.target.value)}
/>
@ -101,7 +172,8 @@ function ApplicationForm({ gig }: { gig: SocialGig }) {
<input
required
maxLength={120}
placeholder="邮箱 / 微信 / 其他可联系的方式"
autoComplete="email"
placeholder="邮箱 / 微信 / Telegram…"
value={draft.contact}
onChange={(event) => update("contact", event.target.value)}
/>
@ -109,12 +181,34 @@ function ApplicationForm({ gig }: { gig: SocialGig }) {
<label>
你能带来什么
<textarea
rows={4}
rows={5}
maxLength={2000}
value={draft.note}
onChange={(event) => update("note", event.target.value)}
placeholder="相关经历、作品链接、可投入时间…"
placeholder="相关经历、作品链接、每周能投入多久…"
/>
<span className="social-apply-prompts" aria-hidden>
{NOTE_PROMPTS.map((tip) => (
<button
key={tip}
type="button"
className="social-apply-chip"
onClick={() =>
update(
"note",
draft.note.trim()
? `${draft.note.trim()}\n${tip}`
: tip,
)
}
>
{tip}
</button>
))}
</span>
<small className="social-muted">
{draft.note.length}/2000 · 多写一点,对方更容易回你
</small>
</label>
</fieldset>
<div className="social-actions">
@ -122,47 +216,30 @@ function ApplicationForm({ gig }: { gig: SocialGig }) {
type="submit"
className="social-btn primary"
disabled={
busy ||
delivery === "sent" ||
!draft.name.trim() ||
!draft.contact.trim()
busy || !draft.name.trim() || !draft.contact.trim()
}
>
<Send size={14} />
{busy
? "提交中…"
: delivery === "sent"
? "已提交"
: delivery === "local"
? "重试提交"
: "发送参与申请"}
: delivery === "local"
? "重试提交"
: "发送参与申请"}
</button>
{delivery === "sent" ? (
<button
type="button"
className="social-btn"
onClick={() => {
setDelivery("draft");
setStatus("可以再投一份,请确认信息后提交。");
}}
>
再投一份
</button>
) : null}
</div>
{status && (
{status ? (
<p
role="status"
className={`social-status${delivery === "local" ? " warn" : ""}`}
>
{status}
</p>
)}
) : null}
<small className="social-muted">
草稿会先留在你这边。提交只是表达兴趣,不代表已经被录用。
</small>
</form>
</>
</div>
);
}
@ -192,18 +269,28 @@ export default function RoleBoard({
return (
<SiteShell title="一起做事">
<PageIntro title="一起,做点事" accent="找搭子">
<div className="social-actions">
<div className="social-actions social-cocreate-switch">
<span className="social-btn primary" aria-current="page">
找搭子
</span>
<Link className="social-btn" href={socialPath("/ebook")}>
<BookOpen size={14} />
共创
</Link>
<DemoBadge>
{catalog.source === "remote" ? "最新机会" : "先看看这些机会"}
</DemoBadge>
<span className="social-muted">{roles.length} 个机会</span>
</div>
</PageIntro>
<p className="social-muted social-event-lead reveal">
远程也能一起推进:认领角色、写申请,草稿会先留在本机。
</p>
<div className="social-toolbar reveal">
<SearchField
value={query}
onChange={setQuery}
placeholder="角色 / 技能"
placeholder="角色 / 技能 / 关键词"
/>
<button
type="button"
@ -285,7 +372,7 @@ export default function RoleBoard({
{!roles.length && (
<EmptyState
title="暂时没有合适的机会"
description="换个词试试,或者看看全部。"
description="换个词试试,或者看看共创内容找灵感。"
>
<button
type="button"
@ -298,11 +385,15 @@ export default function RoleBoard({
>
重新看看
</button>
<Link className="social-btn" href={socialPath("/ebook")}>
<Sparkles size={14} />
去共创逛逛
</Link>
</EmptyState>
)}
</div>
{active && (
<SocialDialog title={active.title} onClose={() => setActive(null)}>
<SocialDialog title="表达兴趣" onClose={() => setActive(null)}>
<ApplicationForm gig={active} />
</SocialDialog>
)}

View File

@ -46,9 +46,9 @@ const GROUPS = [
label: "认识人",
items: [
{ href: "/people", label: "想见的人" },
{ href: "/date", label: "认识一下" },
{ href: "/meetup", label: "开视频聊聊" },
{ href: "/chat", label: "大家聊天" },
{ href: "/date", label: "认识一下" },
],
},
{

View File

@ -13,9 +13,9 @@ import { socialPath } from "@social/lib/socialPath";
const LINKS = [
{ href: "/", label: "首页", short: "首页", icon: House },
{ href: "/people", label: "想见的人", short: "看看谁", icon: Compass },
{ href: "/date", label: "认识一下", short: "认识", icon: Heart },
{ href: "/chat", label: "大家聊天", short: "聊天", icon: MessageCircle },
{ href: "/date", label: "认识一下", short: "认识", icon: Heart },
{ href: "/people", label: "想见的人", short: "看看谁", icon: Compass },
{ href: "/roster", label: "我的介绍", short: "我", icon: CircleUserRound },
];

View File

@ -7,8 +7,8 @@ import { socialPath } from "@social/lib/socialPath";
const RAIL = [
{ href: "/people", label: "想见的人", emoji: "👋" },
{ href: "/date", label: "认识一下", emoji: "💕" },
{ href: "/meetup", label: "开视频", emoji: "📹" },
{ href: "/chat", label: "聊一聊", emoji: "💬" },
{ href: "/meetup", label: "聊得来", emoji: "📡" },
{ href: "/chat", label: "群聊", emoji: "💬" },
{ href: "/coffeechat", label: "见一面", emoji: "🌆" },
{ href: "/team", label: "一起做事", emoji: "🚀" },
{ href: "/ebook", label: "共创", emoji: "🎨" },

View File

@ -87,10 +87,16 @@ export function PageIntro({
/** Honest demo / offline chip for mock surfaces. */
export function DemoBadge({
children = "示例介绍,方便先逛逛",
className,
}: {
children?: ReactNode;
className?: string;
}) {
return <span className="social-demo-badge">{children}</span>;
return (
<span className={["social-demo-badge", className].filter(Boolean).join(" ")}>
{children}
</span>
);
}
export function SearchField({
@ -255,7 +261,9 @@ export function SocialDialog({
<X size={18} />
</button>
</header>
<div className="social-dialog-body">{children}</div>
<div className="social-dialog-body social-dialog-body-scroll">
{children}
</div>
</div>
</dialog>
);

View File

@ -14,6 +14,7 @@ const COPY_KEYS = [
"socialOnlineTitle",
"socialOfflineTitle",
"socialTeamTitle",
"socialWayGroup",
"socialWayChat",
"socialWayDate",
"socialWayCafe",