Deepen /social UX: people profiles, city directory, date deck, and plain-language IA.
Hide membership entry, brand ebook/video as 共创, harden H5 touch layout, and align copy with everyday nomad language. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
bbe2514e96
commit
efb408162d
@ -1,38 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "nomadro",
|
|
||||||
"short_name": "nomadro",
|
|
||||||
"description": "随处工作,自由生活 · 出海导航 · 数字游民小册 · 旅居社群",
|
|
||||||
"start_url": "/",
|
|
||||||
"scope": "/",
|
|
||||||
"display": "standalone",
|
|
||||||
"orientation": "any",
|
|
||||||
"background_color": "#0a0e17",
|
|
||||||
"theme_color": "#0a0e17",
|
|
||||||
"lang": "zh-CN",
|
|
||||||
"icons": [
|
|
||||||
{
|
|
||||||
"src": "/favicon.svg?v=2",
|
|
||||||
"sizes": "any",
|
|
||||||
"type": "image/svg+xml",
|
|
||||||
"purpose": "any"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "/icon-192.png?v=2",
|
|
||||||
"sizes": "192x192",
|
|
||||||
"type": "image/png",
|
|
||||||
"purpose": "any"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "/icon-512.png?v=2",
|
|
||||||
"sizes": "512x512",
|
|
||||||
"type": "image/png",
|
|
||||||
"purpose": "any"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "/apple-touch-icon.png?v=2",
|
|
||||||
"sizes": "180x180",
|
|
||||||
"type": "image/png",
|
|
||||||
"purpose": "any"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@ -12,22 +12,22 @@ export default function manifest(): MetadataRoute.Manifest {
|
|||||||
lang: "zh-CN",
|
lang: "zh-CN",
|
||||||
icons: [
|
icons: [
|
||||||
{
|
{
|
||||||
src: "/favicon.svg",
|
src: "/favicon.svg?v=2",
|
||||||
sizes: "any",
|
sizes: "any",
|
||||||
type: "image/svg+xml",
|
type: "image/svg+xml",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: "/icon-192.png",
|
src: "/icon-192.png?v=2",
|
||||||
sizes: "192x192",
|
sizes: "192x192",
|
||||||
type: "image/png",
|
type: "image/png",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: "/icon-512.png",
|
src: "/icon-512.png?v=2",
|
||||||
sizes: "512x512",
|
sizes: "512x512",
|
||||||
type: "image/png",
|
type: "image/png",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
src: "/apple-touch-icon.png",
|
src: "/apple-touch-icon.png?v=2",
|
||||||
sizes: "180x180",
|
sizes: "180x180",
|
||||||
type: "image/png",
|
type: "image/png",
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,8 +1,17 @@
|
|||||||
import ChatRoomClient from "@social/components/ChatRoomClient";
|
import { redirect } from "next/navigation";
|
||||||
import { SEED_CHANNELS } from "@social/lib/seed";
|
|
||||||
|
|
||||||
export default async function Page({ params }: { params: Promise<{ id: string }> }) {
|
/** 旧多频道 URL → 唯一全屏聊天室 */
|
||||||
const { id } = await params;
|
export default async function Page({
|
||||||
const channelId = SEED_CHANNELS.some((c) => c.id === id) ? id : SEED_CHANNELS[0].id;
|
searchParams,
|
||||||
return <ChatRoomClient channelId={channelId} />;
|
}: {
|
||||||
|
params: Promise<{ id: string }>;
|
||||||
|
searchParams: Promise<Record<string, string | string[] | undefined>>;
|
||||||
|
}) {
|
||||||
|
const sp = await searchParams;
|
||||||
|
const introRaw = sp.intro;
|
||||||
|
const intro = Array.isArray(introRaw) ? introRaw[0] : introRaw;
|
||||||
|
if (intro) {
|
||||||
|
redirect(`/social/chat?intro=${encodeURIComponent(intro)}`);
|
||||||
|
}
|
||||||
|
redirect("/social/chat");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
|
import { Suspense } from "react";
|
||||||
import CoffeechatClient from "@social/components/CoffeechatClient";
|
import CoffeechatClient from "@social/components/CoffeechatClient";
|
||||||
|
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
return <CoffeechatClient />;
|
return (
|
||||||
|
<Suspense fallback={<div className="social-status">加载同城目录…</div>}>
|
||||||
|
<CoffeechatClient />
|
||||||
|
</Suspense>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,12 +9,14 @@ import "@social/app/experience.css";
|
|||||||
import "@social/app/interaction.css";
|
import "@social/app/interaction.css";
|
||||||
import "@social/app/studio.css";
|
import "@social/app/studio.css";
|
||||||
import "@social/app/motion.css";
|
import "@social/app/motion.css";
|
||||||
|
import "@social/app/depth.css";
|
||||||
|
import "@social/app/vivid.css";
|
||||||
import SocialExperience from "@social/components/SocialExperience";
|
import SocialExperience from "@social/components/SocialExperience";
|
||||||
|
|
||||||
export const metadata = {
|
export const metadata = {
|
||||||
title: "游民社区 · nomadro",
|
title: "游民社区 · nomadro",
|
||||||
description:
|
description:
|
||||||
"数字游民社交:线上聊天 · Meetup · Coffeechat · 职业花名册 · UGC",
|
"认识同频的人:看看谁在这儿、开视频聊聊、出来见一面、一起做点事",
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function SocialLayout({
|
export default function SocialLayout({
|
||||||
|
|||||||
15
src/app/social/people/[id]/page.tsx
Normal file
15
src/app/social/people/[id]/page.tsx
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { Suspense } from "react";
|
||||||
|
import PeopleProfileClient from "@social/components/PeopleProfileClient";
|
||||||
|
|
||||||
|
export default async function PeopleProfilePage({
|
||||||
|
params,
|
||||||
|
}: {
|
||||||
|
params: Promise<{ id: string }>;
|
||||||
|
}) {
|
||||||
|
const { id } = await params;
|
||||||
|
return (
|
||||||
|
<Suspense fallback={<div className="social-status">加载游民名片…</div>}>
|
||||||
|
<PeopleProfileClient id={id} />
|
||||||
|
</Suspense>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
import VipClient from "@social/components/VipClient";
|
import { redirect } from "next/navigation";
|
||||||
|
|
||||||
|
/** 会员入口已隐藏,直达统一加入社区。 */
|
||||||
export default function Page() {
|
export default function Page() {
|
||||||
return <VipClient />;
|
redirect("/social/join");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -149,6 +149,18 @@ export type NomadroRemoteConfig = {
|
|||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
socialVideoSources?: Record<string, string>;
|
socialVideoSources?: Record<string, string>;
|
||||||
|
/** 游民社区目录覆盖;空数组/非法字段回退包内 seed */
|
||||||
|
socialCatalogs?: {
|
||||||
|
cafes?: Array<Record<string, unknown>>;
|
||||||
|
meetups?: Array<Record<string, unknown>>;
|
||||||
|
gigs?: Array<Record<string, unknown>>;
|
||||||
|
};
|
||||||
|
socialWayChat?: string;
|
||||||
|
socialWayDate?: string;
|
||||||
|
socialWayCafe?: string;
|
||||||
|
socialWayTeam?: string;
|
||||||
|
socialPayJoinLabel?: string;
|
||||||
|
socialOaJoinLabel?: string;
|
||||||
};
|
};
|
||||||
/** 导航页分类 / 链接(后台可增删改隐) */
|
/** 导航页分类 / 链接(后台可增删改隐) */
|
||||||
navContent?: NavContent;
|
navContent?: NavContent;
|
||||||
@ -382,6 +394,99 @@ export const DEFAULT_REMOTE_CONFIG: NomadroRemoteConfig = {
|
|||||||
socialOnlineTitle: "随时,聊得来",
|
socialOnlineTitle: "随时,聊得来",
|
||||||
socialOfflineTitle: "同城,见一面",
|
socialOfflineTitle: "同城,见一面",
|
||||||
socialTeamTitle: "一起,做点事",
|
socialTeamTitle: "一起,做点事",
|
||||||
|
socialWayChat: "开视频聊聊",
|
||||||
|
socialWayDate: "认识一下",
|
||||||
|
socialWayCafe: "找个地方见面",
|
||||||
|
socialWayTeam: "找搭子 · 共创",
|
||||||
|
socialPayJoinLabel: "加入社区",
|
||||||
|
socialOaJoinLabel: "先看看公众号",
|
||||||
|
socialPages: {
|
||||||
|
people: {
|
||||||
|
eyebrow: "先逛逛大家",
|
||||||
|
title: "想见的人",
|
||||||
|
accent: "认识新朋友",
|
||||||
|
description:
|
||||||
|
"点开卡片,看看对方在做什么。现在是示例介绍,方便你先熟悉;想打招呼,去大家聊天的地方说一句就好。",
|
||||||
|
},
|
||||||
|
date: {
|
||||||
|
eyebrow: "慢慢认识",
|
||||||
|
title: "认识一下",
|
||||||
|
accent: "想认识的人",
|
||||||
|
description:
|
||||||
|
"右滑表示想认识,会先记在你这边。接下来可以去聊天室打个招呼——不是一对一私信,而是大家一起聊。",
|
||||||
|
},
|
||||||
|
chat: {
|
||||||
|
eyebrow: "大家在这儿聊",
|
||||||
|
title: "聊天室",
|
||||||
|
accent: "打个招呼",
|
||||||
|
description:
|
||||||
|
"进来跟大家说说话。网络不好时,刚才的话可能先留在你这边,联网后再试一次就行。",
|
||||||
|
},
|
||||||
|
meetup: {
|
||||||
|
eyebrow: "面对面更近",
|
||||||
|
title: "随时,聊得来",
|
||||||
|
accent: "开视频",
|
||||||
|
description:
|
||||||
|
"几个人一起开摄像头见面聊天。点「想参加」只是先记在你这边,还不等于已经约好。",
|
||||||
|
},
|
||||||
|
coffeechat: {
|
||||||
|
eyebrow: "约出来喝一杯",
|
||||||
|
title: "同城,见一面",
|
||||||
|
accent: "城市与咖啡馆",
|
||||||
|
description:
|
||||||
|
"先选城市,再挑适合见面的咖啡馆。看完介绍、聊过天之后,出来见一面会更自然。",
|
||||||
|
},
|
||||||
|
team: {
|
||||||
|
eyebrow: "不只好玩,也能做事",
|
||||||
|
title: "一起,做点事",
|
||||||
|
accent: "找搭子",
|
||||||
|
description:
|
||||||
|
"有人在找帮手、兼职伙伴;也有人一起做共创(小册与视频)。点卡片看看详情。",
|
||||||
|
},
|
||||||
|
gigs: {
|
||||||
|
eyebrow: "帮得上忙的机会",
|
||||||
|
title: "兼职与志愿",
|
||||||
|
accent: "一起做事",
|
||||||
|
description: "想帮忙、想兼职,都从这里看看。合适再表达兴趣。",
|
||||||
|
},
|
||||||
|
join: {
|
||||||
|
eyebrow: "先找到组织",
|
||||||
|
title: "加入社区",
|
||||||
|
accent: "欢迎你来",
|
||||||
|
description:
|
||||||
|
"付费加入后能更方便认识大家;也可以先关注公众号,慢慢了解社区动态。",
|
||||||
|
},
|
||||||
|
vip: {
|
||||||
|
eyebrow: "想多一点支持",
|
||||||
|
title: "会员",
|
||||||
|
description: "开通后能更方便参与社区活动。具体权益以页面说明为准。",
|
||||||
|
},
|
||||||
|
roster: {
|
||||||
|
eyebrow: "让别人认识你",
|
||||||
|
title: "我的介绍",
|
||||||
|
description:
|
||||||
|
"写几句关于自己的话,草稿会先留在你这边。愿意的话,也可以出现在「想见的人」里。",
|
||||||
|
},
|
||||||
|
feedback: {
|
||||||
|
eyebrow: "说说你的想法",
|
||||||
|
title: "意见反馈",
|
||||||
|
accent: "我们在听",
|
||||||
|
description:
|
||||||
|
"有不顺手的地方尽管说。发送失败时会先留在你这边,有网后再试一次。",
|
||||||
|
},
|
||||||
|
ebook: {
|
||||||
|
eyebrow: "共创",
|
||||||
|
title: "共创 · 小册",
|
||||||
|
accent: "大家写的",
|
||||||
|
description: "社区一起写的经验。先看看目录;想完整阅读,可以去书库。",
|
||||||
|
},
|
||||||
|
videos: {
|
||||||
|
eyebrow: "共创",
|
||||||
|
title: "共创 · 视频",
|
||||||
|
accent: "大家拍的",
|
||||||
|
description: "社区一起拍的路上故事。有的可以看,有的先看封面。",
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
navContent: structuredClone(DEFAULT_NAV_CONTENT),
|
navContent: structuredClone(DEFAULT_NAV_CONTENT),
|
||||||
platforms: {
|
platforms: {
|
||||||
|
|||||||
@ -20,18 +20,19 @@
|
|||||||
- **交互**:粘性区块导航与当前位置、方向键筛选成员、关注本地保存;原生 `dialog` 管理视频与加群弹窗的焦点、Escape、背景锁定。
|
- **交互**:粘性区块导航与当前位置、方向键筛选成员、关注本地保存;原生 `dialog` 管理视频与加群弹窗的焦点、Escape、背景锁定。
|
||||||
- **全站布局**:桌面为宽幅内容 + 顶部分组导航;移动端为顶部菜单 + 底部快捷入口。没有侧栏,聊天室频道也使用横向切换。
|
- **全站布局**:桌面为宽幅内容 + 顶部分组导航;移动端为顶部菜单 + 底部快捷入口。没有侧栏,聊天室频道也使用横向切换。
|
||||||
- **全站动效**:`SocialExperience` / `experience.css` 提供星点连线、鼠标柔光、漂移光晕、卡片聚光和页面入场;`interaction.css` / `studio.css` 提供声波、会前雷达、名片透视与书封动效。动效可切为轻量,系统减少动态效果设置优先;离开页面或标签页隐藏时清理/暂停动画。
|
- **全站动效**:`SocialExperience` / `experience.css` 提供星点连线、鼠标柔光、漂移光晕、卡片聚光和页面入场;`interaction.css` / `studio.css` 提供声波、会前雷达、名片透视与书封动效。动效可切为轻量,系统减少动态效果设置优先;离开页面或标签页隐藏时清理/暂停动画。
|
||||||
|
- **视觉终态层**:`depth.css` + `vivid.css`(最后加载)统一玻璃导航、快捷轨、约会进度、聊天跳转最新、咖啡馆主从、Meetup 雷达、触控 ≥44px;子页 `SocialQuickRail` 横向跳转。
|
||||||
|
|
||||||
## 子页面与交互边界
|
## 子页面与交互边界
|
||||||
|
|
||||||
- `/people`:按城市 / 技能 / 兴趣搜索展示成员,收藏与名片弹窗;成员和在线状态为演示资料,交流入口通向真实公开频道,没有虚构私信或匹配结果。
|
- `/people`:按城市 / 技能 / 兴趣搜索展示成员,收藏与名片弹窗;成员和在线状态为演示资料,可选显示本机已发布名片;交流入口通向真实公开频道,没有虚构私信或匹配结果。
|
||||||
- `/chat`、`/chat/[id]`:频道搜索、破冰话题、引用回复、表情、IME 友好的 Enter 发送、独立消息区滚动、本机草稿。连接现有 API / Centrifugo,失败保留「仅本机」消息并支持手动重试;反应与频道收藏仅本机保存。
|
- `/chat`、`/chat/[id]`:全站唯一公开厅;破冰话题、引用回复、表情、IME 友好的 Enter 发送、独立消息区滚动、本机草稿。连接现有 API / Centrifugo,失败保留「仅本机」消息并支持手动重试;反应仅本机保存。`/chat/[id]` 重定向到公开厅。
|
||||||
- `/meetup`、`/meetup/[id]`:活动收藏表示本机参与计划,不是预约成功;导出日历按活动 IANA 时区转换为 UTC,种子默认 `Asia/Shanghai`。视频房间在明确点击进入后才加载,麦克风 / 摄像头默认关闭,支持布局切换、重连、新窗口和离开。音视频能力依赖现有 MiroTalk 服务及用户授权。
|
- `/meetup`、`/meetup/[id]`:活动收藏表示本机参与计划,不是预约成功;导出日历按活动 IANA 时区转换为 UTC,种子默认 `Asia/Shanghai`。视频房间在明确点击进入后才加载,麦克风 / 摄像头默认关闭,支持布局切换、重连、新窗口和离开。音视频能力依赖现有 MiroTalk 服务及用户授权。
|
||||||
- `/coffeechat`:城市 / 关键词 / 网络 / 评分筛选,地点收藏、可分享选中地点、真实评价提交与离线重试。目录中的地点、带宽、评分仅作种子参考;邀约进入公开频道,不伪造订位或即时到场人数。
|
- `/coffeechat`:城市 / 关键词 / 网络 / 评分筛选,地点收藏、可分享选中地点、真实评价提交与离线重试。目录中的地点、带宽、评分仅作种子参考;邀约进入公开频道,不伪造订位或即时到场人数。
|
||||||
- `/roster`:编辑时实时预览名片与完成度,本机草稿优先;慢返回的服务端资料不会覆盖正在编辑的内容。保存调用现有资料 API,明确区别同步成功与尚未同步。
|
- `/roster`:编辑时实时预览名片与完成度,本机草稿优先;慢返回的服务端资料不会覆盖正在编辑的内容。保存调用现有资料 API,明确区别同步成功与尚未同步。
|
||||||
- `/team`、`/gigs`:搜索技能与角色、类型筛选、收藏、参与申请弹窗,校验必填项、保留本机草稿、失败重试和重复提交保护。目录机会是否开放需另行确认。
|
- `/team`、`/gigs`:搜索技能与角色、类型筛选、收藏、参与申请弹窗,校验必填项、保留本机草稿、失败重试和重复提交保护。目录机会是否开放需另行确认。
|
||||||
- `/videos`、`/date`、`/ebook`:统一搜索、收藏、内容详情和话题讨论入口。视频没有片源时明确展示目录预览,不显示假播放器;小册入口通向门户书库,不承诺目录主题已有对应完整正文。
|
- `/videos`、`/date`、`/ebook`:统一搜索、收藏、内容详情和话题讨论入口。视频没有片源时明确展示目录预览,不显示假播放器;小册入口通向门户书库,不承诺目录主题已有对应完整正文。
|
||||||
- `/join`、`/vip`、`/feedback`:加入步骤、已有社群引导、会员中心入口、反馈草稿与离线重试;购买遵循 `payEnabled`,不承诺未实现的优先席位等权益。
|
- `/join`、`/vip`、`/feedback`:加群双路径(付费入群 + 关注公众号)、会员中心入口、反馈草稿与离线重试、「再提一条」;购买遵循 `payEnabled`,不承诺未实现的优先席位等权益。
|
||||||
- **子页面运营**:`/admin/config` 的 `copy.socialPages` 支持按路由键覆盖 `{ eyebrow, title, accent, description }`;`copy.socialVideoSources` 按目录 ID 配置 http(s) 或站内片源。编辑器校验 JSON,非法配置禁止提交;空配置使用内置默认文案。
|
- **子页面运营**:`/admin/config` 的 `copy.socialPages` 支持按路由键覆盖 `{ eyebrow, title, accent, description }`;`copy.socialVideoSources` 按目录 ID 配置片源;`copy.socialCatalogs` 可覆盖 cafes/meetups/gigs(空/非法回退包内 seed)。编辑器校验 JSON;空配置使用内置默认文案。
|
||||||
- **存储**:`useLocalState` 统一草稿、偏好和收藏,兼容服务端渲染和跨标签页更新。本机保存不会冒充服务器发布、真实关注关系或账号登录。
|
- **存储**:`useLocalState` 统一草稿、偏好和收藏,兼容服务端渲染和跨标签页更新。本机保存不会冒充服务器发布、真实关注关系或账号登录。
|
||||||
|
|
||||||
## 首页(数字游民社交)
|
## 首页(数字游民社交)
|
||||||
@ -42,8 +43,6 @@
|
|||||||
- CTA:仅「加群」→ 邮箱弹窗 → PC/H5 `zpay`、微信内 H5 `xpay`、小程序引导虚拟支付(`JoinPayModal` + `triggerPay`)
|
- CTA:仅「加群」→ 邮箱弹窗 → PC/H5 `zpay`、微信内 H5 `xpay`、小程序引导虚拟支付(`JoinPayModal` + `triggerPay`)
|
||||||
- 下方:三种连接入口 → 成员花名册 → Meetup → Coffeechat → **远程团队**(`/social/team`:志愿者 / 兼职 / 全职)→ 加入邀请。
|
- 下方:三种连接入口 → 成员花名册 → Meetup → Coffeechat → **远程团队**(`/social/team`:志愿者 / 兼职 / 全职)→ 加入邀请。
|
||||||
- 首页成员 / 活动预览沿用种子数据,演示在线状态明确标注,非实时成员统计。
|
- 首页成员 / 活动预览沿用种子数据,演示在线状态明确标注,非实时成员统计。
|
||||||
- 世界时钟展示清迈、大理、里斯本、巴厘岛的实际本地时间,并链接对应城市发现页。
|
|
||||||
|
|
||||||
## 本地验收
|
## 本地验收
|
||||||
|
|
||||||
- TypeScript 全量检查与改动范围 ESLint。
|
- TypeScript 全量检查与改动范围 ESLint。
|
||||||
|
|||||||
1419
src/modules/social/app/depth.css
Normal file
1419
src/modules/social/app/depth.css
Normal file
File diff suppressed because it is too large
Load Diff
@ -113,9 +113,241 @@
|
|||||||
border-color: #4ecdc455;
|
border-color: #4ecdc455;
|
||||||
}
|
}
|
||||||
.social-workspace {
|
.social-workspace {
|
||||||
--nav-height: 80px;
|
--nav-height: 72px;
|
||||||
min-height: 100dvh;
|
min-height: 100dvh;
|
||||||
}
|
}
|
||||||
|
.social-workspace-dense {
|
||||||
|
--nav-height: 64px;
|
||||||
|
}
|
||||||
|
.social-page-head {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: flex-start;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 12px 18px;
|
||||||
|
padding: 4px 0 14px;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
border-bottom: 1px solid var(--sx-line);
|
||||||
|
}
|
||||||
|
.social-page-head-copy {
|
||||||
|
display: grid;
|
||||||
|
gap: 6px;
|
||||||
|
min-width: min(100%, 28rem);
|
||||||
|
}
|
||||||
|
.social-page-head h1 {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
margin: 0;
|
||||||
|
font-size: clamp(22px, 2.4vw, 28px);
|
||||||
|
letter-spacing: -0.04em;
|
||||||
|
font-weight: 750;
|
||||||
|
line-height: 1.2;
|
||||||
|
}
|
||||||
|
.social-page-head-eyebrow {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 12px;
|
||||||
|
letter-spacing: 0.08em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: var(--sx-mint);
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
.social-page-head-desc {
|
||||||
|
margin: 0;
|
||||||
|
max-width: 42rem;
|
||||||
|
color: var(--text-secondary, rgba(255, 255, 255, 0.62));
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.55;
|
||||||
|
}
|
||||||
|
.social-page-head-mark {
|
||||||
|
font-size: 0.92em;
|
||||||
|
line-height: 1;
|
||||||
|
opacity: 0.72;
|
||||||
|
}
|
||||||
|
.social-page-head-title {
|
||||||
|
display: inline-flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: baseline;
|
||||||
|
gap: 0.35em;
|
||||||
|
}
|
||||||
|
.social-page-head-accent {
|
||||||
|
color: var(--sx-mint);
|
||||||
|
font-weight: 650;
|
||||||
|
font-size: 0.72em;
|
||||||
|
letter-spacing: 0.02em;
|
||||||
|
}
|
||||||
|
.social-demo-badge {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 6px 10px;
|
||||||
|
border-radius: 999px;
|
||||||
|
border: 1px solid color-mix(in srgb, var(--sx-mint) 35%, transparent);
|
||||||
|
background: color-mix(in srgb, var(--sx-mint) 12%, transparent);
|
||||||
|
color: var(--sx-mint);
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: 0.02em;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.social-nav-join {
|
||||||
|
min-height: 36px;
|
||||||
|
padding-inline: 14px;
|
||||||
|
}
|
||||||
|
.social-join-paths {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
|
gap: 16px;
|
||||||
|
margin: 8px 0 22px;
|
||||||
|
}
|
||||||
|
.social-join-path {
|
||||||
|
display: grid;
|
||||||
|
gap: 10px;
|
||||||
|
align-content: start;
|
||||||
|
}
|
||||||
|
.social-join-path h2 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 1.15rem;
|
||||||
|
}
|
||||||
|
.social-join-path p {
|
||||||
|
margin: 0;
|
||||||
|
color: var(--text-secondary, rgba(255, 255, 255, 0.62));
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
.social-join-path-ico {
|
||||||
|
width: 44px;
|
||||||
|
height: 44px;
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
border-radius: 14px;
|
||||||
|
background: color-mix(in srgb, var(--sx-mint) 14%, transparent);
|
||||||
|
color: var(--sx-mint);
|
||||||
|
}
|
||||||
|
.social-benefit-list {
|
||||||
|
list-style: none;
|
||||||
|
margin: 0 0 12px;
|
||||||
|
padding: 0;
|
||||||
|
display: grid;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.social-benefit-list li {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.social-publish-toggle {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 10px;
|
||||||
|
margin: 4px 0 12px;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1.45;
|
||||||
|
}
|
||||||
|
.social-publish-toggle input {
|
||||||
|
margin-top: 3px;
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
}
|
||||||
|
.social-join-success {
|
||||||
|
display: grid;
|
||||||
|
gap: 14px;
|
||||||
|
justify-items: start;
|
||||||
|
}
|
||||||
|
.social-channel-solo {
|
||||||
|
max-width: 32rem;
|
||||||
|
}
|
||||||
|
@media (max-width: 720px) {
|
||||||
|
.social-join-paths {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.social-chat-live {
|
||||||
|
background: var(--sc-bg, var(--bg-primary));
|
||||||
|
}
|
||||||
|
.social-chat-live-bar {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.social-chat-live .social-live-stage {
|
||||||
|
min-height: 0;
|
||||||
|
}
|
||||||
|
.social-chat-live .social-conversation {
|
||||||
|
height: 100%;
|
||||||
|
min-height: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: 0 !important;
|
||||||
|
border-radius: 0 !important;
|
||||||
|
box-shadow: none !important;
|
||||||
|
background: transparent !important;
|
||||||
|
}
|
||||||
|
.social-chat-live .social-conversation-top {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
.social-chat-live .social-connection-status {
|
||||||
|
margin: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
padding: 6px 12px;
|
||||||
|
}
|
||||||
|
.social-chat-live .social-thread-wrap,
|
||||||
|
.social-chat-live .social-chat-thread {
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
margin: 0;
|
||||||
|
padding: 12px;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 0;
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
.social-chat-live .social-chat-composer {
|
||||||
|
margin: 0;
|
||||||
|
border-radius: 0 !important;
|
||||||
|
border-left: 0;
|
||||||
|
border-right: 0;
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
.social-live-root .social-mobile-dock {
|
||||||
|
z-index: 40;
|
||||||
|
}
|
||||||
|
/* 唯一聊天室:隐藏旧频道分类条 */
|
||||||
|
.social-chat-solo .social-chat-live-tabs,
|
||||||
|
.social-chat-live-tabs {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
.social-chat-live-tabs-legacy {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
flex-shrink: 0;
|
||||||
|
overflow-x: auto;
|
||||||
|
gap: 6px;
|
||||||
|
padding: 8px 12px;
|
||||||
|
border-bottom: var(--sc-border, 1px solid rgba(171, 195, 213, 0.12));
|
||||||
|
background: color-mix(in srgb, var(--sc-bg, #0a0e17) 92%, transparent);
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
}
|
||||||
|
.social-chat-live-tabs .social-live-tab {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
flex: 0 0 auto;
|
||||||
|
min-height: 36px;
|
||||||
|
padding: 0 12px;
|
||||||
|
border-radius: 999px;
|
||||||
|
border: 0;
|
||||||
|
text-decoration: none;
|
||||||
|
white-space: nowrap;
|
||||||
|
color: var(--sc-muted, var(--text-muted));
|
||||||
|
background: transparent;
|
||||||
|
font: inherit;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
.social-chat-live-tabs .social-live-tab.active,
|
||||||
|
.social-chat-live-tabs .social-live-tab[aria-current="page"] {
|
||||||
|
color: #0a0e17;
|
||||||
|
background: var(--sc-gradient, linear-gradient(90deg, #ff6b6b, #4ecdc4));
|
||||||
|
}
|
||||||
.social-workspace .navbar {
|
.social-workspace .navbar {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset: 0 0 auto;
|
inset: 0 0 auto;
|
||||||
@ -202,14 +434,20 @@
|
|||||||
}
|
}
|
||||||
.social-workspace-grid {
|
.social-workspace-grid {
|
||||||
display: block;
|
display: block;
|
||||||
max-width: 1250px;
|
max-width: none;
|
||||||
margin: auto;
|
width: 100%;
|
||||||
padding: 105px 32px 60px;
|
margin: 0;
|
||||||
|
padding: calc(var(--nav-height) + 12px) 20px 88px;
|
||||||
|
min-height: 100dvh;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
.social-workspace-dense .social-workspace-grid {
|
||||||
|
padding: calc(var(--nav-height) + 8px) 16px 80px;
|
||||||
}
|
}
|
||||||
.social-workspace .social-main {
|
.social-workspace .social-main {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
max-width: 1184px;
|
max-width: 1400px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
@ -232,6 +470,76 @@
|
|||||||
padding: 36px 0 34px;
|
padding: 36px 0 34px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
.social-page-intro .social-emoji-field {
|
||||||
|
z-index: 0;
|
||||||
|
opacity: 0.85;
|
||||||
|
}
|
||||||
|
.social-page-intro > :not(.social-emoji-field) {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
.social-workspace .social-fx-orbs {
|
||||||
|
opacity: 0.35;
|
||||||
|
}
|
||||||
|
.social-workspace .social-fx-orb.o3 {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.social-room-hero {
|
||||||
|
position: relative;
|
||||||
|
margin: 8px 0 22px;
|
||||||
|
padding: 22px 22px 20px;
|
||||||
|
border: 1px solid var(--sx-line);
|
||||||
|
border-radius: 20px;
|
||||||
|
background: color-mix(in srgb, var(--sx-surface) 88%, transparent);
|
||||||
|
backdrop-filter: blur(14px);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.social-room-hero h1 {
|
||||||
|
font-size: clamp(26px, 3vw, 36px);
|
||||||
|
letter-spacing: -0.04em;
|
||||||
|
margin: 12px 0 8px;
|
||||||
|
line-height: 1.25;
|
||||||
|
}
|
||||||
|
.social-room-hero > p {
|
||||||
|
color: var(--text-secondary);
|
||||||
|
font-size: 13px;
|
||||||
|
max-width: 54ch;
|
||||||
|
line-height: 1.7;
|
||||||
|
}
|
||||||
|
.social-room-hero-emoji {
|
||||||
|
position: absolute;
|
||||||
|
inset: auto 16px 14px auto;
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
.social-room-hero-emoji i {
|
||||||
|
font-style: normal;
|
||||||
|
font-size: 0.95rem;
|
||||||
|
opacity: 0.28;
|
||||||
|
filter: none;
|
||||||
|
animation: social-emoji-fly 10s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
.social-room-hero-emoji i:nth-child(2) {
|
||||||
|
animation-delay: 0.4s;
|
||||||
|
}
|
||||||
|
.social-room-hero-emoji i:nth-child(3) {
|
||||||
|
animation-delay: 0.8s;
|
||||||
|
}
|
||||||
|
.social-room-hero-emoji i:nth-child(4) {
|
||||||
|
animation-delay: 1.2s;
|
||||||
|
}
|
||||||
|
.social-workspace .reveal {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(18px);
|
||||||
|
transition:
|
||||||
|
opacity 0.55s var(--sx-ease),
|
||||||
|
transform 0.55s var(--sx-ease);
|
||||||
|
}
|
||||||
|
.social-workspace .reveal.visible {
|
||||||
|
opacity: 1;
|
||||||
|
transform: none;
|
||||||
|
}
|
||||||
.social-page-kicker {
|
.social-page-kicker {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -675,6 +983,13 @@
|
|||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 1.9;
|
line-height: 1.9;
|
||||||
}
|
}
|
||||||
|
.social-empty-actions {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 8px;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
.social-empty .social-btn {
|
.social-empty .social-btn {
|
||||||
margin-top: 18px;
|
margin-top: 18px;
|
||||||
}
|
}
|
||||||
@ -1102,6 +1417,15 @@
|
|||||||
backdrop-filter: blur(20px);
|
backdrop-filter: blur(20px);
|
||||||
padding: 8px 10px max(9px, env(safe-area-inset-bottom));
|
padding: 8px 10px max(9px, env(safe-area-inset-bottom));
|
||||||
}
|
}
|
||||||
|
.social-chat-live .social-chat-composer {
|
||||||
|
padding-bottom: calc(12px + 64px + env(safe-area-inset-bottom, 0px));
|
||||||
|
}
|
||||||
|
.social-date-root .social-date-stage {
|
||||||
|
padding-bottom: calc(12px + 72px + env(safe-area-inset-bottom, 0px));
|
||||||
|
}
|
||||||
|
.social-date-root .social-date-deck {
|
||||||
|
height: min(520px, calc(100dvh - 300px));
|
||||||
|
}
|
||||||
.social-mobile-dock a {
|
.social-mobile-dock a {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@ -85,36 +85,36 @@
|
|||||||
.social-emoji-float {
|
.social-emoji-float {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
|
filter: none;
|
||||||
animation-name: social-emoji-fly;
|
animation-name: social-emoji-fly;
|
||||||
animation-timing-function: ease-in-out;
|
animation-timing-function: ease-in-out;
|
||||||
animation-iteration-count: infinite;
|
animation-iteration-count: infinite;
|
||||||
will-change: transform, opacity;
|
will-change: transform, opacity;
|
||||||
|
opacity: 0.22;
|
||||||
|
}
|
||||||
|
|
||||||
|
.social-emoji-field-soft {
|
||||||
|
z-index: 0;
|
||||||
|
opacity: 0.55;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes social-emoji-fly {
|
@keyframes social-emoji-fly {
|
||||||
0% {
|
0%,
|
||||||
transform: translate3d(0, 12px, 0) rotate(-12deg) scale(0.92);
|
|
||||||
opacity: 0.25;
|
|
||||||
}
|
|
||||||
40% {
|
|
||||||
transform: translate3d(10px, -28px, 0) rotate(8deg) scale(1.12);
|
|
||||||
opacity: 0.85;
|
|
||||||
}
|
|
||||||
70% {
|
|
||||||
transform: translate3d(-8px, -10px, 0) rotate(-4deg) scale(1.02);
|
|
||||||
opacity: 0.55;
|
|
||||||
}
|
|
||||||
100% {
|
100% {
|
||||||
transform: translate3d(0, 12px, 0) rotate(-12deg) scale(0.92);
|
transform: translate3d(0, 4px, 0) rotate(-2deg) scale(1);
|
||||||
opacity: 0.25;
|
opacity: 0.14;
|
||||||
|
}
|
||||||
|
50% {
|
||||||
|
transform: translate3d(4px, -8px, 0) rotate(2deg) scale(1.04);
|
||||||
|
opacity: 0.28;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Emoji marquee belt */
|
/* Emoji marquee belt — quiet divider */
|
||||||
.social-fx-belt {
|
.social-fx-belt {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding: 10px 0 18px;
|
padding: 6px 0 10px;
|
||||||
|
opacity: 0.35;
|
||||||
mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
|
mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,15 +122,15 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
width: max-content;
|
width: max-content;
|
||||||
gap: 0;
|
gap: 0;
|
||||||
animation: social-belt-run 22s linear infinite;
|
animation: social-belt-run 48s linear infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
.social-fx-belt-track span {
|
.social-fx-belt-track span {
|
||||||
padding-right: 48px;
|
padding-right: 56px;
|
||||||
font-size: 1.35rem;
|
font-size: 0.95rem;
|
||||||
letter-spacing: 0.35em;
|
letter-spacing: 0.45em;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
opacity: 0.55;
|
opacity: 0.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes social-belt-run {
|
@keyframes social-belt-run {
|
||||||
@ -188,9 +188,10 @@
|
|||||||
|
|
||||||
.social-title-emoji {
|
.social-title-emoji {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-right: 0.35em;
|
margin-right: 0.28em;
|
||||||
animation: social-emoji-wiggle 1.8s ease-in-out infinite;
|
opacity: 0.82;
|
||||||
transform-origin: 50% 80%;
|
animation: none;
|
||||||
|
transform: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes social-emoji-wiggle {
|
@keyframes social-emoji-wiggle {
|
||||||
@ -198,14 +199,8 @@
|
|||||||
100% {
|
100% {
|
||||||
transform: rotate(0deg) scale(1);
|
transform: rotate(0deg) scale(1);
|
||||||
}
|
}
|
||||||
20% {
|
50% {
|
||||||
transform: rotate(-14deg) scale(1.18);
|
transform: rotate(2deg) scale(1.02);
|
||||||
}
|
|
||||||
40% {
|
|
||||||
transform: rotate(12deg) scale(1.1);
|
|
||||||
}
|
|
||||||
60% {
|
|
||||||
transform: rotate(-8deg) scale(1.14);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -513,24 +508,25 @@
|
|||||||
inset: 0;
|
inset: 0;
|
||||||
display: grid;
|
display: grid;
|
||||||
place-items: center;
|
place-items: center;
|
||||||
font-size: 1.6rem;
|
font-size: 1rem;
|
||||||
letter-spacing: 0.4em;
|
letter-spacing: 0.2em;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
animation: social-burst-up 0.75s ease forwards;
|
opacity: 0.55;
|
||||||
|
animation: social-burst-up 0.55s ease forwards;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes social-burst-up {
|
@keyframes social-burst-up {
|
||||||
from {
|
from {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateY(10px) scale(0.7);
|
transform: translateY(6px) scale(0.9);
|
||||||
}
|
}
|
||||||
35% {
|
40% {
|
||||||
opacity: 1;
|
opacity: 0.55;
|
||||||
}
|
}
|
||||||
to {
|
to {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateY(-36px) scale(1.35);
|
transform: translateY(-18px) scale(1.05);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -746,9 +746,15 @@ html.light .social-flow,
|
|||||||
|
|
||||||
/* Immersive Meetup live room — stay in-app, no new tab */
|
/* Immersive Meetup live room — stay in-app, no new tab */
|
||||||
.social-live-root {
|
.social-live-root {
|
||||||
|
position: relative;
|
||||||
|
z-index: 2;
|
||||||
min-height: 100dvh;
|
min-height: 100dvh;
|
||||||
|
height: 100dvh;
|
||||||
|
max-height: 100dvh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
background: var(--sc-bg, #0a0e17);
|
||||||
}
|
}
|
||||||
|
|
||||||
.social-live-bar {
|
.social-live-bar {
|
||||||
@ -845,14 +851,15 @@ html.light .social-flow,
|
|||||||
}
|
}
|
||||||
|
|
||||||
.social-live-stage {
|
.social-live-stage {
|
||||||
flex: 1;
|
flex: 1 1 auto;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
|
height: 100%;
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 0;
|
gap: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.social-live-stage.layout-split {
|
.social-live-stage.layout-split {
|
||||||
grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
|
grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
.social-live-stage.layout-video,
|
.social-live-stage.layout-video,
|
||||||
@ -863,6 +870,7 @@ html.light .social-flow,
|
|||||||
.social-live-video,
|
.social-live-video,
|
||||||
.social-live-chat {
|
.social-live-chat {
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
|
height: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
border-left: var(--sc-border);
|
border-left: var(--sc-border);
|
||||||
@ -875,16 +883,18 @@ html.light .social-flow,
|
|||||||
|
|
||||||
.social-live-frame-wrap {
|
.social-live-frame-wrap {
|
||||||
position: relative;
|
position: relative;
|
||||||
flex: 1;
|
flex: 1 1 auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
min-height: min(70vh, 720px);
|
min-height: 0;
|
||||||
|
height: 100%;
|
||||||
background: #05070c;
|
background: #05070c;
|
||||||
}
|
}
|
||||||
|
|
||||||
.social-live-iframe {
|
.social-live-iframe {
|
||||||
flex: 1;
|
flex: 1 1 auto;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
min-height: min(70vh, 720px);
|
height: 100%;
|
||||||
|
min-height: 0;
|
||||||
border: 0;
|
border: 0;
|
||||||
background: #000;
|
background: #000;
|
||||||
}
|
}
|
||||||
@ -1004,17 +1014,28 @@ html.light .social-flow,
|
|||||||
@media (max-width: 900px) {
|
@media (max-width: 900px) {
|
||||||
.social-live-stage.layout-split {
|
.social-live-stage.layout-split {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
grid-template-rows: minmax(42vh, 1fr) minmax(38vh, 1fr);
|
grid-template-rows: minmax(48dvh, 1.2fr) minmax(34dvh, 0.9fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
.social-live-chat {
|
.social-live-chat {
|
||||||
border-left: none;
|
border-left: none;
|
||||||
border-top: var(--sc-border);
|
border-top: var(--sc-border);
|
||||||
}
|
}
|
||||||
|
|
||||||
.social-live-iframe {
|
|
||||||
min-height: 42vh;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Live / full-bleed rooms: hide floating FX chrome that steals viewport */
|
||||||
|
.social-experience:has(.social-live-root) .social-fx-control,
|
||||||
|
.social-experience:has(.social-live-root) .social-ambient,
|
||||||
|
.social-experience:has(.social-live-root) .social-pointer-glow,
|
||||||
|
.social-experience:has(.social-workspace-dense) .social-fx-control {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
.social-experience:has(.social-live-root) .social-ambient,
|
||||||
|
.social-experience:has(.social-live-root) .social-pointer-glow {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
.social-experience:has(.social-live-root) .social-constellation {
|
||||||
|
opacity: 0.18;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (max-width: 640px) {
|
@media (max-width: 640px) {
|
||||||
|
|||||||
@ -218,10 +218,14 @@
|
|||||||
}
|
}
|
||||||
.connection-actions {
|
.connection-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 25px;
|
gap: 14px 22px;
|
||||||
margin-top: 30px;
|
margin-top: 30px;
|
||||||
}
|
}
|
||||||
|
.connection-actions .connection-film {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
.social-home .connection-join {
|
.social-home .connection-join {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -585,22 +589,22 @@
|
|||||||
font-size: 8px;
|
font-size: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Three clear doors into the existing product. */
|
/* Entry doors into the product. */
|
||||||
.connection-ways {
|
.connection-ways {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(3, 1fr);
|
grid-template-columns: repeat(4, 1fr);
|
||||||
gap: 14px;
|
gap: 12px;
|
||||||
margin-bottom: 50px;
|
margin-bottom: 40px;
|
||||||
}
|
}
|
||||||
.connection-way {
|
.connection-way {
|
||||||
--way-accent: var(--connection-mint);
|
--way-accent: var(--connection-mint);
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 16px;
|
gap: 12px;
|
||||||
padding: 25px 22px;
|
padding: 18px 16px;
|
||||||
border: 1px solid var(--connection-border);
|
border: 1px solid var(--connection-border);
|
||||||
border-radius: 15px;
|
border-radius: 15px;
|
||||||
background: linear-gradient(
|
background: linear-gradient(
|
||||||
@ -1629,14 +1633,14 @@
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.connection-ways {
|
.connection-ways {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: repeat(2, 1fr);
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
}
|
}
|
||||||
.connection-way {
|
.connection-way {
|
||||||
min-height: 83px;
|
min-height: 72px;
|
||||||
padding: 16px 18px;
|
padding: 14px 14px;
|
||||||
gap: 16px;
|
gap: 12px;
|
||||||
}
|
}
|
||||||
.connection-way-icon {
|
.connection-way-icon {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
|
|||||||
@ -293,6 +293,17 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 12px;
|
gap: 12px;
|
||||||
}
|
}
|
||||||
|
.social-chat-starters {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 8px;
|
||||||
|
justify-content: center;
|
||||||
|
max-width: 420px;
|
||||||
|
}
|
||||||
|
.social-chat-starters .social-btn {
|
||||||
|
font-size: 12px;
|
||||||
|
min-height: 40px;
|
||||||
|
}
|
||||||
.social-composer-emoji {
|
.social-composer-emoji {
|
||||||
display: grid;
|
display: grid;
|
||||||
place-items: center;
|
place-items: center;
|
||||||
@ -1176,3 +1187,356 @@
|
|||||||
animation: none;
|
animation: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 640px) {
|
||||||
|
.social-home .social-date-hero {
|
||||||
|
text-align: left;
|
||||||
|
justify-items: stretch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* —— Date / 约会 swipe deck —— */
|
||||||
|
.social-date-root {
|
||||||
|
background:
|
||||||
|
radial-gradient(ellipse 70% 45% at 50% 0%, rgba(255, 107, 107, 0.16), transparent 60%),
|
||||||
|
var(--sc-bg, #0a0e17);
|
||||||
|
}
|
||||||
|
.social-date-bar {
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
.social-date-bar-tools {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
.social-date-stage {
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 18px;
|
||||||
|
padding: 12px 16px 24px;
|
||||||
|
}
|
||||||
|
.social-date-deck {
|
||||||
|
position: relative;
|
||||||
|
width: min(420px, 100%);
|
||||||
|
height: min(620px, calc(100dvh - 220px));
|
||||||
|
min-height: 420px;
|
||||||
|
}
|
||||||
|
.social-date-card {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
border-radius: 24px;
|
||||||
|
overflow: hidden;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
|
background: #12141c;
|
||||||
|
box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
|
||||||
|
touch-action: none;
|
||||||
|
user-select: none;
|
||||||
|
will-change: transform;
|
||||||
|
}
|
||||||
|
.social-date-card.is-next {
|
||||||
|
transform: scale(0.96) translateY(12px);
|
||||||
|
opacity: 0.75;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
.social-date-card.is-top {
|
||||||
|
cursor: grab;
|
||||||
|
z-index: 2;
|
||||||
|
transition: transform 0.18s ease;
|
||||||
|
}
|
||||||
|
.social-date-card.is-dragging {
|
||||||
|
cursor: grabbing;
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
|
.social-date-card.is-fly-like {
|
||||||
|
animation: social-date-fly-like 0.28s ease-in forwards;
|
||||||
|
}
|
||||||
|
.social-date-card.is-fly-pass {
|
||||||
|
animation: social-date-fly-pass 0.28s ease-in forwards;
|
||||||
|
}
|
||||||
|
@keyframes social-date-fly-like {
|
||||||
|
to {
|
||||||
|
transform: translate3d(130vw, 40px, 0) rotate(28deg);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes social-date-fly-pass {
|
||||||
|
to {
|
||||||
|
transform: translate3d(-130vw, 40px, 0) rotate(-28deg);
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.social-date-photo {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
background-position: center top;
|
||||||
|
background-size: cover;
|
||||||
|
}
|
||||||
|
.social-date-gradient {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
background: linear-gradient(
|
||||||
|
180deg,
|
||||||
|
transparent 38%,
|
||||||
|
rgba(8, 10, 16, 0.55) 62%,
|
||||||
|
rgba(8, 10, 16, 0.92) 100%
|
||||||
|
);
|
||||||
|
}
|
||||||
|
.social-date-meta {
|
||||||
|
position: absolute;
|
||||||
|
inset: auto 0 0;
|
||||||
|
padding: 20px 18px 22px;
|
||||||
|
color: #fff;
|
||||||
|
display: grid;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.social-date-name h2 {
|
||||||
|
margin: 0;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
font-size: clamp(26px, 5vw, 34px);
|
||||||
|
letter-spacing: -0.03em;
|
||||||
|
}
|
||||||
|
.social-date-name h2 > i {
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
border-radius: 999px;
|
||||||
|
background: #22c55e;
|
||||||
|
box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
|
||||||
|
}
|
||||||
|
.social-date-name p,
|
||||||
|
.social-date-city,
|
||||||
|
.social-date-bio,
|
||||||
|
.social-date-want {
|
||||||
|
margin: 0;
|
||||||
|
color: rgba(255, 255, 255, 0.82);
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.55;
|
||||||
|
}
|
||||||
|
.social-date-city {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 5px;
|
||||||
|
color: #4ecdc4;
|
||||||
|
}
|
||||||
|
.social-date-want {
|
||||||
|
color: rgba(255, 230, 109, 0.92);
|
||||||
|
}
|
||||||
|
.social-date-meta .social-tags {
|
||||||
|
margin-top: 2px;
|
||||||
|
}
|
||||||
|
.social-date-meta .social-tags span {
|
||||||
|
background: rgba(255, 255, 255, 0.1);
|
||||||
|
border-color: rgba(255, 255, 255, 0.14);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.social-date-stamp {
|
||||||
|
position: absolute;
|
||||||
|
top: 22px;
|
||||||
|
z-index: 3;
|
||||||
|
padding: 8px 14px;
|
||||||
|
border: 3px solid;
|
||||||
|
border-radius: 12px;
|
||||||
|
font-weight: 850;
|
||||||
|
letter-spacing: 0.08em;
|
||||||
|
font-size: 20px;
|
||||||
|
pointer-events: none;
|
||||||
|
opacity: 0;
|
||||||
|
backdrop-filter: blur(4px);
|
||||||
|
}
|
||||||
|
.social-date-stamp.like {
|
||||||
|
left: 18px;
|
||||||
|
color: #4ade80;
|
||||||
|
border-color: #4ade80;
|
||||||
|
background: rgba(34, 197, 94, 0.12);
|
||||||
|
transform: rotate(-12deg);
|
||||||
|
}
|
||||||
|
.social-date-stamp.pass {
|
||||||
|
right: 18px;
|
||||||
|
color: #ff8f8f;
|
||||||
|
border-color: #ff6b6b;
|
||||||
|
background: rgba(255, 107, 107, 0.12);
|
||||||
|
transform: rotate(12deg);
|
||||||
|
}
|
||||||
|
.social-date-online-pill {
|
||||||
|
position: absolute;
|
||||||
|
top: 18px;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
z-index: 2;
|
||||||
|
padding: 5px 12px;
|
||||||
|
border-radius: 999px;
|
||||||
|
background: rgba(34, 197, 94, 0.92);
|
||||||
|
color: #fff;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 650;
|
||||||
|
letter-spacing: 0.02em;
|
||||||
|
box-shadow: 0 8px 20px rgba(34, 197, 94, 0.35);
|
||||||
|
}
|
||||||
|
.social-date-bio {
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.social-date-want {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
.social-date-actions {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 18px;
|
||||||
|
}
|
||||||
|
.social-date-act {
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
width: 64px;
|
||||||
|
height: 64px;
|
||||||
|
border-radius: 999px;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||||
|
background: rgba(18, 20, 28, 0.92);
|
||||||
|
color: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
transition:
|
||||||
|
transform 0.15s ease,
|
||||||
|
box-shadow 0.15s ease;
|
||||||
|
}
|
||||||
|
.social-date-act:disabled {
|
||||||
|
opacity: 0.35;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
.social-date-act:not(:disabled):hover {
|
||||||
|
transform: translateY(-2px) scale(1.04);
|
||||||
|
}
|
||||||
|
.social-date-act.pass {
|
||||||
|
color: #ff6b6b;
|
||||||
|
box-shadow: 0 10px 28px rgba(255, 107, 107, 0.18);
|
||||||
|
}
|
||||||
|
.social-date-act.like {
|
||||||
|
width: 72px;
|
||||||
|
height: 72px;
|
||||||
|
color: #22c55e;
|
||||||
|
box-shadow: 0 12px 32px rgba(34, 197, 94, 0.22);
|
||||||
|
}
|
||||||
|
.social-date-act.reset {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
color: #ffe66d;
|
||||||
|
}
|
||||||
|
.social-date-empty {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
display: grid;
|
||||||
|
place-content: center;
|
||||||
|
justify-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 24px;
|
||||||
|
border: 1px dashed rgba(255, 255, 255, 0.16);
|
||||||
|
background: rgba(18, 20, 28, 0.7);
|
||||||
|
}
|
||||||
|
.social-date-empty p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 700;
|
||||||
|
}
|
||||||
|
.social-date-likes {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 10px;
|
||||||
|
width: min(420px, 100%);
|
||||||
|
padding: 10px 14px;
|
||||||
|
border-radius: 999px;
|
||||||
|
border: 1px solid rgba(255, 107, 107, 0.28);
|
||||||
|
background: rgba(255, 107, 107, 0.08);
|
||||||
|
font-size: 12px;
|
||||||
|
color: #ffc4c0;
|
||||||
|
cursor: pointer;
|
||||||
|
font: inherit;
|
||||||
|
}
|
||||||
|
.social-date-likes > div {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.social-date-likes > div > * {
|
||||||
|
margin-left: -8px;
|
||||||
|
border: 2px solid #0a0e17;
|
||||||
|
border-radius: 999px;
|
||||||
|
}
|
||||||
|
.social-date-likes > div > *:first-child {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
.social-date-likes > em {
|
||||||
|
margin-left: auto;
|
||||||
|
font-style: normal;
|
||||||
|
color: #4ecdc4;
|
||||||
|
font-weight: 650;
|
||||||
|
}
|
||||||
|
.social-date-match-list {
|
||||||
|
display: grid;
|
||||||
|
gap: 10px;
|
||||||
|
margin-bottom: 14px;
|
||||||
|
}
|
||||||
|
.social-date-match-row {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: auto 1fr auto auto;
|
||||||
|
gap: 10px;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10px 12px;
|
||||||
|
border-radius: 14px;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||||
|
background: rgba(255, 255, 255, 0.04);
|
||||||
|
}
|
||||||
|
.social-date-match-row strong {
|
||||||
|
display: block;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
.social-date-match-row p {
|
||||||
|
margin: 2px 0 0;
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--sc-muted, #9fb0bf);
|
||||||
|
}
|
||||||
|
.social-date-toast {
|
||||||
|
position: fixed;
|
||||||
|
left: 50%;
|
||||||
|
bottom: 28px;
|
||||||
|
z-index: 30;
|
||||||
|
translate: -50% 0;
|
||||||
|
padding: 10px 16px;
|
||||||
|
border-radius: 999px;
|
||||||
|
background: rgba(12, 14, 20, 0.92);
|
||||||
|
border: 1px solid rgba(78, 205, 196, 0.35);
|
||||||
|
color: #fff;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 650;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
@media (max-width: 640px) {
|
||||||
|
.social-date-deck {
|
||||||
|
height: min(560px, calc(100dvh - 240px));
|
||||||
|
min-height: 380px;
|
||||||
|
}
|
||||||
|
.social-date-act {
|
||||||
|
width: 58px;
|
||||||
|
height: 58px;
|
||||||
|
}
|
||||||
|
.social-date-act.like {
|
||||||
|
width: 66px;
|
||||||
|
height: 66px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.social-date-card.is-top,
|
||||||
|
.social-date-card.is-fly-like,
|
||||||
|
.social-date-card.is-fly-pass {
|
||||||
|
transition: none;
|
||||||
|
animation: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -61,8 +61,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.connection-hero .social-emoji-field {
|
.connection-hero .social-emoji-field {
|
||||||
z-index: 1;
|
z-index: 0;
|
||||||
opacity: 1;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.connection-hero-layout {
|
.connection-hero-layout {
|
||||||
@ -71,8 +71,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.social-experience[data-immersive="true"] .social-emoji-float {
|
.social-experience[data-immersive="true"] .social-emoji-float {
|
||||||
opacity: 0.82 !important;
|
opacity: 0.22 !important;
|
||||||
filter: drop-shadow(0 14px 26px rgba(0, 0, 0, 0.45)) !important;
|
filter: none !important;
|
||||||
animation-name: social-emoji-fly !important;
|
animation-name: social-emoji-fly !important;
|
||||||
animation-timing-function: ease-in-out !important;
|
animation-timing-function: ease-in-out !important;
|
||||||
animation-iteration-count: infinite !important;
|
animation-iteration-count: infinite !important;
|
||||||
@ -171,12 +171,12 @@
|
|||||||
animation: social-live-ping 1.35s ease-out infinite !important;
|
animation: social-live-ping 1.35s ease-out infinite !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Undo Codex display:none / animation:none */
|
/* Title emoji: visible but calm (no infinite wiggle) */
|
||||||
.social-experience[data-immersive="true"] .social-home .social-title-emoji {
|
.social-experience[data-immersive="true"] .social-home .social-title-emoji {
|
||||||
display: inline-block !important;
|
display: inline-block !important;
|
||||||
margin-right: 0.3em !important;
|
margin-right: 0.28em !important;
|
||||||
animation: social-emoji-wiggle 1.6s ease-in-out infinite !important;
|
animation: none !important;
|
||||||
transform-origin: 50% 80%;
|
opacity: 0.85 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.social-experience[data-immersive="true"] .social-home .social-btn-pulse {
|
.social-experience[data-immersive="true"] .social-home .social-btn-pulse {
|
||||||
@ -291,7 +291,14 @@
|
|||||||
.social-home
|
.social-home
|
||||||
.connection-cafe
|
.connection-cafe
|
||||||
.social-panel-ico {
|
.social-panel-ico {
|
||||||
animation: social-ico-bounce 1.55s ease-in-out infinite !important;
|
animation: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.social-experience[data-immersive="true"]
|
||||||
|
.social-home
|
||||||
|
.connection-cafe:hover
|
||||||
|
.social-panel-ico {
|
||||||
|
animation: social-ico-bounce 1.55s ease-in-out 1 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.social-experience[data-immersive="true"] .social-chip-pop {
|
.social-experience[data-immersive="true"] .social-chip-pop {
|
||||||
@ -365,6 +372,61 @@
|
|||||||
animation-delay: var(--stagger, 0ms) !important;
|
animation-delay: var(--stagger, 0ms) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Workspace subpages share immersive FX with home */
|
||||||
|
.social-experience[data-immersive="true"] .social-workspace .social-fx-orbs {
|
||||||
|
opacity: 0.58 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.social-experience[data-immersive="true"] .social-workspace .social-fx-orb {
|
||||||
|
animation: social-orb-drift 9s ease-in-out infinite !important;
|
||||||
|
filter: blur(52px) !important;
|
||||||
|
opacity: 0.55 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.social-experience[data-immersive="true"] .social-workspace .social-title-emoji {
|
||||||
|
display: inline-block !important;
|
||||||
|
margin-right: 0.28em;
|
||||||
|
animation: none !important;
|
||||||
|
opacity: 0.85 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.social-experience[data-immersive="true"] .social-workspace .social-btn-pulse {
|
||||||
|
position: relative !important;
|
||||||
|
overflow: visible !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.social-experience[data-immersive="true"] .social-workspace .social-btn-pulse::before,
|
||||||
|
.social-experience[data-immersive="true"] .social-workspace .social-btn-pulse::after {
|
||||||
|
content: "" !important;
|
||||||
|
display: block !important;
|
||||||
|
position: absolute !important;
|
||||||
|
inset: -5px !important;
|
||||||
|
border-radius: inherit !important;
|
||||||
|
border: 2px solid rgba(78, 205, 196, 0.5) !important;
|
||||||
|
pointer-events: none !important;
|
||||||
|
animation: social-btn-ring 1.45s ease-out infinite !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.social-experience[data-immersive="true"] .social-workspace .social-btn-pulse::before {
|
||||||
|
animation-delay: 0.7s !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.social-experience[data-immersive="true"] .social-room-hero-emoji i {
|
||||||
|
animation-name: social-emoji-fly !important;
|
||||||
|
animation-timing-function: ease-in-out !important;
|
||||||
|
animation-iteration-count: infinite !important;
|
||||||
|
opacity: 0.25 !important;
|
||||||
|
filter: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.social-experience[data-immersive="true"] .social-role-art > i {
|
||||||
|
animation: sx-orbit 18s linear infinite !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.social-experience[data-immersive="true"] .social-page-intro .social-emoji-float {
|
||||||
|
opacity: 0.2 !important;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Immersive is an explicit opt-in. It must beat OS prefers-reduced-motion
|
* Immersive is an explicit opt-in. It must beat OS prefers-reduced-motion
|
||||||
* (Windows “显示动画” off, automation browsers, etc.). Light mode still respects reduce.
|
* (Windows “显示动画” off, automation browsers, etc.). Light mode still respects reduce.
|
||||||
@ -381,12 +443,28 @@
|
|||||||
animation-iteration-count: infinite !important;
|
animation-iteration-count: infinite !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.social-experience[data-immersive="true"] .social-home .social-fx-orb {
|
.social-experience[data-immersive="true"] .social-home .social-fx-orb,
|
||||||
|
.social-experience[data-immersive="true"] .social-workspace .social-fx-orb {
|
||||||
animation: social-orb-drift 8s ease-in-out infinite !important;
|
animation: social-orb-drift 8s ease-in-out infinite !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.social-experience[data-immersive="true"] .social-workspace .social-title-emoji {
|
||||||
|
animation: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.social-experience[data-immersive="true"] .social-room-hero-emoji i {
|
||||||
|
animation-name: social-emoji-fly !important;
|
||||||
|
animation-iteration-count: infinite !important;
|
||||||
|
opacity: 0.22 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.social-experience[data-immersive="true"] .social-workspace .social-btn-pulse::before,
|
||||||
|
.social-experience[data-immersive="true"] .social-workspace .social-btn-pulse::after {
|
||||||
|
animation: social-btn-ring 1.45s ease-out infinite !important;
|
||||||
|
}
|
||||||
|
|
||||||
.social-experience[data-immersive="true"] .social-fx-belt-track {
|
.social-experience[data-immersive="true"] .social-fx-belt-track {
|
||||||
animation: social-belt-run 14s linear infinite !important;
|
animation: social-belt-run 48s linear infinite !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.social-experience[data-immersive="true"] .connection-signal i {
|
.social-experience[data-immersive="true"] .connection-signal i {
|
||||||
@ -417,7 +495,7 @@
|
|||||||
|
|
||||||
.social-experience[data-immersive="true"] .social-home .social-title-emoji {
|
.social-experience[data-immersive="true"] .social-home .social-title-emoji {
|
||||||
display: inline-block !important;
|
display: inline-block !important;
|
||||||
animation: social-emoji-wiggle 1.6s ease-in-out infinite !important;
|
animation: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.social-experience[data-immersive="true"] .social-home .social-btn-pulse::before,
|
.social-experience[data-immersive="true"] .social-home .social-btn-pulse::before,
|
||||||
|
|||||||
@ -150,6 +150,50 @@
|
|||||||
}
|
}
|
||||||
.social-role-card {
|
.social-role-card {
|
||||||
gap: 15px;
|
gap: 15px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.social-role-art {
|
||||||
|
position: relative;
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
min-height: 88px;
|
||||||
|
margin: -4px -4px 4px;
|
||||||
|
border-radius: 14px;
|
||||||
|
background:
|
||||||
|
radial-gradient(circle at 20% 30%, #4ecdc433, transparent 55%),
|
||||||
|
radial-gradient(circle at 80% 70%, #ff6b6b28, transparent 50%),
|
||||||
|
linear-gradient(135deg, #4ecdc40f, #ffe66d0a);
|
||||||
|
color: var(--sx-mint);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.social-role-art > span {
|
||||||
|
position: absolute;
|
||||||
|
left: 14px;
|
||||||
|
top: 10px;
|
||||||
|
font-family: var(--font-display, inherit);
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 650;
|
||||||
|
letter-spacing: -0.06em;
|
||||||
|
opacity: 0.22;
|
||||||
|
}
|
||||||
|
.social-role-art > i {
|
||||||
|
position: absolute;
|
||||||
|
width: 120px;
|
||||||
|
height: 120px;
|
||||||
|
border: 1px solid #4ecdc433;
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: sx-orbit 22s linear infinite;
|
||||||
|
}
|
||||||
|
.social-role-art > i:nth-of-type(2) {
|
||||||
|
width: 70px;
|
||||||
|
height: 70px;
|
||||||
|
border-color: #ff6b6b33;
|
||||||
|
animation-direction: reverse;
|
||||||
|
animation-duration: 16s;
|
||||||
|
}
|
||||||
|
.social-role-art > svg {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
}
|
}
|
||||||
.social-role-symbol {
|
.social-role-symbol {
|
||||||
display: grid;
|
display: grid;
|
||||||
|
|||||||
1249
src/modules/social/app/vivid.css
Normal file
1249
src/modules/social/app/vivid.css
Normal file
File diff suppressed because it is too large
Load Diff
@ -8,8 +8,14 @@ import {
|
|||||||
useState,
|
useState,
|
||||||
useSyncExternalStore,
|
useSyncExternalStore,
|
||||||
} from "react";
|
} from "react";
|
||||||
import { MOCK_ROSTER, type SocialRosterMember } from "@social/lib/rosterMock";
|
import Link from "next/link";
|
||||||
|
import type { SocialRosterMember } from "@social/lib/rosterMock";
|
||||||
|
import {
|
||||||
|
SELF_MEMBER_ID,
|
||||||
|
useDiscoveryRoster,
|
||||||
|
} from "@social/lib/discoveryRoster";
|
||||||
import { loadJson, saveJson } from "@social/lib/storage";
|
import { loadJson, saveJson } from "@social/lib/storage";
|
||||||
|
import { socialPath } from "@social/lib/socialPath";
|
||||||
import SocialAvatar from "./SocialAvatar";
|
import SocialAvatar from "./SocialAvatar";
|
||||||
import SectionSpark from "./SectionSpark";
|
import SectionSpark from "./SectionSpark";
|
||||||
|
|
||||||
@ -44,6 +50,7 @@ const FILTERS = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export default function AttractiveRoster({ onJoin }: { onJoin: () => void }) {
|
export default function AttractiveRoster({ onJoin }: { onJoin: () => void }) {
|
||||||
|
const roster = useDiscoveryRoster();
|
||||||
const likesSnapshot = useSyncExternalStore(
|
const likesSnapshot = useSyncExternalStore(
|
||||||
subscribeLikes,
|
subscribeLikes,
|
||||||
getLikesSnapshot,
|
getLikesSnapshot,
|
||||||
@ -54,7 +61,7 @@ export default function AttractiveRoster({ onJoin }: { onJoin: () => void }) {
|
|||||||
[likesSnapshot],
|
[likesSnapshot],
|
||||||
);
|
);
|
||||||
const [filter, setFilter] = useState<"all" | "online" | "f" | "m">("all");
|
const [filter, setFilter] = useState<"all" | "online" | "f" | "m">("all");
|
||||||
const [activeId, setActiveId] = useState<string | null>(null);
|
const [highlightId, setHighlightId] = useState<string | null>(null);
|
||||||
const [burst, setBurst] = useState(false);
|
const [burst, setBurst] = useState(false);
|
||||||
const burstTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
const burstTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||||
const filterId = useId();
|
const filterId = useId();
|
||||||
@ -64,16 +71,16 @@ export default function AttractiveRoster({ onJoin }: { onJoin: () => void }) {
|
|||||||
const id: unknown = (event as CustomEvent).detail;
|
const id: unknown = (event as CustomEvent).detail;
|
||||||
if (
|
if (
|
||||||
typeof id !== "string" ||
|
typeof id !== "string" ||
|
||||||
!MOCK_ROSTER.some((member) => member.id === id)
|
!roster.some((member) => member.id === id)
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
setFilter("all");
|
setFilter("all");
|
||||||
setActiveId(id);
|
setHighlightId(id);
|
||||||
};
|
};
|
||||||
window.addEventListener("nomadro-social-select-member", selectMember);
|
window.addEventListener("nomadro-social-select-member", selectMember);
|
||||||
return () =>
|
return () =>
|
||||||
window.removeEventListener("nomadro-social-select-member", selectMember);
|
window.removeEventListener("nomadro-social-select-member", selectMember);
|
||||||
}, []);
|
}, [roster]);
|
||||||
|
|
||||||
useEffect(
|
useEffect(
|
||||||
() => () => {
|
() => () => {
|
||||||
@ -83,20 +90,25 @@ export default function AttractiveRoster({ onJoin }: { onJoin: () => void }) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const list = useMemo(() => {
|
const list = useMemo(() => {
|
||||||
return MOCK_ROSTER.filter((m) => {
|
return roster.filter((m) => {
|
||||||
if (filter === "online") return m.online;
|
if (filter === "online") return m.online;
|
||||||
if (filter === "f" || filter === "m") return m.gender === filter;
|
if (filter === "f" || filter === "m") return m.gender === filter;
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}, [filter]);
|
}, [filter, roster]);
|
||||||
|
|
||||||
const online = useMemo(() => MOCK_ROSTER.filter((m) => m.online), []);
|
const online = useMemo(() => roster.filter((m) => m.online), [roster]);
|
||||||
const active = list.find((m) => m.id === activeId) || null;
|
|
||||||
|
|
||||||
const toggleLike = (m: SocialRosterMember) => {
|
const toggleLike = (
|
||||||
|
event: { preventDefault(): void; stopPropagation(): void },
|
||||||
|
m: SocialRosterMember,
|
||||||
|
) => {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
saveJson(LIKE_KEY, { ...likes, [m.id]: !likes[m.id] });
|
saveJson(LIKE_KEY, { ...likes, [m.id]: !likes[m.id] });
|
||||||
window.dispatchEvent(new Event(LIKES_CHANGED));
|
window.dispatchEvent(new Event(LIKES_CHANGED));
|
||||||
setBurst(true);
|
setBurst(true);
|
||||||
|
setHighlightId(m.id);
|
||||||
if (burstTimer.current) clearTimeout(burstTimer.current);
|
if (burstTimer.current) clearTimeout(burstTimer.current);
|
||||||
burstTimer.current = setTimeout(() => setBurst(false), 700);
|
burstTimer.current = setTimeout(() => setBurst(false), 700);
|
||||||
};
|
};
|
||||||
@ -111,16 +123,22 @@ export default function AttractiveRoster({ onJoin }: { onJoin: () => void }) {
|
|||||||
<div className="section-header reveal">
|
<div className="section-header reveal">
|
||||||
<SectionSpark label="people" />
|
<SectionSpark label="people" />
|
||||||
<span className="section-tag">
|
<span className="section-tag">
|
||||||
<span>01 / FIND YOUR PEOPLE</span>
|
<span>看看谁在这儿</span>
|
||||||
<span>有相似的热爱,也有不同的精彩</span>
|
<span>点开认识</span>
|
||||||
</span>
|
</span>
|
||||||
<h2>
|
<h2>
|
||||||
<span className="social-title-emoji" aria-hidden>
|
<span className="social-title-emoji" aria-hidden>
|
||||||
👋
|
👋
|
||||||
</span>
|
</span>
|
||||||
这些人,也许你会想见
|
想见的人
|
||||||
</h2>
|
</h2>
|
||||||
<p>从好奇一个人的生活开始,让下一次相遇自然发生。</p>
|
<p>
|
||||||
|
点开卡片,看看对方在做什么、想认识谁。
|
||||||
|
现在是示例介绍,方便你先逛逛
|
||||||
|
{roster.some((m) => m.id === SELF_MEMBER_ID)
|
||||||
|
? "(也包含你写好的介绍)"
|
||||||
|
: ""}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="social-people-bar reveal">
|
<div className="social-people-bar reveal">
|
||||||
@ -131,15 +149,15 @@ export default function AttractiveRoster({ onJoin }: { onJoin: () => void }) {
|
|||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
<strong className="social-count-pulse">{online.length}</strong>{" "}
|
<strong className="social-count-pulse">{online.length}</strong>{" "}
|
||||||
位演示在线
|
位现在在线
|
||||||
<span> · 非实时统计</span>
|
<span> · 示例数据</span>
|
||||||
</p>
|
</p>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-primary btn-sm social-btn-pulse"
|
className="btn btn-primary btn-sm social-btn-pulse"
|
||||||
onClick={onJoin}
|
onClick={onJoin}
|
||||||
>
|
>
|
||||||
加群认识
|
加入社区认识
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -160,7 +178,7 @@ export default function AttractiveRoster({ onJoin }: { onJoin: () => void }) {
|
|||||||
className={`social-people-filter${filter === f.id ? " active" : ""}`}
|
className={`social-people-filter${filter === f.id ? " active" : ""}`}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setFilter(f.id);
|
setFilter(f.id);
|
||||||
setActiveId(null);
|
setHighlightId(null);
|
||||||
}}
|
}}
|
||||||
onKeyDown={(event) => {
|
onKeyDown={(event) => {
|
||||||
const key = event.key;
|
const key = event.key;
|
||||||
@ -178,7 +196,7 @@ export default function AttractiveRoster({ onJoin }: { onJoin: () => void }) {
|
|||||||
FILTERS.length;
|
FILTERS.length;
|
||||||
const next = FILTERS[nextIndex];
|
const next = FILTERS[nextIndex];
|
||||||
setFilter(next.id);
|
setFilter(next.id);
|
||||||
setActiveId(null);
|
setHighlightId(null);
|
||||||
document.getElementById(`${filterId}-${next.id}`)?.focus();
|
document.getElementById(`${filterId}-${next.id}`)?.focus();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -194,13 +212,12 @@ export default function AttractiveRoster({ onJoin }: { onJoin: () => void }) {
|
|||||||
aria-labelledby={`${filterId}-${filter}`}
|
aria-labelledby={`${filterId}-${filter}`}
|
||||||
>
|
>
|
||||||
{list.map((m, i) => (
|
{list.map((m, i) => (
|
||||||
<button
|
<Link
|
||||||
key={m.id}
|
key={m.id}
|
||||||
type="button"
|
href={socialPath(`/people/${m.id}`)}
|
||||||
className={`social-people-chip social-chip-pop${m.online ? " is-online" : ""}${likes[m.id] ? " is-liked" : ""}${activeId === m.id ? " is-active" : ""}`}
|
className={`social-people-chip social-chip-pop is-rich${m.online ? " is-online" : ""}${likes[m.id] ? " is-liked" : ""}${highlightId === m.id ? " is-active" : ""}`}
|
||||||
style={{ ["--stagger" as string]: `${Math.min(i, 12) * 40}ms` }}
|
style={{ ["--stagger" as string]: `${Math.min(i, 12) * 40}ms` }}
|
||||||
onClick={() => setActiveId(activeId === m.id ? null : m.id)}
|
onClick={() => setHighlightId(m.id)}
|
||||||
aria-pressed={activeId === m.id}
|
|
||||||
>
|
>
|
||||||
<span className="social-people-chip-ava">
|
<span className="social-people-chip-ava">
|
||||||
<SocialAvatar src={m.avatar} size={52} lazy />
|
<SocialAvatar src={m.avatar} size={52} lazy />
|
||||||
@ -211,69 +228,54 @@ export default function AttractiveRoster({ onJoin }: { onJoin: () => void }) {
|
|||||||
</em>
|
</em>
|
||||||
) : null}
|
) : null}
|
||||||
</span>
|
</span>
|
||||||
<strong>{m.name}</strong>
|
<strong>
|
||||||
<span className="connection-member-role">{m.title}</span>
|
{m.name}
|
||||||
<em>{m.city.split("·")[0].trim()}</em>
|
{m.id === SELF_MEMBER_ID ? " · 我" : ""}
|
||||||
</button>
|
</strong>
|
||||||
|
<span className="connection-member-role">
|
||||||
|
{m.title}
|
||||||
|
{m.vibe ? ` · ${m.vibe.split("·")[0].trim()}` : ""}
|
||||||
|
</span>
|
||||||
|
<em>
|
||||||
|
{m.city.split("·")[0].trim()}
|
||||||
|
{m.tags[0] ? ` · ${m.tags[0]}` : ""}
|
||||||
|
</em>
|
||||||
|
<span className="social-people-chip-want" title={m.lookingFor}>
|
||||||
|
{m.lookingFor}
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
role="button"
|
||||||
|
tabIndex={0}
|
||||||
|
className="social-people-chip-like"
|
||||||
|
aria-label={likes[m.id] ? "取消关注" : "关注"}
|
||||||
|
onClick={(e) => toggleLike(e, m)}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === "Enter" || e.key === " ") toggleLike(e, m);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{likes[m.id] ? "♥" : "♡"}
|
||||||
|
</span>
|
||||||
|
</Link>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{active ? (
|
|
||||||
<div
|
|
||||||
className={`social-people-detail social-detail-in reveal visible${burst ? " is-burst" : ""}`}
|
|
||||||
role="status"
|
|
||||||
>
|
|
||||||
{burst ? (
|
{burst ? (
|
||||||
<span className="social-burst" aria-hidden>
|
<span className="social-burst social-burst-float" aria-hidden>
|
||||||
✨💫💖
|
♥
|
||||||
</span>
|
</span>
|
||||||
) : null}
|
) : null}
|
||||||
<SocialAvatar src={active.avatar} size={44} />
|
|
||||||
<div>
|
<p className="social-people-hint">👆 点卡片看看详情,也可以先点爱心关注</p>
|
||||||
<strong>
|
|
||||||
{active.name}
|
|
||||||
<span>
|
|
||||||
{active.title} · {active.city}
|
|
||||||
{active.online ? " · 在线" : ""}
|
|
||||||
</span>
|
|
||||||
</strong>
|
|
||||||
<p>{active.lookingFor}</p>
|
|
||||||
<div className="social-people-detail-tags">
|
|
||||||
{active.tags.slice(0, 3).map((t) => (
|
|
||||||
<span key={t}>{t}</span>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="social-people-detail-acts">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="btn btn-ghost btn-sm"
|
|
||||||
onClick={() => toggleLike(active)}
|
|
||||||
>
|
|
||||||
{likes[active.id] ? "♥ 已关注" : "♡ 关注"}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="btn btn-primary btn-sm social-btn-pulse"
|
|
||||||
onClick={onJoin}
|
|
||||||
>
|
|
||||||
打招呼 👋
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<p className="social-people-hint">
|
|
||||||
👆 点选一位,看 TA 想认识什么样的人
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<div className="social-section-actions reveal">
|
<div className="social-section-actions reveal">
|
||||||
<button
|
<Link href={socialPath("/people")} className="btn btn-primary">
|
||||||
type="button"
|
看看更多人
|
||||||
className="btn btn-primary social-btn-pulse"
|
</Link>
|
||||||
onClick={onJoin}
|
<Link href={socialPath("/date")} className="btn btn-ghost">
|
||||||
>
|
去左右滑认识
|
||||||
加群,认识他们 ✨
|
</Link>
|
||||||
|
<button type="button" className="btn btn-ghost" onClick={onJoin}>
|
||||||
|
加入社区
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import {
|
|||||||
type FormEvent,
|
type FormEvent,
|
||||||
} from "react";
|
} from "react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
import { useSearchParams } from "next/navigation";
|
||||||
import {
|
import {
|
||||||
ArrowUpRight,
|
ArrowUpRight,
|
||||||
Coffee,
|
Coffee,
|
||||||
@ -20,18 +21,22 @@ import {
|
|||||||
Wifi,
|
Wifi,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import SiteShell from "./SiteShell";
|
import SiteShell from "./SiteShell";
|
||||||
|
import CityDirectory from "./CityDirectory";
|
||||||
import {
|
import {
|
||||||
BookmarkButton,
|
BookmarkButton,
|
||||||
|
DemoBadge,
|
||||||
EmptyState,
|
EmptyState,
|
||||||
PageIntro,
|
PageIntro,
|
||||||
SearchField,
|
SearchField,
|
||||||
ShareButton,
|
ShareButton,
|
||||||
} from "./SocialUI";
|
} from "./SocialUI";
|
||||||
import { SEED_CAFES } from "@social/lib/seed";
|
|
||||||
import { socialApi } from "@social/lib/api";
|
import { socialApi } from "@social/lib/api";
|
||||||
import { useLocalState } from "@social/lib/useLocalState";
|
import { useLocalState } from "@social/lib/useLocalState";
|
||||||
import { uid } from "@social/lib/storage";
|
import { uid } from "@social/lib/storage";
|
||||||
|
import { resolveSocialCatalog } from "@social/lib/resolveCatalog";
|
||||||
|
import { socialPath } from "@social/lib/socialPath";
|
||||||
import type { SocialCafe, SocialCafeReview } from "@social/lib/types";
|
import type { SocialCafe, SocialCafeReview } from "@social/lib/types";
|
||||||
|
import { useSocialConfig } from "./SocialExperience";
|
||||||
|
|
||||||
type Review = SocialCafeReview & { local?: boolean };
|
type Review = SocialCafeReview & { local?: boolean };
|
||||||
|
|
||||||
@ -52,6 +57,7 @@ function CafeDetail({ cafe, id }: { cafe: SocialCafe; id: string }) {
|
|||||||
const [author, setAuthor] = useLocalState("nick", "游民");
|
const [author, setAuthor] = useLocalState("nick", "游民");
|
||||||
const [score, setScore] = useState(5);
|
const [score, setScore] = useState(5);
|
||||||
const [text, setText] = useState("");
|
const [text, setText] = useState("");
|
||||||
|
const [photoNote, setPhotoNote] = useState("");
|
||||||
const [status, setStatus] = useState("");
|
const [status, setStatus] = useState("");
|
||||||
const [busy, setBusy] = useState(false);
|
const [busy, setBusy] = useState(false);
|
||||||
const lock = useRef(false);
|
const lock = useRef(false);
|
||||||
@ -71,7 +77,7 @@ function CafeDetail({ cafe, id }: { cafe: SocialCafe; id: string }) {
|
|||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
if (active)
|
if (active)
|
||||||
setStatus("当前离线:本机评价尚未送达社区,可联网后手动重试。");
|
setStatus("网络不太好:评价先留在你这边了,有网后再点「再发一次」。");
|
||||||
});
|
});
|
||||||
return () => {
|
return () => {
|
||||||
active = false;
|
active = false;
|
||||||
@ -80,8 +86,18 @@ function CafeDetail({ cafe, id }: { cafe: SocialCafe; id: string }) {
|
|||||||
const submit = async (event?: FormEvent, retry?: Review) => {
|
const submit = async (event?: FormEvent, retry?: Review) => {
|
||||||
event?.preventDefault();
|
event?.preventDefault();
|
||||||
const payload = retry
|
const payload = retry
|
||||||
? { author: retry.author, score: retry.score, text: retry.text }
|
? {
|
||||||
: { author: author.trim() || "游民", score, text: text.trim() };
|
author: retry.author,
|
||||||
|
score: retry.score,
|
||||||
|
text: retry.text,
|
||||||
|
photoNote: retry.photoNote,
|
||||||
|
}
|
||||||
|
: {
|
||||||
|
author: author.trim() || "游民",
|
||||||
|
score,
|
||||||
|
text: text.trim(),
|
||||||
|
photoNote: photoNote.trim() || undefined,
|
||||||
|
};
|
||||||
if (!payload.text || lock.current) return;
|
if (!payload.text || lock.current) return;
|
||||||
lock.current = true;
|
lock.current = true;
|
||||||
setBusy(true);
|
setBusy(true);
|
||||||
@ -102,8 +118,11 @@ function CafeDetail({ cafe, id }: { cafe: SocialCafe; id: string }) {
|
|||||||
.catch(() =>
|
.catch(() =>
|
||||||
setStatus("评价已发布;列表暂未刷新,请稍后重新打开查看。"),
|
setStatus("评价已发布;列表暂未刷新,请稍后重新打开查看。"),
|
||||||
);
|
);
|
||||||
setStatus("评价已发布,谢谢你分享真实体验。");
|
setStatus("评价已发布");
|
||||||
if (!retry && textRef.current.trim() === payload.text) setText("");
|
if (!retry && textRef.current.trim() === payload.text) {
|
||||||
|
setText("");
|
||||||
|
setPhotoNote("");
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
if (!retry)
|
if (!retry)
|
||||||
setReviews((current) => [
|
setReviews((current) => [
|
||||||
@ -116,20 +135,27 @@ function CafeDetail({ cafe, id }: { cafe: SocialCafe; id: string }) {
|
|||||||
},
|
},
|
||||||
...current,
|
...current,
|
||||||
]);
|
]);
|
||||||
setStatus("已保存到本机,尚未发布。联网后可点击评价下方的「重试发布」。");
|
setStatus("先留在你这边了。有网后点评价下面的「再发一次」就行。");
|
||||||
if (!retry && textRef.current.trim() === payload.text) setText("");
|
if (!retry && textRef.current.trim() === payload.text) {
|
||||||
|
setText("");
|
||||||
|
setPhotoNote("");
|
||||||
|
}
|
||||||
} finally {
|
} finally {
|
||||||
lock.current = false;
|
lock.current = false;
|
||||||
setBusy(false);
|
setBusy(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const invitation = `有朋友想在${cafe.city}的 ${cafe.name} 喝杯咖啡聊聊吗?想交流远程工作和最近的生活。`;
|
const invitation = `有人约在 ${cafe.city} · ${cafe.name} 喝咖啡,一起聊聊远程生活?`;
|
||||||
return (
|
return (
|
||||||
<section className="social-panel social-cafe-detail" id={id}>
|
<section className="social-panel social-cafe-detail" id={id}>
|
||||||
|
<div className="social-cafe-detail-hero" aria-hidden>
|
||||||
|
<Coffee size={42} strokeWidth={1.2} />
|
||||||
|
<span>{cafe.city}</span>
|
||||||
|
</div>
|
||||||
<div className="social-section-label">
|
<div className="social-section-label">
|
||||||
<span>THE NEXT COFFEE COULD CHANGE EVERYTHING</span>
|
<span>详情</span>
|
||||||
<ShareButton
|
<ShareButton
|
||||||
path={`/social/coffeechat#${cafe.id}`}
|
path={socialPath(`/coffeechat#${cafe.id}`)}
|
||||||
title={`${cafe.city} · ${cafe.name}`}
|
title={`${cafe.city} · ${cafe.name}`}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@ -148,28 +174,31 @@ function CafeDetail({ cafe, id }: { cafe: SocialCafe; id: string }) {
|
|||||||
</span>
|
</span>
|
||||||
<span>
|
<span>
|
||||||
<Star size={15} />
|
<Star size={15} />
|
||||||
目录评分 {cafe.rating}
|
{cafe.rating}
|
||||||
</span>
|
</span>
|
||||||
|
<span>{cafe.partners ? "推荐见面点" : "社区收录"}</span>
|
||||||
</div>
|
</div>
|
||||||
<Link
|
<Link
|
||||||
className="social-btn primary"
|
className="social-btn coral"
|
||||||
href={`/social/chat/coffee?intro=${encodeURIComponent(invitation)}`}
|
href={socialPath(
|
||||||
|
`/chat?intro=${encodeURIComponent(invitation)}`,
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<MessageCircle size={15} />
|
<MessageCircle size={15} />
|
||||||
发起公开 Coffeechat 邀约 <ArrowUpRight size={15} />
|
去聊天室约人 <ArrowUpRight size={15} />
|
||||||
</Link>
|
</Link>
|
||||||
<p className="social-muted social-cafe-invite-note">
|
<p className="social-muted social-cafe-invite-note">
|
||||||
先在公开频道交流时间与人数,确认后再安排见面。
|
先在聊天室约好时间,再出来见面。评分供参考,你也可以留下自己的体验。
|
||||||
</p>
|
</p>
|
||||||
<div className="social-review-layout">
|
<div className="social-review-layout">
|
||||||
<div>
|
<div>
|
||||||
<h3>真实体验,让下一次约见更轻松。</h3>
|
<h3>写评价</h3>
|
||||||
<form
|
<form
|
||||||
className="social-form"
|
className="social-form"
|
||||||
onSubmit={(event) => void submit(event)}
|
onSubmit={(event) => void submit(event)}
|
||||||
>
|
>
|
||||||
<label>
|
<label>
|
||||||
你的名字
|
名字
|
||||||
<input
|
<input
|
||||||
value={author}
|
value={author}
|
||||||
onChange={(event) => setAuthor(event.target.value)}
|
onChange={(event) => setAuthor(event.target.value)}
|
||||||
@ -178,7 +207,7 @@ function CafeDetail({ cafe, id }: { cafe: SocialCafe; id: string }) {
|
|||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
<fieldset className="social-star-rating">
|
<fieldset className="social-star-rating">
|
||||||
<legend>你的评分</legend>
|
<legend>评分</legend>
|
||||||
{[1, 2, 3, 4, 5].map((value) => (
|
{[1, 2, 3, 4, 5].map((value) => (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@ -196,14 +225,23 @@ function CafeDetail({ cafe, id }: { cafe: SocialCafe; id: string }) {
|
|||||||
))}
|
))}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<label>
|
<label>
|
||||||
分享一次真实体验
|
体验
|
||||||
<textarea
|
<textarea
|
||||||
required
|
required
|
||||||
rows={4}
|
rows={4}
|
||||||
maxLength={1000}
|
maxLength={1000}
|
||||||
value={text}
|
value={text}
|
||||||
onChange={(event) => setText(event.target.value)}
|
onChange={(event) => setText(event.target.value)}
|
||||||
placeholder="网络稳定吗?插座够不够?适合安静工作还是深聊?"
|
placeholder="网速 / 插座 / 适合工作还是聊天"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
<label>
|
||||||
|
合照备注(选填)
|
||||||
|
<input
|
||||||
|
maxLength={200}
|
||||||
|
value={photoNote}
|
||||||
|
onChange={(event) => setPhotoNote(event.target.value)}
|
||||||
|
placeholder="例如:二楼靠窗合影位很好拍"
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
<button
|
<button
|
||||||
@ -211,19 +249,18 @@ function CafeDetail({ cafe, id }: { cafe: SocialCafe; id: string }) {
|
|||||||
className="social-btn"
|
className="social-btn"
|
||||||
disabled={busy || !text.trim()}
|
disabled={busy || !text.trim()}
|
||||||
>
|
>
|
||||||
{busy ? "正在提交…" : "发布评价"}
|
{busy ? "提交中…" : "发布"}
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div className="social-section-label">
|
<div className="social-section-label">
|
||||||
社区评价 <span>{reviews.length} 条(含本机未发布)</span>
|
评价 <span>{reviews.length}</span>
|
||||||
</div>
|
</div>
|
||||||
{!reviews.length ? (
|
{!reviews.length ? (
|
||||||
<EmptyState
|
<EmptyState title="还没有评价" description="写一条帮后来的人。">
|
||||||
title="第一条真实评价,从你开始"
|
<span className="social-muted">也可以先写在你这边</span>
|
||||||
description="你的一个小建议,可能帮下一位游民找到熟悉感。"
|
</EmptyState>
|
||||||
/>
|
|
||||||
) : (
|
) : (
|
||||||
<div className="social-review-list">
|
<div className="social-review-list">
|
||||||
{reviews.map((review) => (
|
{reviews.map((review) => (
|
||||||
@ -235,6 +272,9 @@ function CafeDetail({ cafe, id }: { cafe: SocialCafe; id: string }) {
|
|||||||
</span>
|
</span>
|
||||||
</header>
|
</header>
|
||||||
<p>{review.text}</p>
|
<p>{review.text}</p>
|
||||||
|
{review.photoNote ? (
|
||||||
|
<p className="social-muted">合照:{review.photoNote}</p>
|
||||||
|
) : null}
|
||||||
<small suppressHydrationWarning>
|
<small suppressHydrationWarning>
|
||||||
{new Date(review.at).toLocaleDateString()}
|
{new Date(review.at).toLocaleDateString()}
|
||||||
</small>
|
</small>
|
||||||
@ -244,7 +284,7 @@ function CafeDetail({ cafe, id }: { cafe: SocialCafe; id: string }) {
|
|||||||
disabled={busy}
|
disabled={busy}
|
||||||
onClick={() => void submit(undefined, review)}
|
onClick={() => void submit(undefined, review)}
|
||||||
>
|
>
|
||||||
仅本机 · 重试发布
|
还没发出 · 再发一次
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</article>
|
</article>
|
||||||
@ -255,7 +295,7 @@ function CafeDetail({ cafe, id }: { cafe: SocialCafe; id: string }) {
|
|||||||
</div>
|
</div>
|
||||||
{status && (
|
{status && (
|
||||||
<p
|
<p
|
||||||
className={`social-status${status.includes("本机") ? " warn" : ""}`}
|
className={`social-status${status.includes("你这边") || status.includes("网络不太好") ? " warn" : ""}`}
|
||||||
role="status"
|
role="status"
|
||||||
>
|
>
|
||||||
{status}
|
{status}
|
||||||
@ -266,50 +306,81 @@ function CafeDetail({ cafe, id }: { cafe: SocialCafe; id: string }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function CafeDirectory() {
|
export default function CafeDirectory() {
|
||||||
const [query, setQuery] = useState("");
|
const config = useSocialConfig();
|
||||||
const [city, setCity] = useState("all");
|
const searchParams = useSearchParams();
|
||||||
|
const catalog = useMemo(
|
||||||
|
() => resolveSocialCatalog(config.copy.socialCatalogs),
|
||||||
|
[config.copy.socialCatalogs],
|
||||||
|
);
|
||||||
|
const seedCafes = catalog.cafes;
|
||||||
|
const cityParam = (searchParams.get("city") || "").trim();
|
||||||
|
const initialCity = useMemo(() => {
|
||||||
|
if (!cityParam) return "all";
|
||||||
|
const exact = seedCafes.find((c) => c.city === cityParam)?.city;
|
||||||
|
if (exact) return exact;
|
||||||
|
const fuzzy = seedCafes.find((c) =>
|
||||||
|
c.city.includes(cityParam) || cityParam.includes(c.city),
|
||||||
|
)?.city;
|
||||||
|
return fuzzy || "all";
|
||||||
|
}, [cityParam, seedCafes]);
|
||||||
|
const [query, setQuery] = useState(cityParam && initialCity === "all" ? cityParam : "");
|
||||||
|
const [city, setCity] = useState(initialCity);
|
||||||
const [sort, setSort] = useState("recommended");
|
const [sort, setSort] = useState("recommended");
|
||||||
|
useEffect(() => {
|
||||||
|
setCity(initialCity);
|
||||||
|
if (cityParam && initialCity === "all") setQuery(cityParam);
|
||||||
|
}, [initialCity, cityParam]);
|
||||||
const selected =
|
const selected =
|
||||||
useSyncExternalStore(
|
useSyncExternalStore(
|
||||||
subscribeHash,
|
subscribeHash,
|
||||||
() => location.hash.slice(1),
|
() => location.hash.slice(1),
|
||||||
() => "",
|
() => "",
|
||||||
) || SEED_CAFES[0].id;
|
) || seedCafes[0]?.id || "";
|
||||||
const [saved] = useLocalState<string[]>("saved-cafes", []);
|
const [saved] = useLocalState<string[]>("saved-cafes", []);
|
||||||
const id = useId();
|
const id = useId();
|
||||||
const cafes = useMemo(
|
const cafes = useMemo(
|
||||||
() =>
|
() =>
|
||||||
SEED_CAFES.filter(
|
seedCafes
|
||||||
|
.filter(
|
||||||
(cafe) =>
|
(cafe) =>
|
||||||
(city === "all" || cafe.city === city) &&
|
(city === "all" || cafe.city === city) &&
|
||||||
(sort !== "saved" || saved.includes(cafe.id)) &&
|
(sort !== "saved" || saved.includes(cafe.id)) &&
|
||||||
`${cafe.name} ${cafe.city} ${cafe.vibe}`
|
`${cafe.name} ${cafe.city} ${cafe.vibe}`
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(query.toLowerCase()),
|
.includes(query.toLowerCase()),
|
||||||
).sort((a, b) =>
|
)
|
||||||
|
.sort((a, b) =>
|
||||||
sort === "wifi"
|
sort === "wifi"
|
||||||
? b.wifiMbps - a.wifiMbps
|
? b.wifiMbps - a.wifiMbps
|
||||||
: sort === "rating"
|
: sort === "rating"
|
||||||
? b.rating - a.rating
|
? b.rating - a.rating
|
||||||
: 0,
|
: 0,
|
||||||
),
|
),
|
||||||
[query, city, sort, saved],
|
[query, city, sort, saved, seedCafes],
|
||||||
);
|
);
|
||||||
const active = cafes.find((cafe) => cafe.id === selected) || cafes[0];
|
const active = cafes.find((cafe) => cafe.id === selected) || cafes[0];
|
||||||
return (
|
return (
|
||||||
<SiteShell title="Coffeechat">
|
<SiteShell title="见一面">
|
||||||
<PageIntro
|
<PageIntro title="同城,见一面" accent="城市与咖啡馆">
|
||||||
eyebrow="GOOD COFFEE. BETTER COMPANY."
|
<DemoBadge>
|
||||||
title="先约一杯咖啡,"
|
{catalog.source === "remote" ? "最新地点" : "先看看这些地方"}
|
||||||
accent="再把网友变成朋友。"
|
</DemoBadge>
|
||||||
description="找一个有插座、有好咖啡,也容得下好对话的地方。按城市找店,把下一次见面安排得更轻松。"
|
</PageIntro>
|
||||||
/>
|
<p className="social-muted reveal" style={{ marginBottom: 16 }}>
|
||||||
<div className="social-toolbar">
|
先选城市,找到同城的人,再挑一家咖啡馆出来坐坐。
|
||||||
|
</p>
|
||||||
|
<div className="social-cafe-cities reveal">
|
||||||
|
<CityDirectory compact />
|
||||||
|
</div>
|
||||||
|
<h3 className="social-section-label reveal" style={{ marginTop: 28 }}>
|
||||||
|
适合见面的咖啡馆
|
||||||
|
</h3>
|
||||||
|
<div className="social-toolbar reveal">
|
||||||
<SearchField
|
<SearchField
|
||||||
value={query}
|
value={query}
|
||||||
onChange={setQuery}
|
onChange={setQuery}
|
||||||
label="搜索咖啡馆"
|
label="搜索咖啡馆"
|
||||||
placeholder="搜索店名、城市、氛围…"
|
placeholder="店名 / 城市 / 氛围"
|
||||||
/>
|
/>
|
||||||
<select
|
<select
|
||||||
aria-label="咖啡馆排序"
|
aria-label="咖啡馆排序"
|
||||||
@ -317,14 +388,14 @@ export default function CafeDirectory() {
|
|||||||
value={sort}
|
value={sort}
|
||||||
onChange={(event) => setSort(event.target.value)}
|
onChange={(event) => setSort(event.target.value)}
|
||||||
>
|
>
|
||||||
<option value="recommended">目录顺序</option>
|
<option value="recommended">推荐</option>
|
||||||
<option value="wifi">网络优先</option>
|
<option value="wifi">网速</option>
|
||||||
<option value="rating">评分优先</option>
|
<option value="rating">评分</option>
|
||||||
<option value="saved">我的收藏</option>
|
<option value="saved">收藏</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div className="social-filters social-city-filters">
|
<div className="social-filters social-city-filters reveal">
|
||||||
{["all", ...new Set(SEED_CAFES.map((cafe) => cafe.city))].map(
|
{["all", ...new Set(seedCafes.map((cafe) => cafe.city))].map(
|
||||||
(value) => (
|
(value) => (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@ -333,21 +404,19 @@ export default function CafeDirectory() {
|
|||||||
key={value}
|
key={value}
|
||||||
onClick={() => setCity(value)}
|
onClick={() => setCity(value)}
|
||||||
>
|
>
|
||||||
{value === "all" ? "所有城市" : value}
|
{value === "all" ? "全部" : value}
|
||||||
</button>
|
</button>
|
||||||
),
|
),
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="social-section-label">
|
<div className="social-cafe-layout">
|
||||||
把相遇放进日常{" "}
|
|
||||||
<span>地点与评分为种子目录参考,出发前请核实营业信息。</span>
|
|
||||||
</div>
|
|
||||||
<div className="social-grid social-cafe-grid">
|
<div className="social-grid social-cafe-grid">
|
||||||
{cafes.map((cafe, index) => (
|
{cafes.map((cafe, index) => (
|
||||||
<article
|
<article
|
||||||
key={cafe.id}
|
key={cafe.id}
|
||||||
id={cafe.id}
|
id={cafe.id}
|
||||||
className={`social-card cafe-color-${index % 4}${active?.id === cafe.id ? " active" : ""}`}
|
className={`social-card social-panel-fx reveal cafe-color-${index % 4}${active?.id === cafe.id ? " active" : ""}`}
|
||||||
|
style={{ ["--stagger" as string]: `${index * 70}ms` }}
|
||||||
>
|
>
|
||||||
<div className="social-cafe-art" aria-hidden="true">
|
<div className="social-cafe-art" aria-hidden="true">
|
||||||
<Coffee size={45} strokeWidth={1} />
|
<Coffee size={45} strokeWidth={1} />
|
||||||
@ -366,7 +435,7 @@ export default function CafeDirectory() {
|
|||||||
<div className="social-tags">
|
<div className="social-tags">
|
||||||
<span>★ {cafe.rating}</span>
|
<span>★ {cafe.rating}</span>
|
||||||
<span>WiFi {cafe.wifiMbps}M</span>
|
<span>WiFi {cafe.wifiMbps}M</span>
|
||||||
<span>{cafe.partners ? "合作目录" : "社区收录"}</span>
|
<span>{cafe.partners ? "推荐见面点" : "社区收录"}</span>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@ -385,14 +454,37 @@ export default function CafeDirectory() {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{active?.id === cafe.id ? "正在查看" : "看看这里"}
|
{active?.id === cafe.id ? "查看中" : "详情"}
|
||||||
<ArrowUpRight size={14} />
|
<ArrowUpRight size={14} />
|
||||||
</button>
|
</button>
|
||||||
</article>
|
</article>
|
||||||
))}
|
))}
|
||||||
{!cafes.length && <EmptyState />}
|
{!cafes.length && (
|
||||||
|
<EmptyState
|
||||||
|
emoji="☕"
|
||||||
|
title="没有咖啡馆"
|
||||||
|
description="换城市或清空筛选。"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-btn"
|
||||||
|
onClick={() => {
|
||||||
|
setQuery("");
|
||||||
|
setCity("all");
|
||||||
|
setSort("recommended");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
重置筛选
|
||||||
|
</button>
|
||||||
|
</EmptyState>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
{active && (
|
||||||
|
<aside className="social-cafe-aside">
|
||||||
|
<CafeDetail key={active.id} cafe={active} id={id} />
|
||||||
|
</aside>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
{active && <CafeDetail key={active.id} cafe={active} id={id} />}
|
|
||||||
</SiteShell>
|
</SiteShell>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,102 +1,42 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useState } from "react";
|
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import {
|
import { ArrowUpRight, Hash, MessageCircle } from "lucide-react";
|
||||||
ArrowUpRight,
|
|
||||||
Coffee,
|
|
||||||
Hash,
|
|
||||||
MessageCircle,
|
|
||||||
Radio,
|
|
||||||
Sparkles,
|
|
||||||
} from "lucide-react";
|
|
||||||
import SiteShell from "./SiteShell";
|
import SiteShell from "./SiteShell";
|
||||||
import { BookmarkButton, EmptyState, PageIntro, SearchField } from "./SocialUI";
|
import { DemoBadge, PageIntro } from "./SocialUI";
|
||||||
import { SEED_CHANNELS } from "@social/lib/seed";
|
|
||||||
import { socialPath } from "@social/lib/socialPath";
|
import { socialPath } from "@social/lib/socialPath";
|
||||||
|
import { SOCIAL_CHAT_ID } from "./ChatWorkspace";
|
||||||
|
import { SEED_CHANNELS } from "@social/lib/seed";
|
||||||
|
|
||||||
const ICONS = [MessageCircle, Sparkles, Radio, Coffee];
|
/** Legacy multi-channel UI retired — product is a single public lobby. */
|
||||||
const STARTERS = [
|
|
||||||
"大家好,第一次加入!你们都在哪座城市远程工作?",
|
|
||||||
"最近在找适合办公的咖啡馆,有什么宝藏推荐?",
|
|
||||||
"最近在做一个小项目,有想一起交流产品的朋友吗?",
|
|
||||||
];
|
|
||||||
export default function ChannelDirectory() {
|
export default function ChannelDirectory() {
|
||||||
const [query, setQuery] = useState("");
|
const channel =
|
||||||
const channels = SEED_CHANNELS.filter((item) =>
|
SEED_CHANNELS.find((item) => item.id === SOCIAL_CHAT_ID) ||
|
||||||
`${item.name} ${item.topic}`.toLowerCase().includes(query.toLowerCase()),
|
SEED_CHANNELS[0];
|
||||||
);
|
|
||||||
return (
|
return (
|
||||||
<SiteShell title="话题聊天室">
|
<SiteShell title="大家聊天">
|
||||||
<PageIntro
|
<PageIntro title="大家聊天" accent="打个招呼">
|
||||||
eyebrow="CONVERSATIONS THAT CONNECT"
|
<DemoBadge>一个聊天室,简单好找</DemoBadge>
|
||||||
title="一句你好,"
|
</PageIntro>
|
||||||
accent="打开一整个世界。"
|
<section className="social-panel social-channel-solo">
|
||||||
description="聊远程工作,交换城市情报,分享一个今天的小发现。公开频道里,总有一段对话值得你加入。"
|
|
||||||
/>
|
|
||||||
<div className="social-toolbar">
|
|
||||||
<SearchField
|
|
||||||
value={query}
|
|
||||||
onChange={setQuery}
|
|
||||||
placeholder="搜索城市、频道或话题…"
|
|
||||||
label="搜索频道"
|
|
||||||
/>
|
|
||||||
<span className="social-muted">{channels.length} 个话题频道</span>
|
|
||||||
</div>
|
|
||||||
<div className="social-grid social-channel-grid">
|
|
||||||
{channels.map((channel) => {
|
|
||||||
const index = SEED_CHANNELS.findIndex(
|
|
||||||
(item) => item.id === channel.id,
|
|
||||||
);
|
|
||||||
const Icon = ICONS[index % ICONS.length];
|
|
||||||
return (
|
|
||||||
<article
|
|
||||||
className={`social-card social-channel-card channel-${index}`}
|
|
||||||
key={channel.id}
|
|
||||||
>
|
|
||||||
<div className="social-card-top">
|
<div className="social-card-top">
|
||||||
<span className="social-card-ico">
|
<span className="social-card-ico">
|
||||||
<Icon size={25} strokeWidth={1.5} />
|
<MessageCircle size={25} strokeWidth={1.5} />
|
||||||
</span>
|
</span>
|
||||||
<span className="social-badge">公开频道</span>
|
<span className="social-badge">随时可进</span>
|
||||||
</div>
|
</div>
|
||||||
<strong>{channel.name}</strong>
|
<strong>{channel?.name || "大家聊天"}</strong>
|
||||||
<p>{channel.topic}</p>
|
<p>{channel?.topic || "游民闲聊 · 打个招呼就好"}</p>
|
||||||
<div className="social-channel-preview">
|
<div className="social-channel-preview">
|
||||||
<Hash size={13} />
|
<Hash size={13} />
|
||||||
<span>从报到开始,也可以先听听大家在聊什么。</span>
|
<span>约咖啡、打招呼、找人聊天,都在这里说一声就行。</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="social-card-actions">
|
<div className="social-card-actions">
|
||||||
<Link
|
<Link href={socialPath("/chat")} className="social-btn primary">
|
||||||
href={socialPath(`/chat/${channel.id}`)}
|
进入聊天室 <ArrowUpRight size={14} />
|
||||||
className="social-btn primary"
|
|
||||||
>
|
|
||||||
加入对话 <ArrowUpRight size={14} />
|
|
||||||
</Link>
|
</Link>
|
||||||
<BookmarkButton id={channel.id} collection="saved-channels" />
|
|
||||||
</div>
|
|
||||||
</article>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
{!channels.length && <EmptyState />}
|
|
||||||
</div>
|
|
||||||
<div className="social-section-label">
|
|
||||||
不知道怎么开场? <span>点一个破冰话题,带进频道慢慢聊。</span>
|
|
||||||
</div>
|
|
||||||
<div className="social-icebreakers">
|
|
||||||
{STARTERS.map((starter, index) => (
|
|
||||||
<Link
|
|
||||||
key={starter}
|
|
||||||
href={socialPath(
|
|
||||||
`/chat/general?intro=${encodeURIComponent(starter)}`,
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<span>0{index + 1}</span>
|
|
||||||
<p>{starter}</p>
|
|
||||||
<ArrowUpRight size={17} />
|
|
||||||
</Link>
|
|
||||||
))}
|
|
||||||
</div>
|
</div>
|
||||||
|
</section>
|
||||||
</SiteShell>
|
</SiteShell>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,8 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
export { default } from "./ChannelDirectory";
|
import ChatWorkspace from "./ChatWorkspace";
|
||||||
|
|
||||||
|
/** 全站唯一聊天室;分类页暂时隐藏。 */
|
||||||
|
export default function ChatListClient() {
|
||||||
|
return <ChatWorkspace />;
|
||||||
|
}
|
||||||
|
|||||||
@ -3,7 +3,6 @@
|
|||||||
import { useEffect, useRef, useState, type FormEvent } from "react";
|
import { useEffect, useRef, useState, type FormEvent } from "react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import {
|
import {
|
||||||
ArrowDown,
|
|
||||||
ArrowLeft,
|
ArrowLeft,
|
||||||
CheckCheck,
|
CheckCheck,
|
||||||
CornerUpLeft,
|
CornerUpLeft,
|
||||||
@ -14,20 +13,28 @@ import {
|
|||||||
WifiOff,
|
WifiOff,
|
||||||
X,
|
X,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import SiteShell from "./SiteShell";
|
import { DemoBadge, EmptyState, ShareButton } from "./SocialUI";
|
||||||
import { EmptyState, ShareButton } from "./SocialUI";
|
import { SocialMobileDock } from "./SocialNavigation";
|
||||||
import { SEED_CHANNELS } from "@social/lib/seed";
|
import { SEED_CHANNELS } from "@social/lib/seed";
|
||||||
import { socialPath } from "@social/lib/socialPath";
|
import { socialPath } from "@social/lib/socialPath";
|
||||||
import { useSocialChat } from "@social/lib/useSocialChat";
|
import { useSocialChat } from "@social/lib/useSocialChat";
|
||||||
import { useLocalState } from "@social/lib/useLocalState";
|
import { useLocalState } from "@social/lib/useLocalState";
|
||||||
import { loadJson } from "@social/lib/storage";
|
import { loadJson } from "@social/lib/storage";
|
||||||
|
|
||||||
|
/** 全站唯一聊天室频道(分类页暂时隐藏) */
|
||||||
|
export const SOCIAL_CHAT_ID = "general";
|
||||||
|
|
||||||
const EMOJIS = ["👋", "☕", "🌍", "✨", "🙌", "❤️", "💻", "🌴"];
|
const EMOJIS = ["👋", "☕", "🌍", "✨", "🙌", "❤️", "💻", "🌴"];
|
||||||
|
const STARTERS = [
|
||||||
|
"大家好,第一次来,我在…",
|
||||||
|
"有人一起找 cowork 吗?",
|
||||||
|
"下一站想去哪座城?",
|
||||||
|
];
|
||||||
const STATUS = {
|
const STATUS = {
|
||||||
connecting: "正在连接",
|
connecting: "正在连上…",
|
||||||
online: "已连接社区",
|
online: "已连上,可以聊天",
|
||||||
offline: "离线 · 消息仅保存在本机",
|
offline: "网络不太好 · 消息先留在你这边,有网再发",
|
||||||
preview: "示例对话 · 可以开始真实聊天",
|
preview: "先看看示例 · 连上后会变成实时聊天",
|
||||||
};
|
};
|
||||||
|
|
||||||
export function Conversation({
|
export function Conversation({
|
||||||
@ -83,7 +90,7 @@ export function Conversation({
|
|||||||
? `回复 ${reply.author}:${reply.text.slice(0, 100)}\n${chat.draft}`
|
? `回复 ${reply.author}:${reply.text.slice(0, 100)}\n${chat.draft}`
|
||||||
: chat.draft;
|
: chat.draft;
|
||||||
if (body.length > 2000) {
|
if (body.length > 2000) {
|
||||||
setComposerError("包含引用的消息最多 2000 字,请缩短正文后重试。");
|
setComposerError("消息过长,请缩短后重试。");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setComposerError("");
|
setComposerError("");
|
||||||
@ -104,13 +111,13 @@ export function Conversation({
|
|||||||
>
|
>
|
||||||
<div className="social-conversation-top">
|
<div className="social-conversation-top">
|
||||||
<div>
|
<div>
|
||||||
<Hash size={21} />
|
<Hash size={18} />
|
||||||
<div>
|
<div>
|
||||||
<strong>{channel.name.replace("#", "")}</strong>
|
<strong>{channel.name.replace("#", "")}</strong>
|
||||||
<p>{channel.topic}</p>
|
<p>{channel.topic}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<ShareButton path={`/social/chat/${channelId}`} title={channel.topic} />
|
<ShareButton path={socialPath("/chat")} title={channel.topic} />
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className={`social-connection-status ${chat.status === "offline" ? "offline" : ""}`}
|
className={`social-connection-status ${chat.status === "offline" ? "offline" : ""}`}
|
||||||
@ -118,7 +125,16 @@ export function Conversation({
|
|||||||
>
|
>
|
||||||
{chat.status === "offline" ? <WifiOff size={12} /> : <Wifi size={12} />}
|
{chat.status === "offline" ? <WifiOff size={12} /> : <Wifi size={12} />}
|
||||||
{STATUS[chat.status]}
|
{STATUS[chat.status]}
|
||||||
<span>公开频道</span>
|
{chat.status === "offline" ? (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-btn"
|
||||||
|
style={{ minHeight: 32, marginLeft: "auto" }}
|
||||||
|
onClick={() => window.location.reload()}
|
||||||
|
>
|
||||||
|
刷新重连
|
||||||
|
</button>
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
<div className="social-thread-wrap">
|
<div className="social-thread-wrap">
|
||||||
<div
|
<div
|
||||||
@ -137,9 +153,26 @@ export function Conversation({
|
|||||||
>
|
>
|
||||||
{!chat.messages.length && (
|
{!chat.messages.length && (
|
||||||
<EmptyState
|
<EmptyState
|
||||||
title="从你的一句你好开始"
|
emoji="💬"
|
||||||
description="说说你在哪座城市,正在做什么,或最近对什么感兴趣。"
|
title="这里还很安静"
|
||||||
/>
|
description="点一句现成的话,或自己写一句打个招呼。网络不好时,话会先留在你这边。"
|
||||||
|
>
|
||||||
|
<div className="social-chat-starters">
|
||||||
|
{STARTERS.map((starter) => (
|
||||||
|
<button
|
||||||
|
key={starter}
|
||||||
|
type="button"
|
||||||
|
className="social-btn"
|
||||||
|
onClick={() => {
|
||||||
|
setDraft(starter);
|
||||||
|
composerRef.current?.focus();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{starter}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</EmptyState>
|
||||||
)}
|
)}
|
||||||
{chat.messages.map((message) => (
|
{chat.messages.map((message) => (
|
||||||
<article
|
<article
|
||||||
@ -177,7 +210,6 @@ export function Conversation({
|
|||||||
type="button"
|
type="button"
|
||||||
className={reactions[message.id] ? "liked" : ""}
|
className={reactions[message.id] ? "liked" : ""}
|
||||||
aria-pressed={Boolean(reactions[message.id])}
|
aria-pressed={Boolean(reactions[message.id])}
|
||||||
title="反应保存在当前设备"
|
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
setReactions((current) => ({
|
setReactions((current) => ({
|
||||||
...current,
|
...current,
|
||||||
@ -194,39 +226,35 @@ export function Conversation({
|
|||||||
disabled={chat.sending}
|
disabled={chat.sending}
|
||||||
onClick={() => void chat.send(message.text, message.id)}
|
onClick={() => void chat.send(message.text, message.id)}
|
||||||
>
|
>
|
||||||
仅本机 · 点击重试
|
重试
|
||||||
</button>
|
</button>
|
||||||
) : (
|
) : message.mine && message.delivery === "sent" ? (
|
||||||
message.mine && (
|
<span className="social-msg-sent">
|
||||||
<span>
|
<CheckCheck size={12} />
|
||||||
<CheckCheck size={11} />
|
|
||||||
已发送
|
|
||||||
</span>
|
</span>
|
||||||
)
|
) : null}
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
))}
|
))}
|
||||||
{chat.sending && (
|
|
||||||
<div className="social-chat-typing" role="status">
|
|
||||||
<i />
|
|
||||||
<i />
|
|
||||||
<i />
|
|
||||||
<span>正在发送…</span>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
className="social-new-messages"
|
|
||||||
type="button"
|
type="button"
|
||||||
|
className="social-jump-latest"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const thread = threadRef.current!;
|
const thread = threadRef.current;
|
||||||
thread.scrollTo({ top: thread.scrollHeight, behavior: "smooth" });
|
if (!thread) return;
|
||||||
|
atBottom.current = true;
|
||||||
|
thread.dataset.unread = "false";
|
||||||
|
thread.scrollTo({
|
||||||
|
top: thread.scrollHeight,
|
||||||
|
behavior: matchMedia("(prefers-reduced-motion: reduce)").matches
|
||||||
|
? "instant"
|
||||||
|
: "smooth",
|
||||||
|
});
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ArrowDown size={13} />
|
最新消息 ↓
|
||||||
查看新消息
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<form
|
<form
|
||||||
@ -234,15 +262,14 @@ export function Conversation({
|
|||||||
onSubmit={(event) => void submit(event)}
|
onSubmit={(event) => void submit(event)}
|
||||||
>
|
>
|
||||||
{composerError && (
|
{composerError && (
|
||||||
<p className="social-status error" role="alert">
|
<p className="social-status warn" role="alert">
|
||||||
{composerError}
|
{composerError}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{reply && (
|
{reply && (
|
||||||
<div className="social-reply-preview">
|
<div className="social-reply-chip">
|
||||||
<CornerUpLeft size={13} />
|
|
||||||
<span>
|
<span>
|
||||||
回复 {reply.author} · {reply.text.slice(0, 50)}
|
回复 {reply.author}:{reply.text.slice(0, 48)}
|
||||||
</span>
|
</span>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@ -256,7 +283,7 @@ export function Conversation({
|
|||||||
<textarea
|
<textarea
|
||||||
ref={composerRef}
|
ref={composerRef}
|
||||||
aria-label="消息内容"
|
aria-label="消息内容"
|
||||||
placeholder="你在哪座城市?今天有什么新发现?"
|
placeholder="报到 / 找 cowork / 下一站去哪…"
|
||||||
rows={2}
|
rows={2}
|
||||||
maxLength={2000}
|
maxLength={2000}
|
||||||
value={chat.draft}
|
value={chat.draft}
|
||||||
@ -323,54 +350,38 @@ export function Conversation({
|
|||||||
发送
|
发送
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<p className="social-composer-note">
|
|
||||||
Enter 发送 · Shift + Enter 换行 · 草稿保存在当前设备
|
|
||||||
</p>
|
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function ChatWorkspace({ channelId }: { channelId: string }) {
|
export default function ChatWorkspace() {
|
||||||
const channel = SEED_CHANNELS.find((item) => item.id === channelId);
|
const channel =
|
||||||
|
SEED_CHANNELS.find((item) => item.id === SOCIAL_CHAT_ID) ||
|
||||||
|
SEED_CHANNELS[0];
|
||||||
|
const id = channel?.id || SOCIAL_CHAT_ID;
|
||||||
return (
|
return (
|
||||||
<SiteShell title={channel?.name || "聊天室"}>
|
<div className="social-root social-live-root social-skin social-chat-live social-chat-solo">
|
||||||
{channel ? (
|
<header className="social-live-bar social-chat-live-bar">
|
||||||
<>
|
<div className="social-live-bar-main">
|
||||||
<div className="social-room-heading">
|
<Link href={socialPath("/")} className="social-nav-back">
|
||||||
<Link href={socialPath("/chat")}>
|
|
||||||
<ArrowLeft size={14} />
|
<ArrowLeft size={14} />
|
||||||
所有频道
|
首页
|
||||||
</Link>
|
</Link>
|
||||||
<span>GOOD CONVERSATIONS START HERE</span>
|
<div>
|
||||||
|
<strong>大家聊天</strong>
|
||||||
|
<p className="social-muted">
|
||||||
|
{channel?.topic || "游民闲聊"} · 打个招呼就好
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="social-chat-layout">
|
<DemoBadge>能连上就实时聊 · 不行就先留在你这边</DemoBadge>
|
||||||
<nav className="social-room-channels">
|
</div>
|
||||||
<span>选择话题</span>
|
<ShareButton path={socialPath("/chat")} title="游民社区聊天室" />
|
||||||
{SEED_CHANNELS.map((item) => (
|
</header>
|
||||||
<Link
|
<div className="social-live-stage layout-chat">
|
||||||
key={item.id}
|
<Conversation key={id} channelId={id} />
|
||||||
href={socialPath(`/chat/${item.id}`)}
|
</div>
|
||||||
aria-current={item.id === channelId ? "page" : undefined}
|
<SocialMobileDock />
|
||||||
>
|
|
||||||
<Hash size={14} />
|
|
||||||
{item.name.replace("#", "")}
|
|
||||||
</Link>
|
|
||||||
))}
|
|
||||||
</nav>
|
|
||||||
<Conversation key={channelId} channelId={channelId} />
|
|
||||||
</div>
|
</div>
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<EmptyState
|
|
||||||
title="这个频道还不存在"
|
|
||||||
description="回到话题广场,找一个感兴趣的频道开始。"
|
|
||||||
>
|
|
||||||
<Link className="social-btn primary" href={socialPath("/chat")}>
|
|
||||||
浏览所有频道
|
|
||||||
</Link>
|
|
||||||
</EmptyState>
|
|
||||||
)}
|
|
||||||
</SiteShell>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
104
src/modules/social/components/CityDirectory.tsx
Normal file
104
src/modules/social/components/CityDirectory.tsx
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useMemo, useState } from "react";
|
||||||
|
import Link from "next/link";
|
||||||
|
import { MapPin, Users, Wifi } from "lucide-react";
|
||||||
|
import {
|
||||||
|
CITY_FILTER_TAGS,
|
||||||
|
SOCIAL_CITIES,
|
||||||
|
type SocialCity,
|
||||||
|
} from "@social/lib/cities";
|
||||||
|
import { socialPath } from "@social/lib/socialPath";
|
||||||
|
|
||||||
|
export default function CityDirectory({
|
||||||
|
compact = false,
|
||||||
|
limit,
|
||||||
|
}: {
|
||||||
|
compact?: boolean;
|
||||||
|
limit?: number;
|
||||||
|
}) {
|
||||||
|
const [tag, setTag] = useState<(typeof CITY_FILTER_TAGS)[number]>("全部");
|
||||||
|
const list = useMemo(() => {
|
||||||
|
const filtered =
|
||||||
|
tag === "全部"
|
||||||
|
? SOCIAL_CITIES
|
||||||
|
: SOCIAL_CITIES.filter((c) => c.tags.includes(tag));
|
||||||
|
return typeof limit === "number" ? filtered.slice(0, limit) : filtered;
|
||||||
|
}, [tag, limit]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={`social-city-dir${compact ? " is-compact" : ""}`}>
|
||||||
|
<div
|
||||||
|
className="social-city-filters"
|
||||||
|
role="tablist"
|
||||||
|
aria-label="城市筛选"
|
||||||
|
>
|
||||||
|
{CITY_FILTER_TAGS.map((t) => (
|
||||||
|
<button
|
||||||
|
key={t}
|
||||||
|
type="button"
|
||||||
|
role="tab"
|
||||||
|
aria-selected={tag === t}
|
||||||
|
className={`social-city-filter${tag === t ? " is-active" : ""}`}
|
||||||
|
onClick={() => setTag(t)}
|
||||||
|
>
|
||||||
|
{t}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<div className="social-city-grid">
|
||||||
|
{list.map((city, i) => (
|
||||||
|
<CityCard key={city.id} city={city} index={i} />
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
{!list.length ? (
|
||||||
|
<p className="social-muted social-city-empty">
|
||||||
|
该标签暂无城市 · 换一个试试
|
||||||
|
</p>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function CityCard({ city, index }: { city: SocialCity; index: number }) {
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
href={socialPath(`/people?city=${encodeURIComponent(city.name)}`)}
|
||||||
|
className={`social-city-card reveal${city.hot ? " is-hot" : ""}`}
|
||||||
|
style={{ ["--stagger" as string]: `${Math.min(index, 10) * 50}ms` }}
|
||||||
|
>
|
||||||
|
<div className="social-city-card-top">
|
||||||
|
<span className="social-city-emoji" aria-hidden>
|
||||||
|
{city.emoji}
|
||||||
|
</span>
|
||||||
|
<div>
|
||||||
|
<h3>
|
||||||
|
{city.name}
|
||||||
|
{city.hot ? <em>HOT</em> : null}
|
||||||
|
</h3>
|
||||||
|
<p>{city.country}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p className="social-city-vibe">{city.vibe}</p>
|
||||||
|
<div className="social-city-stats">
|
||||||
|
<span>
|
||||||
|
<Users size={12} aria-hidden />
|
||||||
|
{city.members}+
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<Wifi size={12} aria-hidden />
|
||||||
|
{city.wifiMbps}M
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<MapPin size={12} aria-hidden />
|
||||||
|
{city.costHint}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div className="social-city-tags">
|
||||||
|
{city.tags.slice(0, 3).map((t) => (
|
||||||
|
<span key={t}>{t}</span>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -6,17 +6,21 @@ import {
|
|||||||
ArrowUpRight,
|
ArrowUpRight,
|
||||||
Check,
|
Check,
|
||||||
Heart,
|
Heart,
|
||||||
|
LockKeyhole,
|
||||||
MessageCircle,
|
MessageCircle,
|
||||||
|
Radio,
|
||||||
Send,
|
Send,
|
||||||
Sparkles,
|
|
||||||
Users,
|
Users,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { WechatOaModal } from "~/components/social-follow";
|
import { WechatOaModal } from "~/components/social-follow";
|
||||||
import SiteShell from "./SiteShell";
|
import SiteShell from "./SiteShell";
|
||||||
|
import JoinPayModal from "./JoinPayModal";
|
||||||
import { PageIntro } from "./SocialUI";
|
import { PageIntro } from "./SocialUI";
|
||||||
import { useSocialConfig } from "./SocialExperience";
|
import { useSocialConfig } from "./SocialExperience";
|
||||||
import { socialApi } from "@social/lib/api";
|
import { socialApi } from "@social/lib/api";
|
||||||
import { useLocalState } from "@social/lib/useLocalState";
|
import { useLocalState } from "@social/lib/useLocalState";
|
||||||
|
import { socialPath } from "@social/lib/socialPath";
|
||||||
|
import { resolveSocialLandingCopy } from "@social/lib/landing";
|
||||||
|
|
||||||
export function CommunityFeedback() {
|
export function CommunityFeedback() {
|
||||||
const [draft, setDraft] = useLocalState<{
|
const [draft, setDraft] = useLocalState<{
|
||||||
@ -33,6 +37,11 @@ export function CommunityFeedback() {
|
|||||||
setDelivery("draft");
|
setDelivery("draft");
|
||||||
setStatus("");
|
setStatus("");
|
||||||
};
|
};
|
||||||
|
const reset = () => {
|
||||||
|
setDraft({ kind: "建议", text: "", contact: "" });
|
||||||
|
setDelivery("draft");
|
||||||
|
setStatus("");
|
||||||
|
};
|
||||||
const submit = async (event: FormEvent) => {
|
const submit = async (event: FormEvent) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (!draft.text.trim() || lock.current || delivery === "sent") return;
|
if (!draft.text.trim() || lock.current || delivery === "sent") return;
|
||||||
@ -45,33 +54,46 @@ export function CommunityFeedback() {
|
|||||||
contact: draft.contact.trim(),
|
contact: draft.contact.trim(),
|
||||||
});
|
});
|
||||||
setDelivery("sent");
|
setDelivery("sent");
|
||||||
setStatus("你的想法已提交,谢谢你一起把社区变得更好。");
|
setStatus("已提交,感谢反馈。");
|
||||||
} catch {
|
} catch {
|
||||||
setDelivery("local");
|
setDelivery("local");
|
||||||
setStatus("内容已保存在本机,尚未送达社区。联网后可以在这里重试。");
|
setStatus("先留在你这边了,有网后再试一次");
|
||||||
} finally {
|
} finally {
|
||||||
lock.current = false;
|
lock.current = false;
|
||||||
setBusy(false);
|
setBusy(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<SiteShell title="共建社区">
|
<SiteShell title="说说想法">
|
||||||
<PageIntro
|
<PageIntro title="意见反馈" accent="我们在听" />
|
||||||
eyebrow="A COMMUNITY BUILT WITH YOU"
|
<section className="social-panel social-feedback-panel reveal">
|
||||||
title="你的一点想法,"
|
<div className="social-page-kicker">
|
||||||
accent="可能改变很多人的相遇。"
|
<span />
|
||||||
description="想要什么新功能?哪一步不够顺手?或者,你有一个想和大家一起实现的点子。我们想听见。"
|
说说你的想法
|
||||||
/>
|
</div>
|
||||||
<section className="social-panel social-feedback-panel">
|
<h2 className="social-feedback-title">哪里用得不顺手?告诉我们</h2>
|
||||||
<div className="social-feedback-heading">
|
<p className="social-muted">
|
||||||
<span className="social-feedback-heart">
|
发不出去也没关系,会先留在你这边,有网后再试。我们会看,但不保证马上回复。
|
||||||
<Heart size={32} />
|
</p>
|
||||||
</span>
|
{delivery === "sent" ? (
|
||||||
<div>
|
<div className="social-join-success">
|
||||||
<h2>下一次更新,从这里开始。</h2>
|
<p className="social-status" role="status">
|
||||||
<p>具体的场景、期待的体验,都值得被认真写下来。</p>
|
{status || "已提交"}
|
||||||
|
</p>
|
||||||
|
<div className="social-actions">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-btn primary"
|
||||||
|
onClick={reset}
|
||||||
|
>
|
||||||
|
再提一条
|
||||||
|
</button>
|
||||||
|
<Link className="social-btn" href={socialPath("/")}>
|
||||||
|
回社区首页
|
||||||
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
) : (
|
||||||
<form className="social-form" onSubmit={(event) => void submit(event)}>
|
<form className="social-form" onSubmit={(event) => void submit(event)}>
|
||||||
<fieldset disabled={busy} className="social-fieldset">
|
<fieldset disabled={busy} className="social-fieldset">
|
||||||
<div className="social-filters">
|
<div className="social-filters">
|
||||||
@ -83,45 +105,39 @@ export function CommunityFeedback() {
|
|||||||
aria-pressed={draft.kind === kind}
|
aria-pressed={draft.kind === kind}
|
||||||
onClick={() => update("kind", kind)}
|
onClick={() => update("kind", kind)}
|
||||||
>
|
>
|
||||||
{kind === "建议" ? "✦ 我有一个点子" : "↗ 这里可以更好"}
|
{kind}
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<label>
|
<label>
|
||||||
说说你的想法
|
内容
|
||||||
<textarea
|
<textarea
|
||||||
rows={6}
|
rows={6}
|
||||||
required
|
required
|
||||||
maxLength={3000}
|
maxLength={3000}
|
||||||
value={draft.text}
|
value={draft.text}
|
||||||
onChange={(event) => update("text", event.target.value)}
|
onChange={(event) => update("text", event.target.value)}
|
||||||
placeholder="比如:我想在新城市快速找到一起办公的人,希望能按工作时间和兴趣找伙伴…"
|
placeholder="具体页面 / 操作 / 期望…"
|
||||||
/>
|
/>
|
||||||
<small>{draft.text.length}/3000</small>
|
<small>{draft.text.length}/3000</small>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
方便继续交流的联系方式(选填)
|
联系方式(选填)
|
||||||
<input
|
<input
|
||||||
maxLength={120}
|
maxLength={120}
|
||||||
value={draft.contact}
|
value={draft.contact}
|
||||||
onChange={(event) => update("contact", event.target.value)}
|
onChange={(event) => update("contact", event.target.value)}
|
||||||
placeholder="邮箱 / 微信 / 其他"
|
placeholder="邮箱 / 微信"
|
||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="social-btn primary"
|
className="social-btn primary"
|
||||||
disabled={busy || delivery === "sent" || !draft.text.trim()}
|
disabled={busy || !draft.text.trim()}
|
||||||
>
|
>
|
||||||
<Send size={15} />
|
<Send size={15} />
|
||||||
{busy
|
{busy ? "提交中…" : delivery === "local" ? "重试" : "提交"}
|
||||||
? "提交中…"
|
|
||||||
: delivery === "sent"
|
|
||||||
? "已收到你的想法"
|
|
||||||
: delivery === "local"
|
|
||||||
? "重试提交"
|
|
||||||
: "让这个想法被看见"}
|
|
||||||
</button>
|
</button>
|
||||||
{status && (
|
{status && (
|
||||||
<p
|
<p
|
||||||
@ -131,90 +147,120 @@ export function CommunityFeedback() {
|
|||||||
{status}
|
{status}
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
<p className="social-muted">
|
|
||||||
草稿保存在当前设备,提交成功后才会送达社区。
|
|
||||||
</p>
|
|
||||||
</form>
|
</form>
|
||||||
|
)}
|
||||||
</section>
|
</section>
|
||||||
</SiteShell>
|
</SiteShell>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function CommunityJoin() {
|
export function CommunityJoin() {
|
||||||
const [open, setOpen] = useState(false);
|
const config = useSocialConfig();
|
||||||
|
const copy = resolveSocialLandingCopy(config.copy);
|
||||||
|
const [payOpen, setPayOpen] = useState(false);
|
||||||
|
const [oaOpen, setOaOpen] = useState(false);
|
||||||
return (
|
return (
|
||||||
<SiteShell title="加入社区">
|
<SiteShell title="加入社区">
|
||||||
<PageIntro
|
<PageIntro title="加入社区" />
|
||||||
eyebrow="YOUR PEOPLE ARE OUT THERE"
|
<div className="social-join-paths">
|
||||||
title="世界很大,"
|
<article className="social-panel social-join-path reveal">
|
||||||
accent="总有人和你同频。"
|
<span className="social-page-kicker">
|
||||||
description="不需要一个完美的开场。从一句你好、一张名片、一杯咖啡开始,在新的城市找到熟悉感。"
|
<span />
|
||||||
/>
|
方式一
|
||||||
<div className="social-welcome-banner">
|
</span>
|
||||||
<div className="social-welcome-faces" aria-hidden="true">
|
<span className="social-join-path-ico" aria-hidden>
|
||||||
<span>👋</span>
|
<LockKeyhole size={24} strokeWidth={1.4} />
|
||||||
<span>🌍</span>
|
</span>
|
||||||
<span>☕</span>
|
<h2>{copy.socialPayJoinLabel}</h2>
|
||||||
<span>💻</span>
|
<p>
|
||||||
</div>
|
填一下邮箱,按提示完成支付就能加入。电脑、手机浏览器和微信里都会带你走合适的支付方式。
|
||||||
<div>
|
</p>
|
||||||
<h2>来这里,做真实的自己。</h2>
|
{config.flags.payEnabled ? (
|
||||||
<p>分享经验,保持好奇,尊重每个人的边界。</p>
|
|
||||||
</div>
|
|
||||||
<button
|
<button
|
||||||
className="social-btn primary"
|
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setOpen(true)}
|
className="social-btn coral"
|
||||||
|
onClick={() => setPayOpen(true)}
|
||||||
>
|
>
|
||||||
查看社群加入方式 <ArrowUpRight size={15} />
|
{copy.socialPayJoinLabel}
|
||||||
|
<ArrowUpRight size={15} />
|
||||||
</button>
|
</button>
|
||||||
|
) : (
|
||||||
|
<span className="social-status">暂时还不能购买</span>
|
||||||
|
)}
|
||||||
|
</article>
|
||||||
|
<article className="social-panel social-join-path reveal">
|
||||||
|
<span className="social-page-kicker">
|
||||||
|
<span />
|
||||||
|
方式二
|
||||||
|
</span>
|
||||||
|
<span className="social-join-path-ico" aria-hidden>
|
||||||
|
<MessageCircle size={24} strokeWidth={1.4} />
|
||||||
|
</span>
|
||||||
|
<h2>{copy.socialOaJoinLabel}</h2>
|
||||||
|
<p>
|
||||||
|
关注
|
||||||
|
{config.copy.wechatOaName
|
||||||
|
? `「${config.copy.wechatOaName}」`
|
||||||
|
: "公众号"}
|
||||||
|
,先看看社区动态和活动,再决定要不要正式加入。
|
||||||
|
</p>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-btn primary"
|
||||||
|
onClick={() => setOaOpen(true)}
|
||||||
|
>
|
||||||
|
{copy.socialOaJoinLabel}
|
||||||
|
<ArrowUpRight size={15} />
|
||||||
|
</button>
|
||||||
|
</article>
|
||||||
</div>
|
</div>
|
||||||
|
<h3 className="social-onboarding-heading">加入后可以先去这些地方</h3>
|
||||||
<div className="social-grid social-onboarding-grid">
|
<div className="social-grid social-onboarding-grid">
|
||||||
{[
|
{[
|
||||||
{
|
{
|
||||||
n: "01",
|
|
||||||
icon: Users,
|
|
||||||
title: "让大家认识你",
|
|
||||||
text: "写下城市、兴趣和正在做的事。好的连接,始于一个具体的你。",
|
|
||||||
href: "/social/roster",
|
|
||||||
cta: "制作我的名片",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
n: "02",
|
|
||||||
icon: MessageCircle,
|
icon: MessageCircle,
|
||||||
title: "加入一场好对话",
|
title: "大家聊天",
|
||||||
text: "打个招呼,交换一条城市经验,问一个你一直想问的问题。",
|
desc: "跟大家打个招呼",
|
||||||
href:
|
href: socialPath("/chat"),
|
||||||
"/social/chat/general?intro=" +
|
cta: "去聊聊",
|
||||||
encodeURIComponent(
|
|
||||||
"大家好,我刚来到这里 👋 很想认识同城或同频的新朋友!",
|
|
||||||
),
|
|
||||||
cta: "去公开频道报到",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
n: "03",
|
icon: Heart,
|
||||||
icon: Sparkles,
|
title: "认识一下",
|
||||||
title: "把连接带到生活里",
|
desc: "左右滑,慢慢认识新朋友",
|
||||||
text: "看看下一场 Meetup,或挑一家咖啡馆,公开发起一次见面邀约。",
|
href: socialPath("/date"),
|
||||||
href: "/social/meetup",
|
cta: "去看看",
|
||||||
cta: "发现下一次相遇",
|
},
|
||||||
|
{
|
||||||
|
icon: Users,
|
||||||
|
title: "我的介绍",
|
||||||
|
desc: "写几句,让别人认识你",
|
||||||
|
href: socialPath("/roster"),
|
||||||
|
cta: "去写写",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
icon: Radio,
|
||||||
|
title: "开视频聊聊",
|
||||||
|
desc: "开摄像头,面对面认识",
|
||||||
|
href: socialPath("/meetup"),
|
||||||
|
cta: "去开视频",
|
||||||
},
|
},
|
||||||
].map((item) => (
|
].map((item) => (
|
||||||
<article className="social-card social-onboarding-card" key={item.n}>
|
<article className="social-card social-onboarding-card" key={item.title}>
|
||||||
<div className="social-card-top">
|
<div className="social-card-top">
|
||||||
<item.icon size={27} strokeWidth={1.3} />
|
<item.icon size={24} strokeWidth={1.3} />
|
||||||
<span>{item.n}</span>
|
|
||||||
</div>
|
</div>
|
||||||
<h2>{item.title}</h2>
|
<h2>{item.title}</h2>
|
||||||
<p>{item.text}</p>
|
<p className="social-muted">{item.desc}</p>
|
||||||
<Link className="social-btn" href={item.href}>
|
<Link className="social-btn primary" href={item.href}>
|
||||||
{item.cta}
|
{item.cta}
|
||||||
<ArrowUpRight size={14} />
|
<ArrowUpRight size={14} />
|
||||||
</Link>
|
</Link>
|
||||||
</article>
|
</article>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<WechatOaModal open={open} onClose={() => setOpen(false)} />
|
<JoinPayModal open={payOpen} onClose={() => setPayOpen(false)} />
|
||||||
|
<WechatOaModal open={oaOpen} onClose={() => setOaOpen(false)} />
|
||||||
</SiteShell>
|
</SiteShell>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -225,75 +271,62 @@ export function CommunityMembership() {
|
|||||||
"zh-CN",
|
"zh-CN",
|
||||||
{ maximumFractionDigits: 2 },
|
{ maximumFractionDigits: 2 },
|
||||||
);
|
);
|
||||||
|
const benefits = [
|
||||||
|
"更好地展示自己的介绍",
|
||||||
|
"更方便认识想见的人",
|
||||||
|
"视频见面与同城活动更新提醒",
|
||||||
|
"找搭子做事时优先沟通",
|
||||||
|
];
|
||||||
return (
|
return (
|
||||||
<SiteShell title="会员与连接">
|
<SiteShell title="会员">
|
||||||
<PageIntro
|
<PageIntro title="会员" accent={`¥${price}`} />
|
||||||
eyebrow="MORE CONNECTION. MORE POSSIBILITY."
|
<section className="social-membership-banner reveal">
|
||||||
title="连接,从参与开始。"
|
<div className="social-page-kicker">
|
||||||
accent="把社区变成生活的一部分。"
|
<span />
|
||||||
description="先认识这里的人、加入感兴趣的对话,再选择适合自己的参与方式。会员方案与实际权益可在会员中心查看。"
|
会员通行证
|
||||||
/>
|
|
||||||
<section className="social-membership-banner">
|
|
||||||
<div className="social-membership-emblem" aria-hidden="true">
|
|
||||||
<Sparkles size={51} strokeWidth={1} />
|
|
||||||
<i />
|
|
||||||
<i />
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<h2 className="social-feedback-title">游民会员</h2>
|
||||||
<span className="social-page-kicker">NOMADRO MEMBERSHIP</span>
|
<p className="social-muted">
|
||||||
<h2>留给更深入探索的你。</h2>
|
开通后能更方便参与社区。具体权益以支付页说明为准。
|
||||||
<p>
|
|
||||||
当前会员展示价 <strong>¥{price}</strong>
|
|
||||||
,具体有效期、权益与最终价格以会员中心为准。
|
|
||||||
</p>
|
</p>
|
||||||
|
<ul className="social-benefit-list">
|
||||||
|
{benefits.map((item) => (
|
||||||
|
<li key={item}>
|
||||||
|
<Check size={15} />
|
||||||
|
{item}
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
<div className="social-actions">
|
<div className="social-actions">
|
||||||
{config.flags.payEnabled ? (
|
{config.flags.payEnabled ? (
|
||||||
<Link className="social-btn primary" href="/vip">
|
<Link className="social-btn coral" href="/vip">
|
||||||
{config.copy.vipCta || "查看会员方案"}
|
{config.copy.vipCta || "开通会员"}
|
||||||
<ArrowUpRight size={15} />
|
<ArrowUpRight size={15} />
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
<span className="social-status">
|
<span className="social-status">暂时还不能购买</span>
|
||||||
会员购买暂未开放,欢迎先参与社区。
|
|
||||||
</span>
|
|
||||||
)}
|
)}
|
||||||
<Link className="social-btn" href="/social/join">
|
<Link className="social-btn" href={socialPath("/join")}>
|
||||||
先加入社区
|
去加入社区
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
<div className="social-section-label">
|
|
||||||
现在就能开始的连接 <span>以下是社区入口,不代表额外付费权益</span>
|
|
||||||
</div>
|
|
||||||
<div className="social-grid">
|
<div className="social-grid">
|
||||||
{[
|
{[
|
||||||
{
|
{ title: "我的介绍", href: socialPath("/roster") },
|
||||||
title: "一张有温度的名片",
|
{ title: "认识一下", href: socialPath("/date") },
|
||||||
text: "让你的技能、城市与兴趣有一个清晰的介绍。",
|
{ title: "找咖啡馆", href: socialPath("/coffeechat") },
|
||||||
href: "/social/roster",
|
{ title: "大家聊天", href: socialPath("/chat") },
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "一次公开的 Coffeechat",
|
|
||||||
text: "从一个地方、一杯咖啡和一次公开邀约开始。",
|
|
||||||
href: "/social/coffeechat",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "一场值得参与的对话",
|
|
||||||
text: "走进话题频道和线上活动,与不同城市的人交流。",
|
|
||||||
href: "/social/chat",
|
|
||||||
},
|
|
||||||
].map((item) => (
|
].map((item) => (
|
||||||
<Link
|
<Link
|
||||||
className="social-card social-membership-card"
|
className="social-card social-membership-card"
|
||||||
href={item.href}
|
href={item.href}
|
||||||
key={item.href}
|
key={item.href}
|
||||||
>
|
>
|
||||||
<Check size={21} />
|
<Check size={18} />
|
||||||
<h2>{item.title}</h2>
|
<h2>{item.title}</h2>
|
||||||
<p>{item.text}</p>
|
|
||||||
<span>
|
<span>
|
||||||
去看看 <ArrowUpRight size={14} />
|
打开 <ArrowUpRight size={14} />
|
||||||
</span>
|
</span>
|
||||||
</Link>
|
</Link>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import {
|
|||||||
ArrowUpRight,
|
ArrowUpRight,
|
||||||
Coffee,
|
Coffee,
|
||||||
Globe2,
|
Globe2,
|
||||||
|
Heart,
|
||||||
MoveUpRight,
|
MoveUpRight,
|
||||||
Play,
|
Play,
|
||||||
Radio,
|
Radio,
|
||||||
@ -70,7 +71,7 @@ export default function ConnectionHero({
|
|||||||
<div className="container connection-hero-layout">
|
<div className="container connection-hero-layout">
|
||||||
<div className="connection-copy">
|
<div className="connection-copy">
|
||||||
<div className="connection-eyebrow">
|
<div className="connection-eyebrow">
|
||||||
<span className="connection-status-dot" /> NOMADRO SOCIAL{" "}
|
<span className="connection-status-dot" /> 游民社区{" "}
|
||||||
<span className="connection-eyebrow-divider" /> {copy.socialEyebrow}
|
<span className="connection-eyebrow-divider" /> {copy.socialEyebrow}
|
||||||
</div>
|
</div>
|
||||||
<h1 id="connection-title">
|
<h1 id="connection-title">
|
||||||
@ -91,6 +92,12 @@ export default function ConnectionHero({
|
|||||||
>
|
>
|
||||||
{copy.socialJoinCta} <ArrowUpRight size={19} />
|
{copy.socialJoinCta} <ArrowUpRight size={19} />
|
||||||
</button>
|
</button>
|
||||||
|
<Link className="connection-film" href={socialPath("/date")}>
|
||||||
|
<span>
|
||||||
|
<Heart size={13} />
|
||||||
|
</span>
|
||||||
|
先去认识一下
|
||||||
|
</Link>
|
||||||
<button
|
<button
|
||||||
ref={triggerRef}
|
ref={triggerRef}
|
||||||
className="connection-film"
|
className="connection-film"
|
||||||
@ -99,19 +106,19 @@ export default function ConnectionHero({
|
|||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
<Play size={13} fill="currentColor" />
|
<Play size={13} fill="currentColor" />
|
||||||
</span>{" "}
|
</span>
|
||||||
看看社区故事
|
社区故事
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="connection-proof">
|
<div className="connection-proof">
|
||||||
<div className="connection-avatar-stack" aria-hidden="true">
|
<div className="connection-avatar-stack" aria-hidden="true">
|
||||||
{MOCK_ROSTER.slice(0, 4).map((m) => (
|
{MOCK_ROSTER.slice(0, 5).map((m) => (
|
||||||
<SocialAvatar key={m.id} src={m.avatar} size={34} />
|
<SocialAvatar key={m.id} src={m.avatar} size={36} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<strong>有趣的人,正在这里相遇</strong>
|
<strong>同频的人,正在这里相遇</strong>
|
||||||
<span>自由职业者 · 远程工作者 · 生活探索家</span>
|
<span>自由职业 · 远程工作 · 出来见一面</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -235,7 +242,7 @@ export default function ConnectionHero({
|
|||||||
<Sparkles size={27} strokeWidth={1.3} />
|
<Sparkles size={27} strokeWidth={1.3} />
|
||||||
</div>
|
</div>
|
||||||
<strong>同频,自有引力</strong>
|
<strong>同频,自有引力</strong>
|
||||||
<span>FIND YOUR PEOPLE</span>
|
<span>想见的人</span>
|
||||||
</div>
|
</div>
|
||||||
{NODES.map(({ member, x, y, rotate }, i) => {
|
{NODES.map(({ member, x, y, rotate }, i) => {
|
||||||
const m = MOCK_ROSTER[member];
|
const m = MOCK_ROSTER[member];
|
||||||
@ -292,15 +299,15 @@ export default function ConnectionHero({
|
|||||||
<span>
|
<span>
|
||||||
<span className="connection-status-dot" /> 连接没有边界
|
<span className="connection-status-dot" /> 连接没有边界
|
||||||
</span>
|
</span>
|
||||||
<span>成员展示 · 演示数据</span>
|
<span>先用示例看看感觉</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="container connection-hero-bottom">
|
<div className="container connection-hero-bottom">
|
||||||
<a href="#people">
|
<a href="#people">
|
||||||
<ArrowDown size={14} /> 向下探索你的下一次相遇
|
<ArrowDown size={14} /> 继续往下看
|
||||||
</a>
|
</a>
|
||||||
<span>LESS SCROLLING. MORE CONNECTING.</span>
|
<span>认识人 · 开视频 · 见一面</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<dialog
|
<dialog
|
||||||
@ -347,27 +354,39 @@ export function ConnectionWays({ copy }: { copy: SocialLandingCopy }) {
|
|||||||
const ways = [
|
const ways = [
|
||||||
{
|
{
|
||||||
id: "01",
|
id: "01",
|
||||||
href: "/chat",
|
href: "/meetup",
|
||||||
icon: Radio,
|
icon: Radio,
|
||||||
title: copy.socialOnlineTitle,
|
title: copy.socialWayChat,
|
||||||
sub: "线上闲聊 · 灵感碰撞",
|
sub: copy.socialOnlineTitle,
|
||||||
|
cta: "去聊聊",
|
||||||
className: "mint",
|
className: "mint",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "02",
|
id: "02",
|
||||||
href: "/coffeechat",
|
href: "/date",
|
||||||
icon: Coffee,
|
icon: Heart,
|
||||||
title: copy.socialOfflineTitle,
|
title: copy.socialWayDate,
|
||||||
sub: "一杯咖啡 · 真实连接",
|
sub: "左右滑,慢慢认识",
|
||||||
|
cta: "开始看看",
|
||||||
className: "coral",
|
className: "coral",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "03",
|
id: "03",
|
||||||
|
href: "/coffeechat",
|
||||||
|
icon: Coffee,
|
||||||
|
title: copy.socialWayCafe,
|
||||||
|
sub: copy.socialOfflineTitle,
|
||||||
|
cta: "选城市",
|
||||||
|
className: "yellow",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "04",
|
||||||
href: "/team",
|
href: "/team",
|
||||||
icon: Users,
|
icon: Users,
|
||||||
title: copy.socialTeamTitle,
|
title: copy.socialWayTeam,
|
||||||
sub: "远程协作 · 共创可能",
|
sub: copy.socialTeamTitle,
|
||||||
className: "yellow",
|
cta: "看看机会",
|
||||||
|
className: "mint",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
return (
|
return (
|
||||||
@ -385,6 +404,7 @@ export function ConnectionWays({ copy }: { copy: SocialLandingCopy }) {
|
|||||||
<span className="connection-way-copy">
|
<span className="connection-way-copy">
|
||||||
<strong>{way.title}</strong>
|
<strong>{way.title}</strong>
|
||||||
<small>{way.sub}</small>
|
<small>{way.sub}</small>
|
||||||
|
<em>{way.cta}</em>
|
||||||
</span>
|
</span>
|
||||||
<ArrowUpRight className="connection-way-arrow" size={19} />
|
<ArrowUpRight className="connection-way-arrow" size={19} />
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@ -1,3 +1,570 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
export { StoriesLibrary as default } from "./ResourceLibrary";
|
import {
|
||||||
|
useCallback,
|
||||||
|
useEffect,
|
||||||
|
useMemo,
|
||||||
|
useRef,
|
||||||
|
useState,
|
||||||
|
type PointerEvent as ReactPointerEvent,
|
||||||
|
} from "react";
|
||||||
|
import Link from "next/link";
|
||||||
|
import {
|
||||||
|
ArrowLeft,
|
||||||
|
Heart,
|
||||||
|
MapPin,
|
||||||
|
MessageCircle,
|
||||||
|
RotateCcw,
|
||||||
|
Undo2,
|
||||||
|
X,
|
||||||
|
} from "lucide-react";
|
||||||
|
import SocialAvatar from "./SocialAvatar";
|
||||||
|
import { DemoBadge, ShareButton, SocialDialog } from "./SocialUI";
|
||||||
|
import { SocialMobileDock } from "./SocialNavigation";
|
||||||
|
import type { SocialRosterMember } from "@social/lib/rosterMock";
|
||||||
|
import { useDiscoveryRoster } from "@social/lib/discoveryRoster";
|
||||||
|
import { socialPath } from "@social/lib/socialPath";
|
||||||
|
import { loadJson, saveJson } from "@social/lib/storage";
|
||||||
|
import { useLocalState } from "@social/lib/useLocalState";
|
||||||
|
|
||||||
|
type Filter = "all" | "f" | "m";
|
||||||
|
type Decision = "like" | "pass";
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
type SwipeStore = Record<string, Decision>;
|
||||||
|
type HistoryEntry = { id: string; decision: Decision };
|
||||||
|
|
||||||
|
function shuffle<T>(list: T[]) {
|
||||||
|
const next = [...list];
|
||||||
|
for (let i = next.length - 1; i > 0; i -= 1) {
|
||||||
|
const j = Math.floor(Math.random() * (i + 1));
|
||||||
|
[next[i], next[j]] = [next[j], next[i]];
|
||||||
|
}
|
||||||
|
return next;
|
||||||
|
}
|
||||||
|
|
||||||
|
function syncRosterLike(id: string, liked: boolean) {
|
||||||
|
const current = loadJson<Record<string, boolean>>(LIKE_KEY, {});
|
||||||
|
const next = { ...current };
|
||||||
|
if (liked) next[id] = true;
|
||||||
|
else delete next[id];
|
||||||
|
saveJson(LIKE_KEY, next);
|
||||||
|
window.dispatchEvent(new Event(LIKES_CHANGED));
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function DateClient() {
|
||||||
|
const roster = useDiscoveryRoster();
|
||||||
|
const [filter, setFilter] = useState<Filter>("all");
|
||||||
|
const [swipes, setSwipes] = useLocalState<SwipeStore>(SWIPE_KEY, {});
|
||||||
|
const [history, setHistory] = useLocalState<HistoryEntry[]>(HISTORY_KEY, []);
|
||||||
|
const [order, setOrder] = useState<string[]>([]);
|
||||||
|
const [drag, setDrag] = useState({ x: 0, y: 0, active: false });
|
||||||
|
const [fly, setFly] = useState<null | { id: string; dir: Decision }>(null);
|
||||||
|
const [toast, setToast] = useState("");
|
||||||
|
const [matchId, setMatchId] = useState<string | null>(null);
|
||||||
|
const [likesOpen, setLikesOpen] = useState(false);
|
||||||
|
const start = useRef({ x: 0, y: 0 });
|
||||||
|
const dragging = useRef(false);
|
||||||
|
const dragRef = useRef({ x: 0, y: 0 });
|
||||||
|
const busy = useRef(false);
|
||||||
|
const toastTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setOrder((prev) => {
|
||||||
|
const ids = roster.map((m) => m.id);
|
||||||
|
const keep = prev.filter((id) => ids.includes(id));
|
||||||
|
const missing = ids.filter((id) => !keep.includes(id));
|
||||||
|
return keep.length ? [...keep, ...missing] : shuffle(ids);
|
||||||
|
});
|
||||||
|
}, [roster]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (history.length) return;
|
||||||
|
const entries = Object.entries(swipes) as [string, Decision][];
|
||||||
|
if (!entries.length) return;
|
||||||
|
setHistory(entries.map(([id, decision]) => ({ id, decision })));
|
||||||
|
}, [swipes, history.length, setHistory]);
|
||||||
|
|
||||||
|
useEffect(
|
||||||
|
() => () => {
|
||||||
|
if (toastTimer.current) clearTimeout(toastTimer.current);
|
||||||
|
},
|
||||||
|
[],
|
||||||
|
);
|
||||||
|
|
||||||
|
const deck = useMemo(() => {
|
||||||
|
return order
|
||||||
|
.map((id) => roster.find((m) => m.id === id)!)
|
||||||
|
.filter((m) => m && !swipes[m.id])
|
||||||
|
.filter((m) => filter === "all" || m.gender === filter);
|
||||||
|
}, [order, swipes, filter, roster]);
|
||||||
|
|
||||||
|
const current = deck[0] || null;
|
||||||
|
const next = deck[1] || null;
|
||||||
|
const remaining = deck.length;
|
||||||
|
const totalForFilter = roster.filter(
|
||||||
|
(m) => filter === "all" || m.gender === filter,
|
||||||
|
).length;
|
||||||
|
const liked = useMemo(
|
||||||
|
() =>
|
||||||
|
roster
|
||||||
|
.filter((m) => swipes[m.id] === "like")
|
||||||
|
.slice()
|
||||||
|
.reverse(),
|
||||||
|
[swipes, roster],
|
||||||
|
);
|
||||||
|
const matchMember = matchId
|
||||||
|
? roster.find((m) => m.id === matchId) || null
|
||||||
|
: null;
|
||||||
|
|
||||||
|
const flash = useCallback((text: string) => {
|
||||||
|
setToast(text);
|
||||||
|
if (toastTimer.current) clearTimeout(toastTimer.current);
|
||||||
|
toastTimer.current = setTimeout(() => setToast(""), 1600);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const commit = useCallback(
|
||||||
|
(member: SocialRosterMember, decision: Decision) => {
|
||||||
|
if (busy.current || fly) return;
|
||||||
|
busy.current = true;
|
||||||
|
setFly({ id: member.id, dir: decision });
|
||||||
|
window.setTimeout(() => {
|
||||||
|
setSwipes((prev) => ({ ...prev, [member.id]: decision }));
|
||||||
|
setHistory((prev) => [...prev, { id: member.id, decision }]);
|
||||||
|
if (decision === "like") {
|
||||||
|
syncRosterLike(member.id, true);
|
||||||
|
setMatchId(member.id);
|
||||||
|
flash(`想认识 ${member.name}`);
|
||||||
|
} else {
|
||||||
|
flash("已跳过");
|
||||||
|
}
|
||||||
|
setFly(null);
|
||||||
|
setDrag({ x: 0, y: 0, active: false });
|
||||||
|
dragRef.current = { x: 0, y: 0 };
|
||||||
|
busy.current = false;
|
||||||
|
}, 280);
|
||||||
|
},
|
||||||
|
[fly, setSwipes, flash],
|
||||||
|
);
|
||||||
|
|
||||||
|
const undo = useCallback(() => {
|
||||||
|
if (busy.current || fly || !history.length) return;
|
||||||
|
const last = history[history.length - 1];
|
||||||
|
setHistory((prev) => prev.slice(0, -1));
|
||||||
|
setSwipes((prev) => {
|
||||||
|
const nextStore = { ...prev };
|
||||||
|
delete nextStore[last.id];
|
||||||
|
return nextStore;
|
||||||
|
});
|
||||||
|
if (last.decision === "like") syncRosterLike(last.id, false);
|
||||||
|
setMatchId(null);
|
||||||
|
setDrag({ x: 0, y: 0, active: false });
|
||||||
|
flash("已撤销");
|
||||||
|
}, [history, fly, setSwipes, flash]);
|
||||||
|
|
||||||
|
const onPointerDown = (event: ReactPointerEvent<HTMLElement>) => {
|
||||||
|
if (!current || fly || busy.current) return;
|
||||||
|
dragging.current = true;
|
||||||
|
start.current = { x: event.clientX, y: event.clientY };
|
||||||
|
event.currentTarget.setPointerCapture(event.pointerId);
|
||||||
|
setDrag({ x: 0, y: 0, active: true });
|
||||||
|
};
|
||||||
|
|
||||||
|
const onPointerMove = (event: ReactPointerEvent<HTMLElement>) => {
|
||||||
|
if (!dragging.current || !current || fly) return;
|
||||||
|
const nextDrag = {
|
||||||
|
x: event.clientX - start.current.x,
|
||||||
|
y: (event.clientY - start.current.y) * 0.35,
|
||||||
|
};
|
||||||
|
dragRef.current = nextDrag;
|
||||||
|
setDrag({ ...nextDrag, active: true });
|
||||||
|
};
|
||||||
|
|
||||||
|
const onPointerUp = () => {
|
||||||
|
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");
|
||||||
|
else {
|
||||||
|
setDrag({ x: 0, y: 0, active: false });
|
||||||
|
dragRef.current = { x: 0, y: 0 };
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const resetDeck = () => {
|
||||||
|
setSwipes({});
|
||||||
|
setHistory([]);
|
||||||
|
setOrder(shuffle(roster.map((m) => m.id)));
|
||||||
|
setDrag({ x: 0, y: 0, active: false });
|
||||||
|
dragRef.current = { x: 0, y: 0 };
|
||||||
|
setFly(null);
|
||||||
|
setMatchId(null);
|
||||||
|
setLikesOpen(false);
|
||||||
|
busy.current = false;
|
||||||
|
flash("已重新洗牌");
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const onKey = (event: KeyboardEvent) => {
|
||||||
|
const tag = (event.target as HTMLElement | null)?.tagName;
|
||||||
|
if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT") return;
|
||||||
|
if (event.key === "ArrowRight") {
|
||||||
|
event.preventDefault();
|
||||||
|
if (current) commit(current, "like");
|
||||||
|
} else if (event.key === "ArrowLeft") {
|
||||||
|
event.preventDefault();
|
||||||
|
if (current) commit(current, "pass");
|
||||||
|
} else if (
|
||||||
|
(event.key === "z" || event.key === "Z") &&
|
||||||
|
(event.metaKey || event.ctrlKey)
|
||||||
|
) {
|
||||||
|
event.preventDefault();
|
||||||
|
undo();
|
||||||
|
} else if (event.key === "Backspace") {
|
||||||
|
event.preventDefault();
|
||||||
|
undo();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
window.addEventListener("keydown", onKey);
|
||||||
|
return () => window.removeEventListener("keydown", onKey);
|
||||||
|
}, [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));
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="social-root social-live-root social-skin social-date-root">
|
||||||
|
<header className="social-live-bar social-date-bar">
|
||||||
|
<div className="social-live-bar-main">
|
||||||
|
<Link href={socialPath("/")} className="social-nav-back">
|
||||||
|
<ArrowLeft size={14} />
|
||||||
|
首页
|
||||||
|
</Link>
|
||||||
|
<div>
|
||||||
|
<strong>认识一下</strong>
|
||||||
|
<p className="social-muted">
|
||||||
|
左滑划走 · 右滑想认识
|
||||||
|
{totalForFilter
|
||||||
|
? ` · 还剩 ${remaining}/${totalForFilter}`
|
||||||
|
: ""}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<DemoBadge>示例介绍,方便先逛逛</DemoBadge>
|
||||||
|
</div>
|
||||||
|
<div className="social-date-bar-tools">
|
||||||
|
<div className="social-filters" aria-label="筛选">
|
||||||
|
{(
|
||||||
|
[
|
||||||
|
["all", "全部"],
|
||||||
|
["f", "女生"],
|
||||||
|
["m", "男生"],
|
||||||
|
] as const
|
||||||
|
).map(([id, label]) => (
|
||||||
|
<button
|
||||||
|
key={id}
|
||||||
|
type="button"
|
||||||
|
className={filter === id ? "active" : ""}
|
||||||
|
aria-pressed={filter === id}
|
||||||
|
onClick={() => setFilter(id)}
|
||||||
|
>
|
||||||
|
{label}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
{liked.length > 0 ? (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-btn"
|
||||||
|
onClick={() => setLikesOpen(true)}
|
||||||
|
>
|
||||||
|
<Heart size={14} />
|
||||||
|
想认识 {liked.length}
|
||||||
|
</button>
|
||||||
|
) : null}
|
||||||
|
<ShareButton path={socialPath("/date")} title="游民社区 · 认识一下" />
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div className="social-date-stage">
|
||||||
|
{totalForFilter > 0 ? (
|
||||||
|
<div
|
||||||
|
className="social-date-progress"
|
||||||
|
aria-label={`还剩 ${remaining} 人`}
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
style={{
|
||||||
|
width: `${Math.max(4, (remaining / totalForFilter) * 100)}%`,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
<div className="social-date-deck" aria-live="polite">
|
||||||
|
{!current && (
|
||||||
|
<div className="social-date-empty">
|
||||||
|
<span aria-hidden style={{ fontSize: 36 }}>
|
||||||
|
✨
|
||||||
|
</span>
|
||||||
|
<strong>这批看完了</strong>
|
||||||
|
<p className="social-muted">
|
||||||
|
想认识的人会先记在你这边。可以再看一轮,或去聊天室打个招呼。
|
||||||
|
</p>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-btn primary"
|
||||||
|
onClick={resetDeck}
|
||||||
|
>
|
||||||
|
<RotateCcw size={15} />
|
||||||
|
再来一轮
|
||||||
|
</button>
|
||||||
|
{liked.length > 0 && (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-btn"
|
||||||
|
onClick={() => setLikesOpen(true)}
|
||||||
|
>
|
||||||
|
<Heart size={15} />
|
||||||
|
查看想认识 ({liked.length})
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{next && (
|
||||||
|
<article className="social-date-card is-next" aria-hidden>
|
||||||
|
<DateCardFace member={next} />
|
||||||
|
</article>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{current && (
|
||||||
|
<article
|
||||||
|
className={`social-date-card is-top${drag.active ? " is-dragging" : ""}${fly ? ` is-fly-${fly.dir}` : ""}`}
|
||||||
|
style={
|
||||||
|
fly
|
||||||
|
? undefined
|
||||||
|
: {
|
||||||
|
transform: `translate3d(${drag.x}px, ${drag.y}px, 0) rotate(${rotate}deg)`,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onPointerDown={onPointerDown}
|
||||||
|
onPointerMove={onPointerMove}
|
||||||
|
onPointerUp={onPointerUp}
|
||||||
|
onPointerCancel={onPointerUp}
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
className="social-date-stamp like"
|
||||||
|
style={{ opacity: fly?.dir === "like" ? 1 : likeOpacity }}
|
||||||
|
>
|
||||||
|
想认识
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
className="social-date-stamp pass"
|
||||||
|
style={{ opacity: fly?.dir === "pass" ? 1 : passOpacity }}
|
||||||
|
>
|
||||||
|
划走
|
||||||
|
</span>
|
||||||
|
<DateCardFace member={current} />
|
||||||
|
</article>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p className="social-date-hint" aria-hidden={!current}>
|
||||||
|
拖卡片左右滑 · 或点下面按钮 · 撤销用 ⌘/Ctrl+Z
|
||||||
|
</p>
|
||||||
|
<div className="social-date-actions">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-date-act pass"
|
||||||
|
disabled={!current || Boolean(fly)}
|
||||||
|
aria-label="跳过"
|
||||||
|
onClick={() => current && commit(current, "pass")}
|
||||||
|
>
|
||||||
|
<X size={28} strokeWidth={2.4} />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-date-act reset"
|
||||||
|
disabled={!history.length}
|
||||||
|
aria-label="撤销上一次"
|
||||||
|
onClick={undo}
|
||||||
|
>
|
||||||
|
<Undo2 size={20} />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-date-act like"
|
||||||
|
disabled={!current || Boolean(fly)}
|
||||||
|
aria-label="想认识"
|
||||||
|
onClick={() => current && commit(current, "like")}
|
||||||
|
>
|
||||||
|
<Heart size={28} strokeWidth={2.2} />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{liked.length > 0 && (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-date-likes"
|
||||||
|
onClick={() => setLikesOpen(true)}
|
||||||
|
>
|
||||||
|
<span>想认识 · {liked.length}</span>
|
||||||
|
<div>
|
||||||
|
{liked.slice(0, 8).map((m) => (
|
||||||
|
<SocialAvatar key={m.id} src={m.avatar} size={34} lazy />
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<em>查看</em>
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{toast ? (
|
||||||
|
<div className="social-date-toast" role="status">
|
||||||
|
{toast}
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
{matchMember ? (
|
||||||
|
<SocialDialog
|
||||||
|
title={`想认识 ${matchMember.name}`}
|
||||||
|
onClose={() => setMatchId(null)}
|
||||||
|
>
|
||||||
|
<div className="social-member-profile">
|
||||||
|
<SocialAvatar src={matchMember.avatar} size={74} />
|
||||||
|
<div>
|
||||||
|
<strong>{matchMember.name}</strong>
|
||||||
|
<p>{matchMember.title}</p>
|
||||||
|
<span className="social-member-city">
|
||||||
|
<MapPin size={12} />
|
||||||
|
{matchMember.city}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</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] || "远程生活"}」。`,
|
||||||
|
)}`,
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<MessageCircle size={15} />
|
||||||
|
去打招呼
|
||||||
|
</Link>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-btn"
|
||||||
|
onClick={() => setMatchId(null)}
|
||||||
|
>
|
||||||
|
继续看看
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</SocialDialog>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
{likesOpen ? (
|
||||||
|
<SocialDialog title="想认识的人" onClose={() => setLikesOpen(false)}>
|
||||||
|
<div className="social-date-match-list">
|
||||||
|
{liked.map((m) => (
|
||||||
|
<article key={m.id} className="social-date-match-row">
|
||||||
|
<SocialAvatar src={m.avatar} size={48} lazy />
|
||||||
|
<div>
|
||||||
|
<strong>{m.name}</strong>
|
||||||
|
<p>
|
||||||
|
{m.title} · {m.city.split("·")[0].trim()}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<Link
|
||||||
|
className="social-btn"
|
||||||
|
href={socialPath(`/people/${m.id}`)}
|
||||||
|
>
|
||||||
|
看看 TA
|
||||||
|
</Link>
|
||||||
|
<Link
|
||||||
|
className="social-btn primary"
|
||||||
|
href={socialPath(
|
||||||
|
`/chat?intro=${encodeURIComponent(
|
||||||
|
`嗨 ${m.name}!想认识你,方便聊聊吗?`,
|
||||||
|
)}`,
|
||||||
|
)}
|
||||||
|
title="去聊天室打招呼"
|
||||||
|
>
|
||||||
|
打招呼
|
||||||
|
</Link>
|
||||||
|
</article>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<div className="social-actions">
|
||||||
|
<Link className="social-btn" href={socialPath("/people")}>
|
||||||
|
回去看看大家
|
||||||
|
</Link>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-btn"
|
||||||
|
onClick={resetDeck}
|
||||||
|
>
|
||||||
|
<RotateCcw size={14} />
|
||||||
|
再看一轮
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</SocialDialog>
|
||||||
|
) : null}
|
||||||
|
<SocialMobileDock />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function DateCardFace({ member }: { member: SocialRosterMember }) {
|
||||||
|
const cover = member.gallery?.[0] || member.avatar;
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div
|
||||||
|
className="social-date-photo"
|
||||||
|
style={{ backgroundImage: `url(${cover})` }}
|
||||||
|
role="img"
|
||||||
|
aria-label={member.name}
|
||||||
|
/>
|
||||||
|
<div className="social-date-gradient" aria-hidden />
|
||||||
|
{member.online ? (
|
||||||
|
<span className="social-date-online-pill">现在在线</span>
|
||||||
|
) : null}
|
||||||
|
<div className="social-date-meta">
|
||||||
|
<div className="social-date-name">
|
||||||
|
<h2>{member.name}</h2>
|
||||||
|
<p>
|
||||||
|
{member.title}
|
||||||
|
{member.vibe ? ` · ${member.vibe}` : ""}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<p className="social-date-city">
|
||||||
|
<MapPin size={14} />
|
||||||
|
{member.city}
|
||||||
|
</p>
|
||||||
|
<p className="social-date-want">{member.lookingFor}</p>
|
||||||
|
<p className="social-date-bio">{member.bio}</p>
|
||||||
|
<div className="social-tags">
|
||||||
|
{member.tags.slice(0, 4).map((tag) => (
|
||||||
|
<span key={tag}>{tag}</span>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useState } from "react";
|
import { useMemo, useState } from "react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import {
|
import {
|
||||||
ArrowUpRight,
|
ArrowUpRight,
|
||||||
@ -8,26 +8,33 @@ import {
|
|||||||
Clock3,
|
Clock3,
|
||||||
Globe2,
|
Globe2,
|
||||||
MessageCircle,
|
MessageCircle,
|
||||||
Radio,
|
Video,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import SiteShell from "./SiteShell";
|
import SiteShell from "./SiteShell";
|
||||||
import {
|
import {
|
||||||
BookmarkButton,
|
BookmarkButton,
|
||||||
|
DemoBadge,
|
||||||
EmptyState,
|
EmptyState,
|
||||||
PageIntro,
|
PageIntro,
|
||||||
SearchField,
|
SearchField,
|
||||||
ShareButton,
|
ShareButton,
|
||||||
} from "./SocialUI";
|
} from "./SocialUI";
|
||||||
import { SEED_MEETUPS } from "@social/lib/seed";
|
|
||||||
import { eventDate, saveEventCalendar } from "@social/lib/calendar";
|
import { eventDate, saveEventCalendar } from "@social/lib/calendar";
|
||||||
import { useLocalState } from "@social/lib/useLocalState";
|
import { useLocalState } from "@social/lib/useLocalState";
|
||||||
import { socialPath } from "@social/lib/socialPath";
|
import { socialPath } from "@social/lib/socialPath";
|
||||||
|
import { resolveSocialCatalog } from "@social/lib/resolveCatalog";
|
||||||
|
import { useSocialConfig } from "./SocialExperience";
|
||||||
|
|
||||||
export default function EventDirectory() {
|
export default function EventDirectory() {
|
||||||
|
const config = useSocialConfig();
|
||||||
|
const catalog = useMemo(
|
||||||
|
() => resolveSocialCatalog(config.copy.socialCatalogs),
|
||||||
|
[config.copy.socialCatalogs],
|
||||||
|
);
|
||||||
const [query, setQuery] = useState("");
|
const [query, setQuery] = useState("");
|
||||||
const [filter, setFilter] = useState("all");
|
const [filter, setFilter] = useState("all");
|
||||||
const [saved] = useLocalState<string[]>("saved-events", []);
|
const [saved] = useLocalState<string[]>("saved-events", []);
|
||||||
const events = SEED_MEETUPS.filter(
|
const events = catalog.meetups.filter(
|
||||||
(item) =>
|
(item) =>
|
||||||
`${item.title} ${item.city}`
|
`${item.title} ${item.city}`
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
@ -35,19 +42,21 @@ export default function EventDirectory() {
|
|||||||
(filter !== "saved" || saved.includes(item.id)),
|
(filter !== "saved" || saved.includes(item.id)),
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<SiteShell title="Meetup 活动">
|
<SiteShell title="开视频聊聊">
|
||||||
<PageIntro
|
<PageIntro title="随时,聊得来" accent="开视频">
|
||||||
eyebrow="SHOW UP. FIND YOUR PEOPLE."
|
<DemoBadge>
|
||||||
title="把下一个晚上,"
|
{catalog.source === "remote" ? "最新场次" : "先看看有哪些场"}
|
||||||
accent="留给有趣的对话。"
|
</DemoBadge>
|
||||||
description="线上办公室、城市闲聊、主题 AMA。你可以先听听,也可以分享一个正在探索的问题。"
|
</PageIntro>
|
||||||
/>
|
<p className="social-muted social-event-lead reveal">
|
||||||
<div className="social-toolbar">
|
几个人一起开摄像头见面聊天,比只打字更近一点。
|
||||||
|
</p>
|
||||||
|
<div className="social-toolbar reveal">
|
||||||
<SearchField
|
<SearchField
|
||||||
value={query}
|
value={query}
|
||||||
onChange={setQuery}
|
onChange={setQuery}
|
||||||
label="搜索活动"
|
label="搜索"
|
||||||
placeholder="搜索主题或城市…"
|
placeholder="主题 / 城市"
|
||||||
/>
|
/>
|
||||||
<div className="social-filters">
|
<div className="social-filters">
|
||||||
<button
|
<button
|
||||||
@ -55,48 +64,45 @@ export default function EventDirectory() {
|
|||||||
className={filter === "all" ? "active" : ""}
|
className={filter === "all" ? "active" : ""}
|
||||||
onClick={() => setFilter("all")}
|
onClick={() => setFilter("all")}
|
||||||
>
|
>
|
||||||
全部活动
|
全部
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
aria-pressed={filter === "saved"}
|
aria-pressed={filter === "saved"}
|
||||||
className={filter === "saved" ? "active" : ""}
|
className={filter === "saved" ? "active" : ""}
|
||||||
onClick={() => setFilter("saved")}
|
onClick={() => setFilter("saved")}
|
||||||
>
|
>
|
||||||
我的计划
|
我想参加的
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="social-status">
|
<div className="social-status social-event-banner reveal">
|
||||||
<Globe2 size={15} />
|
<Globe2 size={15} />
|
||||||
活动目录预览 · 原始时间默认使用北京时间(UTC+8)·
|
<span>
|
||||||
加入计划仅保存在当前设备
|
时间按北京时间显示 · 「想参加」先记在你这边,还不等于已经约好
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="social-event-grid">
|
<div className="social-event-grid">
|
||||||
{events.map((event, index) => (
|
{events.map((event, index) => (
|
||||||
<article
|
<article
|
||||||
className={`social-card social-event-card event-${index}`}
|
className={`social-card social-event-card social-panel-fx reveal event-${index % 3}`}
|
||||||
key={event.id}
|
key={event.id}
|
||||||
|
style={{ ["--stagger" as string]: `${index * 70}ms` }}
|
||||||
>
|
>
|
||||||
<div className="social-event-art" aria-hidden="true">
|
<div className="social-event-art is-video" aria-hidden="true">
|
||||||
<span>0{index + 1}</span>
|
<span>{String(index + 1).padStart(2, "0")}</span>
|
||||||
<div>
|
<div className="social-video-grid social-video-grid-sm">
|
||||||
{Array.from({ length: 24 }, (_, i) => (
|
{Array.from({ length: 4 }, (_, i) => (
|
||||||
<i
|
<span key={i} className="social-video-tile is-ghost" />
|
||||||
key={i}
|
|
||||||
style={{
|
|
||||||
height: `${14 + ((i * 17) % 56)}px`,
|
|
||||||
animationDelay: `${i * -0.13}s`,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<Radio size={28} strokeWidth={1.3} />
|
<Video size={26} strokeWidth={1.3} />
|
||||||
</div>
|
</div>
|
||||||
|
<div className="social-event-body">
|
||||||
<div className="social-card-top">
|
<div className="social-card-top">
|
||||||
<span className="social-badge live">
|
<span className="social-badge live">
|
||||||
{event.mode === "hybrid" ? "线上 + 线下" : "线上相聚"}
|
{event.mode === "hybrid" ? "线上+线下" : "线上见面"}
|
||||||
</span>
|
</span>
|
||||||
<span className="social-badge">活动预览</span>
|
<span className="social-badge">可以先看看</span>
|
||||||
</div>
|
</div>
|
||||||
<h2>{event.title}</h2>
|
<h2>{event.title}</h2>
|
||||||
<p className="social-event-time">
|
<p className="social-event-time">
|
||||||
@ -104,7 +110,7 @@ export default function EventDirectory() {
|
|||||||
{event.date} · {event.time} 北京时间
|
{event.date} · {event.time} 北京时间
|
||||||
</p>
|
</p>
|
||||||
<p className="social-muted" suppressHydrationWarning>
|
<p className="social-muted" suppressHydrationWarning>
|
||||||
你的当地时间:
|
你那边大约是:
|
||||||
{eventDate(event).toLocaleString([], {
|
{eventDate(event).toLocaleString([], {
|
||||||
month: "short",
|
month: "short",
|
||||||
day: "numeric",
|
day: "numeric",
|
||||||
@ -113,66 +119,59 @@ export default function EventDirectory() {
|
|||||||
timeZoneName: "short",
|
timeZoneName: "short",
|
||||||
})}
|
})}
|
||||||
</p>
|
</p>
|
||||||
<div className="social-card-actions">
|
<div className="social-event-cta">
|
||||||
<Link
|
<Link
|
||||||
className="social-btn primary"
|
className="social-btn primary"
|
||||||
href={socialPath(`/meetup/${event.id}`)}
|
href={socialPath(`/meetup/${event.id}`)}
|
||||||
>
|
>
|
||||||
进入活动空间 <ArrowUpRight size={15} />
|
去开视频 <ArrowUpRight size={15} />
|
||||||
</Link>
|
</Link>
|
||||||
<BookmarkButton
|
<BookmarkButton
|
||||||
id={event.id}
|
id={event.id}
|
||||||
collection="saved-events"
|
collection="saved-events"
|
||||||
label="加入计划"
|
label="想参加"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="social-card-actions">
|
<div className="social-event-tools">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="social-save"
|
className="social-save"
|
||||||
onClick={() => saveEventCalendar(event)}
|
onClick={() => saveEventCalendar(event)}
|
||||||
>
|
>
|
||||||
<CalendarPlus size={14} />
|
<CalendarPlus size={14} />
|
||||||
添加到日历
|
加到日历
|
||||||
</button>
|
</button>
|
||||||
<ShareButton
|
<ShareButton
|
||||||
path={`/social/meetup/${event.id}`}
|
path={socialPath(`/meetup/${event.id}`)}
|
||||||
title={event.title}
|
title={event.title}
|
||||||
/>
|
/>
|
||||||
<Link
|
<Link className="social-save" href={socialPath("/chat")}>
|
||||||
className="social-save"
|
|
||||||
href={socialPath(`/chat/${event.channelId}`)}
|
|
||||||
>
|
|
||||||
<MessageCircle size={14} />
|
<MessageCircle size={14} />
|
||||||
先去聊聊
|
去聊天
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</article>
|
</article>
|
||||||
))}
|
))}
|
||||||
{!events.length && (
|
{!events.length && (
|
||||||
<EmptyState
|
<EmptyState
|
||||||
title="给下一场相遇留个位置"
|
emoji="📡"
|
||||||
description="收藏感兴趣的活动后,可以在「我的计划」里找到它们。"
|
title="暂时没有合适的场"
|
||||||
/>
|
description="换个词试试,或者看看全部场次。"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-btn"
|
||||||
|
onClick={() => {
|
||||||
|
setQuery("");
|
||||||
|
setFilter("all");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
重新看看
|
||||||
|
</button>
|
||||||
|
</EmptyState>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<section className="social-panel social-event-guide">
|
|
||||||
<h2>第一次参加?轻松一点就好。</h2>
|
|
||||||
<div>
|
|
||||||
<p>
|
|
||||||
<span>01</span>
|
|
||||||
<strong>选一个话题</strong>看看标题,想一个你真的好奇的问题。
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<span>02</span>
|
|
||||||
<strong>先在文字区打招呼</strong>说说你在哪里,正在做什么。
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<span>03</span>
|
|
||||||
<strong>准备好了再开麦</strong>视频和麦克风由你自己决定。
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</SiteShell>
|
</SiteShell>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,29 +1,20 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
/** Dense CSS-only floating emoji field — obvious motion, no framer. */
|
/** Soft ambient accents — few, small, low opacity; never steal focus. */
|
||||||
const EMOJIS = [
|
const EMOJIS = [
|
||||||
{ e: "☕", x: "5%", y: "16%", delay: "0s", dur: "4.8s", size: "2.4rem" },
|
{ e: "☕", x: "8%", y: "22%", delay: "0s", dur: "9s", size: "1.1rem" },
|
||||||
{ e: "🌏", x: "90%", y: "18%", delay: "0.35s", dur: "5.4s", size: "2.6rem" },
|
{ e: "🌏", x: "88%", y: "20%", delay: "1.2s", dur: "11s", size: "1.15rem" },
|
||||||
{ e: "💬", x: "80%", y: "55%", delay: "0.7s", dur: "4.6s", size: "2.1rem" },
|
{ e: "✨", x: "78%", y: "62%", delay: "2.4s", dur: "10s", size: "0.95rem" },
|
||||||
{ e: "🎒", x: "10%", y: "58%", delay: "1.1s", dur: "5.8s", size: "2.2rem" },
|
{ e: "💬", x: "14%", y: "68%", delay: "0.8s", dur: "12s", size: "1rem" },
|
||||||
{ e: "✨", x: "46%", y: "8%", delay: "0.15s", dur: "4.2s", size: "1.9rem" },
|
{ e: "🚀", x: "52%", y: "12%", delay: "3s", dur: "10.5s", size: "0.9rem" },
|
||||||
{ e: "🤝", x: "60%", y: "72%", delay: "1.4s", dur: "5.2s", size: "2.15rem" },
|
|
||||||
{ e: "🚀", x: "26%", y: "36%", delay: "0.55s", dur: "5.6s", size: "2rem" },
|
|
||||||
{ e: "💚", x: "72%", y: "30%", delay: "0.95s", dur: "4.9s", size: "1.75rem" },
|
|
||||||
{ e: "📡", x: "36%", y: "78%", delay: "1.25s", dur: "6s", size: "2.05rem" },
|
|
||||||
{ e: "🔥", x: "94%", y: "68%", delay: "0.4s", dur: "4.5s", size: "2rem" },
|
|
||||||
{ e: "🌈", x: "18%", y: "28%", delay: "1.6s", dur: "5.3s", size: "1.85rem" },
|
|
||||||
{ e: "🎯", x: "54%", y: "48%", delay: "0.85s", dur: "5.1s", size: "1.7rem" },
|
|
||||||
{ e: "💫", x: "68%", y: "12%", delay: "1.8s", dur: "4.7s", size: "1.8rem" },
|
|
||||||
{ e: "🌊", x: "42%", y: "62%", delay: "0.25s", dur: "5.9s", size: "1.95rem" },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
export default function FloatingEmojiField() {
|
export default function FloatingEmojiField() {
|
||||||
return (
|
return (
|
||||||
<div className="social-emoji-field" aria-hidden>
|
<div className="social-emoji-field social-emoji-field-soft" aria-hidden>
|
||||||
{EMOJIS.map((item) => (
|
{EMOJIS.map((item) => (
|
||||||
<span
|
<span
|
||||||
key={item.e + item.x + item.y}
|
key={item.e + item.x}
|
||||||
className="social-emoji-float"
|
className="social-emoji-float"
|
||||||
style={{
|
style={{
|
||||||
left: item.x,
|
left: item.x,
|
||||||
|
|||||||
@ -1,24 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
/** Endless emoji marquee between sections — CSS only. */
|
/** Quiet section divider — sparse glyphs, low visual weight. */
|
||||||
const ROW = [
|
const ROW = ["☕", "🌏", "💬", "✨", "📡", "🚀"];
|
||||||
"☕",
|
|
||||||
"🌏",
|
|
||||||
"💬",
|
|
||||||
"🎒",
|
|
||||||
"✨",
|
|
||||||
"🤝",
|
|
||||||
"📡",
|
|
||||||
"🚀",
|
|
||||||
"💚",
|
|
||||||
"🎯",
|
|
||||||
"🔥",
|
|
||||||
"🌈",
|
|
||||||
"💫",
|
|
||||||
"🌊",
|
|
||||||
"👋",
|
|
||||||
"🎤",
|
|
||||||
];
|
|
||||||
|
|
||||||
export default function FxBelt() {
|
export default function FxBelt() {
|
||||||
const line = [...ROW, ...ROW, ...ROW].join(" ");
|
const line = [...ROW, ...ROW, ...ROW].join(" ");
|
||||||
|
|||||||
@ -1,33 +1,39 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useEffect, useState, type PointerEvent } from "react";
|
import { useEffect, useMemo, useState, type PointerEvent } from "react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import SiteShell from "./SiteShell";
|
import SiteShell from "./SiteShell";
|
||||||
import JoinPayModal from "./JoinPayModal";
|
import JoinPayModal from "./JoinPayModal";
|
||||||
import AttractiveRoster from "./AttractiveRoster";
|
import AttractiveRoster from "./AttractiveRoster";
|
||||||
import WorldConnections from "./WorldConnections";
|
|
||||||
import ConnectionHero, { ConnectionWays } from "./ConnectionHero";
|
import ConnectionHero, { ConnectionWays } from "./ConnectionHero";
|
||||||
import FxBelt from "./FxBelt";
|
import FxBelt from "./FxBelt";
|
||||||
import SectionSpark from "./SectionSpark";
|
import SectionSpark from "./SectionSpark";
|
||||||
import { ArrowUpRight, Coffee, Radio, Sparkles } from "lucide-react";
|
import CityDirectory from "./CityDirectory";
|
||||||
|
import SocialBrandLogo from "./SocialBrandLogo";
|
||||||
|
import SocialAvatar from "./SocialAvatar";
|
||||||
import {
|
import {
|
||||||
SEED_CAFES,
|
ArrowUpRight,
|
||||||
SEED_GIGS,
|
BookOpen,
|
||||||
SEED_MEETUPS,
|
Heart,
|
||||||
TEAM_KIND_LABEL,
|
Sparkles,
|
||||||
} from "@social/lib/seed";
|
Video,
|
||||||
|
} from "lucide-react";
|
||||||
|
import { TEAM_KIND_LABEL, SEED_EBOOKS, SEED_VIDEOS } from "@social/lib/seed";
|
||||||
|
import { resolveSocialCatalog } from "@social/lib/resolveCatalog";
|
||||||
import { socialPath } from "@social/lib/socialPath";
|
import { socialPath } from "@social/lib/socialPath";
|
||||||
import { useRemoteConfig } from "~/lib/use-remote-config";
|
import { useRemoteConfig } from "~/lib/use-remote-config";
|
||||||
import { resolveSocialLandingCopy } from "@social/lib/landing";
|
import { resolveSocialLandingCopy } from "@social/lib/landing";
|
||||||
|
import { MOCK_ROSTER } from "@social/lib/rosterMock";
|
||||||
|
|
||||||
const DEFAULT_PROMO =
|
const DEFAULT_PROMO =
|
||||||
"https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4";
|
"https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4";
|
||||||
|
|
||||||
const PATH = [
|
const PATH = [
|
||||||
{ href: "#people", label: "想见的人", emoji: "👋" },
|
{ href: "#people", label: "想见的人", emoji: "👋" },
|
||||||
{ href: "#meetup", label: "Meetup", emoji: "📡" },
|
{ href: "#date", label: "认识一下", emoji: "💕" },
|
||||||
{ href: "#coffeechat", label: "Coffeechat", emoji: "☕" },
|
{ href: "#meetup", label: "开视频", emoji: "📹" },
|
||||||
{ href: "#team", label: "远程组队", emoji: "🚀" },
|
{ href: "#cities", label: "见一面", emoji: "🌆" },
|
||||||
|
{ href: "#team", label: "一起做事", emoji: "🚀" },
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
const ROLE_EMOJI: Record<string, string> = {
|
const ROLE_EMOJI: Record<string, string> = {
|
||||||
@ -47,6 +53,13 @@ export default function HomeClient() {
|
|||||||
)?.promoVideoUrl?.trim() ||
|
)?.promoVideoUrl?.trim() ||
|
||||||
DEFAULT_PROMO;
|
DEFAULT_PROMO;
|
||||||
const landingCopy = resolveSocialLandingCopy(config.copy);
|
const landingCopy = resolveSocialLandingCopy(config.copy);
|
||||||
|
const catalog = useMemo(
|
||||||
|
() => resolveSocialCatalog(config.copy.socialCatalogs),
|
||||||
|
[config.copy.socialCatalogs],
|
||||||
|
);
|
||||||
|
const meetups = catalog.meetups;
|
||||||
|
const gigs = catalog.gigs;
|
||||||
|
const datePreview = MOCK_ROSTER.filter((m) => m.online).slice(0, 3);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const root = document.querySelector(".social-home");
|
const root = document.querySelector(".social-home");
|
||||||
@ -123,7 +136,6 @@ export default function HomeClient() {
|
|||||||
copy={landingCopy}
|
copy={landingCopy}
|
||||||
/>
|
/>
|
||||||
<ConnectionWays copy={landingCopy} />
|
<ConnectionWays copy={landingCopy} />
|
||||||
<WorldConnections />
|
|
||||||
|
|
||||||
<nav className="social-path" aria-label="本页导航">
|
<nav className="social-path" aria-label="本页导航">
|
||||||
<div className="container">
|
<div className="container">
|
||||||
@ -149,91 +161,174 @@ export default function HomeClient() {
|
|||||||
|
|
||||||
<AttractiveRoster onJoin={() => setJoinOpen(true)} />
|
<AttractiveRoster onJoin={() => setJoinOpen(true)} />
|
||||||
|
|
||||||
|
<section
|
||||||
|
className="section section-compact social-section-alt"
|
||||||
|
id="date"
|
||||||
|
aria-label="认识一下"
|
||||||
|
>
|
||||||
|
<div className="container">
|
||||||
|
<div className="social-date-hero reveal">
|
||||||
|
<div className="social-date-hero-copy">
|
||||||
|
<span className="section-tag">
|
||||||
|
<span>认识一下</span>
|
||||||
|
<span>左右滑</span>
|
||||||
|
</span>
|
||||||
|
<h2>
|
||||||
|
<span className="social-title-emoji" aria-hidden>
|
||||||
|
💕
|
||||||
|
</span>
|
||||||
|
一张一张认识新朋友
|
||||||
|
</h2>
|
||||||
|
<p>
|
||||||
|
像翻相册一样:不感兴趣就划走,想认识就留下。
|
||||||
|
记在你这边,之后再决定要不要打招呼。
|
||||||
|
</p>
|
||||||
|
<ul className="social-date-hero-steps">
|
||||||
|
<li>
|
||||||
|
<em>←</em> 划走
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<em>→</em> 想认识
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<em>♥</em> 稍后打招呼
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<div className="social-date-stage-acts">
|
||||||
|
<Link
|
||||||
|
className="btn btn-primary"
|
||||||
|
href={socialPath("/date")}
|
||||||
|
>
|
||||||
|
开始认识
|
||||||
|
<ArrowUpRight size={16} />
|
||||||
|
</Link>
|
||||||
|
<Link
|
||||||
|
className="btn btn-ghost"
|
||||||
|
href={socialPath("/people")}
|
||||||
|
>
|
||||||
|
先浏览大家
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Link
|
||||||
|
href={socialPath("/date")}
|
||||||
|
className="social-date-hero-deck"
|
||||||
|
aria-label="开始认识"
|
||||||
|
>
|
||||||
|
{datePreview.map((m, i) => (
|
||||||
|
<div
|
||||||
|
key={m.id}
|
||||||
|
className={`social-date-hero-card social-date-hero-card-${i}`}
|
||||||
|
style={{
|
||||||
|
["--i" as string]: i,
|
||||||
|
backgroundImage: `linear-gradient(180deg, transparent 35%, #0a0a0ef2 88%), url(${m.avatar})`,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{m.online ? (
|
||||||
|
<span className="social-date-hero-online">在线</span>
|
||||||
|
) : null}
|
||||||
|
<div className="social-date-hero-meta">
|
||||||
|
<strong>
|
||||||
|
{m.name}
|
||||||
|
<small>{m.title}</small>
|
||||||
|
</strong>
|
||||||
|
<em>{m.city.split("·")[0].trim()}</em>
|
||||||
|
<p>{m.lookingFor}</p>
|
||||||
|
<div className="social-date-card-tags">
|
||||||
|
{m.tags.slice(0, 2).map((t) => (
|
||||||
|
<span key={t}>{t}</span>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
<span className="social-date-hero-cta">
|
||||||
|
<Heart size={14} /> 点这里开始滑
|
||||||
|
</span>
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<FxBelt />
|
<FxBelt />
|
||||||
|
|
||||||
<section
|
<section
|
||||||
className="section section-compact social-section-alt"
|
className="section section-compact social-section-alt"
|
||||||
id="meetup"
|
id="meetup"
|
||||||
aria-label="Meetup"
|
aria-label="开视频聊聊"
|
||||||
>
|
>
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<div className="section-header reveal">
|
<div className="section-header reveal">
|
||||||
<SectionSpark label="meetup" />
|
<SectionSpark label="meetup" />
|
||||||
<span className="section-tag">
|
<span className="section-tag">
|
||||||
<span>02 / MEETUP</span>
|
<span>开视频</span>
|
||||||
<span>让想法在对话中发生</span>
|
<span>{meetups.length} 场可看</span>
|
||||||
</span>
|
</span>
|
||||||
<h2>
|
<h2>
|
||||||
<span className="social-title-emoji" aria-hidden>
|
<span className="social-title-emoji" aria-hidden>
|
||||||
📡
|
📹
|
||||||
</span>
|
</span>
|
||||||
隔着屏幕,也能聊到同频
|
{landingCopy.socialOnlineTitle}
|
||||||
</h2>
|
</h2>
|
||||||
<p>
|
<p>
|
||||||
{SEED_MEETUPS.length} 场活动预览 ·
|
几个人一起开摄像头见面,比只打字更近一点。
|
||||||
可以先听听,再慢慢打开话匣子
|
「想参加」会先记在你这边。
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="social-panel-grid social-panel-grid-2">
|
<div className="social-panel-grid social-panel-grid-2">
|
||||||
{SEED_MEETUPS.map((m, i) => (
|
{meetups.map((m, i) => (
|
||||||
<article
|
<article
|
||||||
key={m.id}
|
key={m.id}
|
||||||
className={`social-panel social-panel-fx reveal${i === 0 ? " is-accent" : ""}`}
|
className={`social-panel social-panel-fx reveal${i === 0 ? " is-accent" : ""}`}
|
||||||
style={{ ["--stagger" as string]: `${i * 80}ms` }}
|
style={{ ["--stagger" as string]: `${i * 80}ms` }}
|
||||||
>
|
>
|
||||||
<div className="connection-meetup-art" aria-hidden="true">
|
<div
|
||||||
<span className="connection-meetup-number">0{i + 1}</span>
|
className="connection-meetup-art is-video"
|
||||||
<div className="connection-audio-bars">
|
aria-hidden="true"
|
||||||
{Array.from({ length: 18 }, (_, n) => (
|
>
|
||||||
<i
|
<span className="connection-meetup-number">
|
||||||
key={n}
|
0{i + 1}
|
||||||
style={{
|
</span>
|
||||||
height: `${12 + ((n * 17 + i * 13) % 55)}px`,
|
<div className="social-video-grid">
|
||||||
animationDelay: `${n * -0.15}s`,
|
{MOCK_ROSTER.slice(i, i + 4).map((p) => (
|
||||||
}}
|
<span key={p.id} className="social-video-tile">
|
||||||
/>
|
<SocialAvatar src={p.avatar} size={36} lazy />
|
||||||
|
</span>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<Radio size={26} strokeWidth={1.2} />
|
<Video size={22} strokeWidth={1.3} />
|
||||||
</div>
|
</div>
|
||||||
<div className="social-panel-meta">
|
<div className="social-panel-meta">
|
||||||
<span>{m.city === "Online" ? "线上" : m.city}</span>
|
<span>{m.city === "Online" ? "线上见面" : m.city}</span>
|
||||||
<time>
|
<time>
|
||||||
{m.date} · {m.time}
|
{m.date} · {m.time}
|
||||||
</time>
|
</time>
|
||||||
</div>
|
</div>
|
||||||
<h3>{m.title}</h3>
|
<h3>{m.title}</h3>
|
||||||
<p>文字暖场 → MiroTalk 开麦 → 认识新朋友</p>
|
<p>进来开摄像头,和几位新朋友面对面聊</p>
|
||||||
<Link
|
<Link
|
||||||
className="btn btn-primary btn-sm"
|
className="btn btn-primary btn-sm"
|
||||||
href={socialPath(`/meetup/${m.id}`)}
|
href={socialPath(`/meetup/${m.id}`)}
|
||||||
>
|
>
|
||||||
进房
|
去开视频
|
||||||
<svg
|
<ArrowUpRight size={14} />
|
||||||
width="16"
|
|
||||||
height="16"
|
|
||||||
viewBox="0 0 24 24"
|
|
||||||
fill="none"
|
|
||||||
stroke="currentColor"
|
|
||||||
strokeWidth="2"
|
|
||||||
aria-hidden
|
|
||||||
>
|
|
||||||
<path d="M5 12h14M12 5l7 7-7 7" />
|
|
||||||
</svg>
|
|
||||||
</Link>
|
</Link>
|
||||||
</article>
|
</article>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<div className="social-section-actions reveal">
|
<div className="social-section-actions reveal">
|
||||||
<Link href={socialPath("/meetup")} className="btn btn-ghost">
|
<Link href={socialPath("/meetup")} className="btn btn-ghost">
|
||||||
全部 Meetup
|
看看全部
|
||||||
|
</Link>
|
||||||
|
<Link href={socialPath("/chat")} className="btn btn-ghost">
|
||||||
|
去文字聊天
|
||||||
</Link>
|
</Link>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-ghost"
|
className="btn btn-ghost"
|
||||||
onClick={() => setJoinOpen(true)}
|
onClick={() => setJoinOpen(true)}
|
||||||
>
|
>
|
||||||
加群占座
|
加入社区
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -243,72 +338,38 @@ export default function HomeClient() {
|
|||||||
|
|
||||||
<section
|
<section
|
||||||
className="section section-compact"
|
className="section section-compact"
|
||||||
id="coffeechat"
|
id="cities"
|
||||||
aria-label="Coffeechat"
|
aria-label="同城见一面"
|
||||||
>
|
>
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<div className="section-header reveal">
|
<div className="section-header reveal">
|
||||||
<SectionSpark label="coffee" />
|
<SectionSpark label="cities" />
|
||||||
<span className="section-tag">
|
<span className="section-tag">
|
||||||
<span>03 / COFFEECHAT</span>
|
<span>挑一座城</span>
|
||||||
<span>把线上默契,带到线下</span>
|
<span>再出来见面</span>
|
||||||
</span>
|
</span>
|
||||||
<h2>
|
<h2>
|
||||||
<span className="social-title-emoji" aria-hidden>
|
<span className="social-title-emoji" aria-hidden>
|
||||||
☕
|
🌆
|
||||||
</span>
|
</span>
|
||||||
咖啡馆里把网友变朋友
|
{landingCopy.socialOfflineTitle}
|
||||||
</h2>
|
</h2>
|
||||||
<p>精选合作店 · 插座够 · 适合 1v1 / 小局</p>
|
<p>
|
||||||
</div>
|
认识了、聊过之后,出来见一面会更自然。
|
||||||
<div className="social-panel-grid social-panel-grid-4">
|
先挑一座城市,再找适合见面的咖啡馆。
|
||||||
{SEED_CAFES.map((c, i) => (
|
</p>
|
||||||
<article
|
|
||||||
key={c.id}
|
|
||||||
className={`social-panel social-panel-fx connection-cafe connection-cafe-${i} reveal`}
|
|
||||||
style={{ ["--stagger" as string]: `${i * 70}ms` }}
|
|
||||||
>
|
|
||||||
<div
|
|
||||||
className="social-panel-ico social-panel-ico-bounce"
|
|
||||||
aria-hidden
|
|
||||||
>
|
|
||||||
<Coffee size={27} strokeWidth={1.3} />
|
|
||||||
</div>
|
|
||||||
<div className="social-panel-meta">
|
|
||||||
<span>{c.city}</span>
|
|
||||||
{c.partners ? (
|
|
||||||
<span className="is-warm">合作店</span>
|
|
||||||
) : null}
|
|
||||||
</div>
|
|
||||||
<h3>{c.name}</h3>
|
|
||||||
<p>{c.vibe}</p>
|
|
||||||
<div className="social-panel-foot">
|
|
||||||
<span>⭐ {c.rating}</span>
|
|
||||||
<span>📶 {c.wifiMbps}M</span>
|
|
||||||
</div>
|
|
||||||
<Link
|
|
||||||
className="btn btn-primary btn-sm"
|
|
||||||
href={socialPath("/coffeechat")}
|
|
||||||
>
|
|
||||||
约见
|
|
||||||
</Link>
|
|
||||||
</article>
|
|
||||||
))}
|
|
||||||
</div>
|
</div>
|
||||||
|
<CityDirectory compact limit={8} />
|
||||||
<div className="social-section-actions reveal">
|
<div className="social-section-actions reveal">
|
||||||
<Link
|
<Link
|
||||||
href={socialPath("/coffeechat")}
|
href={socialPath("/coffeechat")}
|
||||||
className="btn btn-ghost"
|
className="btn btn-primary"
|
||||||
>
|
>
|
||||||
全部咖啡馆
|
看看咖啡馆
|
||||||
|
</Link>
|
||||||
|
<Link href={socialPath("/people")} className="btn btn-ghost">
|
||||||
|
找同城的人
|
||||||
</Link>
|
</Link>
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="btn btn-ghost"
|
|
||||||
onClick={() => setJoinOpen(true)}
|
|
||||||
>
|
|
||||||
加群找同城
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
@ -318,28 +379,38 @@ export default function HomeClient() {
|
|||||||
<section
|
<section
|
||||||
className="section section-compact social-section-alt"
|
className="section section-compact social-section-alt"
|
||||||
id="team"
|
id="team"
|
||||||
aria-label="远程团队"
|
aria-label="一起做点事"
|
||||||
>
|
>
|
||||||
<div className="container">
|
<div className="container">
|
||||||
<div className="section-header reveal">
|
<div className="section-header reveal">
|
||||||
<SectionSpark label="team" />
|
<SectionSpark label="team" />
|
||||||
<span className="section-tag">
|
<span className="section-tag">
|
||||||
<span>04 / CO-CREATE</span>
|
<span>找搭子</span>
|
||||||
<span>好的伙伴,让自由走得更远</span>
|
<span>共创</span>
|
||||||
</span>
|
</span>
|
||||||
<h2>
|
<h2>
|
||||||
<span className="social-title-emoji" aria-hidden>
|
<span className="social-title-emoji" aria-hidden>
|
||||||
🚀
|
🚀
|
||||||
</span>
|
</span>
|
||||||
有些可能,适合一起实现
|
{landingCopy.socialTeamTitle}
|
||||||
</h2>
|
</h2>
|
||||||
<p>志愿 / 兼职 / 全职 · 先聊人再投 · 群里可问内推</p>
|
<p>
|
||||||
|
有人在找帮手;也有人一起写小册、拍视频做共创。
|
||||||
|
点卡片看看详情,合适再表达兴趣。
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="social-together-tabs reveal" aria-hidden>
|
||||||
|
<span className="is-on">找搭子</span>
|
||||||
|
<span>共创</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="social-panel-grid social-panel-grid-3">
|
<div className="social-panel-grid social-panel-grid-3">
|
||||||
{SEED_GIGS.slice(0, 6).map((g, i) => (
|
{gigs.slice(0, 3).map((g, i) => (
|
||||||
<article
|
<Link
|
||||||
key={g.id}
|
key={g.id}
|
||||||
className="social-panel social-panel-fx connection-team reveal"
|
href={socialPath(`/team#${g.id}`)}
|
||||||
|
className="social-panel social-panel-fx connection-team reveal is-clickable"
|
||||||
style={{ ["--stagger" as string]: `${i * 60}ms` }}
|
style={{ ["--stagger" as string]: `${i * 60}ms` }}
|
||||||
>
|
>
|
||||||
<div className="social-panel-ico" aria-hidden>
|
<div className="social-panel-ico" aria-hidden>
|
||||||
@ -347,7 +418,7 @@ export default function HomeClient() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="social-panel-meta">
|
<div className="social-panel-meta">
|
||||||
<span>{TEAM_KIND_LABEL[g.kind || "parttime"]}</span>
|
<span>{TEAM_KIND_LABEL[g.kind || "parttime"]}</span>
|
||||||
<span>{g.remote ? "远程" : "可线下"}</span>
|
<span>{g.remote ? "线上也能做" : "可以见面做"}</span>
|
||||||
</div>
|
</div>
|
||||||
<h3>{g.title}</h3>
|
<h3>{g.title}</h3>
|
||||||
<p>{g.pay}</p>
|
<p>{g.pay}</p>
|
||||||
@ -356,25 +427,62 @@ export default function HomeClient() {
|
|||||||
<span key={t}>{t}</span>
|
<span key={t}>{t}</span>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<Link
|
|
||||||
className="btn btn-primary btn-sm"
|
|
||||||
href={socialPath("/team")}
|
|
||||||
>
|
|
||||||
聊聊
|
|
||||||
</Link>
|
</Link>
|
||||||
</article>
|
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div className="social-ugc-row reveal">
|
||||||
|
{SEED_EBOOKS.slice(0, 2).map((book) => (
|
||||||
|
<Link
|
||||||
|
key={book.id}
|
||||||
|
href={socialPath("/ebook")}
|
||||||
|
className="social-ugc-card"
|
||||||
|
>
|
||||||
|
<span className="social-ugc-ico" aria-hidden>
|
||||||
|
<BookOpen size={20} />
|
||||||
|
</span>
|
||||||
|
<div>
|
||||||
|
<em>共创 · 小册</em>
|
||||||
|
<strong>{book.title}</strong>
|
||||||
|
<p>{book.blurb}</p>
|
||||||
|
</div>
|
||||||
|
<ArrowUpRight size={16} />
|
||||||
|
</Link>
|
||||||
|
))}
|
||||||
|
{SEED_VIDEOS.slice(0, 2).map((vid) => (
|
||||||
|
<Link
|
||||||
|
key={vid.id}
|
||||||
|
href={socialPath("/videos")}
|
||||||
|
className="social-ugc-card is-video"
|
||||||
|
>
|
||||||
|
<span className="social-ugc-ico" aria-hidden>
|
||||||
|
{vid.coverEmoji}
|
||||||
|
</span>
|
||||||
|
<div>
|
||||||
|
<em>共创 · 视频</em>
|
||||||
|
<strong>{vid.title}</strong>
|
||||||
|
<p>
|
||||||
|
{vid.city} · {vid.minutes} 分钟
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<ArrowUpRight size={16} />
|
||||||
|
</Link>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
<div className="social-section-actions reveal">
|
<div className="social-section-actions reveal">
|
||||||
<Link href={socialPath("/team")} className="btn btn-ghost">
|
<Link href={socialPath("/team")} className="btn btn-ghost">
|
||||||
全部岗位
|
更多机会
|
||||||
|
</Link>
|
||||||
|
<Link href={socialPath("/ebook")} className="btn btn-ghost">
|
||||||
|
逛共创
|
||||||
</Link>
|
</Link>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-ghost"
|
className="btn btn-ghost"
|
||||||
onClick={() => setJoinOpen(true)}
|
onClick={() => setJoinOpen(true)}
|
||||||
>
|
>
|
||||||
加群问内推
|
加入社区
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -390,7 +498,7 @@ export default function HomeClient() {
|
|||||||
<Sparkles size={52} strokeWidth={1} />
|
<Sparkles size={52} strokeWidth={1} />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span className="connection-eyebrow">YOUR NEXT CHAPTER</span>
|
<span className="connection-eyebrow">加入社区</span>
|
||||||
<h2>{landingCopy.socialInviteTitle}</h2>
|
<h2>{landingCopy.socialInviteTitle}</h2>
|
||||||
<p>{landingCopy.socialInviteLead}</p>
|
<p>{landingCopy.socialInviteLead}</p>
|
||||||
</div>
|
</div>
|
||||||
@ -408,31 +516,29 @@ export default function HomeClient() {
|
|||||||
<div className="container">
|
<div className="container">
|
||||||
<div className="footer-grid footer-grid-rings">
|
<div className="footer-grid footer-grid-rings">
|
||||||
<div className="footer-brand">
|
<div className="footer-brand">
|
||||||
<div className="nav-logo">
|
<SocialBrandLogo />
|
||||||
<span className="logo-icon social-logo-spin">◈</span>
|
<p>认识同频的人 · 开视频聊聊 · 出来见一面 · 一起做点事</p>
|
||||||
<span className="logo-text">游民社区</span>
|
|
||||||
</div>
|
|
||||||
<p>数字游民社交场:加群、Coffeechat、Meetup、远程组队。</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="footer-links">
|
<div className="footer-links">
|
||||||
<h4>连接</h4>
|
<h4>认识人</h4>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="social-footer-link"
|
className="social-footer-link"
|
||||||
onClick={() => setJoinOpen(true)}
|
onClick={() => setJoinOpen(true)}
|
||||||
>
|
>
|
||||||
加群
|
加入社区
|
||||||
</button>
|
</button>
|
||||||
<Link href={socialPath("/chat")}>聊天室</Link>
|
<Link href={socialPath("/people")}>想见的人</Link>
|
||||||
<Link href={socialPath("/meetup")}>Meetup</Link>
|
<Link href={socialPath("/date")}>认识一下</Link>
|
||||||
<Link href={socialPath("/coffeechat")}>Coffeechat</Link>
|
<Link href={socialPath("/meetup")}>开视频聊聊</Link>
|
||||||
|
<Link href={socialPath("/chat")}>大家聊天</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="footer-links">
|
<div className="footer-links">
|
||||||
<h4>成长</h4>
|
<h4>见面 · 做事</h4>
|
||||||
<Link href={socialPath("/roster")}>花名册</Link>
|
<Link href={socialPath("/coffeechat")}>找城市见面</Link>
|
||||||
<Link href={socialPath("/vip")}>VIP</Link>
|
<Link href={socialPath("/team")}>找搭子做事</Link>
|
||||||
<Link href={socialPath("/team")}>远程团队</Link>
|
<Link href={socialPath("/ebook")}>共创</Link>
|
||||||
<Link href={socialPath("/feedback")}>反馈</Link>
|
<Link href={socialPath("/feedback")}>说说想法</Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="footer-links">
|
<div className="footer-links">
|
||||||
<h4>更多</h4>
|
<h4>更多</h4>
|
||||||
|
|||||||
@ -111,7 +111,7 @@ function JoinPaySheet({ onClose }: Pick<Props, "onClose">) {
|
|||||||
<div className="social-join-sheet">
|
<div className="social-join-sheet">
|
||||||
<header className="social-join-sheet-head">
|
<header className="social-join-sheet-head">
|
||||||
<span className="social-join-brand">
|
<span className="social-join-brand">
|
||||||
<Sparkles size={17} /> NOMADRO SOCIAL
|
<Sparkles size={17} /> 游民社区
|
||||||
</span>
|
</span>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@ -124,10 +124,10 @@ function JoinPaySheet({ onClose }: Pick<Props, "onClose">) {
|
|||||||
</button>
|
</button>
|
||||||
</header>
|
</header>
|
||||||
<h2 id={titleId} className="social-join-title">
|
<h2 id={titleId} className="social-join-title">
|
||||||
加群,遇见你的同类。
|
加入游民社区
|
||||||
</h2>
|
</h2>
|
||||||
<p id={descriptionId} className="social-muted">
|
<p id={descriptionId} className="social-muted">
|
||||||
一起聊天、喝咖啡、做点有趣的事。
|
认识同频的人 · 开视频聊聊 · 出来见一面 · 一起做点事
|
||||||
<br />
|
<br />
|
||||||
{channelHint}
|
{channelHint}
|
||||||
</p>
|
</p>
|
||||||
@ -139,7 +139,7 @@ function JoinPaySheet({ onClose }: Pick<Props, "onClose">) {
|
|||||||
type="email"
|
type="email"
|
||||||
inputMode="email"
|
inputMode="email"
|
||||||
autoComplete="email"
|
autoComplete="email"
|
||||||
placeholder="you@example.com"
|
placeholder="你的邮箱"
|
||||||
value={email}
|
value={email}
|
||||||
aria-invalid={Boolean(err)}
|
aria-invalid={Boolean(err)}
|
||||||
aria-describedby={err ? errorId : undefined}
|
aria-describedby={err ? errorId : undefined}
|
||||||
|
|||||||
@ -1,3 +1,357 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
export { default } from "./MeetupRoom";
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||||
|
import Link from "next/link";
|
||||||
|
import { MIROTALK_URL, SEED_CHANNELS } from "@social/lib/seed";
|
||||||
|
import { loadJson, saveJson } from "@social/lib/storage";
|
||||||
|
import { socialPath } from "@social/lib/socialPath";
|
||||||
|
import { resolveSocialCatalog } from "@social/lib/resolveCatalog";
|
||||||
|
import { useSocialChat } from "@social/lib/useSocialChat";
|
||||||
|
import { useSocialConfig } from "./SocialExperience";
|
||||||
|
import { SocialMobileDock } from "./SocialNavigation";
|
||||||
|
|
||||||
|
type Layout = "split" | "video" | "chat";
|
||||||
|
|
||||||
|
/** Origins allowed by MiroTalk ALLOWED_EMBED_ORIGINS. */
|
||||||
|
const EMBED_OK = new Set([
|
||||||
|
"https://nomadro.cn",
|
||||||
|
"https://www.nomadro.cn",
|
||||||
|
"https://nomadweb.nomadro.com",
|
||||||
|
"https://social.nomadro.cn",
|
||||||
|
"http://localhost:3000",
|
||||||
|
"http://127.0.0.1:3000",
|
||||||
|
"http://localhost:3001",
|
||||||
|
"http://127.0.0.1:3001",
|
||||||
|
]);
|
||||||
|
|
||||||
|
function joinUrl(room: string, name: string) {
|
||||||
|
const q = new URLSearchParams({
|
||||||
|
room,
|
||||||
|
name,
|
||||||
|
notify: "0",
|
||||||
|
chat: "0",
|
||||||
|
audio: "1",
|
||||||
|
video: "1",
|
||||||
|
});
|
||||||
|
return `${MIROTALK_URL.replace(/\/$/, "")}/join?${q.toString()}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function canEmbedHere() {
|
||||||
|
if (typeof window === "undefined") return true;
|
||||||
|
return EMBED_OK.has(window.location.origin);
|
||||||
|
}
|
||||||
|
|
||||||
|
function warmMirotalkOrigin() {
|
||||||
|
try {
|
||||||
|
const origin = new URL(MIROTALK_URL).origin;
|
||||||
|
for (const rel of ["dns-prefetch", "preconnect"] as const) {
|
||||||
|
if (document.querySelector(`link[rel="${rel}"][href="${origin}"]`))
|
||||||
|
continue;
|
||||||
|
const link = document.createElement("link");
|
||||||
|
link.rel = rel;
|
||||||
|
link.href = origin;
|
||||||
|
if (rel === "preconnect") link.crossOrigin = "anonymous";
|
||||||
|
document.head.appendChild(link);
|
||||||
|
}
|
||||||
|
void fetch(`${origin}/js/nomadro-speed.js`, {
|
||||||
|
mode: "no-cors",
|
||||||
|
credentials: "omit",
|
||||||
|
cache: "force-cache",
|
||||||
|
}).catch(() => undefined);
|
||||||
|
} catch {
|
||||||
|
/* ignore */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function defaultLayout(): Layout {
|
||||||
|
if (
|
||||||
|
typeof window !== "undefined" &&
|
||||||
|
window.matchMedia("(max-width: 768px)").matches
|
||||||
|
) {
|
||||||
|
return "video";
|
||||||
|
}
|
||||||
|
return "split";
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function MeetupLiveClient({ meetupId }: { meetupId: string }) {
|
||||||
|
const config = useSocialConfig();
|
||||||
|
const meetups = useMemo(
|
||||||
|
() => resolveSocialCatalog(config.copy.socialCatalogs).meetups,
|
||||||
|
[config.copy.socialCatalogs],
|
||||||
|
);
|
||||||
|
const meetup =
|
||||||
|
meetups.find((m) => m.id === meetupId) ||
|
||||||
|
meetups[0] || {
|
||||||
|
id: meetupId,
|
||||||
|
title: "开视频见面",
|
||||||
|
city: "Online",
|
||||||
|
date: "",
|
||||||
|
time: "",
|
||||||
|
mode: "online" as const,
|
||||||
|
mirotalkRoom: meetupId,
|
||||||
|
channelId: "meetup-live",
|
||||||
|
};
|
||||||
|
const channel =
|
||||||
|
SEED_CHANNELS.find((c) => c.id === meetup.channelId) || SEED_CHANNELS[0];
|
||||||
|
const chat = useSocialChat(channel.id);
|
||||||
|
|
||||||
|
const [layout, setLayout] = useState<Layout>("split");
|
||||||
|
const [joinName, setJoinName] = useState("");
|
||||||
|
const [videoReady, setVideoReady] = useState(false);
|
||||||
|
const [embedBlocked, setEmbedBlocked] = useState(false);
|
||||||
|
const [iframeLoading, setIframeLoading] = useState(true);
|
||||||
|
const bottomRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
|
const videoSrc = useMemo(
|
||||||
|
() => joinUrl(meetup.mirotalkRoom, joinName || "游民"),
|
||||||
|
[meetup.mirotalkRoom, joinName],
|
||||||
|
);
|
||||||
|
const preferEmbed = canEmbedHere() && !embedBlocked;
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setLayout(defaultLayout());
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
warmMirotalkOrigin();
|
||||||
|
const name = (loadJson("nick", "游民") || "游民").trim() || "游民";
|
||||||
|
chat.setNick(name);
|
||||||
|
setJoinName(name);
|
||||||
|
if (canEmbedHere()) {
|
||||||
|
setIframeLoading(true);
|
||||||
|
setVideoReady(true);
|
||||||
|
}
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- mount once
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
bottomRef.current?.scrollIntoView({ behavior: "smooth" });
|
||||||
|
}, [chat.messages]);
|
||||||
|
|
||||||
|
const startVideo = useCallback(
|
||||||
|
(forceReload = false) => {
|
||||||
|
const name = chat.nick.trim() || "游民";
|
||||||
|
saveJson("nick", name);
|
||||||
|
setJoinName(name);
|
||||||
|
if (!preferEmbed) {
|
||||||
|
window.location.assign(joinUrl(meetup.mirotalkRoom, name));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setIframeLoading(true);
|
||||||
|
if (forceReload && videoReady) {
|
||||||
|
setVideoReady(false);
|
||||||
|
window.requestAnimationFrame(() => setVideoReady(true));
|
||||||
|
} else {
|
||||||
|
setVideoReady(true);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
[chat.nick, meetup.mirotalkRoom, preferEmbed, videoReady],
|
||||||
|
);
|
||||||
|
|
||||||
|
const send = async () => {
|
||||||
|
if (!chat.draft.trim() || chat.sending) return;
|
||||||
|
await chat.send(chat.draft);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="social-root social-live-root social-skin social-meetup-live">
|
||||||
|
<header className="social-live-bar">
|
||||||
|
<div className="social-live-bar-main">
|
||||||
|
<Link href={socialPath("/meetup")} className="social-nav-back">
|
||||||
|
← 回去看场次
|
||||||
|
</Link>
|
||||||
|
<div>
|
||||||
|
<strong>{meetup.title}</strong>
|
||||||
|
<p className="social-muted">
|
||||||
|
{meetup.date} {meetup.time} · {channel.name}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<span
|
||||||
|
className={`social-live-conn ${chat.status === "offline" ? "is-off" : chat.status === "online" ? "is-on" : ""}`}
|
||||||
|
role="status"
|
||||||
|
>
|
||||||
|
{chat.status === "online"
|
||||||
|
? "聊天已接通"
|
||||||
|
: chat.status === "offline"
|
||||||
|
? "聊天暂时断了"
|
||||||
|
: chat.status === "preview"
|
||||||
|
? "先看看示例"
|
||||||
|
: "正在连上…"}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div className="social-live-bar-tools">
|
||||||
|
<label className="social-live-nick">
|
||||||
|
<span className="social-muted">昵称</span>
|
||||||
|
<input
|
||||||
|
value={chat.nick}
|
||||||
|
onChange={(e) => chat.setNick(e.target.value)}
|
||||||
|
onBlur={() => saveJson("nick", chat.nick.trim() || "游民")}
|
||||||
|
maxLength={24}
|
||||||
|
aria-label="显示名"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
{videoReady &&
|
||||||
|
preferEmbed &&
|
||||||
|
chat.nick.trim() &&
|
||||||
|
chat.nick.trim() !== joinName ? (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-btn"
|
||||||
|
onClick={() => startVideo(true)}
|
||||||
|
title="用新名字重新进入视频"
|
||||||
|
>
|
||||||
|
换名字重进
|
||||||
|
</button>
|
||||||
|
) : null}
|
||||||
|
<div className="social-live-tabs" role="tablist" aria-label="怎么看">
|
||||||
|
{(["split", "video", "chat"] as const).map((m) => (
|
||||||
|
<button
|
||||||
|
key={m}
|
||||||
|
type="button"
|
||||||
|
role="tab"
|
||||||
|
aria-selected={layout === m}
|
||||||
|
className={`social-live-tab${layout === m ? " active" : ""}`}
|
||||||
|
onClick={() => setLayout(m)}
|
||||||
|
>
|
||||||
|
{m === "split" ? "一起看" : m === "video" ? "只看视频" : "只看聊天"}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div className={`social-live-stage layout-${layout}`}>
|
||||||
|
{(layout === "split" || layout === "video") && (
|
||||||
|
<section className="social-live-video" aria-label="开视频">
|
||||||
|
{!videoReady ? (
|
||||||
|
<div className="social-live-gate">
|
||||||
|
<div className="social-live-radar" aria-hidden>
|
||||||
|
<i />
|
||||||
|
<i />
|
||||||
|
<i />
|
||||||
|
<span>LIVE</span>
|
||||||
|
</div>
|
||||||
|
<h2>准备开视频见面</h2>
|
||||||
|
<p>
|
||||||
|
{preferEmbed
|
||||||
|
? "麦克风和摄像头先关着,进去后再打开就好。"
|
||||||
|
: "这里暂时不能直接嵌视频,点下面会跳转到视频页面。"}
|
||||||
|
</p>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-btn primary"
|
||||||
|
onClick={() => startVideo()}
|
||||||
|
>
|
||||||
|
开始见面
|
||||||
|
</button>
|
||||||
|
<p className="social-muted">
|
||||||
|
「想参加」还不等于已经约好 · 随时可以离开回去看别的场
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
) : preferEmbed ? (
|
||||||
|
<div className="social-live-frame-wrap">
|
||||||
|
{iframeLoading && (
|
||||||
|
<div
|
||||||
|
className="social-live-iframe-overlay social-live-iframe-overlay--thin"
|
||||||
|
aria-live="polite"
|
||||||
|
>
|
||||||
|
<div className="social-live-iframe-mark" aria-hidden>
|
||||||
|
N
|
||||||
|
</div>
|
||||||
|
<p>接通中…</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<iframe
|
||||||
|
title={`${meetup.title} video`}
|
||||||
|
src={videoSrc}
|
||||||
|
className="social-live-iframe"
|
||||||
|
allow="camera; microphone; display-capture; autoplay; fullscreen; clipboard-write"
|
||||||
|
referrerPolicy="no-referrer-when-downgrade"
|
||||||
|
loading="eager"
|
||||||
|
onLoad={() => setIframeLoading(false)}
|
||||||
|
onError={() => {
|
||||||
|
setEmbedBlocked(true);
|
||||||
|
setIframeLoading(false);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="social-live-gate">
|
||||||
|
<h2>本页跳转进房</h2>
|
||||||
|
<p>不新开标签;浏览器返回即可回到游民社区。</p>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-btn primary"
|
||||||
|
onClick={() => window.location.assign(videoSrc)}
|
||||||
|
>
|
||||||
|
立即进入
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</section>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{(layout === "split" || layout === "chat") && (
|
||||||
|
<section className="social-live-chat" aria-label="文字频道">
|
||||||
|
<div className="social-live-chat-head">
|
||||||
|
<strong>{channel.name}</strong>
|
||||||
|
<span className="social-muted">{channel.topic}</span>
|
||||||
|
</div>
|
||||||
|
<div className="social-chat-thread social-live-thread">
|
||||||
|
{!chat.messages.length ? (
|
||||||
|
<div className="social-live-empty">
|
||||||
|
<strong>文字频道还很安静</strong>
|
||||||
|
<p>先打个招呼,或问问今晚谁在听。</p>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
{chat.messages.map((m) => (
|
||||||
|
<div
|
||||||
|
key={m.id}
|
||||||
|
className={`social-bubble${m.mine ? " mine" : ""}`}
|
||||||
|
>
|
||||||
|
<header>
|
||||||
|
{m.author}
|
||||||
|
<time suppressHydrationWarning>
|
||||||
|
{new Date(m.at).toLocaleTimeString([], {
|
||||||
|
hour: "2-digit",
|
||||||
|
minute: "2-digit",
|
||||||
|
})}
|
||||||
|
</time>
|
||||||
|
{m.delivery === "demo" ? <span>示例</span> : null}
|
||||||
|
{m.delivery === "local" ? <span>先留在你这边</span> : null}
|
||||||
|
</header>
|
||||||
|
<p>{m.text}</p>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
<div ref={bottomRef} />
|
||||||
|
</div>
|
||||||
|
<div className="social-compose">
|
||||||
|
<input
|
||||||
|
value={chat.draft}
|
||||||
|
onChange={(e) => chat.setDraft(e.target.value)}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === "Enter" && !e.shiftKey) {
|
||||||
|
e.preventDefault();
|
||||||
|
void send();
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
placeholder="发到活动文字频道…"
|
||||||
|
aria-label="消息内容"
|
||||||
|
maxLength={2000}
|
||||||
|
/>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-btn primary"
|
||||||
|
disabled={!chat.draft.trim() || chat.sending}
|
||||||
|
onClick={() => void send()}
|
||||||
|
>
|
||||||
|
发送
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
<SocialMobileDock />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@ -1,257 +1,4 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useEffect, useRef, useState } from "react";
|
/** Legacy alias — full-screen live room lives in MeetupLiveClient. */
|
||||||
import Link from "next/link";
|
export { default } from "./MeetupLiveClient";
|
||||||
import {
|
|
||||||
ArrowLeft,
|
|
||||||
ArrowUpRight,
|
|
||||||
Camera,
|
|
||||||
CameraOff,
|
|
||||||
Columns2,
|
|
||||||
ExternalLink,
|
|
||||||
Maximize2,
|
|
||||||
MessageCircle,
|
|
||||||
Mic,
|
|
||||||
MicOff,
|
|
||||||
Radio,
|
|
||||||
RefreshCw,
|
|
||||||
Video,
|
|
||||||
} from "lucide-react";
|
|
||||||
import SiteShell from "./SiteShell";
|
|
||||||
import { Conversation } from "./ChatWorkspace";
|
|
||||||
import { EmptyState, ShareButton } from "./SocialUI";
|
|
||||||
import { MIROTALK_URL, SEED_MEETUPS } from "@social/lib/seed";
|
|
||||||
import { socialPath } from "@social/lib/socialPath";
|
|
||||||
import { useLocalState } from "@social/lib/useLocalState";
|
|
||||||
|
|
||||||
type Settings = { name: string; audio: boolean; video: boolean };
|
|
||||||
function videoUrl(room: string, settings: Settings) {
|
|
||||||
const query = new URLSearchParams({
|
|
||||||
room,
|
|
||||||
name: settings.name,
|
|
||||||
notify: "0",
|
|
||||||
chat: "0",
|
|
||||||
audio: settings.audio ? "1" : "0",
|
|
||||||
video: settings.video ? "1" : "0",
|
|
||||||
});
|
|
||||||
return `${MIROTALK_URL.replace(/\/$/, "")}/join?${query}`;
|
|
||||||
}
|
|
||||||
export default function MeetupRoom({ meetupId }: { meetupId: string }) {
|
|
||||||
const meetup = SEED_MEETUPS.find((item) => item.id === meetupId);
|
|
||||||
const [nick, setNick] = useLocalState("nick", "游民");
|
|
||||||
const [audio, setAudio] = useState(false);
|
|
||||||
const [video, setVideo] = useState(false);
|
|
||||||
const [joined, setJoined] = useState<Settings | null>(null);
|
|
||||||
const [layout, setLayout] = useState<"split" | "video" | "chat">("split");
|
|
||||||
const [loading, setLoading] = useState(false);
|
|
||||||
const [slow, setSlow] = useState(false);
|
|
||||||
const [reload, setReload] = useState(0);
|
|
||||||
const [fullscreenError, setFullscreenError] = useState("");
|
|
||||||
const stage = useRef<HTMLDivElement>(null);
|
|
||||||
useEffect(() => {
|
|
||||||
if (!loading) return;
|
|
||||||
const timer = setTimeout(() => setSlow(true), 15000);
|
|
||||||
return () => clearTimeout(timer);
|
|
||||||
}, [loading, reload]);
|
|
||||||
const start = () => {
|
|
||||||
setJoined({ name: nick.trim() || "游民", audio, video });
|
|
||||||
setLoading(true);
|
|
||||||
setSlow(false);
|
|
||||||
};
|
|
||||||
const leave = () => {
|
|
||||||
setJoined(null);
|
|
||||||
setLoading(false);
|
|
||||||
setSlow(false);
|
|
||||||
};
|
|
||||||
if (!meetup)
|
|
||||||
return (
|
|
||||||
<SiteShell title="活动空间">
|
|
||||||
<EmptyState
|
|
||||||
title="没有找到这场活动"
|
|
||||||
description="回到活动广场,看看其他相遇的可能。"
|
|
||||||
>
|
|
||||||
<Link className="social-btn primary" href={socialPath("/meetup")}>
|
|
||||||
返回活动广场
|
|
||||||
</Link>
|
|
||||||
</EmptyState>
|
|
||||||
</SiteShell>
|
|
||||||
);
|
|
||||||
const href = videoUrl(
|
|
||||||
meetup.mirotalkRoom,
|
|
||||||
joined || { name: nick.trim() || "游民", audio, video },
|
|
||||||
);
|
|
||||||
return (
|
|
||||||
<SiteShell title="活动空间">
|
|
||||||
<div className="social-room-heading">
|
|
||||||
<Link href={socialPath("/meetup")}>
|
|
||||||
<ArrowLeft size={14} />
|
|
||||||
所有活动
|
|
||||||
</Link>
|
|
||||||
<ShareButton
|
|
||||||
path={`/social/meetup/${meetup.id}`}
|
|
||||||
title={meetup.title}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<header className="social-meetup-heading">
|
|
||||||
<span className="social-page-kicker">
|
|
||||||
<Radio size={13} />
|
|
||||||
MEETUP SPACE
|
|
||||||
</span>
|
|
||||||
<h1>{meetup.title}</h1>
|
|
||||||
<p>
|
|
||||||
{meetup.date} · {meetup.time} 北京时间 · 活动预览
|
|
||||||
</p>
|
|
||||||
</header>
|
|
||||||
<div className="social-live-toolbar">
|
|
||||||
<div className="social-filters" aria-label="活动布局">
|
|
||||||
{[
|
|
||||||
{ key: "split" as const, label: "分屏", icon: Columns2 },
|
|
||||||
{ key: "video" as const, label: "视频", icon: Video },
|
|
||||||
{ key: "chat" as const, label: "聊天", icon: MessageCircle },
|
|
||||||
].map((item) => (
|
|
||||||
<button
|
|
||||||
key={item.key}
|
|
||||||
type="button"
|
|
||||||
className={layout === item.key ? "active" : ""}
|
|
||||||
aria-pressed={layout === item.key}
|
|
||||||
onClick={() => setLayout(item.key)}
|
|
||||||
>
|
|
||||||
<item.icon size={14} />
|
|
||||||
{item.label}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="social-save"
|
|
||||||
onClick={async () => {
|
|
||||||
try {
|
|
||||||
if (document.fullscreenElement) await document.exitFullscreen();
|
|
||||||
else await stage.current?.requestFullscreen();
|
|
||||||
} catch {
|
|
||||||
setFullscreenError("当前浏览器不支持全屏,可切换到视频布局。");
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Maximize2 size={14} />
|
|
||||||
全屏空间
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
{fullscreenError && (
|
|
||||||
<p className="social-status" role="status">
|
|
||||||
{fullscreenError}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
<div ref={stage} className={`social-meetup-room layout-${layout}`}>
|
|
||||||
<section
|
|
||||||
className="social-meetup-video"
|
|
||||||
hidden={layout === "chat"}
|
|
||||||
aria-label="活动视频区"
|
|
||||||
>
|
|
||||||
{!joined ? (
|
|
||||||
<div className="social-prejoin">
|
|
||||||
<div className="social-prejoin-radar" aria-hidden="true">
|
|
||||||
<i />
|
|
||||||
<i />
|
|
||||||
<i />
|
|
||||||
<Video size={34} strokeWidth={1.2} />
|
|
||||||
</div>
|
|
||||||
<span className="social-page-kicker">READY WHEN YOU ARE</span>
|
|
||||||
<h2>准备好了,再打开自己。</h2>
|
|
||||||
<p>
|
|
||||||
先在右侧打个招呼。进入视频前,可以选择是否开启麦克风和摄像头。
|
|
||||||
</p>
|
|
||||||
<label>
|
|
||||||
大家怎么称呼你?
|
|
||||||
<input
|
|
||||||
aria-label="活动昵称"
|
|
||||||
maxLength={24}
|
|
||||||
value={nick}
|
|
||||||
onChange={(event) => setNick(event.target.value)}
|
|
||||||
/>
|
|
||||||
</label>
|
|
||||||
<div className="social-prejoin-devices">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
aria-pressed={audio}
|
|
||||||
onClick={() => setAudio(!audio)}
|
|
||||||
>
|
|
||||||
{audio ? <Mic size={20} /> : <MicOff size={20} />}麦克风
|
|
||||||
{audio ? "开" : "关"}
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
aria-pressed={video}
|
|
||||||
onClick={() => setVideo(!video)}
|
|
||||||
>
|
|
||||||
{video ? <Camera size={20} /> : <CameraOff size={20} />}摄像头
|
|
||||||
{video ? "开" : "关"}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="social-btn primary"
|
|
||||||
onClick={start}
|
|
||||||
>
|
|
||||||
进入视频房间 <ArrowUpRight size={15} />
|
|
||||||
</button>
|
|
||||||
<p className="social-prejoin-note">
|
|
||||||
视频由 MiroTalk 提供 · 进入后按浏览器提示授权
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<div className="social-video-frame">
|
|
||||||
{loading && (
|
|
||||||
<div className="social-video-loading" role="status">
|
|
||||||
<span className="social-loading-orbit" />
|
|
||||||
正在连接视频空间…
|
|
||||||
{slow && (
|
|
||||||
<p>连接需要一点时间,可以先用文字聊天或在新窗口打开。</p>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
<iframe
|
|
||||||
key={reload}
|
|
||||||
src={href}
|
|
||||||
title={`${meetup.title} 视频房间`}
|
|
||||||
allow="camera; microphone; fullscreen; display-capture; autoplay"
|
|
||||||
allowFullScreen
|
|
||||||
referrerPolicy="strict-origin-when-cross-origin"
|
|
||||||
onLoad={() => setLoading(false)}
|
|
||||||
/>
|
|
||||||
<div className="social-video-actions">
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="social-save"
|
|
||||||
onClick={() => {
|
|
||||||
setLoading(true);
|
|
||||||
setSlow(false);
|
|
||||||
setReload((value) => value + 1);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<RefreshCw size={13} />
|
|
||||||
重新连接
|
|
||||||
</button>
|
|
||||||
<a
|
|
||||||
href={href}
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
className="social-save"
|
|
||||||
>
|
|
||||||
<ExternalLink size={13} />
|
|
||||||
新窗口
|
|
||||||
</a>
|
|
||||||
<button type="button" className="social-save" onClick={leave}>
|
|
||||||
离开视频
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</section>
|
|
||||||
<div className="social-meetup-chat" hidden={layout === "video"}>
|
|
||||||
<Conversation channelId={meetup.channelId} compact />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</SiteShell>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|||||||
@ -3,30 +3,28 @@
|
|||||||
import { useMemo, useState } from "react";
|
import { useMemo, useState } from "react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useSearchParams } from "next/navigation";
|
import { useSearchParams } from "next/navigation";
|
||||||
import { ArrowUpRight, MapPin, MessageCircle, Sparkles } from "lucide-react";
|
import { Sparkles } from "lucide-react";
|
||||||
import SiteShell from "./SiteShell";
|
import SiteShell from "./SiteShell";
|
||||||
import SocialAvatar from "./SocialAvatar";
|
import SocialAvatar from "./SocialAvatar";
|
||||||
import {
|
import {
|
||||||
BookmarkButton,
|
DemoBadge,
|
||||||
EmptyState,
|
EmptyState,
|
||||||
PageIntro,
|
PageIntro,
|
||||||
SearchField,
|
SearchField,
|
||||||
ShareButton,
|
|
||||||
SocialDialog,
|
|
||||||
} from "./SocialUI";
|
} from "./SocialUI";
|
||||||
import { MOCK_ROSTER, type SocialRosterMember } from "@social/lib/rosterMock";
|
import { SELF_MEMBER_ID, useDiscoveryRoster } from "@social/lib/discoveryRoster";
|
||||||
import { socialPath } from "@social/lib/socialPath";
|
import { socialPath } from "@social/lib/socialPath";
|
||||||
import { useLocalState } from "@social/lib/useLocalState";
|
import { useLocalState } from "@social/lib/useLocalState";
|
||||||
|
|
||||||
export default function PeopleClient() {
|
export default function PeopleClient() {
|
||||||
const params = useSearchParams();
|
const params = useSearchParams();
|
||||||
|
const roster = useDiscoveryRoster();
|
||||||
const [query, setQuery] = useState(params.get("city") || "");
|
const [query, setQuery] = useState(params.get("city") || "");
|
||||||
const [filter, setFilter] = useState("all");
|
const [filter, setFilter] = useState("all");
|
||||||
const [active, setActive] = useState<SocialRosterMember | null>(null);
|
|
||||||
const [saved] = useLocalState<string[]>("saved-people", []);
|
const [saved] = useLocalState<string[]>("saved-people", []);
|
||||||
const list = useMemo(
|
const list = useMemo(
|
||||||
() =>
|
() =>
|
||||||
MOCK_ROSTER.filter((person) => {
|
roster.filter((person) => {
|
||||||
const haystack =
|
const haystack =
|
||||||
`${person.name} ${person.city} ${person.title} ${person.tags.join(" ")} ${person.lookingFor}`.toLowerCase();
|
`${person.name} ${person.city} ${person.title} ${person.tags.join(" ")} ${person.lookingFor}`.toLowerCase();
|
||||||
return (
|
return (
|
||||||
@ -35,28 +33,29 @@ export default function PeopleClient() {
|
|||||||
(filter !== "online" || person.online)
|
(filter !== "online" || person.online)
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
[query, filter, saved],
|
[query, filter, saved, roster],
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<SiteShell title="发现同类">
|
<SiteShell title="想见的人">
|
||||||
<PageIntro
|
<PageIntro title="想见的人" accent="认识新朋友">
|
||||||
eyebrow="PEOPLE WITHOUT BORDERS"
|
<div className="social-actions">
|
||||||
title="你的下一位朋友,"
|
<DemoBadge>
|
||||||
accent="可能就在下一座城。"
|
{list.length} 位 · 示例介绍,方便先逛逛
|
||||||
description="按城市、技能或兴趣发现同类。先看看彼此的热爱,再让一句你好有一个自然的开始。"
|
</DemoBadge>
|
||||||
/>
|
</div>
|
||||||
<div className="social-toolbar">
|
</PageIntro>
|
||||||
|
<div className="social-toolbar reveal">
|
||||||
<SearchField
|
<SearchField
|
||||||
value={query}
|
value={query}
|
||||||
onChange={setQuery}
|
onChange={setQuery}
|
||||||
label="搜索游民"
|
label="搜索"
|
||||||
placeholder="城市、名字、技能、兴趣…"
|
placeholder="城市 / 名字 / 兴趣"
|
||||||
/>
|
/>
|
||||||
<div className="social-filters" aria-label="成员筛选">
|
<div className="social-filters" aria-label="筛选">
|
||||||
{[
|
{[
|
||||||
{ id: "all", title: "所有游民" },
|
{ id: "all", title: "全部" },
|
||||||
{ id: "online", title: "演示在线" },
|
{ id: "online", title: "现在在线" },
|
||||||
{ id: "saved", title: "我收藏的人" },
|
{ id: "saved", title: "我关注的" },
|
||||||
].map((f) => (
|
].map((f) => (
|
||||||
<button
|
<button
|
||||||
key={f.id}
|
key={f.id}
|
||||||
@ -69,50 +68,40 @@ export default function PeopleClient() {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="social-section-label">
|
<div className="social-people-grid">
|
||||||
相遇,不必靠运气{" "}
|
{list.map((person, index) => (
|
||||||
<span>{list.length} 位成员展示 · 演示资料与在线状态</span>
|
<Link
|
||||||
</div>
|
key={person.id}
|
||||||
<div className="social-member-grid">
|
href={socialPath(`/people/${person.id}`)}
|
||||||
{list.map((person) => (
|
className={`social-people-chip social-chip-pop is-rich reveal${person.online ? " is-online" : ""}`}
|
||||||
<article key={person.id} className="social-member-card">
|
style={{ ["--stagger" as string]: `${Math.min(index, 12) * 40}ms` }}
|
||||||
<div className="social-member-head">
|
|
||||||
<SocialAvatar src={person.avatar} size={51} lazy />
|
|
||||||
<div>
|
|
||||||
<h2>{person.name}</h2>
|
|
||||||
<p>{person.title}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="social-member-city">
|
|
||||||
<MapPin size={13} />
|
|
||||||
{person.city}
|
|
||||||
</div>
|
|
||||||
<p>{person.lookingFor}</p>
|
|
||||||
<div className="social-tags">
|
|
||||||
{person.tags.map((tag) => (
|
|
||||||
<span key={tag}>{tag}</span>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<div className="social-card-actions">
|
|
||||||
<BookmarkButton
|
|
||||||
id={person.id}
|
|
||||||
collection="saved-people"
|
|
||||||
label="想认识"
|
|
||||||
/>
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
className="social-save"
|
|
||||||
onClick={() => setActive(person)}
|
|
||||||
>
|
>
|
||||||
查看名片 <ArrowUpRight size={14} />
|
<span className="social-people-chip-ava">
|
||||||
</button>
|
<SocialAvatar src={person.avatar} size={52} lazy />
|
||||||
</div>
|
{person.online ? <i aria-hidden /> : null}
|
||||||
</article>
|
</span>
|
||||||
|
<strong>
|
||||||
|
{person.name}
|
||||||
|
{person.id === SELF_MEMBER_ID ? " · 我" : ""}
|
||||||
|
</strong>
|
||||||
|
<span className="connection-member-role">
|
||||||
|
{person.title}
|
||||||
|
{person.vibe ? ` · ${person.vibe.split("·")[0].trim()}` : ""}
|
||||||
|
</span>
|
||||||
|
<em>
|
||||||
|
{person.city.split("·")[0].trim()}
|
||||||
|
{person.tags[0] ? ` · ${person.tags[0]}` : ""}
|
||||||
|
</em>
|
||||||
|
<span className="social-people-chip-want" title={person.lookingFor}>
|
||||||
|
{person.lookingFor}
|
||||||
|
</span>
|
||||||
|
</Link>
|
||||||
))}
|
))}
|
||||||
{!list.length && (
|
{!list.length && (
|
||||||
<EmptyState
|
<EmptyState
|
||||||
title="同频的人,值得再找找"
|
emoji="🌊"
|
||||||
description="试试「设计」「清迈」「出海」,或者清空筛选看看其他成员。"
|
title="暂时没找到"
|
||||||
|
description="换个城市或兴趣关键词试试,也可以清空筛选再看。"
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
className="social-btn"
|
className="social-btn"
|
||||||
@ -121,74 +110,25 @@ export default function PeopleClient() {
|
|||||||
setFilter("all");
|
setFilter("all");
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
重置筛选
|
重新看看
|
||||||
</button>
|
</button>
|
||||||
</EmptyState>
|
</EmptyState>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<section className="social-panel social-discover-cta">
|
<div className="social-toolbar social-people-cta-bar">
|
||||||
<Sparkles size={24} />
|
<Link className="social-btn coral" href={socialPath("/date")}>
|
||||||
<div>
|
去左右滑认识
|
||||||
<h2>让别人也能认识你。</h2>
|
</Link>
|
||||||
<p className="social-muted">
|
|
||||||
用一张游民名片,介绍你的城市、技能与好奇心。
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<Link className="social-btn primary" href={socialPath("/roster")}>
|
<Link className="social-btn primary" href={socialPath("/roster")}>
|
||||||
创建我的名片 <ArrowUpRight size={15} />
|
<Sparkles size={15} /> 写写我的介绍
|
||||||
</Link>
|
</Link>
|
||||||
</section>
|
<Link className="social-btn" href={socialPath("/chat")}>
|
||||||
{active && (
|
去大家聊天
|
||||||
<SocialDialog
|
</Link>
|
||||||
title={`${active.name} 的游民名片`}
|
<Link className="social-btn" href={socialPath("/meetup")}>
|
||||||
onClose={() => setActive(null)}
|
去开视频
|
||||||
>
|
|
||||||
<div className="social-member-profile">
|
|
||||||
<SocialAvatar src={active.avatar} size={74} />
|
|
||||||
<div>
|
|
||||||
<strong>{active.name}</strong>
|
|
||||||
<p>{active.title}</p>
|
|
||||||
<span className="social-member-city">
|
|
||||||
<MapPin size={12} />
|
|
||||||
{active.city}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="social-tags">
|
|
||||||
{active.tags.map((tag) => (
|
|
||||||
<span key={tag}>{tag}</span>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<p>{active.bio}</p>
|
|
||||||
<p>
|
|
||||||
<strong>想认识:</strong>
|
|
||||||
{active.lookingFor}
|
|
||||||
</p>
|
|
||||||
<div className="social-status">
|
|
||||||
这是演示成员资料。可以带着一个破冰话题进入公开频道,认识真正参与聊天的人。
|
|
||||||
</div>
|
|
||||||
<div className="social-actions">
|
|
||||||
<Link
|
|
||||||
className="social-btn primary"
|
|
||||||
href={socialPath(
|
|
||||||
`/chat/general?intro=${encodeURIComponent(`大家好,我对${active.tags[0]}很感兴趣,有同样兴趣的朋友吗?`)}`,
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
<MessageCircle size={15} />
|
|
||||||
去公开频道聊聊
|
|
||||||
</Link>
|
</Link>
|
||||||
<BookmarkButton
|
|
||||||
id={active.id}
|
|
||||||
collection="saved-people"
|
|
||||||
label="想认识"
|
|
||||||
/>
|
|
||||||
<ShareButton
|
|
||||||
path={`/social/people?city=${encodeURIComponent(active.city.split("·")[0].trim())}`}
|
|
||||||
title={`在 ${active.city} 发现同类`}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</SocialDialog>
|
|
||||||
)}
|
|
||||||
</SiteShell>
|
</SiteShell>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
266
src/modules/social/components/PeopleProfileClient.tsx
Normal file
266
src/modules/social/components/PeopleProfileClient.tsx
Normal file
@ -0,0 +1,266 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useMemo, useSyncExternalStore } from "react";
|
||||||
|
import Link from "next/link";
|
||||||
|
import {
|
||||||
|
ArrowLeft,
|
||||||
|
Heart,
|
||||||
|
MapPin,
|
||||||
|
MessageCircle,
|
||||||
|
Sparkles,
|
||||||
|
Video,
|
||||||
|
} from "lucide-react";
|
||||||
|
import SiteShell from "./SiteShell";
|
||||||
|
import SocialAvatar from "./SocialAvatar";
|
||||||
|
import {
|
||||||
|
BookmarkButton,
|
||||||
|
DemoBadge,
|
||||||
|
EmptyState,
|
||||||
|
ShareButton,
|
||||||
|
} from "./SocialUI";
|
||||||
|
import {
|
||||||
|
findRosterMember,
|
||||||
|
type SocialRosterMember,
|
||||||
|
} from "@social/lib/rosterMock";
|
||||||
|
import {
|
||||||
|
SELF_MEMBER_ID,
|
||||||
|
useDiscoveryRoster,
|
||||||
|
} from "@social/lib/discoveryRoster";
|
||||||
|
import { loadJson, saveJson } from "@social/lib/storage";
|
||||||
|
import { socialPath } from "@social/lib/socialPath";
|
||||||
|
|
||||||
|
const LIKE_KEY = "social-roster-likes";
|
||||||
|
const LIKES_CHANGED = "social-roster-likes-changed";
|
||||||
|
|
||||||
|
function subscribeLikes(cb: () => void) {
|
||||||
|
window.addEventListener("storage", cb);
|
||||||
|
window.addEventListener(LIKES_CHANGED, cb);
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener("storage", cb);
|
||||||
|
window.removeEventListener(LIKES_CHANGED, cb);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function getLikesSnapshot() {
|
||||||
|
const stored = loadJson<unknown>(LIKE_KEY, {});
|
||||||
|
return JSON.stringify(
|
||||||
|
stored && typeof stored === "object" && !Array.isArray(stored)
|
||||||
|
? stored
|
||||||
|
: {},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function PeopleProfileClient({ id }: { id: string }) {
|
||||||
|
const roster = useDiscoveryRoster();
|
||||||
|
const member =
|
||||||
|
roster.find((m) => m.id === id) || findRosterMember(id);
|
||||||
|
|
||||||
|
const likesSnapshot = useSyncExternalStore(
|
||||||
|
subscribeLikes,
|
||||||
|
getLikesSnapshot,
|
||||||
|
() => "{}",
|
||||||
|
);
|
||||||
|
const likes = useMemo(
|
||||||
|
() => JSON.parse(likesSnapshot) as Record<string, boolean>,
|
||||||
|
[likesSnapshot],
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!member) {
|
||||||
|
return (
|
||||||
|
<SiteShell title="未找到">
|
||||||
|
<EmptyState
|
||||||
|
emoji="🧭"
|
||||||
|
title="没有这位游民"
|
||||||
|
description="这位朋友可能已离开,或者链接有点旧。回去再看看其他人吧。"
|
||||||
|
>
|
||||||
|
<Link className="social-btn primary" href={socialPath("/people")}>
|
||||||
|
回去看看大家
|
||||||
|
</Link>
|
||||||
|
</EmptyState>
|
||||||
|
</SiteShell>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const liked = !!likes[member.id];
|
||||||
|
const cityKey = member.city.split(/[·/]/)[0].trim();
|
||||||
|
const similar = roster
|
||||||
|
.filter(
|
||||||
|
(m) =>
|
||||||
|
m.id !== member.id && m.city.includes(cityKey.slice(0, 2)),
|
||||||
|
)
|
||||||
|
.slice(0, 4);
|
||||||
|
|
||||||
|
const toggleLike = () => {
|
||||||
|
saveJson(LIKE_KEY, { ...likes, [member.id]: !liked });
|
||||||
|
window.dispatchEvent(new Event(LIKES_CHANGED));
|
||||||
|
};
|
||||||
|
|
||||||
|
const intro = encodeURIComponent(
|
||||||
|
`嗨 ${member.name}!看到你在做${member.tags[0] || "远程"},想认识一下。`,
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<SiteShell title={member.name}>
|
||||||
|
<article className="social-profile reveal">
|
||||||
|
<div className="social-profile-nav">
|
||||||
|
<Link href={socialPath("/people")} className="social-btn">
|
||||||
|
<ArrowLeft size={15} /> 回去看看大家
|
||||||
|
</Link>
|
||||||
|
<DemoBadge>示例介绍 · 方便先逛逛</DemoBadge>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<header className="social-profile-hero">
|
||||||
|
<div
|
||||||
|
className="social-profile-cover"
|
||||||
|
style={
|
||||||
|
member.gallery?.[0]
|
||||||
|
? {
|
||||||
|
backgroundImage: `linear-gradient(180deg, transparent 20%, #0c0c0fcc 92%), url(${member.gallery[0]})`,
|
||||||
|
}
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
|
aria-hidden
|
||||||
|
/>
|
||||||
|
<div className="social-profile-identity">
|
||||||
|
<SocialAvatar src={member.avatar} size={96} />
|
||||||
|
<div>
|
||||||
|
<p className="social-profile-kicker">
|
||||||
|
{member.online ? (
|
||||||
|
<span className="is-online">在线</span>
|
||||||
|
) : (
|
||||||
|
<span>离线</span>
|
||||||
|
)}
|
||||||
|
<span>{member.vibe}</span>
|
||||||
|
{member.id === SELF_MEMBER_ID ? <span>这是我</span> : null}
|
||||||
|
</p>
|
||||||
|
<h1>{member.name}</h1>
|
||||||
|
<p className="social-profile-title">{member.title}</p>
|
||||||
|
<p className="social-profile-city">
|
||||||
|
<MapPin size={14} aria-hidden />
|
||||||
|
{member.city}
|
||||||
|
{member.timezone ? ` · ${member.timezone}` : ""}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div className="social-profile-actions">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className={`social-btn${liked ? " coral" : ""}`}
|
||||||
|
onClick={toggleLike}
|
||||||
|
>
|
||||||
|
<Heart size={15} fill={liked ? "currentColor" : "none"} />
|
||||||
|
{liked ? "已关注" : "关注一下"}
|
||||||
|
</button>
|
||||||
|
<Link
|
||||||
|
className="social-btn primary"
|
||||||
|
href={socialPath(`/chat?intro=${intro}`)}
|
||||||
|
>
|
||||||
|
<MessageCircle size={15} />
|
||||||
|
去打招呼
|
||||||
|
</Link>
|
||||||
|
<Link className="social-btn" href={socialPath("/meetup")}>
|
||||||
|
<Video size={15} />
|
||||||
|
去开视频
|
||||||
|
</Link>
|
||||||
|
<BookmarkButton
|
||||||
|
id={member.id}
|
||||||
|
collection="saved-people"
|
||||||
|
label="想认识"
|
||||||
|
/>
|
||||||
|
<ShareButton
|
||||||
|
path={`/social/people/${member.id}`}
|
||||||
|
title={`${member.name} · nomadro 游民社区`}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="social-profile-grid">
|
||||||
|
<section className="social-profile-card">
|
||||||
|
<h2>关于 TA</h2>
|
||||||
|
<p>{member.bio}</p>
|
||||||
|
<p className="social-profile-looking">
|
||||||
|
<Sparkles size={14} aria-hidden />
|
||||||
|
<strong>想认识:</strong>
|
||||||
|
{member.lookingFor}
|
||||||
|
</p>
|
||||||
|
{member.availability ? (
|
||||||
|
<p className="social-muted">什么时候方便 · {member.availability}</p>
|
||||||
|
) : null}
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section className="social-profile-card">
|
||||||
|
<h2>兴趣标签</h2>
|
||||||
|
<div className="social-tags">
|
||||||
|
{member.tags.map((t) => (
|
||||||
|
<span key={t}>{t}</span>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
{member.languages?.length ? (
|
||||||
|
<>
|
||||||
|
<h2>语言</h2>
|
||||||
|
<div className="social-tags is-soft">
|
||||||
|
{member.languages.map((l) => (
|
||||||
|
<span key={l}>{l}</span>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{member.gallery && member.gallery.length > 0 ? (
|
||||||
|
<section className="social-profile-gallery">
|
||||||
|
<h2>生活瞬间</h2>
|
||||||
|
<div className="social-profile-gallery-grid">
|
||||||
|
{member.gallery.map((src) => (
|
||||||
|
// eslint-disable-next-line @next/next/no-img-element
|
||||||
|
<img key={src} src={src} alt="" loading="lazy" />
|
||||||
|
))}
|
||||||
|
<div className="social-profile-gallery-ava">
|
||||||
|
<SocialAvatar src={member.avatar} size={120} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
{similar.length > 0 ? (
|
||||||
|
<section className="social-profile-similar">
|
||||||
|
<h2>附近可能同城的人</h2>
|
||||||
|
<div className="social-people-grid social-profile-similar-grid">
|
||||||
|
{similar.map((m) => (
|
||||||
|
<PersonMini key={m.id} m={m} />
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
<div className="social-profile-footer-cta">
|
||||||
|
<Link className="social-btn coral" href={socialPath("/date")}>
|
||||||
|
去左右滑认识更多人
|
||||||
|
</Link>
|
||||||
|
<Link className="social-btn" href={socialPath("/roster")}>
|
||||||
|
写写我的介绍
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
</SiteShell>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function PersonMini({ m }: { m: SocialRosterMember }) {
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
href={socialPath(`/people/${m.id}`)}
|
||||||
|
className={`social-people-chip social-chip-pop${m.online ? " is-online" : ""}`}
|
||||||
|
>
|
||||||
|
<span className="social-people-chip-ava">
|
||||||
|
<SocialAvatar src={m.avatar} size={52} lazy />
|
||||||
|
{m.online ? <i aria-hidden /> : null}
|
||||||
|
</span>
|
||||||
|
<strong>{m.name}</strong>
|
||||||
|
<span className="connection-member-role">{m.title}</span>
|
||||||
|
<em>{m.city.split("·")[0].trim()}</em>
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -8,6 +8,11 @@ import { PageIntro } from "./SocialUI";
|
|||||||
import { socialApi } from "@social/lib/api";
|
import { socialApi } from "@social/lib/api";
|
||||||
import { useLocalState } from "@social/lib/useLocalState";
|
import { useLocalState } from "@social/lib/useLocalState";
|
||||||
import { loadJson } from "@social/lib/storage";
|
import { loadJson } from "@social/lib/storage";
|
||||||
|
import {
|
||||||
|
ROSTER_PUBLISH_KEY,
|
||||||
|
setRosterPublished,
|
||||||
|
} from "@social/lib/discoveryRoster";
|
||||||
|
import { socialPath } from "@social/lib/socialPath";
|
||||||
import type { SocialRosterProfile } from "@social/lib/types";
|
import type { SocialRosterProfile } from "@social/lib/types";
|
||||||
|
|
||||||
const EMPTY: SocialRosterProfile = {
|
const EMPTY: SocialRosterProfile = {
|
||||||
@ -64,6 +69,10 @@ export default function ProfileStudio() {
|
|||||||
"roster",
|
"roster",
|
||||||
EMPTY,
|
EMPTY,
|
||||||
);
|
);
|
||||||
|
const [published, setPublished] = useLocalState<boolean>(
|
||||||
|
ROSTER_PUBLISH_KEY,
|
||||||
|
false,
|
||||||
|
);
|
||||||
const [, setNick] = useLocalState("nick", "游民");
|
const [, setNick] = useLocalState("nick", "游民");
|
||||||
const [sync, setSync] = useLocalState("roster-sync", "draft");
|
const [sync, setSync] = useLocalState("roster-sync", "draft");
|
||||||
const [status, setStatus] = useState("");
|
const [status, setStatus] = useState("");
|
||||||
@ -129,28 +138,26 @@ export default function ProfileStudio() {
|
|||||||
try {
|
try {
|
||||||
await socialApi.saveRoster(payload);
|
await socialApi.saveRoster(payload);
|
||||||
setSync("synced");
|
setSync("synced");
|
||||||
setStatus("名片资料已同步。你可以去公开频道做个自我介绍。");
|
setStatus("介绍已保存。你可以去聊天室跟大家打个招呼。");
|
||||||
} catch {
|
} catch {
|
||||||
setSync("draft");
|
setSync("draft");
|
||||||
setStatus("资料已存本机,尚未同步。联网后再次点击保存即可重试。");
|
setStatus("先留在你这边了。有网后再点一次保存就行。");
|
||||||
} finally {
|
} finally {
|
||||||
lock.current = false;
|
lock.current = false;
|
||||||
setBusy(false);
|
setBusy(false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<SiteShell title="我的游民名片">
|
<SiteShell title="我的介绍">
|
||||||
<PageIntro
|
<PageIntro title="我的介绍">
|
||||||
eyebrow="YOU ARE MORE THAN A JOB TITLE"
|
<Link className="social-btn" href={socialPath("/people")}>
|
||||||
title="给下一次相遇,"
|
看看大家那边
|
||||||
accent="一个认识你的理由。"
|
</Link>
|
||||||
description="一张有温度的名片,从你正在做的事、喜欢的城市和想遇见的人开始。"
|
</PageIntro>
|
||||||
/>
|
|
||||||
<div className="social-profile-studio">
|
<div className="social-profile-studio">
|
||||||
<section className="social-panel">
|
<section className="social-panel social-panel-fx reveal">
|
||||||
<div className="social-section-label">
|
<div className="social-section-label">
|
||||||
编辑你的名片{" "}
|
<span>{sync === "synced" ? "已保存" : "草稿还在你这边"}</span>
|
||||||
<span>{sync === "synced" ? "已同步" : "本机草稿"}</span>
|
|
||||||
</div>
|
</div>
|
||||||
<form
|
<form
|
||||||
className="social-form"
|
className="social-form"
|
||||||
@ -175,27 +182,46 @@ export default function ProfileStudio() {
|
|||||||
</label>
|
</label>
|
||||||
))}
|
))}
|
||||||
<label className="full">
|
<label className="full">
|
||||||
一段有意思的自我介绍
|
自我介绍
|
||||||
<textarea
|
<textarea
|
||||||
rows={4}
|
rows={4}
|
||||||
maxLength={600}
|
maxLength={600}
|
||||||
value={profile.bio}
|
value={profile.bio}
|
||||||
onChange={(event) => update("bio", event.target.value)}
|
onChange={(event) => update("bio", event.target.value)}
|
||||||
placeholder="最近在研究什么?想找人一起做什么?你会如何介绍现在的生活?"
|
placeholder="在哪、做什么、想认识谁"
|
||||||
/>
|
/>
|
||||||
<small>{profile.bio.length}/600</small>
|
<small>{profile.bio.length}/600</small>
|
||||||
</label>
|
</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<p className="social-muted">
|
<label className="social-publish-toggle">
|
||||||
联系方式为选填。提交前请确认你愿意将填写的资料交给社区保存。
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={Boolean(published)}
|
||||||
|
onChange={(event) => {
|
||||||
|
const next = event.target.checked;
|
||||||
|
setPublished(next);
|
||||||
|
setRosterPublished(next);
|
||||||
|
setStatus(
|
||||||
|
next
|
||||||
|
? "好的,别人在「想见的人」里能看到你(仅当前这台设备的示例列表)。"
|
||||||
|
: "已先藏起来,别人暂时看不到你。",
|
||||||
|
);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<span>出现在「想见的人 / 认识一下」里,让别人看到我</span>
|
||||||
|
</label>
|
||||||
|
{published && complete < 5 ? (
|
||||||
|
<p className="social-status warn" role="status">
|
||||||
|
介绍还差 {5 - complete} 项,补全后再出现会更完整。
|
||||||
</p>
|
</p>
|
||||||
|
) : null}
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="social-btn primary"
|
className="social-btn primary"
|
||||||
disabled={busy || !profile.name.trim()}
|
disabled={busy || !profile.name.trim()}
|
||||||
>
|
>
|
||||||
<Check size={15} />
|
<Check size={15} />
|
||||||
{busy ? "正在同步…" : "保存并同步名片"}
|
{busy ? "保存中…" : "保存介绍"}
|
||||||
</button>
|
</button>
|
||||||
{status && (
|
{status && (
|
||||||
<p
|
<p
|
||||||
@ -207,9 +233,9 @@ export default function ProfileStudio() {
|
|||||||
)}
|
)}
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
<section className="social-profile-preview">
|
<section className="social-profile-preview reveal">
|
||||||
<div className="social-section-label">
|
<div className="social-section-label">
|
||||||
<span>YOUR NEXT CHAPTER</span>
|
<span>预览</span>
|
||||||
<Sparkles size={16} />
|
<Sparkles size={16} />
|
||||||
</div>
|
</div>
|
||||||
<div className="social-profile-passport">
|
<div className="social-profile-passport">
|
||||||
@ -219,12 +245,12 @@ export default function ProfileStudio() {
|
|||||||
<div className="social-profile-monogram">
|
<div className="social-profile-monogram">
|
||||||
{profile.name.trim().slice(0, 1) || "N"}
|
{profile.name.trim().slice(0, 1) || "N"}
|
||||||
</div>
|
</div>
|
||||||
<span className="social-page-kicker">NOMAD ID / 本机预览</span>
|
<span className="social-page-kicker">先看看效果</span>
|
||||||
<h2>{profile.name.trim() || "你的名字"}</h2>
|
<h2>{profile.name.trim() || "你的名字"}</h2>
|
||||||
<p>{profile.title || "让你的好奇心被看见"}</p>
|
<p>{profile.title || "你在做什么"}</p>
|
||||||
<span className="social-member-city">
|
<span className="social-member-city">
|
||||||
<MapPin size={13} />
|
<MapPin size={13} />
|
||||||
{profile.city || "世界很大,正在探索"}
|
{profile.city || "还没写城市"}
|
||||||
</span>
|
</span>
|
||||||
<div className="social-tags">
|
<div className="social-tags">
|
||||||
{profile.skills
|
{profile.skills
|
||||||
@ -236,26 +262,36 @@ export default function ProfileStudio() {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<p className="social-profile-bio">
|
<p className="social-profile-bio">
|
||||||
{profile.bio || "写下你的故事,让下一位同频的人有话可说。"}
|
{profile.bio || "还没写自我介绍"}
|
||||||
</p>
|
</p>
|
||||||
<footer>
|
<footer>
|
||||||
NO BORDERS. REAL CONNECTIONS.<span>✦</span>
|
我的介绍<span>✦</span>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
<div className="social-profile-progress">
|
<div className="social-profile-progress">
|
||||||
<div>
|
<div>
|
||||||
<span>让别人更了解你</span>
|
<span>写好了多少</span>
|
||||||
<strong>{complete}/5</strong>
|
<strong>{complete}/5</strong>
|
||||||
</div>
|
</div>
|
||||||
<progress max={5} value={complete} aria-label="名片完成度" />
|
<progress max={5} value={complete} aria-label="介绍完成度" />
|
||||||
<p>名字、职业、城市、兴趣和自我介绍。</p>
|
<p>名字 · 做什么 · 城市 · 兴趣 · 介绍</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="social-actions">
|
||||||
<Link
|
<Link
|
||||||
className="social-btn"
|
className="social-btn primary"
|
||||||
href={`/social/chat/general?intro=${encodeURIComponent(`大家好,我是${profile.name || "新朋友"},目前在${profile.city || "探索下一座城市"}。${profile.bio || "很高兴认识大家!"}`)}`}
|
href={socialPath(
|
||||||
|
`/chat?intro=${encodeURIComponent(`大家好,我是${profile.name || "新朋友"},目前在${profile.city || "探索中"}。${profile.bio || "很高兴认识大家!"}`)}`,
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
带着名片,打个招呼 <ArrowUpRight size={15} />
|
去聊天室打招呼 <ArrowUpRight size={15} />
|
||||||
</Link>
|
</Link>
|
||||||
|
<Link className="social-btn" href={socialPath("/people")}>
|
||||||
|
看发现页
|
||||||
|
</Link>
|
||||||
|
<Link className="social-btn" href={socialPath("/date")}>
|
||||||
|
去约会
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</SiteShell>
|
</SiteShell>
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import {
|
|||||||
import SiteShell from "./SiteShell";
|
import SiteShell from "./SiteShell";
|
||||||
import {
|
import {
|
||||||
BookmarkButton,
|
BookmarkButton,
|
||||||
|
DemoBadge,
|
||||||
EmptyState,
|
EmptyState,
|
||||||
PageIntro,
|
PageIntro,
|
||||||
SearchField,
|
SearchField,
|
||||||
@ -21,30 +22,13 @@ import {
|
|||||||
import { useSocialConfig } from "./SocialExperience";
|
import { useSocialConfig } from "./SocialExperience";
|
||||||
import { SEED_EBOOKS, SEED_VIDEOS } from "@social/lib/seed";
|
import { SEED_EBOOKS, SEED_VIDEOS } from "@social/lib/seed";
|
||||||
import { useLocalState } from "@social/lib/useLocalState";
|
import { useLocalState } from "@social/lib/useLocalState";
|
||||||
|
import { socialPath } from "@social/lib/socialPath";
|
||||||
|
|
||||||
type Kind = "videos" | "date" | "ebook";
|
type Kind = "videos" | "date" | "ebook";
|
||||||
const COPY = {
|
const COPY = {
|
||||||
videos: {
|
videos: { title: "共创 · 视频", accent: "大家拍的" },
|
||||||
eyebrow: "A WINDOW INTO ANOTHER LIFE",
|
date: { title: "共创 · 访谈", accent: "听听大家" },
|
||||||
title: "世界那么大,",
|
ebook: { title: "共创 · 小册", accent: "大家写的" },
|
||||||
accent: "借一段影像,遇见另一种生活。",
|
|
||||||
description:
|
|
||||||
"城市切片、游民访谈与真实相遇的记录。从一个故事,找到下一次出发的灵感。",
|
|
||||||
},
|
|
||||||
date: {
|
|
||||||
eyebrow: "EVERY NOMAD HAS A STORY",
|
|
||||||
title: "陌生人的日常,",
|
|
||||||
accent: "可能正是你的下一章。",
|
|
||||||
description:
|
|
||||||
"关于工作、迁徙和相遇的故事目录。看看别人的城市,也把你的好奇带进一场对话。",
|
|
||||||
},
|
|
||||||
ebook: {
|
|
||||||
eyebrow: "LESS SCROLLING. MORE DISCOVERY.",
|
|
||||||
title: "给好奇心,",
|
|
||||||
accent: "留一页慢下来的时间。",
|
|
||||||
description:
|
|
||||||
"关于社区、连接和游民生活的小册目录。收藏一个主题,把阅读变成下一场有内容的聊天。",
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function safeSource(value?: string) {
|
function safeSource(value?: string) {
|
||||||
@ -74,7 +58,7 @@ function ResourcePlayer({ source }: { source: string }) {
|
|||||||
/>
|
/>
|
||||||
{failed && (
|
{failed && (
|
||||||
<p role="status" className="social-status warn">
|
<p role="status" className="social-status warn">
|
||||||
片源暂时无法播放,请稍后重试。
|
视频暂时播不了,过一会儿再试试。
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
@ -92,7 +76,7 @@ export default function ResourceLibrary({ kind }: { kind: Kind }) {
|
|||||||
? SEED_EBOOKS.map((book) => ({
|
? SEED_EBOOKS.map((book) => ({
|
||||||
...book,
|
...book,
|
||||||
summary: book.blurb,
|
summary: book.blurb,
|
||||||
city: "社区小册",
|
city: "共创",
|
||||||
coverEmoji: "✦",
|
coverEmoji: "✦",
|
||||||
detail: `${book.chapters} 章 · ${book.minutes} 分钟`,
|
detail: `${book.chapters} 章 · ${book.minutes} 分钟`,
|
||||||
}))
|
}))
|
||||||
@ -112,14 +96,32 @@ export default function ResourceLibrary({ kind }: { kind: Kind }) {
|
|||||||
active && safeSource(config.copy.socialVideoSources?.[active.id]);
|
active && safeSource(config.copy.socialVideoSources?.[active.id]);
|
||||||
return (
|
return (
|
||||||
<SiteShell
|
<SiteShell
|
||||||
title={books ? "灵感书架" : kind === "date" ? "游民故事" : "影像放映室"}
|
title={books ? "共创 · 小册" : kind === "date" ? "共创 · 访谈" : "共创 · 视频"}
|
||||||
>
|
>
|
||||||
<PageIntro {...COPY[kind]} />
|
<PageIntro {...COPY[kind]}>
|
||||||
<div className="social-toolbar">
|
<div className="social-actions social-cocreate-switch">
|
||||||
|
<Link
|
||||||
|
className={`social-btn${books ? " primary" : ""}`}
|
||||||
|
href={socialPath("/ebook")}
|
||||||
|
>
|
||||||
|
小册
|
||||||
|
</Link>
|
||||||
|
<Link
|
||||||
|
className={`social-btn${!books && kind === "videos" ? " primary" : ""}`}
|
||||||
|
href={socialPath("/videos")}
|
||||||
|
>
|
||||||
|
视频
|
||||||
|
</Link>
|
||||||
|
<DemoBadge>
|
||||||
|
{books ? "先看看有哪些" : "有的可以看,有的先看封面"}
|
||||||
|
</DemoBadge>
|
||||||
|
</div>
|
||||||
|
</PageIntro>
|
||||||
|
<div className="social-toolbar reveal">
|
||||||
<SearchField
|
<SearchField
|
||||||
value={query}
|
value={query}
|
||||||
onChange={setQuery}
|
onChange={setQuery}
|
||||||
placeholder={books ? "找一份想读的小册…" : "搜索城市、故事、关键词…"}
|
placeholder={books ? "书名 / 主题" : "城市 / 关键词"}
|
||||||
/>
|
/>
|
||||||
<div className="social-filters">
|
<div className="social-filters">
|
||||||
<button
|
<button
|
||||||
@ -128,7 +130,7 @@ export default function ResourceLibrary({ kind }: { kind: Kind }) {
|
|||||||
aria-pressed={!savedOnly}
|
aria-pressed={!savedOnly}
|
||||||
onClick={() => setSavedOnly(false)}
|
onClick={() => setSavedOnly(false)}
|
||||||
>
|
>
|
||||||
全部{books ? "小册" : "故事"}
|
全部
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@ -136,26 +138,19 @@ export default function ResourceLibrary({ kind }: { kind: Kind }) {
|
|||||||
aria-pressed={savedOnly}
|
aria-pressed={savedOnly}
|
||||||
onClick={() => setSavedOnly(true)}
|
onClick={() => setSavedOnly(true)}
|
||||||
>
|
>
|
||||||
我的收藏 · {saved.length}
|
收藏 · {saved.length}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="social-section-label">
|
|
||||||
{books ? "把灵感带走" : "遇见别人的世界"}
|
|
||||||
<span>
|
|
||||||
{books
|
|
||||||
? "小册主题预览 · 完整内容以阅读书库为准"
|
|
||||||
: "种子内容目录 · 片源发布后可播放"}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div
|
<div
|
||||||
className={`social-grid social-library-grid ${books ? "is-books" : ""}`}
|
className={`social-grid social-library-grid ${books ? "is-books" : ""}`}
|
||||||
>
|
>
|
||||||
{shown.map((item, index) => (
|
{shown.map((item, index) => (
|
||||||
<article
|
<article
|
||||||
id={item.id}
|
id={item.id}
|
||||||
className="social-card social-library-card"
|
className="social-card social-library-card social-panel-fx reveal"
|
||||||
key={item.id}
|
key={item.id}
|
||||||
|
style={{ ["--stagger" as string]: `${index * 70}ms` }}
|
||||||
>
|
>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@ -169,10 +164,10 @@ export default function ResourceLibrary({ kind }: { kind: Kind }) {
|
|||||||
</span>
|
</span>
|
||||||
{books ? (
|
{books ? (
|
||||||
<div className="social-book-cover">
|
<div className="social-book-cover">
|
||||||
<small>NOMADRO FIELD NOTES</small>
|
<small>共创</small>
|
||||||
<BookOpen size={27} strokeWidth={1} />
|
<BookOpen size={27} strokeWidth={1} />
|
||||||
<strong>{item.title}</strong>
|
<strong>{item.title}</strong>
|
||||||
<span>READ. CONNECT. REPEAT.</span>
|
<span>阅读</span>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
@ -187,8 +182,8 @@ export default function ResourceLibrary({ kind }: { kind: Kind }) {
|
|||||||
</span>
|
</span>
|
||||||
<small>
|
<small>
|
||||||
{safeSource(config.copy.socialVideoSources?.[item.id])
|
{safeSource(config.copy.socialVideoSources?.[item.id])
|
||||||
? "播放影像"
|
? "可以看"
|
||||||
: "目录预览"}
|
: "先看封面"}
|
||||||
</small>
|
</small>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
@ -205,7 +200,7 @@ export default function ResourceLibrary({ kind }: { kind: Kind }) {
|
|||||||
className="social-btn"
|
className="social-btn"
|
||||||
onClick={() => setSelected(item.id)}
|
onClick={() => setSelected(item.id)}
|
||||||
>
|
>
|
||||||
展开{books ? "小册" : "故事"}
|
打开
|
||||||
<ArrowUpRight size={14} />
|
<ArrowUpRight size={14} />
|
||||||
</button>
|
</button>
|
||||||
<ShareButton
|
<ShareButton
|
||||||
@ -215,46 +210,49 @@ export default function ResourceLibrary({ kind }: { kind: Kind }) {
|
|||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
))}
|
))}
|
||||||
{!shown.length && <EmptyState />}
|
{!shown.length && (
|
||||||
|
<EmptyState title="没有内容" description="换关键词或看全部。">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-btn"
|
||||||
|
onClick={() => {
|
||||||
|
setQuery("");
|
||||||
|
setSavedOnly(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
重置筛选
|
||||||
|
</button>
|
||||||
|
</EmptyState>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
{active && (
|
{active && (
|
||||||
<SocialDialog title={active.title} onClose={() => setSelected(null)}>
|
<SocialDialog title={active.title} onClose={() => setSelected(null)}>
|
||||||
<div className="social-tags">
|
<div className="social-tags">
|
||||||
<span>{active.detail}</span>
|
<span>{active.detail}</span>
|
||||||
<span>{books ? "小册目录" : source ? "影像" : "内容预览"}</span>
|
<span>{books ? "共创小册" : source ? "可播放" : "先看封面"}</span>
|
||||||
</div>
|
</div>
|
||||||
{!books && source && <ResourcePlayer key={source} source={source} />}
|
{!books && source && <ResourcePlayer key={source} source={source} />}
|
||||||
<p>{active.summary}</p>
|
<p>{active.summary}</p>
|
||||||
{!books && !source && (
|
{!books && !source && (
|
||||||
<p className="social-status warn">
|
<p className="social-status warn">
|
||||||
这是一条内容目录,完整片源尚未发布。你可以先收藏,或围绕这个主题展开聊天。
|
视频还没放出来,可以先收藏,或去聊天室聊聊。
|
||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
{books && (
|
{books && <p>先看看简介;想读全文可以去书库。</p>}
|
||||||
<p>
|
|
||||||
这里展示小册主题简介。点击下方入口浏览完整阅读书库,实际可读书目以书库内展示为准。
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
<div className="social-library-prompt">
|
|
||||||
<span>聊聊这个话题</span>
|
|
||||||
<strong>
|
|
||||||
{books
|
|
||||||
? "刚到一座新城市,你通常怎么认识新朋友?"
|
|
||||||
: `如果下一站是${active.city},你最想和当地游民聊什么?`}
|
|
||||||
</strong>
|
|
||||||
</div>
|
|
||||||
<div className="social-actions">
|
<div className="social-actions">
|
||||||
{books && (
|
{books && (
|
||||||
<Link className="social-btn primary" href="/book">
|
<Link className="social-btn primary" href="/book">
|
||||||
浏览阅读书库 <BookOpen size={15} />
|
打开书库 <BookOpen size={15} />
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
<Link
|
<Link
|
||||||
className={`social-btn${books ? "" : " primary"}`}
|
className={`social-btn${books ? "" : " primary"}`}
|
||||||
href={`/social/chat/general?intro=${encodeURIComponent(`看到「${active.title}」这个主题,想和大家聊聊:${books ? "你在新城市是怎样认识新朋友的?" : `在${active.city}生活最吸引你的是什么?`}`)}`}
|
href={socialPath(
|
||||||
|
`/chat?intro=${encodeURIComponent(`看到「${active.title}」,想聊聊。`)}`,
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<MessageCircle size={15} />
|
<MessageCircle size={15} />
|
||||||
带着话题去聊天
|
去聊天室聊聊
|
||||||
</Link>
|
</Link>
|
||||||
<BookmarkButton id={active.id} collection={`saved-${kind}`} />
|
<BookmarkButton id={active.id} collection={`saved-${kind}`} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useRef, useState, type FormEvent } from "react";
|
import { useMemo, useRef, useState, type FormEvent } from "react";
|
||||||
import {
|
import {
|
||||||
ArrowUpRight,
|
ArrowUpRight,
|
||||||
BriefcaseBusiness,
|
BriefcaseBusiness,
|
||||||
@ -11,14 +11,17 @@ import {
|
|||||||
import SiteShell from "./SiteShell";
|
import SiteShell from "./SiteShell";
|
||||||
import {
|
import {
|
||||||
BookmarkButton,
|
BookmarkButton,
|
||||||
|
DemoBadge,
|
||||||
EmptyState,
|
EmptyState,
|
||||||
PageIntro,
|
PageIntro,
|
||||||
SearchField,
|
SearchField,
|
||||||
SocialDialog,
|
SocialDialog,
|
||||||
} from "./SocialUI";
|
} from "./SocialUI";
|
||||||
import { SEED_GIGS, TEAM_KIND_LABEL } from "@social/lib/seed";
|
import { TEAM_KIND_LABEL } from "@social/lib/seed";
|
||||||
import { socialApi } from "@social/lib/api";
|
import { socialApi } from "@social/lib/api";
|
||||||
import { useLocalState } from "@social/lib/useLocalState";
|
import { useLocalState } from "@social/lib/useLocalState";
|
||||||
|
import { resolveSocialCatalog } from "@social/lib/resolveCatalog";
|
||||||
|
import { useSocialConfig } from "./SocialExperience";
|
||||||
import type { SocialGig, SocialTeamKind } from "@social/lib/types";
|
import type { SocialGig, SocialTeamKind } from "@social/lib/types";
|
||||||
|
|
||||||
function ApplicationForm({ gig }: { gig: SocialGig }) {
|
function ApplicationForm({ gig }: { gig: SocialGig }) {
|
||||||
@ -71,7 +74,16 @@ function ApplicationForm({ gig }: { gig: SocialGig }) {
|
|||||||
<div className="social-tags">
|
<div className="social-tags">
|
||||||
<span>{TEAM_KIND_LABEL[gig.kind || "parttime"]}</span>
|
<span>{TEAM_KIND_LABEL[gig.kind || "parttime"]}</span>
|
||||||
<span>{gig.pay}</span>
|
<span>{gig.pay}</span>
|
||||||
|
<span>{gig.remote ? "线上也能做" : "可以见面做"}</span>
|
||||||
</div>
|
</div>
|
||||||
|
<p className="social-role-brief">{gig.role}</p>
|
||||||
|
{gig.tags.length ? (
|
||||||
|
<div className="social-tags">
|
||||||
|
{gig.tags.map((tag) => (
|
||||||
|
<span key={tag}>{tag}</span>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
<p>介绍一下你想参与的原因,附上作品或经验,让对方更容易了解你。</p>
|
<p>介绍一下你想参与的原因,附上作品或经验,让对方更容易了解你。</p>
|
||||||
<form className="social-form" onSubmit={(event) => void submit(event)}>
|
<form className="social-form" onSubmit={(event) => void submit(event)}>
|
||||||
<fieldset disabled={busy} className="social-fieldset">
|
<fieldset disabled={busy} className="social-fieldset">
|
||||||
@ -105,10 +117,16 @@ function ApplicationForm({ gig }: { gig: SocialGig }) {
|
|||||||
/>
|
/>
|
||||||
</label>
|
</label>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
<div className="social-actions">
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
className="social-btn primary"
|
className="social-btn primary"
|
||||||
disabled={busy || delivery === "sent"}
|
disabled={
|
||||||
|
busy ||
|
||||||
|
delivery === "sent" ||
|
||||||
|
!draft.name.trim() ||
|
||||||
|
!draft.contact.trim()
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<Send size={14} />
|
<Send size={14} />
|
||||||
{busy
|
{busy
|
||||||
@ -119,6 +137,19 @@ function ApplicationForm({ gig }: { gig: SocialGig }) {
|
|||||||
? "重试提交"
|
? "重试提交"
|
||||||
: "发送参与申请"}
|
: "发送参与申请"}
|
||||||
</button>
|
</button>
|
||||||
|
{delivery === "sent" ? (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-btn"
|
||||||
|
onClick={() => {
|
||||||
|
setDelivery("draft");
|
||||||
|
setStatus("可以再投一份,请确认信息后提交。");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
再投一份
|
||||||
|
</button>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
{status && (
|
{status && (
|
||||||
<p
|
<p
|
||||||
role="status"
|
role="status"
|
||||||
@ -128,7 +159,7 @@ function ApplicationForm({ gig }: { gig: SocialGig }) {
|
|||||||
</p>
|
</p>
|
||||||
)}
|
)}
|
||||||
<small className="social-muted">
|
<small className="social-muted">
|
||||||
草稿仅保存在本机。提交不代表录用或确认合作。
|
草稿会先留在你这边。提交只是表达兴趣,不代表已经被录用。
|
||||||
</small>
|
</small>
|
||||||
</form>
|
</form>
|
||||||
</>
|
</>
|
||||||
@ -140,12 +171,17 @@ export default function RoleBoard({
|
|||||||
}: {
|
}: {
|
||||||
initialKind?: SocialTeamKind | "all";
|
initialKind?: SocialTeamKind | "all";
|
||||||
}) {
|
}) {
|
||||||
|
const config = useSocialConfig();
|
||||||
|
const catalog = useMemo(
|
||||||
|
() => resolveSocialCatalog(config.copy.socialCatalogs),
|
||||||
|
[config.copy.socialCatalogs],
|
||||||
|
);
|
||||||
const [kind, setKind] = useState<string>(initialKind);
|
const [kind, setKind] = useState<string>(initialKind);
|
||||||
const [query, setQuery] = useState("");
|
const [query, setQuery] = useState("");
|
||||||
const [savedOnly, setSavedOnly] = useState(false);
|
const [savedOnly, setSavedOnly] = useState(false);
|
||||||
const [saved] = useLocalState<string[]>("saved-roles", []);
|
const [saved] = useLocalState<string[]>("saved-roles", []);
|
||||||
const [active, setActive] = useState<SocialGig | null>(null);
|
const [active, setActive] = useState<SocialGig | null>(null);
|
||||||
const roles = SEED_GIGS.filter(
|
const roles = catalog.gigs.filter(
|
||||||
(gig) =>
|
(gig) =>
|
||||||
(kind === "all" || gig.kind === kind) &&
|
(kind === "all" || gig.kind === kind) &&
|
||||||
(!savedOnly || saved.includes(gig.id)) &&
|
(!savedOnly || saved.includes(gig.id)) &&
|
||||||
@ -154,18 +190,20 @@ export default function RoleBoard({
|
|||||||
.includes(query.toLowerCase()),
|
.includes(query.toLowerCase()),
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<SiteShell title="远程组队">
|
<SiteShell title="一起做事">
|
||||||
<PageIntro
|
<PageIntro title="一起,做点事" accent="找搭子">
|
||||||
eyebrow="BUILD SOMETHING. TOGETHER."
|
<div className="social-actions">
|
||||||
title="不只擦肩而过,"
|
<DemoBadge>
|
||||||
accent="一起做点有意思的事。"
|
{catalog.source === "remote" ? "最新机会" : "先看看这些机会"}
|
||||||
description="把技能变成连接。寻找远程合作、参与一次活动,或加入一个值得投入的团队。"
|
</DemoBadge>
|
||||||
/>
|
<span className="social-muted">{roles.length} 个机会</span>
|
||||||
<div className="social-toolbar">
|
</div>
|
||||||
|
</PageIntro>
|
||||||
|
<div className="social-toolbar reveal">
|
||||||
<SearchField
|
<SearchField
|
||||||
value={query}
|
value={query}
|
||||||
onChange={setQuery}
|
onChange={setQuery}
|
||||||
placeholder="搜索角色、技能、兴趣…"
|
placeholder="角色 / 技能"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
@ -173,11 +211,11 @@ export default function RoleBoard({
|
|||||||
aria-pressed={savedOnly}
|
aria-pressed={savedOnly}
|
||||||
onClick={() => setSavedOnly(!savedOnly)}
|
onClick={() => setSavedOnly(!savedOnly)}
|
||||||
>
|
>
|
||||||
我的收藏 · {saved.length}
|
收藏 · {saved.length}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="social-filters">
|
<div className="social-filters reveal">
|
||||||
{[["all", "全部机会"], ...Object.entries(TEAM_KIND_LABEL)].map(
|
{[["all", "全部"], ...Object.entries(TEAM_KIND_LABEL)].map(
|
||||||
([id, label]) => (
|
([id, label]) => (
|
||||||
<button
|
<button
|
||||||
key={id}
|
key={id}
|
||||||
@ -191,13 +229,23 @@ export default function RoleBoard({
|
|||||||
),
|
),
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="social-section-label">
|
|
||||||
找到你的下一位队友{" "}
|
|
||||||
<span>{roles.length} 个目录机会 · 开放情况请以沟通确认为准</span>
|
|
||||||
</div>
|
|
||||||
<div className="social-grid social-role-grid">
|
<div className="social-grid social-role-grid">
|
||||||
{roles.map((gig, index) => (
|
{roles.map((gig, index) => (
|
||||||
<article className="social-card social-role-card" key={gig.id}>
|
<article
|
||||||
|
className="social-card social-role-card social-panel-fx reveal"
|
||||||
|
key={gig.id}
|
||||||
|
style={{ ["--stagger" as string]: `${index * 70}ms` }}
|
||||||
|
>
|
||||||
|
<div className="social-role-art" aria-hidden="true">
|
||||||
|
<span>{String(index + 1).padStart(2, "0")}</span>
|
||||||
|
<i />
|
||||||
|
<i />
|
||||||
|
{gig.kind === "volunteer" ? (
|
||||||
|
<HeartHandshake size={28} strokeWidth={1.2} />
|
||||||
|
) : (
|
||||||
|
<BriefcaseBusiness size={28} strokeWidth={1.2} />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
<div className="social-card-top">
|
<div className="social-card-top">
|
||||||
<div className={`social-role-symbol tone-${index % 3}`}>
|
<div className={`social-role-symbol tone-${index % 3}`}>
|
||||||
{gig.kind === "volunteer" ? (
|
{gig.kind === "volunteer" ? (
|
||||||
@ -216,7 +264,7 @@ export default function RoleBoard({
|
|||||||
<div className="social-role-meta">
|
<div className="social-role-meta">
|
||||||
<span>
|
<span>
|
||||||
<Globe2 size={13} />
|
<Globe2 size={13} />
|
||||||
{gig.remote ? "可以远程" : "线下 / 混合"}
|
{gig.remote ? "线上也能做" : "可以见面做"}
|
||||||
</span>
|
</span>
|
||||||
<span>{gig.pay}</span>
|
<span>{gig.pay}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -234,7 +282,24 @@ export default function RoleBoard({
|
|||||||
</button>
|
</button>
|
||||||
</article>
|
</article>
|
||||||
))}
|
))}
|
||||||
{!roles.length && <EmptyState />}
|
{!roles.length && (
|
||||||
|
<EmptyState
|
||||||
|
title="暂时没有合适的机会"
|
||||||
|
description="换个词试试,或者看看全部。"
|
||||||
|
>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="social-btn"
|
||||||
|
onClick={() => {
|
||||||
|
setQuery("");
|
||||||
|
setKind("all");
|
||||||
|
setSavedOnly(false);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
重新看看
|
||||||
|
</button>
|
||||||
|
</EmptyState>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
{active && (
|
{active && (
|
||||||
<SocialDialog title={active.title} onClose={() => setActive(null)}>
|
<SocialDialog title={active.title} onClose={() => setActive(null)}>
|
||||||
|
|||||||
@ -13,7 +13,10 @@ import {
|
|||||||
} from "react";
|
} from "react";
|
||||||
import { socialPath } from "@social/lib/socialPath";
|
import { socialPath } from "@social/lib/socialPath";
|
||||||
import { applySocialSkin, SOCIAL_SKIN_DEFAULT } from "@social/lib/skin";
|
import { applySocialSkin, SOCIAL_SKIN_DEFAULT } from "@social/lib/skin";
|
||||||
import { SocialMobileDock, SocialFooter } from "./SocialNavigation";
|
import { useRevealMotion } from "@social/lib/useRevealMotion";
|
||||||
|
import { SocialMobileDock } from "./SocialNavigation";
|
||||||
|
import SocialQuickRail from "./SocialQuickRail";
|
||||||
|
import SocialBrandLogo from "./SocialBrandLogo";
|
||||||
|
|
||||||
function readTheme(): "light" | "dark" {
|
function readTheme(): "light" | "dark" {
|
||||||
try {
|
try {
|
||||||
@ -40,31 +43,29 @@ const serverTheme = () => "dark" as const;
|
|||||||
const GROUPS = [
|
const GROUPS = [
|
||||||
{
|
{
|
||||||
id: "online",
|
id: "online",
|
||||||
label: "线上",
|
label: "认识人",
|
||||||
items: [
|
items: [
|
||||||
{ href: "/people", label: "发现同类" },
|
{ href: "/people", label: "想见的人" },
|
||||||
{ href: "/chat", label: "聊天室" },
|
{ href: "/meetup", label: "开视频聊聊" },
|
||||||
{ href: "/meetup", label: "Meetup" },
|
{ href: "/chat", label: "大家聊天" },
|
||||||
|
{ href: "/date", label: "认识一下" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "offline",
|
id: "offline",
|
||||||
label: "线下",
|
label: "见一面",
|
||||||
items: [
|
items: [
|
||||||
{ href: "/coffeechat", label: "Coffeechat" },
|
{ href: "/coffeechat", label: "找城市见面" },
|
||||||
{ href: "/date", label: "访谈" },
|
{ href: "/roster", label: "我的介绍" },
|
||||||
{ href: "/roster", label: "花名册" },
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "grow",
|
id: "together",
|
||||||
label: "成长",
|
label: "一起做事",
|
||||||
items: [
|
items: [
|
||||||
{ href: "/team", label: "远程团队" },
|
{ href: "/team", label: "找搭子做事" },
|
||||||
{ href: "/vip", label: "VIP" },
|
{ href: "/ebook", label: "共创" },
|
||||||
{ href: "/ebook", label: "小册" },
|
{ href: "/feedback", label: "说说想法" },
|
||||||
{ href: "/videos", label: "视频" },
|
|
||||||
{ href: "/feedback", label: "反馈" },
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@ -93,6 +94,11 @@ export default function SiteShell({
|
|||||||
applySocialSkin(SOCIAL_SKIN_DEFAULT);
|
applySocialSkin(SOCIAL_SKIN_DEFAULT);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useRevealMotion(home ? ".social-home" : ".social-workspace", [
|
||||||
|
home,
|
||||||
|
pathname,
|
||||||
|
]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
document.documentElement.setAttribute("data-theme", theme);
|
document.documentElement.setAttribute("data-theme", theme);
|
||||||
document.documentElement.classList.toggle("light", theme === "light");
|
document.documentElement.classList.toggle("light", theme === "light");
|
||||||
@ -163,21 +169,21 @@ export default function SiteShell({
|
|||||||
const joinBtn = onJoin ? (
|
const joinBtn = onJoin ? (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-primary btn-sm"
|
className="social-btn coral social-nav-join"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
closeMenus();
|
closeMenus();
|
||||||
onJoin();
|
onJoin();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
加群
|
加入社区
|
||||||
</button>
|
</button>
|
||||||
) : (
|
) : (
|
||||||
<Link
|
<Link
|
||||||
href={socialPath("/join")}
|
href={socialPath("/join")}
|
||||||
className="btn btn-primary btn-sm"
|
className="social-btn coral social-nav-join"
|
||||||
onClick={closeMenus}
|
onClick={closeMenus}
|
||||||
>
|
>
|
||||||
加群
|
加入社区
|
||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -188,10 +194,7 @@ export default function SiteShell({
|
|||||||
aria-label="游民社区"
|
aria-label="游民社区"
|
||||||
>
|
>
|
||||||
<div className="nav-container">
|
<div className="nav-container">
|
||||||
<Link href={socialPath("/")} className="nav-logo" onClick={closeMenus}>
|
<SocialBrandLogo onClick={closeMenus} />
|
||||||
<span className="logo-icon">◈</span>
|
|
||||||
<span className="logo-text">游民社区</span>
|
|
||||||
</Link>
|
|
||||||
|
|
||||||
<div id={menuId} className={`nav-links${menuOpen ? " open" : ""}`}>
|
<div id={menuId} className={`nav-links${menuOpen ? " open" : ""}`}>
|
||||||
{GROUPS.map((g) => (
|
{GROUPS.map((g) => (
|
||||||
@ -307,20 +310,15 @@ export default function SiteShell({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="social-flow social-root social-workspace">
|
<div className="social-flow social-root social-workspace social-workspace-dense">
|
||||||
<a className="connection-skip-link" href="#social-main">
|
<a className="connection-skip-link" href="#social-main">
|
||||||
跳到主要内容
|
跳到主要内容
|
||||||
</a>
|
</a>
|
||||||
{nav}
|
{nav}
|
||||||
<div className="social-workspace-grid">
|
<div className="social-workspace-grid">
|
||||||
<main className="social-main" id="social-main">
|
<main className="social-main" id="social-main" data-page={title || "社区"}>
|
||||||
<div className="social-breadcrumb">
|
<SocialQuickRail />
|
||||||
<Link href={socialPath("/")}>nomadro</Link>
|
|
||||||
<span>/</span>
|
|
||||||
<span>{title || "社区"}</span>
|
|
||||||
</div>
|
|
||||||
{children}
|
{children}
|
||||||
<SocialFooter />
|
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
<SocialMobileDock />
|
<SocialMobileDock />
|
||||||
|
|||||||
74
src/modules/social/components/SocialBrandLogo.tsx
Normal file
74
src/modules/social/components/SocialBrandLogo.tsx
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import Link from "next/link";
|
||||||
|
import { useId } from "react";
|
||||||
|
import { socialPath } from "@social/lib/socialPath";
|
||||||
|
|
||||||
|
/** Align with portal topbar mark on nomadro.cn */
|
||||||
|
export function NomadroMark({ className = "" }: { className?: string }) {
|
||||||
|
const gid = useId().replace(/:/g, "");
|
||||||
|
return (
|
||||||
|
<svg
|
||||||
|
className={className}
|
||||||
|
viewBox="0 0 40 40"
|
||||||
|
fill="none"
|
||||||
|
aria-hidden
|
||||||
|
width={28}
|
||||||
|
height={28}
|
||||||
|
>
|
||||||
|
<circle
|
||||||
|
cx="20"
|
||||||
|
cy="20"
|
||||||
|
r="18"
|
||||||
|
stroke={`url(#${gid})`}
|
||||||
|
strokeWidth="2.5"
|
||||||
|
/>
|
||||||
|
<path
|
||||||
|
d="M12 22c4-8 12-8 16 0"
|
||||||
|
stroke={`url(#${gid})`}
|
||||||
|
strokeWidth="2"
|
||||||
|
strokeLinecap="round"
|
||||||
|
/>
|
||||||
|
<circle cx="28" cy="14" r="3" fill={`url(#${gid})`} />
|
||||||
|
<defs>
|
||||||
|
<linearGradient id={gid} x1="0" y1="0" x2="40" y2="40">
|
||||||
|
<stop offset="0%" stopColor="#FF6B6B" />
|
||||||
|
<stop offset="50%" stopColor="#FFE66D" />
|
||||||
|
<stop offset="100%" stopColor="#4ECDC4" />
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function SocialBrandLogo({
|
||||||
|
href = socialPath("/"),
|
||||||
|
section = "游民社区",
|
||||||
|
onClick,
|
||||||
|
}: {
|
||||||
|
href?: string;
|
||||||
|
section?: string;
|
||||||
|
onClick?: () => void;
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
href={href}
|
||||||
|
className="nav-logo social-brand-logo"
|
||||||
|
onClick={onClick}
|
||||||
|
aria-label="nomadro 游民社区"
|
||||||
|
>
|
||||||
|
<NomadroMark className="social-brand-mark" />
|
||||||
|
<span className="logo-text">
|
||||||
|
<span className="social-brand-name">nomadro</span>
|
||||||
|
{section ? (
|
||||||
|
<>
|
||||||
|
<span className="social-brand-sep" aria-hidden>
|
||||||
|
·
|
||||||
|
</span>
|
||||||
|
<span className="social-brand-section">{section}</span>
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
|
</span>
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -42,12 +42,12 @@ function Constellation({ active }: { active: boolean }) {
|
|||||||
canvas.width = width * ratio;
|
canvas.width = width * ratio;
|
||||||
canvas.height = height * ratio;
|
canvas.height = height * ratio;
|
||||||
context.setTransform(ratio, 0, 0, ratio, 0, 0);
|
context.setTransform(ratio, 0, 0, ratio, 0, 0);
|
||||||
points = Array.from({ length: width < 700 ? 48 : 96 }, (_, i) => ({
|
points = Array.from({ length: width < 700 ? 28 : 52 }, (_, i) => ({
|
||||||
x: Math.random() * width,
|
x: Math.random() * width,
|
||||||
y: Math.random() * height,
|
y: Math.random() * height,
|
||||||
vx: (Math.random() - 0.5) * 0.48,
|
vx: (Math.random() - 0.5) * 0.28,
|
||||||
vy: (Math.random() - 0.5) * 0.48,
|
vy: (Math.random() - 0.5) * 0.28,
|
||||||
r: 1.2 + Math.random() * 2.1,
|
r: 0.9 + Math.random() * 1.4,
|
||||||
color: ["78,205,196", "255,107,107", "255,230,109"][i % 3],
|
color: ["78,205,196", "255,107,107", "255,230,109"][i % 3],
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
@ -62,22 +62,22 @@ function Constellation({ active }: { active: boolean }) {
|
|||||||
const near = Math.hypot(pointer.x - p.x, pointer.y - p.y) < 240;
|
const near = Math.hypot(pointer.x - p.x, pointer.y - p.y) < 240;
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
context.arc(p.x, p.y, p.r, 0, Math.PI * 2);
|
context.arc(p.x, p.y, p.r, 0, Math.PI * 2);
|
||||||
context.fillStyle = `rgba(${p.color},${near ? 0.95 : 0.55})`;
|
context.fillStyle = `rgba(${p.color},${near ? 0.55 : 0.28})`;
|
||||||
context.fill();
|
context.fill();
|
||||||
if (near) {
|
if (near) {
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
context.arc(p.x, p.y, p.r + 6, 0, Math.PI * 2);
|
context.arc(p.x, p.y, p.r + 4, 0, Math.PI * 2);
|
||||||
context.fillStyle = `rgba(${p.color},0.16)`;
|
context.fillStyle = `rgba(${p.color},0.1)`;
|
||||||
context.fill();
|
context.fill();
|
||||||
}
|
}
|
||||||
if (width > 700)
|
if (width > 700)
|
||||||
points.slice(index + 1).forEach((q) => {
|
points.slice(index + 1).forEach((q) => {
|
||||||
const distance = Math.hypot(q.x - p.x, q.y - p.y);
|
const distance = Math.hypot(q.x - p.x, q.y - p.y);
|
||||||
if (distance > 170) return;
|
if (distance > 140) return;
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
context.moveTo(p.x, p.y);
|
context.moveTo(p.x, p.y);
|
||||||
context.lineTo(q.x, q.y);
|
context.lineTo(q.x, q.y);
|
||||||
context.strokeStyle = `rgba(78,205,196,${(1 - distance / 170) * 0.32})`;
|
context.strokeStyle = `rgba(78,205,196,${(1 - distance / 140) * 0.16})`;
|
||||||
context.lineWidth = 1.05;
|
context.lineWidth = 1.05;
|
||||||
context.stroke();
|
context.stroke();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5,29 +5,29 @@ import { usePathname } from "next/navigation";
|
|||||||
import {
|
import {
|
||||||
CircleUserRound,
|
CircleUserRound,
|
||||||
Compass,
|
Compass,
|
||||||
|
Heart,
|
||||||
House,
|
House,
|
||||||
MessageCircle,
|
MessageCircle,
|
||||||
Radio,
|
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { socialPath } from "@social/lib/socialPath";
|
import { socialPath } from "@social/lib/socialPath";
|
||||||
|
|
||||||
const LINKS = [
|
const LINKS = [
|
||||||
{ href: "/", label: "社区首页", icon: House },
|
{ href: "/", label: "首页", short: "首页", icon: House },
|
||||||
{ href: "/people", label: "发现同类", icon: Compass },
|
{ href: "/people", label: "想见的人", short: "看看谁", icon: Compass },
|
||||||
{ href: "/chat", label: "话题聊天室", icon: MessageCircle },
|
{ href: "/date", label: "认识一下", short: "认识", icon: Heart },
|
||||||
{ href: "/meetup", label: "Meetup 活动", icon: Radio },
|
{ href: "/chat", label: "大家聊天", short: "聊天", icon: MessageCircle },
|
||||||
{ href: "/roster", label: "我的游民名片", icon: CircleUserRound },
|
{ href: "/roster", label: "我的介绍", short: "我", icon: CircleUserRound },
|
||||||
];
|
];
|
||||||
|
|
||||||
export function SocialMobileDock() {
|
export function SocialMobileDock() {
|
||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
const links = LINKS;
|
|
||||||
return (
|
return (
|
||||||
<nav className="social-mobile-dock" aria-label="快捷导航">
|
<nav className="social-mobile-dock" aria-label="快捷导航">
|
||||||
{links.map((item) => (
|
{LINKS.map((item) => (
|
||||||
<Link
|
<Link
|
||||||
key={item.href}
|
key={item.href}
|
||||||
href={socialPath(item.href)}
|
href={socialPath(item.href)}
|
||||||
|
aria-label={item.label}
|
||||||
aria-current={
|
aria-current={
|
||||||
(
|
(
|
||||||
item.href === "/"
|
item.href === "/"
|
||||||
@ -38,16 +38,8 @@ export function SocialMobileDock() {
|
|||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<item.icon size={19} strokeWidth={1.6} />
|
<item.icon size={20} strokeWidth={1.7} />
|
||||||
<span>
|
<span>{item.short}</span>
|
||||||
{item.label === "我的游民名片"
|
|
||||||
? "我的名片"
|
|
||||||
: item.label === "话题聊天室"
|
|
||||||
? "聊天"
|
|
||||||
: item.label === "Meetup 活动"
|
|
||||||
? "活动"
|
|
||||||
: item.label}
|
|
||||||
</span>
|
|
||||||
</Link>
|
</Link>
|
||||||
))}
|
))}
|
||||||
</nav>
|
</nav>
|
||||||
@ -57,11 +49,12 @@ export function SocialMobileDock() {
|
|||||||
export function SocialFooter() {
|
export function SocialFooter() {
|
||||||
return (
|
return (
|
||||||
<footer className="social-workspace-footer">
|
<footer className="social-workspace-footer">
|
||||||
<span>nomadro social · Meet beyond borders.</span>
|
<span>游民社区 · 认识同频的人</span>
|
||||||
<div>
|
<div>
|
||||||
<Link href={socialPath("/feedback")}>反馈与建议</Link>
|
<Link href={socialPath("/date")}>认识一下</Link>
|
||||||
|
<Link href={socialPath("/feedback")}>说说想法</Link>
|
||||||
<Link href={socialPath("/join")}>加入社区</Link>
|
<Link href={socialPath("/join")}>加入社区</Link>
|
||||||
<Link href={socialPath("/roster")}>我的名片</Link>
|
<Link href={socialPath("/roster")}>我的介绍</Link>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
);
|
);
|
||||||
|
|||||||
48
src/modules/social/components/SocialQuickRail.tsx
Normal file
48
src/modules/social/components/SocialQuickRail.tsx
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import Link from "next/link";
|
||||||
|
import { usePathname } from "next/navigation";
|
||||||
|
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: "/coffeechat", label: "见一面", emoji: "🌆" },
|
||||||
|
{ href: "/team", label: "一起做事", emoji: "🚀" },
|
||||||
|
{ href: "/ebook", label: "共创", emoji: "🎨" },
|
||||||
|
{ href: "/roster", label: "我的介绍", emoji: "🪪" },
|
||||||
|
{ href: "/join", label: "加入社区", emoji: "✨" },
|
||||||
|
];
|
||||||
|
|
||||||
|
export default function SocialQuickRail() {
|
||||||
|
const pathname = usePathname();
|
||||||
|
return (
|
||||||
|
<nav className="social-quick-rail" aria-label="社区快捷入口">
|
||||||
|
<div className="social-quick-rail-track">
|
||||||
|
{RAIL.map((item) => {
|
||||||
|
const href = socialPath(item.href);
|
||||||
|
const active =
|
||||||
|
item.href === "/ebook"
|
||||||
|
? pathname.startsWith(socialPath("/ebook")) ||
|
||||||
|
pathname.startsWith(socialPath("/videos"))
|
||||||
|
: item.href === "/"
|
||||||
|
? pathname === socialPath("/")
|
||||||
|
: pathname.startsWith(href);
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
key={item.href}
|
||||||
|
href={href}
|
||||||
|
className={`social-quick-chip${active ? " is-active" : ""}`}
|
||||||
|
aria-current={active ? "page" : undefined}
|
||||||
|
>
|
||||||
|
<span aria-hidden>{item.emoji}</span>
|
||||||
|
{item.label}
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -1,64 +1,98 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useEffect, useRef, useState, type ReactNode } from "react";
|
import { useEffect, useRef, useState, type ReactNode } from "react";
|
||||||
import { ArrowUpRight, Check, Copy, Search, X } from "lucide-react";
|
import { Check, Copy, Search, X } from "lucide-react";
|
||||||
import { useLocalState } from "@social/lib/useLocalState";
|
import { useLocalState } from "@social/lib/useLocalState";
|
||||||
import { useSocialConfig } from "./SocialExperience";
|
import { useSocialConfig } from "./SocialExperience";
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from "next/navigation";
|
||||||
|
|
||||||
|
const PAGE_MARK: Record<string, string> = {
|
||||||
|
people: "👋",
|
||||||
|
roster: "🪪",
|
||||||
|
meetup: "📡",
|
||||||
|
coffeechat: "☕",
|
||||||
|
team: "🚀",
|
||||||
|
gigs: "💼",
|
||||||
|
chat: "💬",
|
||||||
|
join: "✨",
|
||||||
|
vip: "✨",
|
||||||
|
ebook: "🎨",
|
||||||
|
videos: "🎨",
|
||||||
|
date: "💕",
|
||||||
|
feedback: "💌",
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Compact page header — remote eyebrow / description when present. */
|
||||||
export function PageIntro({
|
export function PageIntro({
|
||||||
eyebrow,
|
|
||||||
title,
|
title,
|
||||||
accent,
|
accent,
|
||||||
|
eyebrow,
|
||||||
description,
|
description,
|
||||||
|
emoji,
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
eyebrow: string;
|
eyebrow?: string;
|
||||||
title: string;
|
title: string;
|
||||||
accent: string;
|
accent?: string;
|
||||||
description: string;
|
description?: string;
|
||||||
|
emoji?: string;
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const config = useSocialConfig();
|
const config = useSocialConfig();
|
||||||
const key = usePathname().split("/")[2] || "home";
|
const key = usePathname().split("/")[2] || "home";
|
||||||
const copy = config.copy.socialPages?.[key];
|
const copy = config.copy.socialPages?.[key];
|
||||||
eyebrow =
|
const resolvedTitle =
|
||||||
typeof copy?.eyebrow === "string" && copy.eyebrow.trim()
|
typeof copy?.title === "string" && copy.title.trim()
|
||||||
? copy.eyebrow
|
? copy.title
|
||||||
: eyebrow;
|
: title;
|
||||||
title =
|
const resolvedAccent =
|
||||||
typeof copy?.title === "string" && copy.title.trim() ? copy.title : title;
|
|
||||||
accent =
|
|
||||||
typeof copy?.accent === "string" && copy.accent.trim()
|
typeof copy?.accent === "string" && copy.accent.trim()
|
||||||
? copy.accent
|
? copy.accent
|
||||||
: accent;
|
: accent || "";
|
||||||
description =
|
const resolvedEyebrow =
|
||||||
|
typeof copy?.eyebrow === "string" && copy.eyebrow.trim()
|
||||||
|
? copy.eyebrow
|
||||||
|
: eyebrow || "";
|
||||||
|
const resolvedDescription =
|
||||||
typeof copy?.description === "string" && copy.description.trim()
|
typeof copy?.description === "string" && copy.description.trim()
|
||||||
? copy.description
|
? copy.description
|
||||||
: description;
|
: description || "";
|
||||||
|
const mark = emoji || PAGE_MARK[key] || "◈";
|
||||||
return (
|
return (
|
||||||
<section className="social-page-intro">
|
<header className="social-page-head">
|
||||||
<div className="social-page-orbit" aria-hidden="true">
|
<div className="social-page-head-copy">
|
||||||
<i />
|
{resolvedEyebrow ? (
|
||||||
<i />
|
<p className="social-page-head-eyebrow">{resolvedEyebrow}</p>
|
||||||
<i />
|
) : null}
|
||||||
<span>✦</span>
|
|
||||||
</div>
|
|
||||||
<div className="social-page-kicker">
|
|
||||||
<span />
|
|
||||||
{eyebrow}
|
|
||||||
</div>
|
|
||||||
<h1>
|
<h1>
|
||||||
{title}
|
<span className="social-page-head-mark" aria-hidden>
|
||||||
<br />
|
{mark}
|
||||||
<span>{accent}</span>
|
</span>
|
||||||
|
<span className="social-page-head-title">
|
||||||
|
{resolvedTitle}
|
||||||
|
{resolvedAccent ? (
|
||||||
|
<span className="social-page-head-accent">{resolvedAccent}</span>
|
||||||
|
) : null}
|
||||||
|
</span>
|
||||||
</h1>
|
</h1>
|
||||||
<p>{description}</p>
|
{resolvedDescription ? (
|
||||||
|
<p className="social-page-head-desc">{resolvedDescription}</p>
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
{children}
|
{children}
|
||||||
</section>
|
</header>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Honest demo / offline chip for mock surfaces. */
|
||||||
|
export function DemoBadge({
|
||||||
|
children = "示例介绍,方便先逛逛",
|
||||||
|
}: {
|
||||||
|
children?: ReactNode;
|
||||||
|
}) {
|
||||||
|
return <span className="social-demo-badge">{children}</span>;
|
||||||
|
}
|
||||||
|
|
||||||
export function SearchField({
|
export function SearchField({
|
||||||
value,
|
value,
|
||||||
onChange,
|
onChange,
|
||||||
@ -160,20 +194,22 @@ export function ShareButton({ path, title }: { path: string; title: string }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function EmptyState({
|
export function EmptyState({
|
||||||
title = "暂时没有找到",
|
title = "暂时没有",
|
||||||
description = "换个关键词,或试试其他筛选。",
|
description = "换个关键词,或清空筛选。",
|
||||||
children,
|
children,
|
||||||
|
emoji = "✦",
|
||||||
}: {
|
}: {
|
||||||
title?: string;
|
title?: string;
|
||||||
description?: string;
|
description?: string;
|
||||||
children?: ReactNode;
|
children?: ReactNode;
|
||||||
|
emoji?: string;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<div className="social-empty">
|
<div className="social-empty">
|
||||||
<span aria-hidden>✦</span>
|
<span aria-hidden>{emoji}</span>
|
||||||
<h3>{title}</h3>
|
<h3>{title}</h3>
|
||||||
<p>{description}</p>
|
<p>{description}</p>
|
||||||
{children}
|
{children ? <div className="social-empty-actions">{children}</div> : null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -202,28 +238,24 @@ export function SocialDialog({
|
|||||||
}, []);
|
}, []);
|
||||||
return (
|
return (
|
||||||
<dialog
|
<dialog
|
||||||
className="social-detail-dialog"
|
|
||||||
ref={ref}
|
ref={ref}
|
||||||
aria-label={title}
|
className="social-dialog"
|
||||||
onCancel={(event) => {
|
onCancel={(event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
onClose();
|
onClose();
|
||||||
}}
|
}}
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
if (event.target === event.currentTarget) onClose();
|
if (event.target === ref.current) onClose();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div>
|
<div className="social-dialog-sheet">
|
||||||
<header>
|
<header>
|
||||||
<span>
|
<h2>{title}</h2>
|
||||||
MAKE A CONNECTION <ArrowUpRight size={14} />
|
<button type="button" aria-label="关闭" onClick={onClose}>
|
||||||
</span>
|
<X size={18} />
|
||||||
<button type="button" aria-label="关闭详情" onClick={onClose}>
|
|
||||||
<X size={20} />
|
|
||||||
</button>
|
</button>
|
||||||
</header>
|
</header>
|
||||||
<h2>{title}</h2>
|
<div className="social-dialog-body">{children}</div>
|
||||||
{children}
|
|
||||||
</div>
|
</div>
|
||||||
</dialog>
|
</dialog>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,65 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { useEffect, useState } from "react";
|
|
||||||
import Link from "next/link";
|
|
||||||
import { Globe2 } from "lucide-react";
|
|
||||||
|
|
||||||
const CITIES = [
|
|
||||||
{ name: "清迈", zone: "Asia/Bangkok", caption: "CHIANG MAI", emoji: "🌿" },
|
|
||||||
{ name: "大理", zone: "Asia/Shanghai", caption: "DALI", emoji: "🏔️" },
|
|
||||||
{ name: "里斯本", zone: "Europe/Lisbon", caption: "LISBON", emoji: "🌊" },
|
|
||||||
{ name: "巴厘岛", zone: "Asia/Makassar", caption: "BALI", emoji: "🌴" },
|
|
||||||
];
|
|
||||||
export default function WorldConnections() {
|
|
||||||
const [now, setNow] = useState<Date | null>(null);
|
|
||||||
useEffect(() => {
|
|
||||||
const update = () => setNow(new Date());
|
|
||||||
const first = requestAnimationFrame(update);
|
|
||||||
const timer = setInterval(update, 30000);
|
|
||||||
return () => {
|
|
||||||
cancelAnimationFrame(first);
|
|
||||||
clearInterval(timer);
|
|
||||||
};
|
|
||||||
}, []);
|
|
||||||
return (
|
|
||||||
<div className="container social-world-strip">
|
|
||||||
<div>
|
|
||||||
<strong>
|
|
||||||
<Globe2
|
|
||||||
size={14}
|
|
||||||
style={{
|
|
||||||
display: "inline",
|
|
||||||
verticalAlign: "middle",
|
|
||||||
marginRight: 7,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
世界在流动,连接在发生
|
|
||||||
</strong>
|
|
||||||
<p>四座城市 · 此刻的当地时间</p>
|
|
||||||
</div>
|
|
||||||
{CITIES.map((city) => (
|
|
||||||
<div className="social-world-city" key={city.zone}>
|
|
||||||
<strong>
|
|
||||||
<span aria-hidden>{city.emoji}</span>
|
|
||||||
{city.name}
|
|
||||||
</strong>
|
|
||||||
<time>
|
|
||||||
{now
|
|
||||||
? new Intl.DateTimeFormat("en-GB", {
|
|
||||||
timeZone: city.zone,
|
|
||||||
hour: "2-digit",
|
|
||||||
minute: "2-digit",
|
|
||||||
hour12: false,
|
|
||||||
}).format(now)
|
|
||||||
: "--:--"}
|
|
||||||
</time>
|
|
||||||
<small>{city.caption}</small>
|
|
||||||
<Link
|
|
||||||
href={`/social/people?city=${encodeURIComponent(city.name)}`}
|
|
||||||
aria-label={`发现${city.name}的游民`}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -19,122 +19,100 @@ export type SocialSection = {
|
|||||||
export const SOCIAL_SECTIONS: SocialSection[] = [
|
export const SOCIAL_SECTIONS: SocialSection[] = [
|
||||||
{
|
{
|
||||||
id: "online",
|
id: "online",
|
||||||
title: "线上社交",
|
title: "认识人",
|
||||||
subtitle: "加群 · 实时聊天 · Meetup",
|
subtitle: "看看谁在这儿 · 聊聊 · 开视频",
|
||||||
features: [
|
features: [
|
||||||
{
|
{
|
||||||
id: "join",
|
id: "people",
|
||||||
emoji: "🚩",
|
emoji: "👋",
|
||||||
title: "加群",
|
title: "想见的人",
|
||||||
desc: "线上社区入口,找到同频游民",
|
desc: "按城市或兴趣看看大家",
|
||||||
href: "/join",
|
href: "/people",
|
||||||
status: "live",
|
status: "live",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "chat",
|
id: "chat",
|
||||||
emoji: "💬",
|
emoji: "💬",
|
||||||
title: "实时聊天室",
|
title: "大家聊天",
|
||||||
desc: "自研文字频道,本地可发消息",
|
desc: "打个招呼就好",
|
||||||
href: "/chat",
|
href: "/chat",
|
||||||
status: "live",
|
status: "live",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "meetup",
|
id: "meetup",
|
||||||
emoji: "📹",
|
emoji: "📹",
|
||||||
title: "线上 Meetup",
|
title: "开视频聊聊",
|
||||||
desc: "站内分屏视频房 · 同页文字频道",
|
desc: "几个人一起开摄像头见面",
|
||||||
href: "/meetup",
|
href: "/meetup",
|
||||||
status: "live",
|
status: "live",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: "join",
|
||||||
|
emoji: "🚩",
|
||||||
|
title: "加入社区",
|
||||||
|
desc: "付费加入,或先看公众号",
|
||||||
|
href: "/join",
|
||||||
|
status: "live",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "offline",
|
id: "offline",
|
||||||
title: "线下连接",
|
title: "见一面",
|
||||||
subtitle: "Coffeechat · Date",
|
subtitle: "咖啡馆 · 认识一下 · 我的介绍",
|
||||||
features: [
|
features: [
|
||||||
{
|
{
|
||||||
id: "coffeechat",
|
id: "coffeechat",
|
||||||
emoji: "☕",
|
emoji: "☕",
|
||||||
title: "Coffeechat",
|
title: "找城市见面",
|
||||||
desc: "咖啡馆合作 · 评价 · 合照备注",
|
desc: "选城市,找适合见面的咖啡馆",
|
||||||
href: "/coffeechat",
|
href: "/coffeechat",
|
||||||
status: "live",
|
status: "live",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "date",
|
id: "date",
|
||||||
emoji: "🎙",
|
emoji: "💕",
|
||||||
title: "Date / 访谈",
|
title: "认识一下",
|
||||||
desc: "线下访谈视频与故事",
|
desc: "左滑跳过 · 右滑想认识",
|
||||||
href: "/date",
|
href: "/date",
|
||||||
status: "live",
|
status: "live",
|
||||||
},
|
},
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "vip",
|
|
||||||
title: "VIP",
|
|
||||||
subtitle: "职业花名册 · 虚拟支付",
|
|
||||||
features: [
|
|
||||||
{
|
{
|
||||||
id: "roster",
|
id: "roster",
|
||||||
emoji: "📇",
|
emoji: "📇",
|
||||||
title: "职业花名册",
|
title: "我的介绍",
|
||||||
desc: "资料表单 · Linktree · 手机号",
|
desc: "写几句,让别人认识你",
|
||||||
href: "/roster",
|
href: "/roster",
|
||||||
status: "live",
|
status: "live",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
id: "pay",
|
|
||||||
emoji: "💳",
|
|
||||||
title: "会员开通",
|
|
||||||
desc: "虚拟支付 · 对接门户 VIP",
|
|
||||||
href: "/vip",
|
|
||||||
status: "live",
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "ugc",
|
id: "grow",
|
||||||
title: "UGC",
|
title: "一起做事",
|
||||||
subtitle: "小册 · 视频",
|
subtitle: "找搭子 · 共创 · 说说想法",
|
||||||
features: [
|
|
||||||
{
|
|
||||||
id: "ebook",
|
|
||||||
emoji: "📖",
|
|
||||||
title: "电子书",
|
|
||||||
desc: "游民内容共创与阅读",
|
|
||||||
href: "/ebook",
|
|
||||||
status: "live",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "video",
|
|
||||||
emoji: "🎬",
|
|
||||||
title: "视频",
|
|
||||||
desc: "UGC 视频与访谈合集",
|
|
||||||
href: "/videos",
|
|
||||||
status: "live",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "ops",
|
|
||||||
title: "远程团队",
|
|
||||||
subtitle: "志愿者 · 兼职 · 全职 · 反馈",
|
|
||||||
features: [
|
features: [
|
||||||
{
|
{
|
||||||
id: "team",
|
id: "team",
|
||||||
emoji: "🧑💻",
|
emoji: "🧑💻",
|
||||||
title: "远程团队",
|
title: "找搭子做事",
|
||||||
desc: "招募志愿者 / 兼职 / 全职",
|
desc: "帮忙、兼职、一起做点事",
|
||||||
href: "/team",
|
href: "/team",
|
||||||
status: "live",
|
status: "live",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: "cocreate",
|
||||||
|
emoji: "✨",
|
||||||
|
title: "共创",
|
||||||
|
desc: "大家一起写的小册和拍的视频",
|
||||||
|
href: "/ebook",
|
||||||
|
status: "live",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: "feedback",
|
id: "feedback",
|
||||||
emoji: "💡",
|
emoji: "💡",
|
||||||
title: "反馈建议",
|
title: "说说想法",
|
||||||
desc: "产品反馈与改进建议",
|
desc: "哪里不顺手,告诉我们",
|
||||||
href: "/feedback",
|
href: "/feedback",
|
||||||
status: "live",
|
status: "live",
|
||||||
},
|
},
|
||||||
|
|||||||
168
src/modules/social/lib/cities.ts
Normal file
168
src/modules/social/lib/cities.ts
Normal file
@ -0,0 +1,168 @@
|
|||||||
|
/** Offline city catalog — seed inspired by meetup.hackrobot.cn destination list. */
|
||||||
|
|
||||||
|
export type SocialCity = {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
country: string;
|
||||||
|
emoji: string;
|
||||||
|
vibe: string;
|
||||||
|
members: number;
|
||||||
|
costHint: string;
|
||||||
|
wifiMbps: number;
|
||||||
|
tags: string[];
|
||||||
|
hot?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const SOCIAL_CITIES: SocialCity[] = [
|
||||||
|
{
|
||||||
|
id: "dali",
|
||||||
|
name: "大理",
|
||||||
|
country: "中国",
|
||||||
|
emoji: "🏔️",
|
||||||
|
vibe: "苍山洱海 · 慢生活",
|
||||||
|
members: 520,
|
||||||
|
costHint: "¥3,000/月起",
|
||||||
|
wifiMbps: 50,
|
||||||
|
tags: ["热门", "便宜", "山城"],
|
||||||
|
hot: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "chengdu",
|
||||||
|
name: "成都",
|
||||||
|
country: "中国",
|
||||||
|
emoji: "🌶️",
|
||||||
|
vibe: "天府之国 · 美食慢节奏",
|
||||||
|
members: 680,
|
||||||
|
costHint: "¥4,500/月起",
|
||||||
|
wifiMbps: 80,
|
||||||
|
tags: ["热门", "美食", "宜居"],
|
||||||
|
hot: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "hangzhou",
|
||||||
|
name: "杭州",
|
||||||
|
country: "中国",
|
||||||
|
emoji: "🏞️",
|
||||||
|
vibe: "西湖 · 互联网重镇",
|
||||||
|
members: 560,
|
||||||
|
costHint: "¥6,000/月起",
|
||||||
|
wifiMbps: 100,
|
||||||
|
tags: ["热门", "高速网络"],
|
||||||
|
hot: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "kunming",
|
||||||
|
name: "昆明",
|
||||||
|
country: "中国",
|
||||||
|
emoji: "🌸",
|
||||||
|
vibe: "四季如春 · 通往东南亚",
|
||||||
|
members: 380,
|
||||||
|
costHint: "¥3,500/月起",
|
||||||
|
wifiMbps: 55,
|
||||||
|
tags: ["温暖", "便宜"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "shenzhen",
|
||||||
|
name: "深圳",
|
||||||
|
country: "中国",
|
||||||
|
emoji: "🚀",
|
||||||
|
vibe: "科技创新 · 创业友好",
|
||||||
|
members: 850,
|
||||||
|
costHint: "¥8,000/月起",
|
||||||
|
wifiMbps: 120,
|
||||||
|
tags: ["热门", "高速网络", "一线城市"],
|
||||||
|
hot: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "xiamen",
|
||||||
|
name: "厦门",
|
||||||
|
country: "中国",
|
||||||
|
emoji: "🏝️",
|
||||||
|
vibe: "海滨花园 · 鼓浪屿",
|
||||||
|
members: 320,
|
||||||
|
costHint: "¥5,500/月起",
|
||||||
|
wifiMbps: 70,
|
||||||
|
tags: ["海滨", "温暖"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "shanghai",
|
||||||
|
name: "上海",
|
||||||
|
country: "中国",
|
||||||
|
emoji: "🌆",
|
||||||
|
vibe: "国际大都市 · 文化交汇",
|
||||||
|
members: 1200,
|
||||||
|
costHint: "¥10,000/月起",
|
||||||
|
wifiMbps: 110,
|
||||||
|
tags: ["一线城市", "热门"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "lijiang",
|
||||||
|
name: "丽江",
|
||||||
|
country: "中国",
|
||||||
|
emoji: "🏯",
|
||||||
|
vibe: "玉龙雪山 · 古城慢旅",
|
||||||
|
members: 280,
|
||||||
|
costHint: "¥3,200/月起",
|
||||||
|
wifiMbps: 45,
|
||||||
|
tags: ["便宜", "山城"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "chiangmai",
|
||||||
|
name: "清迈",
|
||||||
|
country: "泰国",
|
||||||
|
emoji: "🌿",
|
||||||
|
vibe: "Nimman · 游民大本营",
|
||||||
|
members: 940,
|
||||||
|
costHint: "฿18,000/月起",
|
||||||
|
wifiMbps: 90,
|
||||||
|
tags: ["热门", "友好社区", "高速网络"],
|
||||||
|
hot: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "bali",
|
||||||
|
name: "巴厘岛",
|
||||||
|
country: "印尼",
|
||||||
|
emoji: "🌴",
|
||||||
|
vibe: "Canggu · 冲浪与 cowork",
|
||||||
|
members: 720,
|
||||||
|
costHint: "Rp8jt/月起",
|
||||||
|
wifiMbps: 60,
|
||||||
|
tags: ["海滨", "温暖", "热门"],
|
||||||
|
hot: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "lisbon",
|
||||||
|
name: "里斯本",
|
||||||
|
country: "葡萄牙",
|
||||||
|
emoji: "🌊",
|
||||||
|
vibe: "阳光海岸 · 欧洲时区",
|
||||||
|
members: 610,
|
||||||
|
costHint: "€1,200/月起",
|
||||||
|
wifiMbps: 100,
|
||||||
|
tags: ["海滨", "友好社区"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "penang",
|
||||||
|
name: "槟城",
|
||||||
|
country: "马来西亚",
|
||||||
|
emoji: "🍜",
|
||||||
|
vibe: "美食 · 海风开放工位",
|
||||||
|
members: 260,
|
||||||
|
costHint: "RM2,800/月起",
|
||||||
|
wifiMbps: 100,
|
||||||
|
tags: ["美食", "便宜"],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const CITY_FILTER_TAGS = [
|
||||||
|
"全部",
|
||||||
|
"热门",
|
||||||
|
"便宜",
|
||||||
|
"高速网络",
|
||||||
|
"温暖",
|
||||||
|
"海滨",
|
||||||
|
"山城",
|
||||||
|
"一线城市",
|
||||||
|
"友好社区",
|
||||||
|
"美食",
|
||||||
|
] as const;
|
||||||
83
src/modules/social/lib/discoveryRoster.ts
Normal file
83
src/modules/social/lib/discoveryRoster.ts
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useMemo, useSyncExternalStore } from "react";
|
||||||
|
import { MOCK_ROSTER, type SocialRosterMember } from "./rosterMock";
|
||||||
|
import { loadJson, saveJson } from "./storage";
|
||||||
|
import type { SocialRosterProfile } from "./types";
|
||||||
|
|
||||||
|
export const ROSTER_PUBLISH_KEY = "roster-publish";
|
||||||
|
export const ROSTER_PUBLISH_CHANGED = "social-roster-publish-changed";
|
||||||
|
export const SELF_MEMBER_ID = "self-local";
|
||||||
|
|
||||||
|
const EMPTY: SocialRosterProfile = {
|
||||||
|
name: "",
|
||||||
|
title: "",
|
||||||
|
city: "",
|
||||||
|
phone: "",
|
||||||
|
linktree: "",
|
||||||
|
skills: "",
|
||||||
|
bio: "",
|
||||||
|
};
|
||||||
|
|
||||||
|
const STORAGE_CHANGE = "nomadro-social-storage";
|
||||||
|
|
||||||
|
function subscribeSocialStorage(cb: () => void) {
|
||||||
|
window.addEventListener("storage", cb);
|
||||||
|
window.addEventListener(STORAGE_CHANGE, cb);
|
||||||
|
window.addEventListener(ROSTER_PUBLISH_CHANGED, cb);
|
||||||
|
return () => {
|
||||||
|
window.removeEventListener("storage", cb);
|
||||||
|
window.removeEventListener(STORAGE_CHANGE, cb);
|
||||||
|
window.removeEventListener(ROSTER_PUBLISH_CHANGED, cb);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function setRosterPublished(published: boolean) {
|
||||||
|
saveJson(ROSTER_PUBLISH_KEY, published);
|
||||||
|
window.dispatchEvent(new Event(STORAGE_CHANGE));
|
||||||
|
window.dispatchEvent(new Event(ROSTER_PUBLISH_CHANGED));
|
||||||
|
}
|
||||||
|
|
||||||
|
export function profileToMember(
|
||||||
|
profile: SocialRosterProfile,
|
||||||
|
): SocialRosterMember | null {
|
||||||
|
const name = profile.name.trim();
|
||||||
|
if (!name) return null;
|
||||||
|
const tags = profile.skills
|
||||||
|
.split(/[,,、]/)
|
||||||
|
.map((t) => t.trim())
|
||||||
|
.filter(Boolean)
|
||||||
|
.slice(0, 6);
|
||||||
|
return {
|
||||||
|
id: SELF_MEMBER_ID,
|
||||||
|
name,
|
||||||
|
title: profile.title.trim() || "游民",
|
||||||
|
city: profile.city.trim() || "探索中",
|
||||||
|
tags: tags.length ? tags : ["新朋友"],
|
||||||
|
avatar: `https://api.dicebear.com/7.x/initials/svg?seed=${encodeURIComponent(name)}`,
|
||||||
|
bio: profile.bio.trim() || "刚写好介绍,想认识同频的人。",
|
||||||
|
vibe: "刚出现",
|
||||||
|
online: true,
|
||||||
|
lookingFor: "想认识同频游民",
|
||||||
|
gender: "f",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Seed roster + optional self card when user opted into discovery. */
|
||||||
|
export function useDiscoveryRoster(): SocialRosterMember[] {
|
||||||
|
const published = useSyncExternalStore(
|
||||||
|
subscribeSocialStorage,
|
||||||
|
() => loadJson<boolean>(ROSTER_PUBLISH_KEY, false),
|
||||||
|
() => false,
|
||||||
|
);
|
||||||
|
const profile = useSyncExternalStore(
|
||||||
|
subscribeSocialStorage,
|
||||||
|
() => loadJson<SocialRosterProfile>("roster", EMPTY),
|
||||||
|
() => EMPTY,
|
||||||
|
);
|
||||||
|
return useMemo(() => {
|
||||||
|
const self = published ? profileToMember(profile) : null;
|
||||||
|
if (!self) return MOCK_ROSTER;
|
||||||
|
return [self, ...MOCK_ROSTER.filter((m) => m.id !== SELF_MEMBER_ID)];
|
||||||
|
}, [published, profile]);
|
||||||
|
}
|
||||||
@ -14,6 +14,12 @@ const COPY_KEYS = [
|
|||||||
"socialOnlineTitle",
|
"socialOnlineTitle",
|
||||||
"socialOfflineTitle",
|
"socialOfflineTitle",
|
||||||
"socialTeamTitle",
|
"socialTeamTitle",
|
||||||
|
"socialWayChat",
|
||||||
|
"socialWayDate",
|
||||||
|
"socialWayCafe",
|
||||||
|
"socialWayTeam",
|
||||||
|
"socialPayJoinLabel",
|
||||||
|
"socialOaJoinLabel",
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export type SocialLandingCopy = Record<(typeof COPY_KEYS)[number], string>;
|
export type SocialLandingCopy = Record<(typeof COPY_KEYS)[number], string>;
|
||||||
|
|||||||
139
src/modules/social/lib/resolveCatalog.ts
Normal file
139
src/modules/social/lib/resolveCatalog.ts
Normal file
@ -0,0 +1,139 @@
|
|||||||
|
import {
|
||||||
|
SEED_CAFES,
|
||||||
|
SEED_GIGS,
|
||||||
|
SEED_MEETUPS,
|
||||||
|
} from "./seed";
|
||||||
|
import type {
|
||||||
|
SocialCafe,
|
||||||
|
SocialGig,
|
||||||
|
SocialMeetup,
|
||||||
|
SocialTeamKind,
|
||||||
|
} from "./types";
|
||||||
|
|
||||||
|
export type SocialCatalogBundle = {
|
||||||
|
cafes: SocialCafe[];
|
||||||
|
meetups: SocialMeetup[];
|
||||||
|
gigs: SocialGig[];
|
||||||
|
source: "remote" | "seed";
|
||||||
|
};
|
||||||
|
|
||||||
|
type RawCatalog = {
|
||||||
|
cafes?: unknown;
|
||||||
|
meetups?: unknown;
|
||||||
|
gigs?: unknown;
|
||||||
|
};
|
||||||
|
|
||||||
|
function asString(v: unknown, fallback = "") {
|
||||||
|
return typeof v === "string" ? v : fallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
function asNumber(v: unknown, fallback: number) {
|
||||||
|
const n = Number(v);
|
||||||
|
return Number.isFinite(n) ? n : fallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
function asBool(v: unknown, fallback: boolean) {
|
||||||
|
return typeof v === "boolean" ? v : fallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeCafe(raw: unknown, i: number, fallback?: SocialCafe): SocialCafe | null {
|
||||||
|
if (!raw || typeof raw !== "object") return null;
|
||||||
|
const r = raw as Record<string, unknown>;
|
||||||
|
const id = asString(r.id) || fallback?.id || `cafe-${i}`;
|
||||||
|
const name = asString(r.name) || fallback?.name;
|
||||||
|
if (!name) return null;
|
||||||
|
return {
|
||||||
|
id,
|
||||||
|
name,
|
||||||
|
city: asString(r.city, fallback?.city || "未标注"),
|
||||||
|
wifiMbps: asNumber(r.wifiMbps, fallback?.wifiMbps ?? 40),
|
||||||
|
power: asString(r.power, fallback?.power || "插座情况待确认"),
|
||||||
|
vibe: asString(r.vibe, fallback?.vibe || ""),
|
||||||
|
partners: asBool(r.partners, fallback?.partners ?? false),
|
||||||
|
rating: asNumber(r.rating, fallback?.rating ?? 4.5),
|
||||||
|
reviews: asNumber(r.reviews, fallback?.reviews ?? 0),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeMeetup(
|
||||||
|
raw: unknown,
|
||||||
|
i: number,
|
||||||
|
fallback?: SocialMeetup,
|
||||||
|
): SocialMeetup | null {
|
||||||
|
if (!raw || typeof raw !== "object") return null;
|
||||||
|
const r = raw as Record<string, unknown>;
|
||||||
|
const id = asString(r.id) || fallback?.id || `meetup-${i}`;
|
||||||
|
const title = asString(r.title) || fallback?.title;
|
||||||
|
if (!title) return null;
|
||||||
|
const mode = r.mode === "hybrid" ? "hybrid" : "online";
|
||||||
|
return {
|
||||||
|
id,
|
||||||
|
title,
|
||||||
|
city: asString(r.city, fallback?.city || "Online"),
|
||||||
|
date: asString(r.date, fallback?.date || ""),
|
||||||
|
time: asString(r.time, fallback?.time || ""),
|
||||||
|
mode,
|
||||||
|
mirotalkRoom: asString(
|
||||||
|
r.mirotalkRoom,
|
||||||
|
fallback?.mirotalkRoom || id,
|
||||||
|
),
|
||||||
|
timeZone: asString(r.timeZone, fallback?.timeZone || "Asia/Shanghai") || undefined,
|
||||||
|
channelId: asString(r.channelId, fallback?.channelId || "meetup-live"),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function normalizeGig(raw: unknown, i: number, fallback?: SocialGig): SocialGig | null {
|
||||||
|
if (!raw || typeof raw !== "object") return null;
|
||||||
|
const r = raw as Record<string, unknown>;
|
||||||
|
const id = asString(r.id) || fallback?.id || `gig-${i}`;
|
||||||
|
const title = asString(r.title) || fallback?.title;
|
||||||
|
if (!title) return null;
|
||||||
|
const kindRaw = asString(r.kind, fallback?.kind || "parttime");
|
||||||
|
const kind: SocialTeamKind =
|
||||||
|
kindRaw === "volunteer" || kindRaw === "fulltime" || kindRaw === "parttime"
|
||||||
|
? kindRaw
|
||||||
|
: "parttime";
|
||||||
|
const tags = Array.isArray(r.tags)
|
||||||
|
? r.tags.map((t) => String(t)).filter(Boolean)
|
||||||
|
: fallback?.tags || [];
|
||||||
|
return {
|
||||||
|
id,
|
||||||
|
title,
|
||||||
|
role: asString(r.role, fallback?.role || ""),
|
||||||
|
pay: asString(r.pay, fallback?.pay || "面议"),
|
||||||
|
remote: asBool(r.remote, fallback?.remote ?? true),
|
||||||
|
tags,
|
||||||
|
kind,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function pickList<T>(
|
||||||
|
remote: unknown,
|
||||||
|
seed: T[],
|
||||||
|
normalize: (raw: unknown, i: number, fallback?: T) => T | null,
|
||||||
|
): { items: T[]; usedRemote: boolean } {
|
||||||
|
if (!Array.isArray(remote) || remote.length === 0) {
|
||||||
|
return { items: seed, usedRemote: false };
|
||||||
|
}
|
||||||
|
const items = remote
|
||||||
|
.map((row, i) => normalize(row, i, seed[i]))
|
||||||
|
.filter((row): row is T => Boolean(row));
|
||||||
|
if (!items.length) return { items: seed, usedRemote: false };
|
||||||
|
return { items, usedRemote: true };
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Remote catalog overlays seed; empty/invalid remote → package seed offline. */
|
||||||
|
export function resolveSocialCatalog(
|
||||||
|
catalogs: RawCatalog | null | undefined,
|
||||||
|
): SocialCatalogBundle {
|
||||||
|
const cafes = pickList(catalogs?.cafes, SEED_CAFES, normalizeCafe);
|
||||||
|
const meetups = pickList(catalogs?.meetups, SEED_MEETUPS, normalizeMeetup);
|
||||||
|
const gigs = pickList(catalogs?.gigs, SEED_GIGS, normalizeGig);
|
||||||
|
const usedRemote = cafes.usedRemote || meetups.usedRemote || gigs.usedRemote;
|
||||||
|
return {
|
||||||
|
cafes: cafes.items,
|
||||||
|
meetups: meetups.items,
|
||||||
|
gigs: gigs.items,
|
||||||
|
source: usedRemote ? "remote" : "seed",
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -12,6 +12,11 @@ export type SocialRosterMember = {
|
|||||||
online: boolean;
|
online: boolean;
|
||||||
lookingFor: string;
|
lookingFor: string;
|
||||||
gender: "f" | "m";
|
gender: "f" | "m";
|
||||||
|
languages?: string[];
|
||||||
|
availability?: string;
|
||||||
|
timezone?: string;
|
||||||
|
/** Extra photos for profile wall (nomads-style) */
|
||||||
|
gallery?: string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MOCK_ROSTER: SocialRosterMember[] = [
|
export const MOCK_ROSTER: SocialRosterMember[] = [
|
||||||
@ -22,11 +27,18 @@ export const MOCK_ROSTER: SocialRosterMember[] = [
|
|||||||
city: "清迈 · Nimman",
|
city: "清迈 · Nimman",
|
||||||
tags: ["咖啡局", "设计", "日出"],
|
tags: ["咖啡局", "设计", "日出"],
|
||||||
avatar: "https://randomuser.me/api/portraits/women/65.jpg",
|
avatar: "https://randomuser.me/api/portraits/women/65.jpg",
|
||||||
bio: "喜欢把 cowork 聊成真实见面。周末常去 Graph Table。",
|
bio: "喜欢把 cowork 聊成真实见面。周末常去 Graph Table,也爱清晨骑车去山上看雾。",
|
||||||
vibe: "温柔 · 有品味",
|
vibe: "温柔 · 有品味",
|
||||||
online: true,
|
online: true,
|
||||||
lookingFor: "想认识会拍照的远程伙伴",
|
lookingFor: "想认识会拍照的远程伙伴",
|
||||||
gender: "f",
|
gender: "f",
|
||||||
|
languages: ["中文", "English"],
|
||||||
|
availability: "本周可 Coffeechat",
|
||||||
|
timezone: "ICT (UTC+7)",
|
||||||
|
gallery: [
|
||||||
|
"https://images.unsplash.com/photo-1523906834658-6e24ef2386f9?w=640&q=80",
|
||||||
|
"https://images.unsplash.com/photo-1554118811-1e0d58224f24?w=640&q=80",
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "m02",
|
id: "m02",
|
||||||
@ -35,11 +47,17 @@ export const MOCK_ROSTER: SocialRosterMember[] = [
|
|||||||
city: "里斯本",
|
city: "里斯本",
|
||||||
tags: ["Next.js", "夜跑", "冲浪"],
|
tags: ["Next.js", "夜跑", "冲浪"],
|
||||||
avatar: "https://randomuser.me/api/portraits/men/32.jpg",
|
avatar: "https://randomuser.me/api/portraits/men/32.jpg",
|
||||||
bio: "白天写代码,傍晚海边。欢迎 Coffeechat 聊产品。",
|
bio: "白天写代码,傍晚海边。欢迎 Coffeechat 聊产品与出海。",
|
||||||
vibe: "阳光 · 靠谱",
|
vibe: "阳光 · 靠谱",
|
||||||
online: true,
|
online: true,
|
||||||
lookingFor: "找联创 / 一起做副业",
|
lookingFor: "找联创 / 一起做副业",
|
||||||
gender: "m",
|
gender: "m",
|
||||||
|
languages: ["English", "Português", "中文"],
|
||||||
|
availability: "欧洲晚间可视频",
|
||||||
|
timezone: "WET (UTC+0)",
|
||||||
|
gallery: [
|
||||||
|
"https://images.unsplash.com/photo-1555881403-7463c9aea225?w=640&q=80",
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "m03",
|
id: "m03",
|
||||||
@ -48,11 +66,14 @@ export const MOCK_ROSTER: SocialRosterMember[] = [
|
|||||||
city: "巴厘岛 · Canggu",
|
city: "巴厘岛 · Canggu",
|
||||||
tags: ["Vlog", "瑜伽", "出海"],
|
tags: ["Vlog", "瑜伽", "出海"],
|
||||||
avatar: "https://randomuser.me/api/portraits/women/44.jpg",
|
avatar: "https://randomuser.me/api/portraits/women/44.jpg",
|
||||||
bio: "镜头前很活泼,线下更爱深度聊天。",
|
bio: "镜头前很活泼,线下更爱深度聊天。常在 Canggu cowork。",
|
||||||
vibe: "活力",
|
vibe: "活力",
|
||||||
online: false,
|
online: false,
|
||||||
lookingFor: "想认识同频创作者",
|
lookingFor: "想认识同频创作者",
|
||||||
gender: "f",
|
gender: "f",
|
||||||
|
languages: ["中文", "English"],
|
||||||
|
availability: "周末可线下局",
|
||||||
|
timezone: "WITA (UTC+8)",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "m04",
|
id: "m04",
|
||||||
@ -61,11 +82,14 @@ export const MOCK_ROSTER: SocialRosterMember[] = [
|
|||||||
city: "东京 / 远程",
|
city: "东京 / 远程",
|
||||||
tags: ["B2B", "胶片", "拉面"],
|
tags: ["B2B", "胶片", "拉面"],
|
||||||
avatar: "https://randomuser.me/api/portraits/men/75.jpg",
|
avatar: "https://randomuser.me/api/portraits/men/75.jpg",
|
||||||
bio: "时差玩家。Meetup 控场很稳,私下爱胶片机。",
|
bio: "时差玩家。开视频见面时很稳,私下爱胶片机。",
|
||||||
vibe: "干净 · 有梗",
|
vibe: "干净 · 有梗",
|
||||||
online: true,
|
online: true,
|
||||||
lookingFor: "想找一起探索城市的人",
|
lookingFor: "想找一起探索城市的人",
|
||||||
gender: "m",
|
gender: "m",
|
||||||
|
languages: ["日本語", "English", "中文"],
|
||||||
|
availability: "常来开视频见面",
|
||||||
|
timezone: "JST (UTC+9)",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "m05",
|
id: "m05",
|
||||||
@ -79,6 +103,9 @@ export const MOCK_ROSTER: SocialRosterMember[] = [
|
|||||||
online: true,
|
online: true,
|
||||||
lookingFor: "找一起搞出海的搭档",
|
lookingFor: "找一起搞出海的搭档",
|
||||||
gender: "f",
|
gender: "f",
|
||||||
|
languages: ["中文", "English", "ไทย"],
|
||||||
|
availability: "今晚可以开视频",
|
||||||
|
timezone: "ICT (UTC+7)",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "m06",
|
id: "m06",
|
||||||
@ -92,6 +119,9 @@ export const MOCK_ROSTER: SocialRosterMember[] = [
|
|||||||
online: false,
|
online: false,
|
||||||
lookingFor: "想找 cowork 搭子",
|
lookingFor: "想找 cowork 搭子",
|
||||||
gender: "m",
|
gender: "m",
|
||||||
|
languages: ["中文", "English"],
|
||||||
|
availability: "工作日 cowork",
|
||||||
|
timezone: "ICT (UTC+7)",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "m07",
|
id: "m07",
|
||||||
@ -105,6 +135,12 @@ export const MOCK_ROSTER: SocialRosterMember[] = [
|
|||||||
online: true,
|
online: true,
|
||||||
lookingFor: "想认识爱旅行的你",
|
lookingFor: "想认识爱旅行的你",
|
||||||
gender: "f",
|
gender: "f",
|
||||||
|
languages: ["English", "中文"],
|
||||||
|
availability: "可约旅拍",
|
||||||
|
timezone: "ICT (UTC+7)",
|
||||||
|
gallery: [
|
||||||
|
"https://images.unsplash.com/photo-1492691527719-9d1e07e534b4?w=640&q=80",
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "m08",
|
id: "m08",
|
||||||
@ -118,6 +154,9 @@ export const MOCK_ROSTER: SocialRosterMember[] = [
|
|||||||
online: true,
|
online: true,
|
||||||
lookingFor: "找一起搞钱也搞生活的人",
|
lookingFor: "找一起搞钱也搞生活的人",
|
||||||
gender: "m",
|
gender: "m",
|
||||||
|
languages: ["中文", "English", "Bahasa"],
|
||||||
|
availability: "本周可视频",
|
||||||
|
timezone: "MYT (UTC+8)",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "m09",
|
id: "m09",
|
||||||
@ -131,6 +170,9 @@ export const MOCK_ROSTER: SocialRosterMember[] = [
|
|||||||
online: false,
|
online: false,
|
||||||
lookingFor: "想认识认真做产品的人",
|
lookingFor: "想认识认真做产品的人",
|
||||||
gender: "f",
|
gender: "f",
|
||||||
|
languages: ["Deutsch", "English", "中文"],
|
||||||
|
availability: "周末可聊",
|
||||||
|
timezone: "CET (UTC+1)",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "m10",
|
id: "m10",
|
||||||
@ -139,11 +181,14 @@ export const MOCK_ROSTER: SocialRosterMember[] = [
|
|||||||
city: "首尔 / 远程",
|
city: "首尔 / 远程",
|
||||||
tags: ["Agent", "开源", "咖啡"],
|
tags: ["Agent", "开源", "咖啡"],
|
||||||
avatar: "https://randomuser.me/api/portraits/men/41.jpg",
|
avatar: "https://randomuser.me/api/portraits/men/41.jpg",
|
||||||
bio: "技术宅但不社恐。Meetup 常客。",
|
bio: "技术宅但不社恐。经常来开视频见面。",
|
||||||
vibe: "稳 · 有趣",
|
vibe: "稳 · 有趣",
|
||||||
online: true,
|
online: true,
|
||||||
lookingFor: "找一起做 AI 副业的人",
|
lookingFor: "找一起做 AI 副业的人",
|
||||||
gender: "m",
|
gender: "m",
|
||||||
|
languages: ["한국어", "English"],
|
||||||
|
availability: "常在视频见面里",
|
||||||
|
timezone: "KST (UTC+9)",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "m11",
|
id: "m11",
|
||||||
@ -157,6 +202,9 @@ export const MOCK_ROSTER: SocialRosterMember[] = [
|
|||||||
online: true,
|
online: true,
|
||||||
lookingFor: "欢迎路过的游民串门",
|
lookingFor: "欢迎路过的游民串门",
|
||||||
gender: "f",
|
gender: "f",
|
||||||
|
languages: ["中文"],
|
||||||
|
availability: "店里随时欢迎",
|
||||||
|
timezone: "CST (UTC+8)",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "m12",
|
id: "m12",
|
||||||
@ -170,9 +218,21 @@ export const MOCK_ROSTER: SocialRosterMember[] = [
|
|||||||
online: false,
|
online: false,
|
||||||
lookingFor: "想认识想出发的你",
|
lookingFor: "想认识想出发的你",
|
||||||
gender: "m",
|
gender: "m",
|
||||||
|
languages: ["English", "Français", "中文"],
|
||||||
|
availability: "可预约 1v1",
|
||||||
|
timezone: "WET (UTC+0)",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export function findRosterMember(
|
||||||
|
id: string,
|
||||||
|
extra: SocialRosterMember[] = [],
|
||||||
|
): SocialRosterMember | undefined {
|
||||||
|
return (
|
||||||
|
extra.find((m) => m.id === id) || MOCK_ROSTER.find((m) => m.id === id)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/** 仅演示用,禁止当作真实运营数据展示 */
|
/** 仅演示用,禁止当作真实运营数据展示 */
|
||||||
export const SOCIAL_PROOF = {
|
export const SOCIAL_PROOF = {
|
||||||
onlineNow: MOCK_ROSTER.filter((m) => m.online).length,
|
onlineNow: MOCK_ROSTER.filter((m) => m.online).length,
|
||||||
|
|||||||
@ -42,7 +42,7 @@ export const SEED_MESSAGES: SocialChatMessage[] = [
|
|||||||
id: "m4",
|
id: "m4",
|
||||||
channelId: "meetup-live",
|
channelId: "meetup-live",
|
||||||
author: "Host",
|
author: "Host",
|
||||||
text: "今晚 20:00 Meetup,视频走 MiroTalk,文字留在本频道。",
|
text: "今晚 20:00 开视频见面,文字也可以在这儿继续聊。",
|
||||||
at: "2026-10-30T08:00:00.000Z",
|
at: "2026-10-30T08:00:00.000Z",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@ -147,38 +147,38 @@ export const SEED_VIDEOS: SocialVideo[] = [
|
|||||||
export const SEED_EBOOKS: SocialEbook[] = [
|
export const SEED_EBOOKS: SocialEbook[] = [
|
||||||
{
|
{
|
||||||
id: "social-playbook",
|
id: "social-playbook",
|
||||||
title: "游民社区玩法手册",
|
title: "游民社区怎么玩",
|
||||||
chapters: 6,
|
chapters: 6,
|
||||||
minutes: 35,
|
minutes: 35,
|
||||||
blurb: "加群、聊天室、Meetup、Coffeechat 怎么玩。",
|
blurb: "怎么认识人、开视频、约咖啡、一起做事,一篇说清楚。",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "roster-guide",
|
id: "roster-guide",
|
||||||
title: "职业花名册指南",
|
title: "怎么写好自我介绍",
|
||||||
chapters: 4,
|
chapters: 4,
|
||||||
minutes: 20,
|
minutes: 20,
|
||||||
blurb: "如何写资料、挂 Linktree、被同城找到。",
|
blurb: "写几句让同城的人找到你,也不用写得很正式。",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const SEED_GIGS: SocialGig[] = [
|
export const SEED_GIGS: SocialGig[] = [
|
||||||
{
|
{
|
||||||
id: "vol-welcome",
|
id: "vol-welcome",
|
||||||
title: "新人接待志愿者",
|
title: "欢迎新人的帮手",
|
||||||
role: "志愿者",
|
role: "帮忙志愿",
|
||||||
pay: "公益积分 / 社群徽章",
|
pay: "公益积分 / 社群徽章",
|
||||||
remote: true,
|
remote: true,
|
||||||
kind: "volunteer",
|
kind: "volunteer",
|
||||||
tags: ["加群引导", "花名册答疑", "周报"],
|
tags: ["带新人", "答疑", "周报"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "vol-event",
|
id: "vol-event",
|
||||||
title: "线下局志愿者",
|
title: "线下见面局帮手",
|
||||||
role: "志愿者",
|
role: "帮忙志愿",
|
||||||
pay: "活动席位优先",
|
pay: "活动席位优先",
|
||||||
remote: false,
|
remote: false,
|
||||||
kind: "volunteer",
|
kind: "volunteer",
|
||||||
tags: ["Coffeechat", "合照", "场地协调"],
|
tags: ["约咖啡", "合照", "场地协调"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "ops-assistant",
|
id: "ops-assistant",
|
||||||
@ -187,21 +187,21 @@ export const SEED_GIGS: SocialGig[] = [
|
|||||||
pay: "按场次结算",
|
pay: "按场次结算",
|
||||||
remote: true,
|
remote: true,
|
||||||
kind: "parttime",
|
kind: "parttime",
|
||||||
tags: ["拍摄", "剪辑素材", "活动跟场"],
|
tags: ["拍摄", "剪辑", "活动跟场"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "community-mod",
|
id: "community-mod",
|
||||||
title: "社群值班主持人",
|
title: "社群值班主持人",
|
||||||
role: "远程兼职",
|
role: "线上兼职",
|
||||||
pay: "月度津贴",
|
pay: "月度津贴",
|
||||||
remote: true,
|
remote: true,
|
||||||
kind: "parttime",
|
kind: "parttime",
|
||||||
tags: ["聊天室", "Meetup 控场"],
|
tags: ["聊天室", "视频见面主持"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "content-pt",
|
id: "content-pt",
|
||||||
title: "内容兼职编辑",
|
title: "内容兼职编辑",
|
||||||
role: "远程兼职",
|
role: "线上兼职",
|
||||||
pay: "按篇结算",
|
pay: "按篇结算",
|
||||||
remote: true,
|
remote: true,
|
||||||
kind: "parttime",
|
kind: "parttime",
|
||||||
@ -210,16 +210,16 @@ export const SEED_GIGS: SocialGig[] = [
|
|||||||
{
|
{
|
||||||
id: "ft-community",
|
id: "ft-community",
|
||||||
title: "社群运营负责人",
|
title: "社群运营负责人",
|
||||||
role: "全职 · 远程优先",
|
role: "全职 · 线上优先",
|
||||||
pay: "面议 · 季度复盘",
|
pay: "面议 · 季度复盘",
|
||||||
remote: true,
|
remote: true,
|
||||||
kind: "fulltime",
|
kind: "fulltime",
|
||||||
tags: ["增长", "活动", "花名册"],
|
tags: ["增长", "活动", "认识人"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "ft-fullstack",
|
id: "ft-fullstack",
|
||||||
title: "全栈工程师",
|
title: "全栈工程师",
|
||||||
role: "全职 · 远程",
|
role: "全职 · 线上",
|
||||||
pay: "面议",
|
pay: "面议",
|
||||||
remote: true,
|
remote: true,
|
||||||
kind: "fulltime",
|
kind: "fulltime",
|
||||||
@ -228,9 +228,9 @@ export const SEED_GIGS: SocialGig[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const TEAM_KIND_LABEL: Record<SocialTeamKind, string> = {
|
export const TEAM_KIND_LABEL: Record<SocialTeamKind, string> = {
|
||||||
volunteer: "志愿者",
|
volunteer: "帮忙志愿",
|
||||||
parttime: "兼职",
|
parttime: "兼职机会",
|
||||||
fulltime: "全职",
|
fulltime: "全职机会",
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Same box as nomadro.cn (82.x). Prefer .cn — avoid .com→107 hop. */
|
/** Same box as nomadro.cn (82.x). Prefer .cn — avoid .com→107 hop. */
|
||||||
|
|||||||
32
src/modules/social/lib/useRevealMotion.ts
Normal file
32
src/modules/social/lib/useRevealMotion.ts
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { useEffect } from "react";
|
||||||
|
|
||||||
|
/** Observe `.reveal` inside a root selector and mark `.visible` once. */
|
||||||
|
export function useRevealMotion(rootSelector: string, deps: unknown[] = []) {
|
||||||
|
useEffect(() => {
|
||||||
|
const root = document.querySelector(rootSelector);
|
||||||
|
if (!root) return;
|
||||||
|
const observer = new IntersectionObserver(
|
||||||
|
(entries) =>
|
||||||
|
entries.forEach((entry) => {
|
||||||
|
if (!entry.isIntersecting) return;
|
||||||
|
entry.target.classList.add("visible");
|
||||||
|
observer.unobserve(entry.target);
|
||||||
|
}),
|
||||||
|
{ threshold: 0.08, rootMargin: "0px 0px -20px 0px" },
|
||||||
|
);
|
||||||
|
const scan = () => {
|
||||||
|
root
|
||||||
|
.querySelectorAll(".reveal:not(.visible)")
|
||||||
|
.forEach((el) => observer.observe(el));
|
||||||
|
};
|
||||||
|
scan();
|
||||||
|
const t = window.setTimeout(scan, 350);
|
||||||
|
return () => {
|
||||||
|
window.clearTimeout(t);
|
||||||
|
observer.disconnect();
|
||||||
|
};
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- caller owns deps
|
||||||
|
}, deps);
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user