Polish /social home UX with glass panels, compact roster, and motion FX.
Keep community-aligned layout without photo big-cards; add particles, emoji belts, and SVG sparks while hardening SiteShell mobile nav and join modal. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
6e15868e04
commit
d38bf6c475
@ -1,5 +1,6 @@
|
||||
import GigsClient from "@social/components/GigsClient";
|
||||
import TeamClient from "@social/components/TeamClient";
|
||||
|
||||
/** 兼容旧路径 /social/gigs → 远程团队 · 兼职 */
|
||||
export default function Page() {
|
||||
return <GigsClient />;
|
||||
return <TeamClient initialKind="parttime" />;
|
||||
}
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
import { ModuleBoundary } from "~/components/module-boundary";
|
||||
/* 视觉 SoT:对齐旅居社群;业务样式在 social globals */
|
||||
/* 主题1:旅居社群对齐;主题2:琥珀信号(theme2.css,可切换) */
|
||||
import "@community/app/globals.css";
|
||||
import "@social/app/globals.css";
|
||||
import "@social/app/fx.css";
|
||||
import "@social/app/theme2.css";
|
||||
|
||||
export const metadata = {
|
||||
title: "游民社区 · nomadro",
|
||||
@ -15,7 +17,15 @@ export default function SocialLayout({
|
||||
}) {
|
||||
return (
|
||||
<ModuleBoundary moduleKey="social">
|
||||
<div className="community-root social-skin">{children}</div>
|
||||
<div className="community-root social-skin">
|
||||
{/* 首屏防闪:默认主题1;切换器已隐藏,皮肤代码保留可再开 */}
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `(function(){try{localStorage.setItem('nomadro-social-skin','1');}catch(e){}document.documentElement.setAttribute('data-social-skin','1');})();`,
|
||||
}}
|
||||
/>
|
||||
{children}
|
||||
</div>
|
||||
</ModuleBoundary>
|
||||
);
|
||||
}
|
||||
|
||||
5
src/app/social/team/page.tsx
Normal file
5
src/app/social/team/page.tsx
Normal file
@ -0,0 +1,5 @@
|
||||
import TeamClient from "@social/components/TeamClient";
|
||||
|
||||
export default function Page() {
|
||||
return <TeamClient />;
|
||||
}
|
||||
@ -9,6 +9,19 @@
|
||||
- 前缀:`/api/social/v1`(不占用 `/api/v1`)
|
||||
- 挂载失败 / `SOCIAL_ENABLED=false` → 不影响 ebook / community / pay
|
||||
- 前端失败自动降级 localStorage
|
||||
- 实时:Centrifugo(`/realtime/token` + publish);不可用则聊天室轮询
|
||||
|
||||
## 视觉
|
||||
|
||||
- **T1**(默认):社区对齐;`lib/skin.ts` · `SOCIAL_SKIN_DEFAULT = "1"`
|
||||
- **T2**:`app/theme2.css`(琥珀信号);切换器默认隐藏
|
||||
- **首页动效**:`SocialOrbitScene`(three.js)· `FloatingEmojiField` · framer-motion · aurora / sheen CSS;`prefers-reduced-motion` 降级
|
||||
|
||||
## 首页(数字游民社交)
|
||||
|
||||
- 右侧:宣传片 `<video>`(`modules.social.promoVideoUrl` 可覆盖默认源)
|
||||
- CTA:仅「加群」→ 邮箱弹窗 → PC/H5 `zpay`、微信内 H5 `xpay`、小程序引导虚拟支付(`JoinPayModal` + `triggerPay`)
|
||||
- 下方:成员花名册 → Meetup → Coffeechat → **远程团队**(`/social/team`:志愿者 / 兼职 / 全职);原 PATH/HUB/NEXT 已去掉
|
||||
|
||||
## 本地
|
||||
|
||||
@ -18,4 +31,4 @@ pnpm dev
|
||||
curl http://127.0.0.1:8080/api/social/v1/health
|
||||
```
|
||||
|
||||
部署说明见 [`deploy/social/README.md`](../../../deploy/social/README.md)。
|
||||
部署说明见 [`deploy/social/README.md`](../../../deploy/social/README.md)。前端先本地验收,未经允许不上线。
|
||||
|
||||
581
src/modules/social/app/fx.css
Normal file
581
src/modules/social/app/fx.css
Normal file
@ -0,0 +1,581 @@
|
||||
/* —— 动效强化(玻璃面板风格;禁止大图卡) —— */
|
||||
|
||||
.social-fx {
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
overflow-x: clip;
|
||||
}
|
||||
|
||||
.social-fx #particle-canvas {
|
||||
z-index: 0;
|
||||
pointer-events: none;
|
||||
opacity: 0.95;
|
||||
}
|
||||
|
||||
.social-fx-orbs {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 0;
|
||||
pointer-events: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.social-fx-orb {
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
filter: blur(70px);
|
||||
opacity: 0.35;
|
||||
animation: social-orb-drift 12s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.social-fx-orb.o1 {
|
||||
width: 340px;
|
||||
height: 340px;
|
||||
left: -80px;
|
||||
top: 18%;
|
||||
background: #ff6b6b;
|
||||
}
|
||||
|
||||
.social-fx-orb.o2 {
|
||||
width: 280px;
|
||||
height: 280px;
|
||||
right: -60px;
|
||||
top: 48%;
|
||||
background: #4ecdc4;
|
||||
animation-delay: -4s;
|
||||
animation-duration: 14s;
|
||||
}
|
||||
|
||||
.social-fx-orb.o3 {
|
||||
width: 260px;
|
||||
height: 260px;
|
||||
left: 40%;
|
||||
bottom: 8%;
|
||||
background: #ffe66d;
|
||||
animation-delay: -7s;
|
||||
animation-duration: 16s;
|
||||
}
|
||||
|
||||
@keyframes social-orb-drift {
|
||||
0%,
|
||||
100% {
|
||||
transform: translate(0, 0) scale(1);
|
||||
}
|
||||
33% {
|
||||
transform: translate(40px, -50px) scale(1.12);
|
||||
}
|
||||
66% {
|
||||
transform: translate(-30px, 30px) scale(0.92);
|
||||
}
|
||||
}
|
||||
|
||||
/* Hero emoji rain */
|
||||
.social-hero-fx {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.social-emoji-field {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
pointer-events: none;
|
||||
overflow: hidden;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.social-emoji-float {
|
||||
position: absolute;
|
||||
line-height: 1;
|
||||
filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
|
||||
animation-name: social-emoji-fly;
|
||||
animation-timing-function: ease-in-out;
|
||||
animation-iteration-count: infinite;
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
|
||||
@keyframes social-emoji-fly {
|
||||
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% {
|
||||
transform: translate3d(0, 12px, 0) rotate(-12deg) scale(0.92);
|
||||
opacity: 0.25;
|
||||
}
|
||||
}
|
||||
|
||||
/* Emoji marquee belt */
|
||||
.social-fx-belt {
|
||||
overflow: hidden;
|
||||
padding: 10px 0 18px;
|
||||
mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
|
||||
}
|
||||
|
||||
.social-fx-belt-track {
|
||||
display: flex;
|
||||
width: max-content;
|
||||
gap: 0;
|
||||
animation: social-belt-run 22s linear infinite;
|
||||
}
|
||||
|
||||
.social-fx-belt-track span {
|
||||
padding-right: 48px;
|
||||
font-size: 1.35rem;
|
||||
letter-spacing: 0.35em;
|
||||
white-space: nowrap;
|
||||
opacity: 0.55;
|
||||
}
|
||||
|
||||
@keyframes social-belt-run {
|
||||
from {
|
||||
transform: translateX(0);
|
||||
}
|
||||
to {
|
||||
transform: translateX(-33.333%);
|
||||
}
|
||||
}
|
||||
|
||||
/* Section spark */
|
||||
.social-section-spark {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 8px;
|
||||
min-height: 28px;
|
||||
}
|
||||
|
||||
.social-section-spark-svg {
|
||||
width: min(240px, 72%);
|
||||
height: 28px;
|
||||
}
|
||||
|
||||
.social-spark-path {
|
||||
stroke-dasharray: 280;
|
||||
stroke-dashoffset: 280;
|
||||
}
|
||||
|
||||
.reveal.visible .social-spark-path {
|
||||
animation: social-spark-draw 1.1s ease forwards;
|
||||
}
|
||||
|
||||
@keyframes social-spark-draw {
|
||||
to {
|
||||
stroke-dashoffset: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.social-spark-dot {
|
||||
animation: social-spark-blink 1.4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes social-spark-blink {
|
||||
0%,
|
||||
100% {
|
||||
opacity: 0.35;
|
||||
r: 3;
|
||||
}
|
||||
50% {
|
||||
opacity: 1;
|
||||
r: 6;
|
||||
}
|
||||
}
|
||||
|
||||
.social-title-emoji {
|
||||
display: inline-block;
|
||||
margin-right: 0.35em;
|
||||
animation: social-emoji-wiggle 1.8s ease-in-out infinite;
|
||||
transform-origin: 50% 80%;
|
||||
}
|
||||
|
||||
@keyframes social-emoji-wiggle {
|
||||
0%,
|
||||
100% {
|
||||
transform: rotate(0deg) scale(1);
|
||||
}
|
||||
20% {
|
||||
transform: rotate(-14deg) scale(1.18);
|
||||
}
|
||||
40% {
|
||||
transform: rotate(12deg) scale(1.1);
|
||||
}
|
||||
60% {
|
||||
transform: rotate(-8deg) scale(1.14);
|
||||
}
|
||||
}
|
||||
|
||||
/* Path pills bounce in */
|
||||
.social-path-track.reveal.visible .social-path-link {
|
||||
animation: social-path-pop 0.55s cubic-bezier(0.2, 0.9, 0.2, 1.2) both;
|
||||
}
|
||||
|
||||
.social-path-track.reveal.visible .social-path-link:nth-child(1) {
|
||||
animation-delay: 0.05s;
|
||||
}
|
||||
.social-path-track.reveal.visible .social-path-link:nth-child(2) {
|
||||
animation-delay: 0.12s;
|
||||
}
|
||||
.social-path-track.reveal.visible .social-path-link:nth-child(3) {
|
||||
animation-delay: 0.19s;
|
||||
}
|
||||
.social-path-track.reveal.visible .social-path-link:nth-child(4) {
|
||||
animation-delay: 0.26s;
|
||||
}
|
||||
|
||||
@keyframes social-path-pop {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(16px) scale(0.86);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
.social-path-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.social-path-emoji {
|
||||
display: inline-block;
|
||||
font-size: 1.05rem;
|
||||
transition: transform 0.25s;
|
||||
}
|
||||
|
||||
.social-path-link:hover .social-path-emoji {
|
||||
animation: social-emoji-wiggle 0.55s ease;
|
||||
}
|
||||
|
||||
/* CTA pulse */
|
||||
.social-btn-pulse {
|
||||
position: relative;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.social-btn-pulse::before,
|
||||
.social-btn-pulse::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: -4px;
|
||||
border-radius: inherit;
|
||||
border: 2px solid rgba(78, 205, 196, 0.55);
|
||||
pointer-events: none;
|
||||
animation: social-btn-ring 1.6s ease-out infinite;
|
||||
}
|
||||
|
||||
.social-btn-pulse::before {
|
||||
animation-delay: 0.8s;
|
||||
}
|
||||
|
||||
@keyframes social-btn-ring {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
opacity: 0.75;
|
||||
}
|
||||
100% {
|
||||
transform: scale(1.28);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.social-promo-glow {
|
||||
animation: social-promo-breathe 3.2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes social-promo-breathe {
|
||||
0%,
|
||||
100% {
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(78, 205, 196, 0);
|
||||
transform: translateY(0);
|
||||
}
|
||||
50% {
|
||||
box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38), 0 0 48px 4px rgba(78, 205, 196, 0.28);
|
||||
transform: translateY(-4px);
|
||||
}
|
||||
}
|
||||
|
||||
.social-promo-live {
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
margin-right: 6px;
|
||||
border-radius: 999px;
|
||||
background: #22c55e;
|
||||
vertical-align: middle;
|
||||
animation: social-live-ping 1.2s ease-out infinite;
|
||||
}
|
||||
|
||||
@keyframes social-live-ping {
|
||||
0% {
|
||||
box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.65);
|
||||
}
|
||||
70% {
|
||||
box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
|
||||
}
|
||||
100% {
|
||||
box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Panels: animate when revealed */
|
||||
.social-panel-fx {
|
||||
--stagger: 0ms;
|
||||
}
|
||||
|
||||
.reveal.visible .social-panel-fx,
|
||||
.social-panel-fx.reveal.visible {
|
||||
animation: social-panel-in 0.65s cubic-bezier(0.2, 0.8, 0.2, 1) both;
|
||||
animation-delay: var(--stagger, 0ms);
|
||||
}
|
||||
|
||||
@keyframes social-panel-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(28px) scale(0.96) rotateX(6deg);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
.social-panel-fx:hover {
|
||||
transform: translateY(-6px) scale(1.01);
|
||||
box-shadow: var(--shadow-glow), 0 0 0 1px rgba(78, 205, 196, 0.28);
|
||||
transition: transform 0.25s, box-shadow 0.25s;
|
||||
}
|
||||
|
||||
.social-panel-ico {
|
||||
width: 52px;
|
||||
height: 52px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
border-radius: 16px;
|
||||
border: var(--border-glass);
|
||||
background: color-mix(in srgb, var(--accent-3, #4ecdc4) 14%, transparent);
|
||||
font-size: 1.45rem;
|
||||
color: var(--accent-3, #4ecdc4);
|
||||
animation: social-ico-bounce 2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.social-panel-ico-bounce {
|
||||
animation-duration: 1.6s;
|
||||
}
|
||||
|
||||
@keyframes social-ico-bounce {
|
||||
0%,
|
||||
100% {
|
||||
transform: translateY(0) rotate(0deg);
|
||||
}
|
||||
50% {
|
||||
transform: translateY(-8px) rotate(-6deg);
|
||||
}
|
||||
}
|
||||
|
||||
.social-ring-spin {
|
||||
transform-origin: 24px 24px;
|
||||
animation: social-ring-spin 3.5s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes social-ring-spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
/* People chips */
|
||||
.social-chip-pop {
|
||||
animation: social-chip-in 0.5s cubic-bezier(0.2, 0.9, 0.2, 1.15) both;
|
||||
animation-delay: var(--stagger, 0ms);
|
||||
}
|
||||
|
||||
@keyframes social-chip-in {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: scale(0.5) translateY(12px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
.social-people-chip:hover {
|
||||
transform: translateY(-6px) scale(1.05) !important;
|
||||
}
|
||||
|
||||
.social-people-chip.is-online .social-people-chip-ava::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: -4px;
|
||||
border-radius: 999px;
|
||||
border: 2px solid rgba(78, 205, 196, 0.65);
|
||||
animation: social-btn-ring 1.4s ease-out infinite;
|
||||
}
|
||||
|
||||
.social-people-bar-avs img {
|
||||
animation: social-ava-bob 2.4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
.social-people-bar-avs img:nth-child(2) {
|
||||
animation-delay: 0.15s;
|
||||
}
|
||||
.social-people-bar-avs img:nth-child(3) {
|
||||
animation-delay: 0.3s;
|
||||
}
|
||||
.social-people-bar-avs img:nth-child(4) {
|
||||
animation-delay: 0.45s;
|
||||
}
|
||||
.social-people-bar-avs img:nth-child(5) {
|
||||
animation-delay: 0.6s;
|
||||
}
|
||||
.social-people-bar-avs img:nth-child(6) {
|
||||
animation-delay: 0.75s;
|
||||
}
|
||||
|
||||
@keyframes social-ava-bob {
|
||||
0%,
|
||||
100% {
|
||||
transform: translateY(0);
|
||||
}
|
||||
50% {
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
}
|
||||
|
||||
.social-chip-heart {
|
||||
position: absolute;
|
||||
top: -4px;
|
||||
right: -6px;
|
||||
font-style: normal;
|
||||
font-size: 0.8rem;
|
||||
color: #ff6b6b;
|
||||
animation: social-heart-pop 0.45s ease;
|
||||
}
|
||||
|
||||
@keyframes social-heart-pop {
|
||||
from {
|
||||
transform: scale(0);
|
||||
}
|
||||
70% {
|
||||
transform: scale(1.35);
|
||||
}
|
||||
to {
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
.social-count-pulse {
|
||||
display: inline-block;
|
||||
color: var(--accent-3, #4ecdc4);
|
||||
animation: social-count-glow 1.4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes social-count-glow {
|
||||
0%,
|
||||
100% {
|
||||
text-shadow: 0 0 0 transparent;
|
||||
transform: scale(1);
|
||||
}
|
||||
50% {
|
||||
text-shadow: 0 0 16px rgba(78, 205, 196, 0.9);
|
||||
transform: scale(1.08);
|
||||
}
|
||||
}
|
||||
|
||||
.social-detail-in {
|
||||
animation: social-detail-slide 0.4s cubic-bezier(0.2, 0.9, 0.2, 1);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@keyframes social-detail-slide {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(16px) scale(0.98);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
.social-burst {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
font-size: 1.6rem;
|
||||
letter-spacing: 0.4em;
|
||||
pointer-events: none;
|
||||
animation: social-burst-up 0.75s ease forwards;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
@keyframes social-burst-up {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(10px) scale(0.7);
|
||||
}
|
||||
35% {
|
||||
opacity: 1;
|
||||
}
|
||||
to {
|
||||
opacity: 0;
|
||||
transform: translateY(-36px) scale(1.35);
|
||||
}
|
||||
}
|
||||
|
||||
.social-logo-spin {
|
||||
display: inline-block;
|
||||
animation: social-logo-spin 6s linear infinite;
|
||||
}
|
||||
|
||||
@keyframes social-logo-spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
.social-panel .btn-sm {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.social-hero-fx .shape {
|
||||
animation-duration: 5.5s !important;
|
||||
opacity: 0.55 !important;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.social-emoji-float,
|
||||
.social-fx-orb,
|
||||
.social-fx-belt-track,
|
||||
.social-btn-pulse::before,
|
||||
.social-btn-pulse::after,
|
||||
.social-promo-glow,
|
||||
.social-promo-live,
|
||||
.social-panel-fx,
|
||||
.social-chip-pop,
|
||||
.social-title-emoji,
|
||||
.social-panel-ico,
|
||||
.social-ring-spin,
|
||||
.social-logo-spin,
|
||||
.social-people-chip.is-online .social-people-chip-ava::before,
|
||||
.social-people-bar-avs img,
|
||||
.social-count-pulse,
|
||||
.social-spark-path,
|
||||
.social-spark-dot,
|
||||
.social-hero-fx .shape {
|
||||
animation: none !important;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
494
src/modules/social/app/theme2.css
Normal file
494
src/modules/social/app/theme2.css
Normal file
@ -0,0 +1,494 @@
|
||||
/**
|
||||
* 游民社区 · 主题 2「琥珀信号」
|
||||
* 与主题 1(旅居社群对齐)完全独立;html[data-social-skin="2"] 启用。
|
||||
*/
|
||||
|
||||
html[data-social-skin="2"] .social-skin {
|
||||
--t2-ink: #07070a;
|
||||
--t2-panel: #101016;
|
||||
--t2-line: rgba(245, 158, 11, 0.22);
|
||||
--t2-amber: #f59e0b;
|
||||
--t2-amber-dim: rgba(245, 158, 11, 0.14);
|
||||
--t2-cyan: #22d3ee;
|
||||
--t2-text: #f4f1ea;
|
||||
--t2-muted: #9a958c;
|
||||
--t2-danger: #fb7185;
|
||||
--t2-radius: 4px;
|
||||
--t2-font-display: "Segoe UI Variable Display", "Bahnschrift", "DIN Alternate",
|
||||
var(--font-outfit), system-ui, sans-serif;
|
||||
--t2-font-body: var(--font-noto-sc), "Segoe UI", system-ui, sans-serif;
|
||||
--sc-bg: var(--t2-ink);
|
||||
--sc-bg-card: color-mix(in srgb, var(--t2-panel) 92%, transparent);
|
||||
--sc-bg-glass: var(--t2-amber-dim);
|
||||
--sc-text: var(--t2-text);
|
||||
--sc-muted: var(--t2-muted);
|
||||
--sc-accent-1: var(--t2-amber);
|
||||
--sc-accent-2: #fbbf24;
|
||||
--sc-accent-3: var(--t2-cyan);
|
||||
--sc-gradient: linear-gradient(120deg, #f59e0b 0%, #fbbf24 45%, #22d3ee 100%);
|
||||
--sc-border: 1px solid var(--t2-line);
|
||||
--sc-radius: var(--t2-radius);
|
||||
--sc-shadow: 0 0 0 1px rgba(245, 158, 11, 0.08), 0 24px 60px rgba(0, 0, 0, 0.45);
|
||||
--sc-font-display: var(--t2-font-display);
|
||||
--sc-font-body: var(--t2-font-body);
|
||||
}
|
||||
|
||||
html.light[data-social-skin="2"] .social-skin,
|
||||
html[data-theme="light"][data-social-skin="2"] .social-skin {
|
||||
--t2-ink: #f6f3eb;
|
||||
--t2-panel: #ffffff;
|
||||
--t2-line: rgba(120, 80, 10, 0.18);
|
||||
--t2-amber: #b45309;
|
||||
--t2-amber-dim: rgba(180, 83, 9, 0.08);
|
||||
--t2-cyan: #0e7490;
|
||||
--t2-text: #1c1917;
|
||||
--t2-muted: #78716c;
|
||||
--sc-shadow: 0 0 0 1px rgba(180, 83, 9, 0.08), 0 18px 40px rgba(28, 25, 23, 0.08);
|
||||
}
|
||||
|
||||
/* —— 壳 / 背景 —— */
|
||||
html[data-social-skin="2"] .social-flow,
|
||||
html[data-social-skin="2"] .social-root,
|
||||
html[data-social-skin="2"] .home-flow.social-flow {
|
||||
background:
|
||||
linear-gradient(180deg, rgba(245, 158, 11, 0.07), transparent 28%),
|
||||
repeating-linear-gradient(
|
||||
0deg,
|
||||
transparent,
|
||||
transparent 47px,
|
||||
rgba(245, 158, 11, 0.035) 48px
|
||||
),
|
||||
radial-gradient(ellipse 80% 50% at 100% 0%, rgba(34, 211, 238, 0.08), transparent 55%),
|
||||
var(--t2-ink, #07070a);
|
||||
color: var(--t2-text, #f4f1ea);
|
||||
font-family: var(--t2-font-body);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-flow::before {
|
||||
content: "";
|
||||
pointer-events: none;
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 0;
|
||||
background: radial-gradient(circle at 12% 88%, rgba(245, 158, 11, 0.08), transparent 32%);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .navbar {
|
||||
border-bottom: 1px solid var(--t2-line);
|
||||
background: color-mix(in srgb, var(--t2-ink) 78%, transparent);
|
||||
backdrop-filter: blur(18px) saturate(1.2);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .navbar.scrolled {
|
||||
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .logo-icon {
|
||||
border-radius: var(--t2-radius);
|
||||
background: var(--t2-amber);
|
||||
color: #111;
|
||||
box-shadow: 0 0 24px rgba(245, 158, 11, 0.45);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .logo-text {
|
||||
font-family: var(--t2-font-display);
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.92rem;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .btn-primary,
|
||||
html[data-social-skin="2"] .social-btn.primary,
|
||||
html[data-social-skin="2"] .social-compose button {
|
||||
border-radius: var(--t2-radius);
|
||||
background: var(--t2-amber) !important;
|
||||
color: #111 !important;
|
||||
border: none !important;
|
||||
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 28px rgba(245, 158, 11, 0.35);
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .btn-primary:hover,
|
||||
html[data-social-skin="2"] .social-btn.primary:hover {
|
||||
filter: brightness(1.06);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .btn-ghost,
|
||||
html[data-social-skin="2"] .social-btn,
|
||||
html[data-social-skin="2"] .social-nav-back {
|
||||
border-radius: var(--t2-radius);
|
||||
border: 1px solid var(--t2-line);
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .nav-group-btn,
|
||||
html[data-social-skin="2"] .nav-dropdown-link,
|
||||
html[data-social-skin="2"] .nav-icon-btn {
|
||||
border-radius: var(--t2-radius);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .nav-dropdown {
|
||||
border-radius: var(--t2-radius);
|
||||
border: 1px solid var(--t2-line);
|
||||
background: var(--t2-panel);
|
||||
box-shadow: var(--sc-shadow);
|
||||
}
|
||||
|
||||
/* 皮肤切换器 */
|
||||
html[data-social-skin="2"] .social-skin-switch,
|
||||
.social-skin-switch {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 2px;
|
||||
padding: 3px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||
background: rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
.social-skin-switch button {
|
||||
min-height: 36px;
|
||||
min-width: 44px;
|
||||
padding: 0 10px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
background: transparent;
|
||||
color: var(--sc-muted, #94a3b8);
|
||||
font: inherit;
|
||||
font-size: 0.78rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.04em;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.social-skin-switch button[aria-pressed="true"] {
|
||||
background: var(--t2-amber, #f59e0b);
|
||||
color: #111;
|
||||
}
|
||||
|
||||
html[data-social-skin="1"] .social-skin-switch button[aria-pressed="true"] {
|
||||
background: #4ecdc4;
|
||||
color: #0a0e17;
|
||||
}
|
||||
|
||||
/* —— Hero:品牌优先、少卡片 —— */
|
||||
html[data-social-skin="2"] .hero {
|
||||
min-height: 100dvh;
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
border-bottom: 1px solid var(--t2-line);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .hero-bg-shapes .shape {
|
||||
opacity: 0.28;
|
||||
filter: saturate(0.55) hue-rotate(18deg);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] #particles-canvas,
|
||||
html[data-social-skin="2"] .particle-canvas {
|
||||
opacity: 0.45;
|
||||
mix-blend-mode: screen;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .hero-badge {
|
||||
border-radius: var(--t2-radius);
|
||||
border: 1px solid var(--t2-line);
|
||||
background: var(--t2-amber-dim);
|
||||
color: var(--t2-amber);
|
||||
letter-spacing: 0.14em;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.72rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .hero-badge .badge-dot {
|
||||
background: var(--t2-amber);
|
||||
box-shadow: 0 0 12px var(--t2-amber);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .hero-title {
|
||||
font-family: var(--t2-font-display);
|
||||
font-weight: 800;
|
||||
letter-spacing: -0.04em;
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .gradient-text {
|
||||
background: linear-gradient(100deg, #f59e0b, #fde68a 55%, #22d3ee) !important;
|
||||
-webkit-background-clip: text !important;
|
||||
background-clip: text !important;
|
||||
color: transparent !important;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .hero-subtitle {
|
||||
color: var(--t2-muted);
|
||||
font-size: 1.05rem;
|
||||
max-width: 28rem;
|
||||
border-left: 2px solid var(--t2-amber);
|
||||
padding-left: 14px;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .float-card {
|
||||
border-radius: var(--t2-radius);
|
||||
border: 1px solid var(--t2-line);
|
||||
background: color-mix(in srgb, var(--t2-panel) 88%, transparent);
|
||||
backdrop-filter: blur(10px);
|
||||
font-family: var(--t2-font-display);
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .float-card small {
|
||||
color: var(--t2-muted);
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .globe-svg circle[fill="url(#socialGlobeGlow)"] {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
/* PATH:竖轨信号条 */
|
||||
html[data-social-skin="2"] .journey-strip {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .section-tag {
|
||||
color: var(--t2-amber);
|
||||
letter-spacing: 0.2em;
|
||||
border: 1px solid var(--t2-line);
|
||||
border-radius: var(--t2-radius);
|
||||
padding: 4px 8px;
|
||||
background: var(--t2-amber-dim);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .section-header h2,
|
||||
html[data-social-skin="2"] .social-hub-block-head h3,
|
||||
html[data-social-skin="2"] .social-hero h1,
|
||||
html[data-social-skin="2"] .social-section-head h2 {
|
||||
font-family: var(--t2-font-display);
|
||||
letter-spacing: -0.03em;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .journey-card,
|
||||
html[data-social-skin="2"] .social-hub-card,
|
||||
html[data-social-skin="2"] .social-next-card,
|
||||
html[data-social-skin="2"] .social-card,
|
||||
html[data-social-skin="2"] .social-list-item,
|
||||
html[data-social-skin="2"] .social-panel {
|
||||
border-radius: var(--t2-radius);
|
||||
border: 1px solid var(--t2-line);
|
||||
background:
|
||||
linear-gradient(135deg, var(--t2-amber-dim), transparent 42%),
|
||||
var(--t2-panel);
|
||||
box-shadow: none;
|
||||
backdrop-filter: none;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-hub-card:hover,
|
||||
html[data-social-skin="2"] .social-next-card:hover,
|
||||
html[data-social-skin="2"] .social-card:hover,
|
||||
html[data-social-skin="2"] .journey-card:hover {
|
||||
transform: translateY(-2px);
|
||||
border-color: rgba(245, 158, 11, 0.55);
|
||||
box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.2), 0 16px 40px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-hub-emoji,
|
||||
html[data-social-skin="2"] .social-card-ico {
|
||||
border-radius: var(--t2-radius);
|
||||
background: #000;
|
||||
border: 1px solid var(--t2-line);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-pill,
|
||||
html[data-social-skin="2"] .social-badge {
|
||||
border-radius: var(--t2-radius);
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.68rem;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-pill.live,
|
||||
html[data-social-skin="2"] .social-badge.live {
|
||||
color: var(--t2-amber);
|
||||
border-color: rgba(245, 158, 11, 0.45);
|
||||
background: var(--t2-amber-dim);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-hub-go,
|
||||
html[data-social-skin="2"] .social-next-card em,
|
||||
html[data-social-skin="2"] .social-list-item em {
|
||||
color: var(--t2-amber);
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .journey-n {
|
||||
color: var(--t2-amber);
|
||||
font-family: var(--t2-font-display);
|
||||
}
|
||||
|
||||
/* HUB:改成通栏带状,减弱「卡片堆」感 */
|
||||
html[data-social-skin="2"] .social-hub-grid {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-hub-card {
|
||||
min-height: 0;
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr auto;
|
||||
grid-template-rows: auto auto;
|
||||
gap: 6px 16px;
|
||||
align-items: center;
|
||||
padding: 16px 18px;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-hub-card-top {
|
||||
grid-column: 1;
|
||||
grid-row: 1 / span 2;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-hub-card h4 {
|
||||
grid-column: 2;
|
||||
grid-row: 1;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-hub-card p {
|
||||
grid-column: 2;
|
||||
grid-row: 2;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-hub-card .social-pill {
|
||||
display: none;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-hub-go {
|
||||
grid-column: 3;
|
||||
grid-row: 1 / span 2;
|
||||
align-self: center;
|
||||
font-family: var(--t2-font-display);
|
||||
letter-spacing: 0.06em;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-next-grid {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
@media (min-width: 900px) {
|
||||
html[data-social-skin="2"] .social-next-grid {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
/* Chat */
|
||||
html[data-social-skin="2"] .social-chat-thread {
|
||||
border-radius: var(--t2-radius);
|
||||
border: 1px solid var(--t2-line);
|
||||
background:
|
||||
linear-gradient(180deg, rgba(245, 158, 11, 0.05), transparent 20%),
|
||||
#0a0a0e;
|
||||
max-height: min(62vh, 560px);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-bubble {
|
||||
border-radius: var(--t2-radius);
|
||||
border: 1px solid var(--t2-line);
|
||||
background: var(--t2-panel);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-bubble.mine {
|
||||
background: linear-gradient(160deg, rgba(245, 158, 11, 0.22), rgba(34, 211, 238, 0.08));
|
||||
border-color: rgba(245, 158, 11, 0.4);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-compose input,
|
||||
html[data-social-skin="2"] .social-form input,
|
||||
html[data-social-skin="2"] .social-form textarea,
|
||||
html[data-social-skin="2"] .social-chat-nick input {
|
||||
border-radius: var(--t2-radius);
|
||||
border: 1px solid var(--t2-line);
|
||||
background: #0a0a0e;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-compose {
|
||||
position: sticky;
|
||||
bottom: 12px;
|
||||
padding: 10px;
|
||||
border-radius: var(--t2-radius);
|
||||
border: 1px solid var(--t2-line);
|
||||
background: color-mix(in srgb, var(--t2-panel) 90%, transparent);
|
||||
backdrop-filter: blur(12px);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-compose button {
|
||||
border-radius: var(--t2-radius) !important;
|
||||
min-width: 96px;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-hero-tag {
|
||||
border-radius: var(--t2-radius);
|
||||
color: var(--t2-amber);
|
||||
border-color: var(--t2-line);
|
||||
background: var(--t2-amber-dim);
|
||||
letter-spacing: 0.12em;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.72rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-hero h1 span {
|
||||
background: linear-gradient(100deg, #f59e0b, #22d3ee);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .footer {
|
||||
border-top: 1px solid var(--t2-line);
|
||||
background: #050508;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .footer-cols h4 {
|
||||
color: var(--t2-amber);
|
||||
letter-spacing: 0.12em;
|
||||
text-transform: uppercase;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-live-tab.active {
|
||||
background: var(--t2-amber) !important;
|
||||
color: #111 !important;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-live-iframe-mark {
|
||||
background: var(--t2-amber) !important;
|
||||
color: #111 !important;
|
||||
border-radius: var(--t2-radius);
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-live-iframe-overlay h2 {
|
||||
background: linear-gradient(100deg, #f59e0b, #22d3ee);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
html[data-social-skin="2"] .social-hub-card {
|
||||
grid-template-columns: auto 1fr;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-hub-go {
|
||||
grid-column: 2;
|
||||
grid-row: 3;
|
||||
justify-self: start;
|
||||
}
|
||||
|
||||
html[data-social-skin="2"] .social-skin-switch button {
|
||||
min-width: 40px;
|
||||
font-size: 0.72rem;
|
||||
}
|
||||
}
|
||||
167
src/modules/social/components/AttractiveRoster.tsx
Normal file
167
src/modules/social/components/AttractiveRoster.tsx
Normal file
@ -0,0 +1,167 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { MOCK_ROSTER, type SocialRosterMember } from "@social/lib/rosterMock";
|
||||
import { loadJson, saveJson } from "@social/lib/storage";
|
||||
|
||||
const LIKE_KEY = "social-roster-likes";
|
||||
|
||||
const FILTERS = [
|
||||
{ id: "all" as const, label: "全部", emoji: "✨" },
|
||||
{ id: "online" as const, label: "在线", emoji: "🟢" },
|
||||
{ id: "f" as const, label: "女生", emoji: "👩" },
|
||||
{ id: "m" as const, label: "男生", emoji: "👨" },
|
||||
];
|
||||
|
||||
export default function AttractiveRoster({ onJoin }: { onJoin: () => void }) {
|
||||
const [likes, setLikes] = useState<Record<string, boolean>>({});
|
||||
const [filter, setFilter] = useState<"all" | "online" | "f" | "m">("all");
|
||||
const [activeId, setActiveId] = useState<string | null>(null);
|
||||
const [burst, setBurst] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setLikes(loadJson<Record<string, boolean>>(LIKE_KEY, {}));
|
||||
}, []);
|
||||
|
||||
const list = useMemo(() => {
|
||||
return MOCK_ROSTER.filter((m) => {
|
||||
if (filter === "online") return m.online;
|
||||
if (filter === "f" || filter === "m") return m.gender === filter;
|
||||
return true;
|
||||
});
|
||||
}, [filter]);
|
||||
|
||||
const online = useMemo(() => MOCK_ROSTER.filter((m) => m.online), []);
|
||||
const active = list.find((m) => m.id === activeId) || null;
|
||||
|
||||
const toggleLike = (m: SocialRosterMember) => {
|
||||
setLikes((prev) => {
|
||||
const next = { ...prev, [m.id]: !prev[m.id] };
|
||||
saveJson(LIKE_KEY, next);
|
||||
return next;
|
||||
});
|
||||
setBurst(true);
|
||||
window.setTimeout(() => setBurst(false), 700);
|
||||
};
|
||||
|
||||
return (
|
||||
<section className="section section-compact" id="people" aria-label="在线游民">
|
||||
<div className="container">
|
||||
<div className="section-header reveal">
|
||||
<span className="section-tag">PEOPLE</span>
|
||||
<h2>
|
||||
<span className="social-title-emoji" aria-hidden>
|
||||
👋
|
||||
</span>
|
||||
这些人,也许你会想见
|
||||
</h2>
|
||||
<p>点选查看简介 · 关注本地记录 · 加群再认识真人。</p>
|
||||
</div>
|
||||
|
||||
<div className="social-people-bar reveal">
|
||||
<div className="social-people-bar-avs" aria-hidden>
|
||||
{online.slice(0, 6).map((m) => (
|
||||
<img key={m.id} src={m.avatar} alt="" />
|
||||
))}
|
||||
</div>
|
||||
<p>
|
||||
<strong className="social-count-pulse">{online.length}</strong> 位演示在线
|
||||
<span> · 非实时统计</span>
|
||||
</p>
|
||||
<button type="button" className="btn btn-primary btn-sm social-btn-pulse" onClick={onJoin}>
|
||||
加群认识
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="social-people-filters reveal" role="tablist" aria-label="筛选">
|
||||
{FILTERS.map((f) => (
|
||||
<button
|
||||
key={f.id}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={filter === f.id}
|
||||
className={`social-people-filter${filter === f.id ? " active" : ""}`}
|
||||
onClick={() => {
|
||||
setFilter(f.id);
|
||||
setActiveId(null);
|
||||
}}
|
||||
>
|
||||
<span aria-hidden>{f.emoji}</span> {f.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="social-people-grid">
|
||||
{list.map((m, i) => (
|
||||
<button
|
||||
key={m.id}
|
||||
type="button"
|
||||
className={`social-people-chip social-chip-pop${m.online ? " is-online" : ""}${likes[m.id] ? " is-liked" : ""}${activeId === m.id ? " is-active" : ""}`}
|
||||
style={{ ["--stagger" as string]: `${Math.min(i, 12) * 40}ms` }}
|
||||
onClick={() => setActiveId(activeId === m.id ? null : m.id)}
|
||||
aria-pressed={activeId === m.id}
|
||||
>
|
||||
<span className="social-people-chip-ava">
|
||||
<img src={m.avatar} alt="" loading="lazy" width={52} height={52} />
|
||||
{m.online ? <i aria-hidden /> : null}
|
||||
{likes[m.id] ? (
|
||||
<em className="social-chip-heart" aria-hidden>
|
||||
♥
|
||||
</em>
|
||||
) : null}
|
||||
</span>
|
||||
<strong>{m.name}</strong>
|
||||
<em>{m.city.split("·")[0].trim()}</em>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{active ? (
|
||||
<div className={`social-people-detail social-detail-in reveal visible${burst ? " is-burst" : ""}`} role="status">
|
||||
{burst ? (
|
||||
<span className="social-burst" aria-hidden>
|
||||
✨💫💖
|
||||
</span>
|
||||
) : null}
|
||||
<img src={active.avatar} alt="" width={44} height={44} />
|
||||
<div>
|
||||
<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">
|
||||
<button type="button" className="btn btn-primary social-btn-pulse" onClick={onJoin}>
|
||||
加群,认识他们 ✨
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@ -15,7 +15,7 @@ export default function ChatListClient() {
|
||||
<br />
|
||||
<span>自研频道 · 可扩展小程序</span>
|
||||
</h1>
|
||||
<p>消息保存在本机(localStorage),不依赖 Lounge / web-view。后续可接 FastAPI + WS。</p>
|
||||
<p>自研频道 · Centrifugo 实时推送 · 离线自动降级本地缓存。不依赖 Lounge / web-view。</p>
|
||||
</section>
|
||||
<div className="social-list">
|
||||
{SEED_CHANNELS.map((c) => (
|
||||
|
||||
@ -51,9 +51,47 @@ export default function ChatRoomClient({ channelId }: { channelId: string }) {
|
||||
useEffect(() => {
|
||||
setNick(loadJson("nick", "游民"));
|
||||
void refresh();
|
||||
const id = window.setInterval(() => void refresh(), 4000);
|
||||
return () => clearInterval(id);
|
||||
}, [refresh]);
|
||||
|
||||
let cancelled = false;
|
||||
let stopRealtime: (() => void) | null = null;
|
||||
let pollId = 0;
|
||||
const startPoll = (ms: number) => {
|
||||
if (pollId) window.clearInterval(pollId);
|
||||
pollId = window.setInterval(() => void refresh(), ms);
|
||||
};
|
||||
startPoll(4000);
|
||||
|
||||
void (async () => {
|
||||
try {
|
||||
const { connectChatRealtime } = await import("@social/lib/realtime");
|
||||
const handle = await connectChatRealtime(channel.id, (msg) => {
|
||||
setMessages((prev) => {
|
||||
if (prev.some((p) => p.id === msg.id)) return prev;
|
||||
const next = [...prev, msg];
|
||||
saveJson(storageKey, next);
|
||||
return next;
|
||||
});
|
||||
setOnline(true);
|
||||
});
|
||||
if (cancelled) {
|
||||
handle?.disconnect();
|
||||
return;
|
||||
}
|
||||
if (handle) {
|
||||
stopRealtime = handle.disconnect;
|
||||
startPoll(30000);
|
||||
}
|
||||
} catch {
|
||||
/* 保持 4s 轮询 */
|
||||
}
|
||||
})();
|
||||
|
||||
return () => {
|
||||
cancelled = true;
|
||||
if (pollId) window.clearInterval(pollId);
|
||||
stopRealtime?.();
|
||||
};
|
||||
}, [refresh, channel.id, storageKey]);
|
||||
|
||||
useEffect(() => {
|
||||
bottomRef.current?.scrollIntoView({ behavior: "smooth" });
|
||||
|
||||
@ -85,15 +85,15 @@ export default function CoffeechatClient() {
|
||||
return (
|
||||
<SiteShell title="Coffeechat">
|
||||
<section className="social-hero">
|
||||
<div className="social-hero-tag">线下 · 咖啡馆</div>
|
||||
<div className="social-hero-tag">COFFEECHAT</div>
|
||||
<h1>
|
||||
Coffeechat
|
||||
<br />
|
||||
<span>合作店 · 评价 · 合照备注</span>
|
||||
<span>约见 · 评价 · 同城</span>
|
||||
</h1>
|
||||
<p>
|
||||
评价写入独立 social 库(与旅居社群数据隔离)。
|
||||
{online ? " 当前已连后端。" : " 后端不可用时先存本机。"}
|
||||
选店、看评价、约见面。
|
||||
{online ? " 评价已同步后端。" : " 离线时评价先存本机。"}
|
||||
</p>
|
||||
</section>
|
||||
|
||||
|
||||
37
src/modules/social/components/FloatingEmojiField.tsx
Normal file
37
src/modules/social/components/FloatingEmojiField.tsx
Normal file
@ -0,0 +1,37 @@
|
||||
"use client";
|
||||
|
||||
/** Dense CSS-only floating emoji field — obvious motion, no framer. */
|
||||
const EMOJIS = [
|
||||
{ e: "☕", x: "6%", y: "18%", delay: "0s", dur: "5.5s", size: "2.2rem" },
|
||||
{ e: "🌏", x: "88%", y: "22%", delay: "0.4s", dur: "6.2s", size: "2.4rem" },
|
||||
{ e: "💬", x: "78%", y: "58%", delay: "0.9s", dur: "5.2s", size: "1.9rem" },
|
||||
{ e: "🎒", x: "12%", y: "62%", delay: "1.3s", dur: "6.8s", size: "2rem" },
|
||||
{ e: "✨", x: "48%", y: "12%", delay: "0.2s", dur: "4.8s", size: "1.7rem" },
|
||||
{ e: "🤝", x: "58%", y: "70%", delay: "1.7s", dur: "5.9s", size: "2rem" },
|
||||
{ e: "🚀", x: "28%", y: "38%", delay: "0.7s", dur: "6.4s", size: "1.8rem" },
|
||||
{ e: "💚", x: "70%", y: "34%", delay: "1.1s", dur: "5.6s", size: "1.6rem" },
|
||||
{ e: "📡", x: "38%", y: "78%", delay: "1.5s", dur: "7s", size: "1.9rem" },
|
||||
{ e: "🔥", x: "92%", y: "72%", delay: "0.5s", dur: "5.1s", size: "1.8rem" },
|
||||
];
|
||||
|
||||
export default function FloatingEmojiField() {
|
||||
return (
|
||||
<div className="social-emoji-field" aria-hidden>
|
||||
{EMOJIS.map((item) => (
|
||||
<span
|
||||
key={item.e + item.x + item.y}
|
||||
className="social-emoji-float"
|
||||
style={{
|
||||
left: item.x,
|
||||
top: item.y,
|
||||
fontSize: item.size,
|
||||
animationDelay: item.delay,
|
||||
animationDuration: item.dur,
|
||||
}}
|
||||
>
|
||||
{item.e}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
16
src/modules/social/components/FxBelt.tsx
Normal file
16
src/modules/social/components/FxBelt.tsx
Normal file
@ -0,0 +1,16 @@
|
||||
"use client";
|
||||
|
||||
/** Endless emoji marquee between sections — CSS only. */
|
||||
const ROW = ["☕", "🌏", "💬", "🎒", "✨", "🤝", "📡", "🚀", "💚", "🎯", "🔥", "🌈"];
|
||||
|
||||
export default function FxBelt() {
|
||||
const line = [...ROW, ...ROW, ...ROW].join(" ");
|
||||
return (
|
||||
<div className="social-fx-belt" aria-hidden>
|
||||
<div className="social-fx-belt-track">
|
||||
<span>{line}</span>
|
||||
<span>{line}</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -1,107 +1,4 @@
|
||||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import SiteShell from "./SiteShell";
|
||||
import { socialApi } from "@social/lib/api";
|
||||
import { SEED_GIGS } from "@social/lib/seed";
|
||||
import { loadJson, saveJson, uid } from "@social/lib/storage";
|
||||
|
||||
type Application = {
|
||||
id: string;
|
||||
gigId: string;
|
||||
name: string;
|
||||
contact: string;
|
||||
note: string;
|
||||
at: string;
|
||||
};
|
||||
|
||||
export default function GigsClient() {
|
||||
const [gigId, setGigId] = useState(SEED_GIGS[0]?.id || "");
|
||||
const [name, setName] = useState("");
|
||||
const [contact, setContact] = useState("");
|
||||
const [note, setNote] = useState("");
|
||||
const [ok, setOk] = useState("");
|
||||
|
||||
const apply = async () => {
|
||||
if (!gigId || !name.trim() || !contact.trim()) return;
|
||||
const payload = {
|
||||
name: name.trim(),
|
||||
contact: contact.trim(),
|
||||
note: note.trim(),
|
||||
};
|
||||
try {
|
||||
await socialApi.applyGig(gigId, payload);
|
||||
setOk("已同步到游民社区独立库。");
|
||||
} catch {
|
||||
const list = loadJson<Application[]>("gig-apps", []);
|
||||
const item: Application = {
|
||||
id: uid("app"),
|
||||
gigId,
|
||||
...payload,
|
||||
at: new Date().toISOString(),
|
||||
};
|
||||
saveJson("gig-apps", [item, ...list]);
|
||||
setOk("后端暂不可用,申请已先存本机。");
|
||||
}
|
||||
setNote("");
|
||||
};
|
||||
|
||||
return (
|
||||
<SiteShell title="兼职">
|
||||
<section className="social-hero">
|
||||
<div className="social-hero-tag">远程团队</div>
|
||||
<h1>
|
||||
招募兼职
|
||||
<br />
|
||||
<span>运营 / 拍摄助理 · 大学生</span>
|
||||
</h1>
|
||||
<p>投递写入独立 social 库,与现网招聘 / 社群表隔离。</p>
|
||||
</section>
|
||||
|
||||
<div className="social-list">
|
||||
{SEED_GIGS.map((g) => (
|
||||
<button
|
||||
key={g.id}
|
||||
type="button"
|
||||
className={`social-list-item social-card-btn${g.id === gigId ? " active" : ""}`}
|
||||
onClick={() => setGigId(g.id)}
|
||||
>
|
||||
<div>
|
||||
<strong>{g.title}</strong>
|
||||
<p>
|
||||
{g.role} · {g.pay} · {g.remote ? "远程" : "驻场"}
|
||||
</p>
|
||||
<p className="social-muted">{g.tags.join(" · ")}</p>
|
||||
</div>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<section className="social-panel" style={{ marginTop: 20 }}>
|
||||
<h2>投递申请</h2>
|
||||
<div className="social-form">
|
||||
<label>
|
||||
姓名
|
||||
<input value={name} onChange={(e) => setName(e.target.value)} />
|
||||
</label>
|
||||
<label>
|
||||
联系方式
|
||||
<input
|
||||
value={contact}
|
||||
onChange={(e) => setContact(e.target.value)}
|
||||
placeholder="微信 / 手机 / 邮箱"
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
自我介绍
|
||||
<textarea rows={3} value={note} onChange={(e) => setNote(e.target.value)} />
|
||||
</label>
|
||||
<button type="button" className="social-btn primary" onClick={() => void apply()}>
|
||||
提交
|
||||
</button>
|
||||
{ok ? <p className="social-muted">{ok}</p> : null}
|
||||
</div>
|
||||
</section>
|
||||
</SiteShell>
|
||||
);
|
||||
}
|
||||
/** @deprecated 请用 TeamClient;保留 re-export 避免旧 import 断裂 */
|
||||
export { default } from "./TeamClient";
|
||||
|
||||
@ -1,47 +1,53 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import Link from "next/link";
|
||||
import ParticleCanvas from "./ParticleCanvas";
|
||||
import SiteShell from "./SiteShell";
|
||||
import { SOCIAL_SECTIONS } from "@social/lib/catalog";
|
||||
import JoinPayModal from "./JoinPayModal";
|
||||
import AttractiveRoster from "./AttractiveRoster";
|
||||
import ParticleCanvas from "./ParticleCanvas";
|
||||
import FloatingEmojiField from "./FloatingEmojiField";
|
||||
import SectionSpark from "./SectionSpark";
|
||||
import FxBelt from "./FxBelt";
|
||||
import { SEED_CAFES, SEED_GIGS, SEED_MEETUPS, TEAM_KIND_LABEL } from "@social/lib/seed";
|
||||
import { socialPath } from "@social/lib/socialPath";
|
||||
import { useRemoteConfig } from "~/lib/use-remote-config";
|
||||
|
||||
const PHRASES = [
|
||||
"不是逃离生活,而是在流动中找到同类。",
|
||||
"加群报到,聊天室续聊,Meetup 见一面。",
|
||||
"Coffeechat 约咖啡馆,花名册让同城看见你。",
|
||||
"线上文字房 + 站内视频房,不新开标签页。",
|
||||
"加群打个招呼,线下见面就不陌生。",
|
||||
"清迈、大理、曼谷——下一场咖啡局也许有你。",
|
||||
"Meetup 暖场、Coffeechat 深聊、远程一起做事。",
|
||||
];
|
||||
|
||||
const PATH_STEPS = [
|
||||
{
|
||||
n: "01",
|
||||
emoji: "🚩",
|
||||
title: "先加群报到",
|
||||
desc: "公众号 / 抖音群进门,再回站内聊天室。",
|
||||
href: "/join",
|
||||
cta: "去加群",
|
||||
},
|
||||
{
|
||||
n: "02",
|
||||
emoji: "💬",
|
||||
title: "遇见同行",
|
||||
desc: "文字频道与 Meetup 分屏,像原生 App 一样留在站内。",
|
||||
href: "/chat",
|
||||
cta: "进聊天室",
|
||||
},
|
||||
{
|
||||
n: "03",
|
||||
emoji: "☕",
|
||||
title: "线下连结",
|
||||
desc: "Coffeechat、访谈与职业花名册,把线上聊到的变成见面。",
|
||||
href: "/coffeechat",
|
||||
cta: "看咖啡馆",
|
||||
},
|
||||
];
|
||||
const DEFAULT_PROMO =
|
||||
"https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4";
|
||||
|
||||
const PATH = [
|
||||
{ href: "#people", label: "想见的人", emoji: "👋" },
|
||||
{ href: "#meetup", label: "Meetup", emoji: "📡" },
|
||||
{ href: "#coffeechat", label: "Coffeechat", emoji: "☕" },
|
||||
{ href: "#team", label: "远程组队", emoji: "🚀" },
|
||||
] as const;
|
||||
|
||||
const CAFE_EMOJI = ["☕", "🌿", "🌊", "🪵"] as const;
|
||||
const ROLE_EMOJI: Record<string, string> = {
|
||||
volunteer: "🙋",
|
||||
parttime: "📝",
|
||||
fulltime: "💼",
|
||||
};
|
||||
|
||||
export default function HomeClient() {
|
||||
const { config } = useRemoteConfig();
|
||||
const [joinOpen, setJoinOpen] = useState(false);
|
||||
const [promoUrl, setPromoUrl] = useState(DEFAULT_PROMO);
|
||||
|
||||
useEffect(() => {
|
||||
const next =
|
||||
(config.modules?.social as { promoVideoUrl?: string } | undefined)?.promoVideoUrl?.trim() ||
|
||||
DEFAULT_PROMO;
|
||||
setPromoUrl(next);
|
||||
}, [config]);
|
||||
|
||||
useEffect(() => {
|
||||
const el = document.getElementById("social-typewriter");
|
||||
if (!el) return;
|
||||
@ -57,10 +63,10 @@ export default function HomeClient() {
|
||||
charIdx++;
|
||||
if (charIdx === current.length) {
|
||||
deleting = true;
|
||||
timer = setTimeout(type, 2400);
|
||||
timer = setTimeout(type, 2500);
|
||||
return;
|
||||
}
|
||||
timer = setTimeout(type, 56);
|
||||
timer = setTimeout(type, 60);
|
||||
} else {
|
||||
el.textContent = current.substring(0, charIdx - 1);
|
||||
charIdx--;
|
||||
@ -68,10 +74,10 @@ export default function HomeClient() {
|
||||
deleting = false;
|
||||
phraseIdx = (phraseIdx + 1) % PHRASES.length;
|
||||
}
|
||||
timer = setTimeout(type, 28);
|
||||
timer = setTimeout(type, 30);
|
||||
}
|
||||
};
|
||||
timer = setTimeout(type, 350);
|
||||
timer = setTimeout(type, 400);
|
||||
return () => clearTimeout(timer);
|
||||
}, []);
|
||||
|
||||
@ -84,278 +90,307 @@ export default function HomeClient() {
|
||||
observer.unobserve(e.target);
|
||||
}
|
||||
}),
|
||||
{ threshold: 0.08, rootMargin: "0px 0px -40px 0px" },
|
||||
{ threshold: 0.06, rootMargin: "0px 0px -24px 0px" },
|
||||
);
|
||||
document.querySelectorAll(".reveal").forEach((el) => observer.observe(el));
|
||||
return () => observer.disconnect();
|
||||
const scan = () => {
|
||||
document.querySelectorAll(".reveal:not(.visible)").forEach((el) => observer.observe(el));
|
||||
};
|
||||
scan();
|
||||
const t = window.setTimeout(scan, 400);
|
||||
return () => {
|
||||
window.clearTimeout(t);
|
||||
observer.disconnect();
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="home-flow social-flow">
|
||||
<div className="home-flow social-flow social-fx">
|
||||
<ParticleCanvas />
|
||||
<SiteShell home>
|
||||
<section className="hero" id="hero">
|
||||
<div className="social-fx-orbs" aria-hidden>
|
||||
<i className="social-fx-orb o1" />
|
||||
<i className="social-fx-orb o2" />
|
||||
<i className="social-fx-orb o3" />
|
||||
</div>
|
||||
<SiteShell home onJoin={() => setJoinOpen(true)}>
|
||||
<section className="hero social-hero-fx" id="hero">
|
||||
<div className="hero-bg-shapes" aria-hidden>
|
||||
<div className="shape shape-1" />
|
||||
<div className="shape shape-2" />
|
||||
<div className="shape shape-3" />
|
||||
</div>
|
||||
<FloatingEmojiField />
|
||||
|
||||
<div className="hero-inner">
|
||||
<div className="hero-top">
|
||||
<div className="hero-content">
|
||||
<div className="hero-badge reveal">
|
||||
<span className="badge-dot" />
|
||||
nomadro · 游民社区
|
||||
nomadro · 数字游民社交
|
||||
</div>
|
||||
<h1 className="hero-title reveal">
|
||||
线上线下
|
||||
游民社区
|
||||
<br />
|
||||
<span className="gradient-text">找到同类</span> 💬
|
||||
<span className="gradient-text">认识同类,线下见面</span>
|
||||
</h1>
|
||||
<p className="hero-subtitle reveal">
|
||||
<span id="social-typewriter" />
|
||||
<span className="typewriter-cursor">|</span>
|
||||
</p>
|
||||
<div className="hero-actions reveal">
|
||||
<button type="button" className="btn btn-primary social-btn-pulse" onClick={() => setJoinOpen(true)}>
|
||||
<span>加群</span>
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<path d="M5 12h14M12 5l7 7-7 7" />
|
||||
</svg>
|
||||
</button>
|
||||
<a href="#people" className="btn btn-ghost">
|
||||
看看谁在线
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="hero-visual reveal">
|
||||
<div className="globe-container">
|
||||
<svg className="globe-svg" viewBox="0 0 400 400" aria-hidden>
|
||||
<defs>
|
||||
<radialGradient id="socialGlobeGlow" cx="50%" cy="50%" r="50%">
|
||||
<stop offset="0%" stopColor="#4ECDC4" stopOpacity="0.3" />
|
||||
<stop offset="100%" stopColor="#4ECDC4" stopOpacity="0" />
|
||||
</radialGradient>
|
||||
<linearGradient id="socialOrbitGrad" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||
<stop offset="0%" stopColor="#FF6B6B" />
|
||||
<stop offset="100%" stopColor="#4ECDC4" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<circle cx="200" cy="200" r="160" fill="url(#socialGlobeGlow)" />
|
||||
<circle
|
||||
cx="200"
|
||||
cy="200"
|
||||
r="120"
|
||||
fill="none"
|
||||
stroke="rgba(78,205,196,0.2)"
|
||||
strokeWidth="1"
|
||||
/>
|
||||
<ellipse
|
||||
cx="200"
|
||||
cy="200"
|
||||
rx="120"
|
||||
ry="40"
|
||||
fill="none"
|
||||
stroke="rgba(78,205,196,0.3)"
|
||||
strokeWidth="1.5"
|
||||
className="orbit-ring"
|
||||
/>
|
||||
<ellipse
|
||||
cx="200"
|
||||
cy="200"
|
||||
rx="40"
|
||||
ry="120"
|
||||
fill="none"
|
||||
stroke="rgba(255,107,107,0.3)"
|
||||
strokeWidth="1.5"
|
||||
className="orbit-ring orbit-ring-2"
|
||||
/>
|
||||
<g className="nomad-dots">
|
||||
<circle cx="180" cy="155" r="5" fill="#FF6B6B" className="pulse-dot" />
|
||||
<circle cx="260" cy="215" r="5" fill="#FFE66D" className="pulse-dot" />
|
||||
<circle cx="145" cy="225" r="5" fill="#4ECDC4" className="pulse-dot" />
|
||||
<circle cx="220" cy="175" r="5" fill="#A78BFA" className="pulse-dot" />
|
||||
</g>
|
||||
<path
|
||||
d="M180 155 Q220 140 260 215"
|
||||
fill="none"
|
||||
stroke="url(#socialOrbitGrad)"
|
||||
strokeWidth="2"
|
||||
strokeDasharray="6 4"
|
||||
className="flight-path"
|
||||
/>
|
||||
</svg>
|
||||
<div className="floating-cards">
|
||||
<div className="float-card fc-1">
|
||||
💬 Chat
|
||||
<br />
|
||||
<small>实时文字房</small>
|
||||
</div>
|
||||
<div className="float-card fc-2">
|
||||
📹 Meetup
|
||||
<br />
|
||||
<small>站内视频</small>
|
||||
</div>
|
||||
<div className="float-card fc-3">
|
||||
☕ Coffee
|
||||
<br />
|
||||
<small>同城约见</small>
|
||||
</div>
|
||||
<div className="social-promo social-promo-glow">
|
||||
<video
|
||||
className="social-promo-video"
|
||||
src={promoUrl}
|
||||
controls
|
||||
playsInline
|
||||
preload="metadata"
|
||||
aria-label="游民社区宣传片"
|
||||
/>
|
||||
<div className="social-promo-badge">
|
||||
<span className="social-promo-live" aria-hidden />
|
||||
宣传片
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div className="hero-bottom reveal">
|
||||
<div className="hero-actions">
|
||||
<Link href={socialPath("/chat")} className="btn btn-primary">
|
||||
<span>进入聊天室</span>
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
|
||||
<path d="M5 12h14M12 5l7 7-7 7" />
|
||||
</svg>
|
||||
</Link>
|
||||
<Link href={socialPath("/join")} className="btn btn-ghost">
|
||||
先加群
|
||||
</Link>
|
||||
<a href="#path" className="btn btn-ghost">
|
||||
看看路径
|
||||
<nav className="social-path" aria-label="本页导航">
|
||||
<div className="container">
|
||||
<div className="social-path-track reveal">
|
||||
{PATH.map((p) => (
|
||||
<a key={p.href} href={p.href} className="social-path-link">
|
||||
<span className="social-path-emoji" aria-hidden>
|
||||
{p.emoji}
|
||||
</span>
|
||||
{p.label}
|
||||
</a>
|
||||
</div>
|
||||
<div className="scroll-hint">
|
||||
<span>向下滚动</span>
|
||||
<div className="scroll-arrow" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="journey-strip section-compact" id="path" aria-label="游民社区路径">
|
||||
<div className="container">
|
||||
<div className="section-header journey-head reveal">
|
||||
<span className="section-tag">PATH</span>
|
||||
<h2>一条路径,三步相扣</h2>
|
||||
<p>先报到,再聊天 / Meetup,最后线下见面——按需进入,不必一次看完。</p>
|
||||
</div>
|
||||
<ol className="journey-rail journey-rail-3 reveal">
|
||||
{PATH_STEPS.map((s, i) => (
|
||||
<li key={s.n} className="journey-step">
|
||||
{i > 0 && <span className="journey-connector" aria-hidden />}
|
||||
<div className="journey-card">
|
||||
<div className="journey-card-top">
|
||||
<span className="journey-n">{s.n}</span>
|
||||
<span className="journey-emoji">{s.emoji}</span>
|
||||
</div>
|
||||
<h3>{s.title}</h3>
|
||||
<p>{s.desc}</p>
|
||||
<div className="journey-actions">
|
||||
<Link href={socialPath(s.href)} className="btn btn-primary btn-sm">
|
||||
{s.cta}
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<AttractiveRoster onJoin={() => setJoinOpen(true)} />
|
||||
|
||||
<FxBelt />
|
||||
|
||||
<section className="section section-compact social-section-alt" id="meetup" aria-label="Meetup">
|
||||
<div className="container">
|
||||
<div className="section-header reveal">
|
||||
<SectionSpark label="meetup" />
|
||||
<span className="section-tag">MEETUP</span>
|
||||
<h2>
|
||||
<span className="social-title-emoji" aria-hidden>
|
||||
📡
|
||||
</span>
|
||||
今晚有人在等你进房
|
||||
</h2>
|
||||
<p>本周 {SEED_MEETUPS.length} 场 · 可只听不说 · 进房就能搭话</p>
|
||||
</div>
|
||||
<div className="social-panel-grid social-panel-grid-2">
|
||||
{SEED_MEETUPS.map((m, i) => (
|
||||
<article
|
||||
key={m.id}
|
||||
className={`social-panel social-panel-fx reveal${i === 0 ? " is-accent" : ""}`}
|
||||
style={{ ["--stagger" as string]: `${i * 80}ms` }}
|
||||
>
|
||||
<div className="social-panel-ico" aria-hidden>
|
||||
<svg viewBox="0 0 48 48" width="40" height="40">
|
||||
<circle cx="24" cy="24" r="22" fill="none" stroke="currentColor" strokeOpacity="0.25" strokeWidth="2" />
|
||||
<circle cx="24" cy="24" r="14" fill="none" stroke="currentColor" strokeOpacity="0.45" strokeWidth="2" className="social-ring-spin" />
|
||||
<text x="24" y="28" textAnchor="middle" fontSize="16">
|
||||
📹
|
||||
</text>
|
||||
</svg>
|
||||
</div>
|
||||
<div className="social-panel-meta">
|
||||
<span>{m.city === "Online" ? "线上" : m.city}</span>
|
||||
<time>
|
||||
{m.date} · {m.time}
|
||||
</time>
|
||||
</div>
|
||||
<h3>{m.title}</h3>
|
||||
<p>文字暖场 → MiroTalk 开麦 → 认识新朋友</p>
|
||||
<Link className="btn btn-primary btn-sm" href={socialPath(`/meetup/${m.id}`)}>
|
||||
进房
|
||||
<svg 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>
|
||||
</article>
|
||||
))}
|
||||
</div>
|
||||
<div className="social-section-actions reveal">
|
||||
<Link href={socialPath("/meetup")} className="btn btn-ghost">
|
||||
全部 Meetup
|
||||
</Link>
|
||||
<button type="button" className="btn btn-ghost" onClick={() => setJoinOpen(true)}>
|
||||
加群占座
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="section-compact" id="modules">
|
||||
<FxBelt />
|
||||
|
||||
<section className="section section-compact" id="coffeechat" aria-label="Coffeechat">
|
||||
<div className="container">
|
||||
<div className="section-header reveal">
|
||||
<span className="section-tag">HUB</span>
|
||||
<h2>核心能力</h2>
|
||||
<p>线上社交、线下连接、VIP 花名册与 UGC——全部站内原生体验。</p>
|
||||
<SectionSpark label="coffee" />
|
||||
<span className="section-tag">COFFEECHAT</span>
|
||||
<h2>
|
||||
<span className="social-title-emoji" aria-hidden>
|
||||
☕
|
||||
</span>
|
||||
咖啡馆里把网友变朋友
|
||||
</h2>
|
||||
<p>精选合作店 · 插座够 · 适合 1v1 / 小局</p>
|
||||
</div>
|
||||
<div className="social-panel-grid social-panel-grid-4">
|
||||
{SEED_CAFES.map((c, i) => (
|
||||
<article
|
||||
key={c.id}
|
||||
className="social-panel social-panel-fx reveal"
|
||||
style={{ ["--stagger" as string]: `${i * 70}ms` }}
|
||||
>
|
||||
<div className="social-panel-ico social-panel-ico-bounce" aria-hidden>
|
||||
{CAFE_EMOJI[i % CAFE_EMOJI.length]}
|
||||
</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 className="social-section-actions reveal">
|
||||
<Link href={socialPath("/coffeechat")} className="btn btn-ghost">
|
||||
全部咖啡馆
|
||||
</Link>
|
||||
<button type="button" className="btn btn-ghost" onClick={() => setJoinOpen(true)}>
|
||||
加群找同城
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{SOCIAL_SECTIONS.map((section) => (
|
||||
<div key={section.id} className="social-hub-block reveal" id={section.id}>
|
||||
<div className="social-hub-block-head">
|
||||
<h3>{section.title}</h3>
|
||||
<p>{section.subtitle}</p>
|
||||
</div>
|
||||
<div className="social-hub-grid">
|
||||
{section.features.map((f) => (
|
||||
<Link key={f.id} href={socialPath(f.href)} className="social-hub-card">
|
||||
<div className="social-hub-card-top">
|
||||
<span className="social-hub-emoji">{f.emoji}</span>
|
||||
<span className={`social-pill${f.status === "live" ? " live" : ""}`}>
|
||||
{f.status === "live" ? "开放" : "即将"}
|
||||
</span>
|
||||
</div>
|
||||
<h4>{f.title}</h4>
|
||||
<p>{f.desc}</p>
|
||||
<span className="social-hub-go">进入 →</span>
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="section-compact" id="next">
|
||||
<FxBelt />
|
||||
|
||||
<section className="section section-compact social-section-alt" id="team" aria-label="远程团队">
|
||||
<div className="container">
|
||||
<div className="section-header reveal">
|
||||
<span className="section-tag">NEXT</span>
|
||||
<h2>接下来你可以</h2>
|
||||
<SectionSpark label="team" />
|
||||
<span className="section-tag">TEAM</span>
|
||||
<h2>
|
||||
<span className="social-title-emoji" aria-hidden>
|
||||
🚀
|
||||
</span>
|
||||
找靠谱搭档一起干
|
||||
</h2>
|
||||
<p>志愿 / 兼职 / 全职 · 先聊人再投 · 群里可问内推</p>
|
||||
</div>
|
||||
<div className="social-next-grid reveal">
|
||||
<Link href={socialPath("/meetup")} className="social-next-card">
|
||||
<span>📹</span>
|
||||
<div>
|
||||
<strong>站内 Meetup</strong>
|
||||
<p>视频与文字同页分屏,不跳外链标签页。</p>
|
||||
</div>
|
||||
<em>→</em>
|
||||
</Link>
|
||||
<Link href={socialPath("/roster")} className="social-next-card">
|
||||
<span>📇</span>
|
||||
<div>
|
||||
<strong>完善花名册</strong>
|
||||
<p>职业资料、Linktree、手机号,让同城找到你。</p>
|
||||
</div>
|
||||
<em>→</em>
|
||||
</Link>
|
||||
<Link href={socialPath("/vip")} className="social-next-card">
|
||||
<span>✨</span>
|
||||
<div>
|
||||
<strong>开通会员</strong>
|
||||
<p>花名册公开、活动席位与 Coffeechat 优先。</p>
|
||||
</div>
|
||||
<em>→</em>
|
||||
<div className="social-panel-grid social-panel-grid-3">
|
||||
{SEED_GIGS.slice(0, 6).map((g, i) => (
|
||||
<article
|
||||
key={g.id}
|
||||
className="social-panel social-panel-fx reveal"
|
||||
style={{ ["--stagger" as string]: `${i * 60}ms` }}
|
||||
>
|
||||
<div className="social-panel-ico" aria-hidden>
|
||||
{ROLE_EMOJI[g.kind || "parttime"] || "📝"}
|
||||
</div>
|
||||
<div className="social-panel-meta">
|
||||
<span>{TEAM_KIND_LABEL[g.kind || "parttime"]}</span>
|
||||
<span>{g.remote ? "远程" : "可线下"}</span>
|
||||
</div>
|
||||
<h3>{g.title}</h3>
|
||||
<p>{g.pay}</p>
|
||||
<div className="social-panel-foot">
|
||||
{(g.tags || []).slice(0, 3).map((t) => (
|
||||
<span key={t}>{t}</span>
|
||||
))}
|
||||
</div>
|
||||
<Link className="btn btn-primary btn-sm" href={socialPath("/team")}>
|
||||
聊聊
|
||||
</Link>
|
||||
</article>
|
||||
))}
|
||||
</div>
|
||||
<div className="social-section-actions reveal">
|
||||
<Link href={socialPath("/team")} className="btn btn-ghost">
|
||||
全部岗位
|
||||
</Link>
|
||||
<button type="button" className="btn btn-ghost" onClick={() => setJoinOpen(true)}>
|
||||
加群问内推
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<footer className="footer">
|
||||
<div className="container footer-inner">
|
||||
<div className="footer-brand">
|
||||
<div className="nav-logo">
|
||||
<span className="logo-icon">💬</span>
|
||||
<span className="logo-text">游民社区</span>
|
||||
<div className="container">
|
||||
<div className="footer-grid footer-grid-rings">
|
||||
<div className="footer-brand">
|
||||
<div className="nav-logo">
|
||||
<span className="logo-icon social-logo-spin">◈</span>
|
||||
<span className="logo-text">游民社区</span>
|
||||
</div>
|
||||
<p>数字游民社交场:加群、Coffeechat、Meetup、远程组队。</p>
|
||||
</div>
|
||||
<p>让数字游民在流动中相遇——线上聊天、Meetup、线下 Coffeechat。</p>
|
||||
</div>
|
||||
<div className="footer-cols">
|
||||
<div>
|
||||
<div className="footer-links">
|
||||
<h4>连接</h4>
|
||||
<Link href={socialPath("/join")}>加群</Link>
|
||||
<button type="button" className="social-footer-link" onClick={() => setJoinOpen(true)}>
|
||||
加群
|
||||
</button>
|
||||
<Link href={socialPath("/chat")}>聊天室</Link>
|
||||
<Link href={socialPath("/meetup")}>Meetup</Link>
|
||||
<Link href={socialPath("/coffeechat")}>Coffeechat</Link>
|
||||
</div>
|
||||
<div>
|
||||
<div className="footer-links">
|
||||
<h4>成长</h4>
|
||||
<Link href={socialPath("/roster")}>花名册</Link>
|
||||
<Link href={socialPath("/vip")}>VIP</Link>
|
||||
<Link href={socialPath("/gigs")}>兼职</Link>
|
||||
<Link href={socialPath("/team")}>远程团队</Link>
|
||||
<Link href={socialPath("/feedback")}>反馈</Link>
|
||||
</div>
|
||||
<div>
|
||||
<div className="footer-links">
|
||||
<h4>更多</h4>
|
||||
<Link href="/">门户首页</Link>
|
||||
<Link href="/community">旅居社群</Link>
|
||||
<Link href="/book">数字游民小册</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="container footer-bottom">
|
||||
<span>© {new Date().getFullYear()} nomadro · 游民社区</span>
|
||||
<div className="footer-bottom">
|
||||
<p suppressHydrationWarning>© {new Date().getFullYear()} nomadro · 游民社区</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</SiteShell>
|
||||
|
||||
<JoinPayModal open={joinOpen} onClose={() => setJoinOpen(false)} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
145
src/modules/social/components/JoinPayModal.tsx
Normal file
145
src/modules/social/components/JoinPayModal.tsx
Normal file
@ -0,0 +1,145 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useId, useState } from "react";
|
||||
import { isWeChat } from "@nomadro/pay";
|
||||
|
||||
type Props = {
|
||||
open: boolean;
|
||||
onClose: () => void;
|
||||
};
|
||||
|
||||
const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||
|
||||
/**
|
||||
* 加群:填邮箱 → 调起门户统一支付
|
||||
* PC/H5 → zpay;微信内 H5 → xpay(xorpay);小程序 WebView 提示走虚拟支付
|
||||
*/
|
||||
export default function JoinPayModal({ open, onClose }: Props) {
|
||||
const titleId = useId();
|
||||
const [email, setEmail] = useState("");
|
||||
const [busy, setBusy] = useState(false);
|
||||
const [err, setErr] = useState("");
|
||||
const [channelHint, setChannelHint] = useState("浏览器将使用 z-pay。");
|
||||
|
||||
useEffect(() => {
|
||||
if (!open) return;
|
||||
setErr("");
|
||||
try {
|
||||
const saved = localStorage.getItem("userEmail") || "";
|
||||
if (saved) setEmail(saved);
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
|
||||
const inMiniProgram =
|
||||
/miniProgram/i.test(navigator.userAgent) ||
|
||||
(window as unknown as { __wxjs_environment?: string }).__wxjs_environment ===
|
||||
"miniprogram";
|
||||
setChannelHint(
|
||||
inMiniProgram
|
||||
? "将进入小程序虚拟支付。"
|
||||
: isWeChat()
|
||||
? "微信内将使用 x-pay。"
|
||||
: "浏览器将使用 z-pay。",
|
||||
);
|
||||
|
||||
const onKey = (e: KeyboardEvent) => {
|
||||
if (e.key === "Escape" && !busy) onClose();
|
||||
};
|
||||
window.addEventListener("keydown", onKey);
|
||||
return () => window.removeEventListener("keydown", onKey);
|
||||
}, [open, onClose, busy]);
|
||||
|
||||
const submit = async () => {
|
||||
const value = email.trim().toLowerCase();
|
||||
if (!EMAIL_RE.test(value)) {
|
||||
setErr("请输入有效邮箱");
|
||||
return;
|
||||
}
|
||||
setErr("");
|
||||
setBusy(true);
|
||||
try {
|
||||
localStorage.setItem("userEmail", value);
|
||||
localStorage.setItem("userName", value.split("@")[0] || "游民");
|
||||
|
||||
const inMiniProgram =
|
||||
/miniProgram/i.test(navigator.userAgent) ||
|
||||
(window as unknown as { __wxjs_environment?: string }).__wxjs_environment ===
|
||||
"miniprogram";
|
||||
|
||||
if (inMiniProgram) {
|
||||
window.location.href = "/vip";
|
||||
return;
|
||||
}
|
||||
|
||||
const { triggerPay } = await import("@vip/app/lib/triggerPay");
|
||||
await triggerPay();
|
||||
onClose();
|
||||
} catch (e) {
|
||||
setErr(e instanceof Error ? e.message : "支付唤起失败,请稍后重试");
|
||||
} finally {
|
||||
setBusy(false);
|
||||
}
|
||||
};
|
||||
|
||||
if (!open) return null;
|
||||
|
||||
return (
|
||||
<div
|
||||
className="social-join-overlay"
|
||||
role="presentation"
|
||||
onClick={(e) => {
|
||||
if (e.target === e.currentTarget && !busy) onClose();
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="social-join-sheet"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby={titleId}
|
||||
>
|
||||
<header className="social-join-sheet-head">
|
||||
<h2 id={titleId}>加群</h2>
|
||||
<button
|
||||
type="button"
|
||||
className="social-join-close"
|
||||
aria-label="关闭"
|
||||
disabled={busy}
|
||||
onClick={onClose}
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</header>
|
||||
<p className="social-muted">
|
||||
加入后可打招呼、约 Coffeechat、进 Meetup。{channelHint}
|
||||
</p>
|
||||
|
||||
<label className="social-join-field">
|
||||
邮箱
|
||||
<input
|
||||
type="email"
|
||||
inputMode="email"
|
||||
autoComplete="email"
|
||||
autoFocus
|
||||
placeholder="you@example.com"
|
||||
value={email}
|
||||
disabled={busy}
|
||||
onChange={(e) => setEmail(e.target.value)}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === "Enter") void submit();
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
{err ? <p className="social-join-err">{err}</p> : null}
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary social-join-submit"
|
||||
disabled={busy}
|
||||
onClick={() => void submit()}
|
||||
>
|
||||
{busy ? "正在拉起支付…" : "确认并支付"}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -9,13 +9,13 @@ export default function MeetupClient() {
|
||||
return (
|
||||
<SiteShell title="Meetup">
|
||||
<section className="social-hero">
|
||||
<div className="social-hero-tag">线上 WebRTC</div>
|
||||
<div className="social-hero-tag">MEETUP</div>
|
||||
<h1>
|
||||
Meetup
|
||||
<br />
|
||||
<span>站内视频房 · 同页文字频道</span>
|
||||
<span>视频房 + 文字频道</span>
|
||||
</h1>
|
||||
<p>全程留在游民社区内体验,不新开标签页。视频与文字可分屏切换。</p>
|
||||
<p>先进房暖场,再开麦认识人。可分屏切换视频与聊天。</p>
|
||||
</section>
|
||||
|
||||
<div className="social-list">
|
||||
|
||||
@ -10,11 +10,12 @@ import { socialPath } from "@social/lib/socialPath";
|
||||
|
||||
type Layout = "split" | "video" | "chat";
|
||||
|
||||
/** Origins currently listed in mirotalk.nomadro.com Caddy frame-ancestors. */
|
||||
/** Origins allowed by MiroTalk ALLOWED_EMBED_ORIGINS (82 本机 mirotalk.nomadro.cn). */
|
||||
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",
|
||||
@ -22,7 +23,16 @@ const EMBED_OK = new Set([
|
||||
]);
|
||||
|
||||
function joinUrl(room: string, name: string) {
|
||||
const q = new URLSearchParams({ room, name });
|
||||
// notify=0: never open MiroTalk "Share the room" popup
|
||||
// chat=0: use portal side chat; keep A/V on for the live room
|
||||
const q = new URLSearchParams({
|
||||
room,
|
||||
name,
|
||||
notify: "0",
|
||||
chat: "0",
|
||||
audio: "1",
|
||||
video: "1",
|
||||
});
|
||||
return `${MIROTALK_URL.replace(/\/$/, "")}/join?${q.toString()}`;
|
||||
}
|
||||
|
||||
@ -31,6 +41,28 @@ function canEmbedHere() {
|
||||
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);
|
||||
}
|
||||
// Warm HTML/JS edge cache (no media) so first iframe paint is faster
|
||||
void fetch(`${origin}/js/nomadro-speed.js`, {
|
||||
mode: "no-cors",
|
||||
credentials: "omit",
|
||||
cache: "force-cache",
|
||||
}).catch(() => undefined);
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
|
||||
export default function MeetupLiveClient({ meetupId }: { meetupId: string }) {
|
||||
const meetup = SEED_MEETUPS.find((m) => m.id === meetupId) || SEED_MEETUPS[0];
|
||||
const channel =
|
||||
@ -43,12 +75,18 @@ export default function MeetupLiveClient({ meetupId }: { meetupId: string }) {
|
||||
|
||||
const [layout, setLayout] = useState<Layout>("split");
|
||||
const [nick, setNick] = useState("游民");
|
||||
/** Frozen at auto-join so nick edits don't remount the iframe. */
|
||||
const [joinName, setJoinName] = useState("");
|
||||
const [text, setText] = useState("");
|
||||
const [messages, setMessages] = useState<SocialChatMessage[]>([]);
|
||||
const [videoReady, setVideoReady] = useState(false);
|
||||
const [embedBlocked, setEmbedBlocked] = useState(false);
|
||||
const [iframeLoading, setIframeLoading] = useState(true);
|
||||
const bottomRef = useRef<HTMLDivElement>(null);
|
||||
const videoSrc = joinUrl(meetup.mirotalkRoom, nick.trim() || "nomadro");
|
||||
const videoSrc = useMemo(
|
||||
() => joinUrl(meetup.mirotalkRoom, joinName || "游民"),
|
||||
[meetup.mirotalkRoom, joinName],
|
||||
);
|
||||
const preferEmbed = canEmbedHere() && !embedBlocked;
|
||||
|
||||
const refresh = useCallback(async () => {
|
||||
@ -68,8 +106,16 @@ export default function MeetupLiveClient({ meetupId }: { meetupId: string }) {
|
||||
}
|
||||
}, [channel.id, seedForRoom, storageKey]);
|
||||
|
||||
// Instant join: hydrate nick → start iframe immediately (no "开始视频" gate)
|
||||
useEffect(() => {
|
||||
setNick(loadJson("nick", "游民"));
|
||||
warmMirotalkOrigin();
|
||||
const name = (loadJson("nick", "游民") || "游民").trim() || "游民";
|
||||
setNick(name);
|
||||
setJoinName(name);
|
||||
if (canEmbedHere()) {
|
||||
setIframeLoading(true);
|
||||
setVideoReady(true);
|
||||
}
|
||||
void refresh();
|
||||
const id = window.setInterval(() => void refresh(), 4000);
|
||||
return () => clearInterval(id);
|
||||
@ -105,6 +151,24 @@ export default function MeetupLiveClient({ meetupId }: { meetupId: string }) {
|
||||
}
|
||||
};
|
||||
|
||||
const startVideo = (forceReload = false) => {
|
||||
const name = nick.trim() || "游民";
|
||||
saveJson("nick", name);
|
||||
setJoinName(name);
|
||||
if (!preferEmbed) {
|
||||
window.location.assign(joinUrl(meetup.mirotalkRoom, name));
|
||||
return;
|
||||
}
|
||||
setIframeLoading(true);
|
||||
if (forceReload && videoReady) {
|
||||
// remount iframe with new name only when user asks
|
||||
setVideoReady(false);
|
||||
window.requestAnimationFrame(() => setVideoReady(true));
|
||||
} else {
|
||||
setVideoReady(true);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="social-root social-live-root">
|
||||
<header className="social-live-bar">
|
||||
@ -119,19 +183,41 @@ export default function MeetupLiveClient({ meetupId }: { meetupId: string }) {
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="social-live-tabs" role="tablist" aria-label="布局">
|
||||
{(["split", "video", "chat"] as const).map((m) => (
|
||||
<div className="social-live-bar-tools">
|
||||
<label className="social-live-nick">
|
||||
<span className="social-muted">昵称</span>
|
||||
<input
|
||||
value={nick}
|
||||
onChange={(e) => setNick(e.target.value)}
|
||||
onBlur={() => saveJson("nick", nick.trim() || "游民")}
|
||||
maxLength={24}
|
||||
aria-label="显示名"
|
||||
/>
|
||||
</label>
|
||||
{videoReady && preferEmbed && nick.trim() && nick.trim() !== joinName ? (
|
||||
<button
|
||||
key={m}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={layout === m}
|
||||
className={`social-live-tab${layout === m ? " active" : ""}`}
|
||||
onClick={() => setLayout(m)}
|
||||
className="social-btn"
|
||||
onClick={() => startVideo(true)}
|
||||
title="用新昵称重进视频"
|
||||
>
|
||||
{m === "split" ? "分屏" : m === "video" ? "视频" : "文字"}
|
||||
重进
|
||||
</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>
|
||||
|
||||
@ -143,53 +229,51 @@ export default function MeetupLiveClient({ meetupId }: { meetupId: string }) {
|
||||
<h2>进入视频房间</h2>
|
||||
<p>
|
||||
{preferEmbed
|
||||
? "在站内嵌打开,不新开标签页。请允许摄像头 / 麦克风。"
|
||||
: "当前域名未在视频 CSP 白名单,将在本页跳转进入(不新开标签)。浏览器返回即可回到社区。"}
|
||||
? "正在准备极速进房…"
|
||||
: "当前域名未在视频 CSP 白名单,将在本页跳转进入(不新开标签)。"}
|
||||
</p>
|
||||
<label>
|
||||
显示名
|
||||
<input
|
||||
value={nick}
|
||||
onChange={(e) => setNick(e.target.value)}
|
||||
maxLength={24}
|
||||
/>
|
||||
</label>
|
||||
<button
|
||||
type="button"
|
||||
className="social-btn primary"
|
||||
onClick={() => {
|
||||
const name = nick.trim() || "游民";
|
||||
saveJson("nick", name);
|
||||
const url = joinUrl(meetup.mirotalkRoom, name);
|
||||
if (preferEmbed) {
|
||||
setVideoReady(true);
|
||||
} else {
|
||||
window.location.assign(url);
|
||||
}
|
||||
}}
|
||||
onClick={() => startVideo()}
|
||||
>
|
||||
开始视频
|
||||
立即进入
|
||||
</button>
|
||||
</div>
|
||||
) : preferEmbed ? (
|
||||
<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"
|
||||
onError={() => setEmbedBlocked(true)}
|
||||
/>
|
||||
<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>
|
||||
<h2>本页跳转进房</h2>
|
||||
<p>不新开标签;浏览器返回即可回到游民社区。</p>
|
||||
<button
|
||||
type="button"
|
||||
className="social-btn primary"
|
||||
onClick={() => window.location.assign(videoSrc)}
|
||||
>
|
||||
继续进入
|
||||
立即进入
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@ -44,14 +44,15 @@ export default function ParticleCanvas() {
|
||||
|
||||
const create = () => {
|
||||
const w = window.innerWidth;
|
||||
const count = Math.min(Math.floor(w / 40), 28);
|
||||
const dense = document.querySelector(".social-fx") != null;
|
||||
const count = Math.min(Math.floor(w / (dense ? 14 : 40)), dense ? 90 : 28);
|
||||
particles = Array.from({ length: count }, () => ({
|
||||
x: Math.random() * w,
|
||||
y: Math.random() * window.innerHeight,
|
||||
size: Math.random() * 2 + 0.5,
|
||||
speedX: (Math.random() - 0.5) * 0.22,
|
||||
speedY: (Math.random() - 0.5) * 0.22,
|
||||
opacity: Math.random() * 0.35 + 0.08,
|
||||
size: Math.random() * (dense ? 3.2 : 2) + (dense ? 1 : 0.5),
|
||||
speedX: (Math.random() - 0.5) * (dense ? 0.45 : 0.22),
|
||||
speedY: (Math.random() - 0.5) * (dense ? 0.45 : 0.22),
|
||||
opacity: Math.random() * (dense ? 0.55 : 0.35) + (dense ? 0.18 : 0.08),
|
||||
hue: [0, 45, 170, 280][Math.floor(Math.random() * 4)],
|
||||
}));
|
||||
};
|
||||
@ -100,9 +101,9 @@ export default function ParticleCanvas() {
|
||||
};
|
||||
|
||||
const ric = window.requestIdleCallback
|
||||
? window.requestIdleCallback(() => start(), { timeout: 1800 })
|
||||
? window.requestIdleCallback(() => start(), { timeout: 600 })
|
||||
: 0;
|
||||
const fallback = window.setTimeout(start, 400);
|
||||
const fallback = window.setTimeout(start, 120);
|
||||
|
||||
window.addEventListener("resize", onResize, { passive: true });
|
||||
document.addEventListener("visibilitychange", onVis);
|
||||
|
||||
31
src/modules/social/components/SectionSpark.tsx
Normal file
31
src/modules/social/components/SectionSpark.tsx
Normal file
@ -0,0 +1,31 @@
|
||||
"use client";
|
||||
|
||||
/** Decorative SVG spark behind section titles */
|
||||
export default function SectionSpark({
|
||||
label,
|
||||
}: {
|
||||
label: string;
|
||||
}) {
|
||||
return (
|
||||
<div className="social-section-spark" aria-hidden>
|
||||
<svg viewBox="0 0 220 48" className="social-section-spark-svg">
|
||||
<defs>
|
||||
<linearGradient id={`spark-${label}`} x1="0" y1="0" x2="1" y2="1">
|
||||
<stop offset="0%" stopColor="#ff6b6b" />
|
||||
<stop offset="50%" stopColor="#ffe66d" />
|
||||
<stop offset="100%" stopColor="#4ecdc4" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<path
|
||||
d="M8 24 C40 4, 80 44, 110 24 S180 4, 212 24"
|
||||
fill="none"
|
||||
stroke={`url(#spark-${label})`}
|
||||
strokeWidth="2"
|
||||
strokeLinecap="round"
|
||||
className="social-spark-path"
|
||||
/>
|
||||
<circle cx="110" cy="24" r="4" fill="#ffe66d" className="social-spark-dot" />
|
||||
</svg>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -3,13 +3,13 @@
|
||||
import Link from "next/link";
|
||||
import { useEffect, useState, type ReactNode } from "react";
|
||||
import { socialPath } from "@social/lib/socialPath";
|
||||
import { applySocialSkin, SOCIAL_SKIN_DEFAULT } from "@social/lib/skin";
|
||||
|
||||
const GROUPS = [
|
||||
{
|
||||
id: "online",
|
||||
label: "线上",
|
||||
items: [
|
||||
{ href: "/join", label: "加群" },
|
||||
{ href: "/chat", label: "聊天室" },
|
||||
{ href: "/meetup", label: "Meetup" },
|
||||
],
|
||||
@ -27,10 +27,10 @@ const GROUPS = [
|
||||
id: "grow",
|
||||
label: "成长",
|
||||
items: [
|
||||
{ href: "/team", label: "远程团队" },
|
||||
{ href: "/vip", label: "VIP" },
|
||||
{ href: "/ebook", label: "小册" },
|
||||
{ href: "/videos", label: "视频" },
|
||||
{ href: "/gigs", label: "兼职" },
|
||||
{ href: "/feedback", label: "反馈" },
|
||||
],
|
||||
},
|
||||
@ -40,17 +40,21 @@ export default function SiteShell({
|
||||
children,
|
||||
title,
|
||||
home = false,
|
||||
onJoin,
|
||||
}: {
|
||||
children: ReactNode;
|
||||
title?: string;
|
||||
/** 首页自带 hero 顶距,不再套 social-main */
|
||||
home?: boolean;
|
||||
onJoin?: () => void;
|
||||
}) {
|
||||
const [theme, setTheme] = useState<"dark" | "light">("dark");
|
||||
const [openGroup, setOpenGroup] = useState<string | null>(null);
|
||||
const [menuOpen, setMenuOpen] = useState(false);
|
||||
const [scrolled, setScrolled] = useState(false);
|
||||
const [mounted, setMounted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setMounted(true);
|
||||
const saved =
|
||||
localStorage.getItem("nomadro-theme") || localStorage.getItem("nomad-theme");
|
||||
const next = saved === "light" ? "light" : "dark";
|
||||
@ -58,15 +62,22 @@ export default function SiteShell({
|
||||
document.documentElement.setAttribute("data-theme", next);
|
||||
document.documentElement.classList.toggle("light", next === "light");
|
||||
document.documentElement.classList.toggle("dark", next === "dark");
|
||||
applySocialSkin(SOCIAL_SKIN_DEFAULT);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
const onScroll = () => setScrolled(window.scrollY > 24);
|
||||
onScroll();
|
||||
window.addEventListener("scroll", onScroll, { passive: true });
|
||||
return () => window.removeEventListener("scroll", onScroll);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
document.body.style.overflow = menuOpen ? "hidden" : "";
|
||||
return () => {
|
||||
document.body.style.overflow = "";
|
||||
};
|
||||
}, [menuOpen]);
|
||||
|
||||
const toggleTheme = () => {
|
||||
const next = theme === "dark" ? "light" : "dark";
|
||||
setTheme(next);
|
||||
@ -76,21 +87,50 @@ export default function SiteShell({
|
||||
document.documentElement.classList.toggle("dark", next === "dark");
|
||||
};
|
||||
|
||||
const closeMenus = () => {
|
||||
setMenuOpen(false);
|
||||
setOpenGroup(null);
|
||||
};
|
||||
|
||||
const joinBtn = onJoin ? (
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary btn-sm"
|
||||
onClick={() => {
|
||||
closeMenus();
|
||||
onJoin();
|
||||
}}
|
||||
>
|
||||
加群
|
||||
</button>
|
||||
) : (
|
||||
<Link href={socialPath("/join")} className="btn btn-primary btn-sm" onClick={closeMenus}>
|
||||
加群
|
||||
</Link>
|
||||
);
|
||||
|
||||
const nav = (
|
||||
<nav className={`navbar${scrolled ? " scrolled" : ""}`} aria-label="游民社区">
|
||||
<nav
|
||||
className={`navbar${mounted && scrolled ? " scrolled" : ""}`}
|
||||
aria-label="游民社区"
|
||||
>
|
||||
<div className="nav-container">
|
||||
<Link href={socialPath("/")} className="nav-logo">
|
||||
<span className="logo-icon">💬</span>
|
||||
<Link href={socialPath("/")} className="nav-logo" onClick={closeMenus}>
|
||||
<span className="logo-icon">◈</span>
|
||||
<span className="logo-text">{title || "游民社区"}</span>
|
||||
</Link>
|
||||
|
||||
<div className="nav-links">
|
||||
<div className={`nav-links${menuOpen ? " open" : ""}`}>
|
||||
{GROUPS.map((g) => (
|
||||
<div
|
||||
key={g.id}
|
||||
className={`nav-group${openGroup === g.id ? " open" : ""}`}
|
||||
onMouseEnter={() => setOpenGroup(g.id)}
|
||||
onMouseLeave={() => setOpenGroup(null)}
|
||||
onMouseEnter={() => {
|
||||
if (window.matchMedia("(min-width: 769px)").matches) setOpenGroup(g.id);
|
||||
}}
|
||||
onMouseLeave={() => {
|
||||
if (window.matchMedia("(min-width: 769px)").matches) setOpenGroup(null);
|
||||
}}
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
@ -99,15 +139,16 @@ export default function SiteShell({
|
||||
onClick={() => setOpenGroup(openGroup === g.id ? null : g.id)}
|
||||
>
|
||||
{g.label}
|
||||
<span aria-hidden>▾</span>
|
||||
<span className="nav-group-caret" aria-hidden>
|
||||
▾
|
||||
</span>
|
||||
</button>
|
||||
<div className="nav-dropdown">
|
||||
<div className="nav-group-panel">
|
||||
{g.items.map((item) => (
|
||||
<Link
|
||||
key={item.href}
|
||||
href={socialPath(item.href)}
|
||||
className="nav-dropdown-link"
|
||||
onClick={() => setOpenGroup(null)}
|
||||
onClick={closeMenus}
|
||||
>
|
||||
{item.label}
|
||||
</Link>
|
||||
@ -115,21 +156,47 @@ export default function SiteShell({
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
<div className="nav-mobile-extras">
|
||||
{joinBtn}
|
||||
<Link href="/" className="btn btn-ghost btn-sm" onClick={closeMenus}>
|
||||
门户
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="nav-actions">
|
||||
<button type="button" className="nav-icon-btn" onClick={toggleTheme} aria-label="切换主题">
|
||||
{theme === "dark" ? "🌙" : "☀️"}
|
||||
<button
|
||||
type="button"
|
||||
className="nav-icon-btn"
|
||||
onClick={toggleTheme}
|
||||
aria-label="切换明暗"
|
||||
suppressHydrationWarning
|
||||
>
|
||||
{!mounted || theme === "dark" ? "🌙" : "☀️"}
|
||||
</button>
|
||||
<Link href={socialPath("/chat")} className="nav-icon-btn" aria-label="聊天室">
|
||||
✉️
|
||||
<Link
|
||||
href={socialPath("/chat")}
|
||||
className="nav-icon-btn"
|
||||
aria-label="聊天室"
|
||||
onClick={closeMenus}
|
||||
>
|
||||
◎
|
||||
</Link>
|
||||
<Link href={socialPath("/join")} className="btn btn-primary btn-sm">
|
||||
加群
|
||||
</Link>
|
||||
<Link href="/" className="btn btn-ghost btn-sm">
|
||||
<span className="social-nav-desktop-cta">{joinBtn}</span>
|
||||
<Link href="/" className="btn btn-ghost btn-sm social-nav-desktop-cta">
|
||||
门户
|
||||
</Link>
|
||||
<button
|
||||
type="button"
|
||||
className={`mobile-menu-btn${menuOpen ? " open" : ""}`}
|
||||
onClick={() => setMenuOpen((v) => !v)}
|
||||
aria-label="菜单"
|
||||
aria-expanded={menuOpen}
|
||||
>
|
||||
<span />
|
||||
<span />
|
||||
<span />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
210
src/modules/social/components/SocialOrbitScene.tsx
Normal file
210
src/modules/social/components/SocialOrbitScene.tsx
Normal file
@ -0,0 +1,210 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useRef } from "react";
|
||||
|
||||
/**
|
||||
* Three.js 游民轨道球:线框地球 + 粒子轨道 + 漂浮 emoji 精灵。
|
||||
* 尊重 prefers-reduced-motion;不可见时暂停。
|
||||
*/
|
||||
export default function SocialOrbitScene() {
|
||||
const mountRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const mount = mountRef.current;
|
||||
if (!mount) return;
|
||||
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
||||
|
||||
let disposed = false;
|
||||
let raf = 0;
|
||||
let renderer: import("three").WebGLRenderer | null = null;
|
||||
let scene: import("three").Scene | null = null;
|
||||
let camera: import("three").PerspectiveCamera | null = null;
|
||||
let group: import("three").Group | null = null;
|
||||
let sprites: import("three").Sprite[] = [];
|
||||
let running = true;
|
||||
|
||||
const boot = async () => {
|
||||
const THREE = await import("three");
|
||||
if (disposed || !mount) return;
|
||||
|
||||
const w = mount.clientWidth || 360;
|
||||
const h = mount.clientHeight || 360;
|
||||
|
||||
scene = new THREE.Scene();
|
||||
camera = new THREE.PerspectiveCamera(42, w / h, 0.1, 100);
|
||||
camera.position.set(0, 0.35, 4.2);
|
||||
|
||||
renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true });
|
||||
renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 1.75));
|
||||
renderer.setSize(w, h);
|
||||
renderer.setClearColor(0x000000, 0);
|
||||
mount.appendChild(renderer.domElement);
|
||||
|
||||
group = new THREE.Group();
|
||||
scene.add(group);
|
||||
|
||||
const globe = new THREE.Mesh(
|
||||
new THREE.IcosahedronGeometry(1.15, 2),
|
||||
new THREE.MeshBasicMaterial({
|
||||
color: 0x4ecdc4,
|
||||
wireframe: true,
|
||||
transparent: true,
|
||||
opacity: 0.45,
|
||||
}),
|
||||
);
|
||||
group.add(globe);
|
||||
|
||||
const ring = new THREE.Mesh(
|
||||
new THREE.TorusGeometry(1.55, 0.018, 12, 96),
|
||||
new THREE.MeshBasicMaterial({
|
||||
color: 0xff6b6b,
|
||||
transparent: true,
|
||||
opacity: 0.7,
|
||||
}),
|
||||
);
|
||||
ring.rotation.x = Math.PI / 2.4;
|
||||
group.add(ring);
|
||||
|
||||
const ring2 = ring.clone();
|
||||
ring2.rotation.x = Math.PI / 1.7;
|
||||
ring2.material = new THREE.MeshBasicMaterial({
|
||||
color: 0xffe66d,
|
||||
transparent: true,
|
||||
opacity: 0.55,
|
||||
});
|
||||
group.add(ring2);
|
||||
|
||||
const pointsGeo = new THREE.BufferGeometry();
|
||||
const count = 140;
|
||||
const pos = new Float32Array(count * 3);
|
||||
for (let i = 0; i < count; i++) {
|
||||
const r = 1.9 + Math.random() * 0.7;
|
||||
const th = Math.random() * Math.PI * 2;
|
||||
const ph = Math.acos(2 * Math.random() - 1);
|
||||
pos[i * 3] = r * Math.sin(ph) * Math.cos(th);
|
||||
pos[i * 3 + 1] = r * Math.sin(ph) * Math.sin(th);
|
||||
pos[i * 3 + 2] = r * Math.cos(ph);
|
||||
}
|
||||
pointsGeo.setAttribute("position", new THREE.BufferAttribute(pos, 3));
|
||||
group.add(
|
||||
new THREE.Points(
|
||||
pointsGeo,
|
||||
new THREE.PointsMaterial({
|
||||
color: 0xa78bfa,
|
||||
size: 0.035,
|
||||
transparent: true,
|
||||
opacity: 0.85,
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
const emojis = ["✈️", "🌏", "☕", "💬", "💻", "🌅", "🎒", "📡"];
|
||||
const makeEmojiTexture = (emoji: string) => {
|
||||
const c = document.createElement("canvas");
|
||||
c.width = 128;
|
||||
c.height = 128;
|
||||
const ctx = c.getContext("2d");
|
||||
if (!ctx) return null;
|
||||
ctx.clearRect(0, 0, 128, 128);
|
||||
ctx.font = "80px serif";
|
||||
ctx.textAlign = "center";
|
||||
ctx.textBaseline = "middle";
|
||||
ctx.fillText(emoji, 64, 70);
|
||||
const tex = new THREE.CanvasTexture(c);
|
||||
tex.colorSpace = THREE.SRGBColorSpace;
|
||||
return tex;
|
||||
};
|
||||
|
||||
sprites = [];
|
||||
emojis.forEach((emoji, i) => {
|
||||
const tex = makeEmojiTexture(emoji);
|
||||
if (!tex) return;
|
||||
const mat = new THREE.SpriteMaterial({
|
||||
map: tex,
|
||||
transparent: true,
|
||||
depthWrite: false,
|
||||
});
|
||||
const spr = new THREE.Sprite(mat);
|
||||
const a = (i / emojis.length) * Math.PI * 2;
|
||||
spr.position.set(Math.cos(a) * 2.1, Math.sin(a * 1.3) * 0.55, Math.sin(a) * 2.1);
|
||||
spr.scale.set(0.38, 0.38, 0.38);
|
||||
group!.add(spr);
|
||||
sprites.push(spr);
|
||||
});
|
||||
|
||||
const light = new THREE.AmbientLight(0xffffff, 1);
|
||||
scene.add(light);
|
||||
|
||||
const clock = new THREE.Clock();
|
||||
const tick = () => {
|
||||
if (disposed || !renderer || !scene || !camera || !group) return;
|
||||
if (running) {
|
||||
const t = clock.getElapsedTime();
|
||||
group.rotation.y = t * 0.28;
|
||||
group.rotation.x = Math.sin(t * 0.35) * 0.12;
|
||||
ring.rotation.z = t * 0.4;
|
||||
ring2.rotation.z = -t * 0.25;
|
||||
sprites.forEach((s, i) => {
|
||||
s.position.y = Math.sin(t * 1.2 + i) * 0.35 + Math.cos(i) * 0.2;
|
||||
});
|
||||
renderer.render(scene, camera);
|
||||
}
|
||||
raf = requestAnimationFrame(tick);
|
||||
};
|
||||
tick();
|
||||
|
||||
const onResize = () => {
|
||||
if (!renderer || !camera || !mount) return;
|
||||
const nw = mount.clientWidth || 360;
|
||||
const nh = mount.clientHeight || 360;
|
||||
camera.aspect = nw / nh;
|
||||
camera.updateProjectionMatrix();
|
||||
renderer.setSize(nw, nh);
|
||||
};
|
||||
window.addEventListener("resize", onResize, { passive: true });
|
||||
|
||||
const io = new IntersectionObserver(
|
||||
([entry]) => {
|
||||
running = Boolean(entry?.isIntersecting) && document.visibilityState === "visible";
|
||||
},
|
||||
{ threshold: 0.05 },
|
||||
);
|
||||
io.observe(mount);
|
||||
|
||||
const onVis = () => {
|
||||
running = document.visibilityState === "visible";
|
||||
};
|
||||
document.addEventListener("visibilitychange", onVis);
|
||||
|
||||
(mount as HTMLDivElement & { __cleanup?: () => void }).__cleanup = () => {
|
||||
window.removeEventListener("resize", onResize);
|
||||
document.removeEventListener("visibilitychange", onVis);
|
||||
io.disconnect();
|
||||
};
|
||||
};
|
||||
|
||||
void boot();
|
||||
|
||||
return () => {
|
||||
disposed = true;
|
||||
cancelAnimationFrame(raf);
|
||||
const cleanup = (mount as HTMLDivElement & { __cleanup?: () => void }).__cleanup;
|
||||
cleanup?.();
|
||||
if (renderer) {
|
||||
renderer.dispose();
|
||||
if (renderer.domElement.parentNode === mount) {
|
||||
mount.removeChild(renderer.domElement);
|
||||
}
|
||||
}
|
||||
scene?.traverse((obj) => {
|
||||
const mesh = obj as import("three").Mesh;
|
||||
if (mesh.geometry) mesh.geometry.dispose();
|
||||
const mat = mesh.material as import("three").Material | import("three").Material[];
|
||||
if (Array.isArray(mat)) mat.forEach((m) => m.dispose());
|
||||
else mat?.dispose?.();
|
||||
});
|
||||
};
|
||||
}, []);
|
||||
|
||||
return <div className="social-orbit-scene" ref={mountRef} aria-hidden />;
|
||||
}
|
||||
161
src/modules/social/components/TeamClient.tsx
Normal file
161
src/modules/social/components/TeamClient.tsx
Normal file
@ -0,0 +1,161 @@
|
||||
"use client";
|
||||
|
||||
import { useMemo, useState } from "react";
|
||||
import SiteShell from "./SiteShell";
|
||||
import { socialApi } from "@social/lib/api";
|
||||
import { SEED_GIGS, TEAM_KIND_LABEL } from "@social/lib/seed";
|
||||
import { loadJson, saveJson, uid } from "@social/lib/storage";
|
||||
import type { SocialTeamKind } from "@social/lib/types";
|
||||
|
||||
type Application = {
|
||||
id: string;
|
||||
gigId: string;
|
||||
name: string;
|
||||
contact: string;
|
||||
note: string;
|
||||
at: string;
|
||||
};
|
||||
|
||||
const TABS: { id: SocialTeamKind | "all"; label: string }[] = [
|
||||
{ id: "all", label: "全部" },
|
||||
{ id: "volunteer", label: "志愿者" },
|
||||
{ id: "parttime", label: "兼职" },
|
||||
{ id: "fulltime", label: "全职" },
|
||||
];
|
||||
|
||||
export default function TeamClient({
|
||||
initialKind = "all",
|
||||
}: {
|
||||
initialKind?: SocialTeamKind | "all";
|
||||
}) {
|
||||
const [tab, setTab] = useState<SocialTeamKind | "all">(initialKind);
|
||||
const roles = useMemo(() => {
|
||||
if (tab === "all") return SEED_GIGS;
|
||||
return SEED_GIGS.filter((g) => (g.kind || "parttime") === tab);
|
||||
}, [tab]);
|
||||
|
||||
const [gigId, setGigId] = useState(roles[0]?.id || SEED_GIGS[0]?.id || "");
|
||||
const [name, setName] = useState("");
|
||||
const [contact, setContact] = useState("");
|
||||
const [note, setNote] = useState("");
|
||||
const [ok, setOk] = useState("");
|
||||
|
||||
const active = SEED_GIGS.find((g) => g.id === gigId) || roles[0];
|
||||
|
||||
const selectTab = (next: SocialTeamKind | "all") => {
|
||||
setTab(next);
|
||||
setOk("");
|
||||
const list =
|
||||
next === "all" ? SEED_GIGS : SEED_GIGS.filter((g) => (g.kind || "parttime") === next);
|
||||
if (list[0]) setGigId(list[0].id);
|
||||
};
|
||||
|
||||
const apply = async () => {
|
||||
if (!gigId || !name.trim() || !contact.trim()) return;
|
||||
const payload = {
|
||||
name: name.trim(),
|
||||
contact: contact.trim(),
|
||||
note: note.trim(),
|
||||
};
|
||||
try {
|
||||
await socialApi.applyGig(gigId, payload);
|
||||
setOk("已同步到游民社区独立库。");
|
||||
} catch {
|
||||
const list = loadJson<Application[]>("gig-apps", []);
|
||||
const item: Application = {
|
||||
id: uid("app"),
|
||||
gigId,
|
||||
...payload,
|
||||
at: new Date().toISOString(),
|
||||
};
|
||||
saveJson("gig-apps", [item, ...list]);
|
||||
setOk("后端暂不可用,申请已先存本机。");
|
||||
}
|
||||
setNote("");
|
||||
};
|
||||
|
||||
return (
|
||||
<SiteShell title="远程团队">
|
||||
<section className="social-hero">
|
||||
<div className="social-hero-tag">TEAM</div>
|
||||
<h1>
|
||||
远程团队
|
||||
<br />
|
||||
<span>志愿者 · 兼职 · 全职</span>
|
||||
</h1>
|
||||
<p>先看人、再投递。可远程协作,群里也能问内推。</p>
|
||||
</section>
|
||||
|
||||
<div className="social-team-tabs" role="tablist" aria-label="岗位类型">
|
||||
{TABS.map((t) => (
|
||||
<button
|
||||
key={t.id}
|
||||
type="button"
|
||||
role="tab"
|
||||
aria-selected={tab === t.id}
|
||||
className={`social-team-tab${tab === t.id ? " active" : ""}`}
|
||||
onClick={() => selectTab(t.id)}
|
||||
>
|
||||
{t.label}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="social-list" style={{ marginTop: 14 }}>
|
||||
{roles.length === 0 ? (
|
||||
<p className="social-muted">该分类暂无岗位。</p>
|
||||
) : (
|
||||
roles.map((g) => (
|
||||
<button
|
||||
key={g.id}
|
||||
type="button"
|
||||
className={`social-list-item social-card-btn${g.id === gigId ? " active" : ""}`}
|
||||
onClick={() => setGigId(g.id)}
|
||||
>
|
||||
<div>
|
||||
<strong>{g.title}</strong>
|
||||
<p>
|
||||
{TEAM_KIND_LABEL[g.kind || "parttime"]} · {g.role} · {g.pay} ·{" "}
|
||||
{g.remote ? "远程" : "驻场 / 混合"}
|
||||
</p>
|
||||
<p className="social-muted">{g.tags.join(" · ")}</p>
|
||||
</div>
|
||||
</button>
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
|
||||
{active ? (
|
||||
<section className="social-panel" style={{ marginTop: 20 }}>
|
||||
<h2>投递 · {active.title}</h2>
|
||||
<p className="social-muted" style={{ marginTop: 4 }}>
|
||||
{TEAM_KIND_LABEL[active.kind || "parttime"]} · {active.pay}
|
||||
</p>
|
||||
<div className="social-form">
|
||||
<label>
|
||||
姓名
|
||||
<input value={name} onChange={(e) => setName(e.target.value)} maxLength={64} />
|
||||
</label>
|
||||
<label>
|
||||
联系方式
|
||||
<input
|
||||
value={contact}
|
||||
onChange={(e) => setContact(e.target.value)}
|
||||
placeholder="微信 / 手机 / 邮箱"
|
||||
maxLength={120}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
自我介绍 / 作品链接
|
||||
<textarea rows={3} value={note} onChange={(e) => setNote(e.target.value)} maxLength={2000} />
|
||||
</label>
|
||||
<button type="button" className="social-btn primary" onClick={() => void apply()}>
|
||||
提交申请
|
||||
</button>
|
||||
{ok ? <p className="social-muted">{ok}</p> : null}
|
||||
</div>
|
||||
</section>
|
||||
) : null}
|
||||
</SiteShell>
|
||||
);
|
||||
}
|
||||
@ -40,8 +40,21 @@ async function req<T>(
|
||||
return (await res.json()) as T;
|
||||
}
|
||||
|
||||
export type SocialRealtimeToken = {
|
||||
ok: boolean;
|
||||
enabled: boolean;
|
||||
wsUrl: string;
|
||||
token: string;
|
||||
channel: string;
|
||||
};
|
||||
|
||||
export const socialApi = {
|
||||
health: () => req<{ ok: boolean; isolated?: boolean }>("/health"),
|
||||
health: () => req<{ ok: boolean; isolated?: boolean; centrifugo?: boolean }>("/health"),
|
||||
|
||||
realtimeToken: (channelId: string) =>
|
||||
req<SocialRealtimeToken>(
|
||||
`/realtime/token?channel_id=${encodeURIComponent(channelId)}`,
|
||||
),
|
||||
|
||||
listMessages: (channelId: string) =>
|
||||
req<{ items: Array<{ id: string; channelId: string; author: string; text: string; at: string; guestId?: string }> }>(
|
||||
|
||||
@ -120,14 +120,14 @@ export const SOCIAL_SECTIONS: SocialSection[] = [
|
||||
{
|
||||
id: "ops",
|
||||
title: "远程团队",
|
||||
subtitle: "招募 · 反馈",
|
||||
subtitle: "志愿者 · 兼职 · 全职 · 反馈",
|
||||
features: [
|
||||
{
|
||||
id: "gigs",
|
||||
id: "team",
|
||||
emoji: "🧑💻",
|
||||
title: "招募兼职",
|
||||
desc: "运营 / 拍摄助理 · 大学生兼职",
|
||||
href: "/gigs",
|
||||
title: "远程团队",
|
||||
desc: "招募志愿者 / 兼职 / 全职",
|
||||
href: "/team",
|
||||
status: "live",
|
||||
},
|
||||
{
|
||||
|
||||
66
src/modules/social/lib/realtime.ts
Normal file
66
src/modules/social/lib/realtime.ts
Normal file
@ -0,0 +1,66 @@
|
||||
"use client";
|
||||
|
||||
import { Centrifuge, type Subscription } from "centrifuge";
|
||||
import { socialApi, type SocialRealtimeToken } from "./api";
|
||||
import type { SocialChatMessage } from "./types";
|
||||
|
||||
export type ChatPublicationHandler = (msg: SocialChatMessage) => void;
|
||||
|
||||
/**
|
||||
* 连接 Centrifugo 订阅频道;失败返回 null(调用方继续轮询)。
|
||||
*/
|
||||
export async function connectChatRealtime(
|
||||
channelId: string,
|
||||
onMessage: ChatPublicationHandler,
|
||||
): Promise<{ disconnect: () => void } | null> {
|
||||
let info: SocialRealtimeToken;
|
||||
try {
|
||||
info = await socialApi.realtimeToken(channelId);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
if (!info?.ok || !info.token || !info.wsUrl) return null;
|
||||
|
||||
const client = new Centrifuge(info.wsUrl, { token: info.token });
|
||||
let sub: Subscription | null = null;
|
||||
|
||||
const handlePub = (ctx: { data?: unknown }) => {
|
||||
const data = ctx?.data as
|
||||
| { type?: string; message?: SocialChatMessage }
|
||||
| undefined;
|
||||
if (!data || data.type !== "chat.message" || !data.message?.id) return;
|
||||
onMessage({
|
||||
id: data.message.id,
|
||||
channelId: data.message.channelId || channelId,
|
||||
author: data.message.author || "游民",
|
||||
text: data.message.text || "",
|
||||
at: data.message.at || new Date().toISOString(),
|
||||
mine: Boolean(data.message.mine),
|
||||
});
|
||||
};
|
||||
|
||||
try {
|
||||
sub = client.newSubscription(info.channel);
|
||||
sub.on("publication", handlePub);
|
||||
sub.subscribe();
|
||||
client.connect();
|
||||
} catch {
|
||||
try {
|
||||
client.disconnect();
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
disconnect: () => {
|
||||
try {
|
||||
sub?.unsubscribe();
|
||||
client.disconnect();
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
183
src/modules/social/lib/rosterMock.ts
Normal file
183
src/modules/social/lib/rosterMock.ts
Normal file
@ -0,0 +1,183 @@
|
||||
/** 首页花名册 mock — 在线状态 / 想认识 / 可互动 */
|
||||
|
||||
export type SocialRosterMember = {
|
||||
id: string;
|
||||
name: string;
|
||||
title: string;
|
||||
city: string;
|
||||
tags: string[];
|
||||
avatar: string;
|
||||
bio: string;
|
||||
vibe: string;
|
||||
online: boolean;
|
||||
lookingFor: string;
|
||||
gender: "f" | "m";
|
||||
};
|
||||
|
||||
export const MOCK_ROSTER: SocialRosterMember[] = [
|
||||
{
|
||||
id: "m01",
|
||||
name: "林悦",
|
||||
title: "独立设计师",
|
||||
city: "清迈 · Nimman",
|
||||
tags: ["咖啡局", "设计", "日出"],
|
||||
avatar: "https://randomuser.me/api/portraits/women/65.jpg",
|
||||
bio: "喜欢把 cowork 聊成真实见面。周末常去 Graph Table。",
|
||||
vibe: "温柔 · 有品味",
|
||||
online: true,
|
||||
lookingFor: "想认识会拍照的远程伙伴",
|
||||
gender: "f",
|
||||
},
|
||||
{
|
||||
id: "m02",
|
||||
name: "Ethan",
|
||||
title: "全栈 / SaaS",
|
||||
city: "里斯本",
|
||||
tags: ["Next.js", "夜跑", "冲浪"],
|
||||
avatar: "https://randomuser.me/api/portraits/men/32.jpg",
|
||||
bio: "白天写代码,傍晚海边。欢迎 Coffeechat 聊产品。",
|
||||
vibe: "阳光 · 靠谱",
|
||||
online: true,
|
||||
lookingFor: "找联创 / 一起做副业",
|
||||
gender: "m",
|
||||
},
|
||||
{
|
||||
id: "m03",
|
||||
name: "苏晴",
|
||||
title: "内容创业者",
|
||||
city: "巴厘岛 · Canggu",
|
||||
tags: ["Vlog", "瑜伽", "出海"],
|
||||
avatar: "https://randomuser.me/api/portraits/women/44.jpg",
|
||||
bio: "镜头前很活泼,线下更爱深度聊天。",
|
||||
vibe: "活力",
|
||||
online: false,
|
||||
lookingFor: "想认识同频创作者",
|
||||
gender: "f",
|
||||
},
|
||||
{
|
||||
id: "m04",
|
||||
name: "Ken",
|
||||
title: "产品经理",
|
||||
city: "东京 / 远程",
|
||||
tags: ["B2B", "胶片", "拉面"],
|
||||
avatar: "https://randomuser.me/api/portraits/men/75.jpg",
|
||||
bio: "时差玩家。Meetup 控场很稳,私下爱胶片机。",
|
||||
vibe: "干净 · 有梗",
|
||||
online: true,
|
||||
lookingFor: "想找一起探索城市的人",
|
||||
gender: "m",
|
||||
},
|
||||
{
|
||||
id: "m05",
|
||||
name: "Mia",
|
||||
title: "增长黑客",
|
||||
city: "曼谷",
|
||||
tags: ["增长", "夜市", "泰语"],
|
||||
avatar: "https://randomuser.me/api/portraits/women/68.jpg",
|
||||
bio: "把增长聊成故事。欢迎约路边摊。",
|
||||
vibe: "聪明 · 飒",
|
||||
online: true,
|
||||
lookingFor: "找一起搞出海的搭档",
|
||||
gender: "f",
|
||||
},
|
||||
{
|
||||
id: "m06",
|
||||
name: "阿杰",
|
||||
title: "独立开发者",
|
||||
city: "成都 → 清迈",
|
||||
tags: ["Flutter", "火锅", "副业"],
|
||||
avatar: "https://randomuser.me/api/portraits/men/52.jpg",
|
||||
bio: "刚到东南亚第三周,想认识本地局朋友。",
|
||||
vibe: "真诚 · 幽默",
|
||||
online: false,
|
||||
lookingFor: "想找 cowork 搭子",
|
||||
gender: "m",
|
||||
},
|
||||
{
|
||||
id: "m07",
|
||||
name: "Nora",
|
||||
title: "摄影师",
|
||||
city: "大城 / 曼谷",
|
||||
tags: ["旅拍", "胶片", "咖啡"],
|
||||
avatar: "https://randomuser.me/api/portraits/women/21.jpg",
|
||||
bio: "擅长拍人。可以帮你拍「游民证件照」。",
|
||||
vibe: "氛围感",
|
||||
online: true,
|
||||
lookingFor: "想认识爱旅行的你",
|
||||
gender: "f",
|
||||
},
|
||||
{
|
||||
id: "m08",
|
||||
name: "Ryan",
|
||||
title: "跨境电商",
|
||||
city: "槟城",
|
||||
tags: ["TikTok", "冲浪", "搞钱"],
|
||||
avatar: "https://randomuser.me/api/portraits/men/22.jpg",
|
||||
bio: "白天看数据,傍晚冲浪。社群里最活跃的那几个之一。",
|
||||
vibe: "热情 · 靠谱",
|
||||
online: true,
|
||||
lookingFor: "找一起搞钱也搞生活的人",
|
||||
gender: "m",
|
||||
},
|
||||
{
|
||||
id: "m09",
|
||||
name: "Iris",
|
||||
title: "UX 研究员",
|
||||
city: "柏林",
|
||||
tags: ["访谈", "市集", "播客"],
|
||||
avatar: "https://randomuser.me/api/portraits/women/33.jpg",
|
||||
bio: "欧洲时区,擅长把陌生人聊成朋友。",
|
||||
vibe: "知性",
|
||||
online: false,
|
||||
lookingFor: "想认识认真做产品的人",
|
||||
gender: "f",
|
||||
},
|
||||
{
|
||||
id: "m10",
|
||||
name: "Leo",
|
||||
title: "AI 工程师",
|
||||
city: "首尔 / 远程",
|
||||
tags: ["Agent", "开源", "咖啡"],
|
||||
avatar: "https://randomuser.me/api/portraits/men/41.jpg",
|
||||
bio: "技术宅但不社恐。Meetup 常客。",
|
||||
vibe: "稳 · 有趣",
|
||||
online: true,
|
||||
lookingFor: "找一起做 AI 副业的人",
|
||||
gender: "m",
|
||||
},
|
||||
{
|
||||
id: "m11",
|
||||
name: "小满",
|
||||
title: "咖啡馆主理人",
|
||||
city: "大理",
|
||||
tags: ["手冲", "音乐会", "徒步"],
|
||||
avatar: "https://randomuser.me/api/portraits/women/90.jpg",
|
||||
bio: "店在古城边。来大理一定请你喝手冲。",
|
||||
vibe: "松弛",
|
||||
online: true,
|
||||
lookingFor: "欢迎路过的游民串门",
|
||||
gender: "f",
|
||||
},
|
||||
{
|
||||
id: "m12",
|
||||
name: "Hugo",
|
||||
title: "游民教练",
|
||||
city: "里斯本",
|
||||
tags: ["签证", "地理套利", "跑步"],
|
||||
avatar: "https://randomuser.me/api/portraits/men/11.jpg",
|
||||
bio: "帮过上百人规划第一站。Coffeechat 从不冷场。",
|
||||
vibe: "温暖",
|
||||
online: false,
|
||||
lookingFor: "想认识想出发的你",
|
||||
gender: "m",
|
||||
},
|
||||
];
|
||||
|
||||
/** 仅演示用,禁止当作真实运营数据展示 */
|
||||
export const SOCIAL_PROOF = {
|
||||
onlineNow: MOCK_ROSTER.filter((m) => m.online).length,
|
||||
members: 1280,
|
||||
meetupsWeek: 6,
|
||||
cities: 42,
|
||||
isDemo: true as const,
|
||||
};
|
||||
@ -5,6 +5,7 @@ import type {
|
||||
SocialEbook,
|
||||
SocialGig,
|
||||
SocialMeetup,
|
||||
SocialTeamKind,
|
||||
SocialVideo,
|
||||
} from "./types";
|
||||
|
||||
@ -161,12 +162,31 @@ export const SEED_EBOOKS: SocialEbook[] = [
|
||||
];
|
||||
|
||||
export const SEED_GIGS: SocialGig[] = [
|
||||
{
|
||||
id: "vol-welcome",
|
||||
title: "新人接待志愿者",
|
||||
role: "志愿者",
|
||||
pay: "公益积分 / 社群徽章",
|
||||
remote: true,
|
||||
kind: "volunteer",
|
||||
tags: ["加群引导", "花名册答疑", "周报"],
|
||||
},
|
||||
{
|
||||
id: "vol-event",
|
||||
title: "线下局志愿者",
|
||||
role: "志愿者",
|
||||
pay: "活动席位优先",
|
||||
remote: false,
|
||||
kind: "volunteer",
|
||||
tags: ["Coffeechat", "合照", "场地协调"],
|
||||
},
|
||||
{
|
||||
id: "ops-assistant",
|
||||
title: "运营 / 拍摄助理",
|
||||
role: "L 大学生兼职",
|
||||
role: "大学生兼职",
|
||||
pay: "按场次结算",
|
||||
remote: true,
|
||||
kind: "parttime",
|
||||
tags: ["拍摄", "剪辑素材", "活动跟场"],
|
||||
},
|
||||
{
|
||||
@ -175,9 +195,44 @@ export const SEED_GIGS: SocialGig[] = [
|
||||
role: "远程兼职",
|
||||
pay: "月度津贴",
|
||||
remote: true,
|
||||
kind: "parttime",
|
||||
tags: ["聊天室", "Meetup 控场"],
|
||||
},
|
||||
{
|
||||
id: "content-pt",
|
||||
title: "内容兼职编辑",
|
||||
role: "远程兼职",
|
||||
pay: "按篇结算",
|
||||
remote: true,
|
||||
kind: "parttime",
|
||||
tags: ["小册", "视频字幕", "社媒"],
|
||||
},
|
||||
{
|
||||
id: "ft-community",
|
||||
title: "社群运营负责人",
|
||||
role: "全职 · 远程优先",
|
||||
pay: "面议 · 季度复盘",
|
||||
remote: true,
|
||||
kind: "fulltime",
|
||||
tags: ["增长", "活动", "花名册"],
|
||||
},
|
||||
{
|
||||
id: "ft-fullstack",
|
||||
title: "全栈工程师",
|
||||
role: "全职 · 远程",
|
||||
pay: "面议",
|
||||
remote: true,
|
||||
kind: "fulltime",
|
||||
tags: ["Next.js", "FastAPI", "小程序"],
|
||||
},
|
||||
];
|
||||
|
||||
export const TEAM_KIND_LABEL: Record<SocialTeamKind, string> = {
|
||||
volunteer: "志愿者",
|
||||
parttime: "兼职",
|
||||
fulltime: "全职",
|
||||
};
|
||||
|
||||
/** Same box as nomadro.cn (82.x). Prefer .cn — avoid .com→107 hop. */
|
||||
export const MIROTALK_URL =
|
||||
process.env.NEXT_PUBLIC_MIROTALK_URL || "https://mirotalk.nomadro.com";
|
||||
process.env.NEXT_PUBLIC_MIROTALK_URL || "https://mirotalk.nomadro.cn";
|
||||
|
||||
32
src/modules/social/lib/skin.ts
Normal file
32
src/modules/social/lib/skin.ts
Normal file
@ -0,0 +1,32 @@
|
||||
/** 游民社区视觉主题:1=现网社区对齐,2=独立自定义 */
|
||||
|
||||
export type SocialSkin = "1" | "2";
|
||||
|
||||
export const SOCIAL_SKIN_KEY = "nomadro-social-skin";
|
||||
export const SOCIAL_SKIN_DEFAULT: SocialSkin = "1";
|
||||
|
||||
export function readSocialSkin(): SocialSkin {
|
||||
if (typeof window === "undefined") return SOCIAL_SKIN_DEFAULT;
|
||||
try {
|
||||
const v = localStorage.getItem(SOCIAL_SKIN_KEY);
|
||||
if (v === "1" || v === "2") return v;
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
return SOCIAL_SKIN_DEFAULT;
|
||||
}
|
||||
|
||||
export function writeSocialSkin(skin: SocialSkin) {
|
||||
try {
|
||||
localStorage.setItem(SOCIAL_SKIN_KEY, skin);
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
if (typeof document !== "undefined") {
|
||||
document.documentElement.setAttribute("data-social-skin", skin);
|
||||
}
|
||||
}
|
||||
|
||||
export function applySocialSkin(skin: SocialSkin) {
|
||||
writeSocialSkin(skin);
|
||||
}
|
||||
@ -64,6 +64,9 @@ export type SocialEbook = {
|
||||
blurb: string;
|
||||
};
|
||||
|
||||
/** 远程团队岗位类型 */
|
||||
export type SocialTeamKind = "volunteer" | "parttime" | "fulltime";
|
||||
|
||||
export type SocialGig = {
|
||||
id: string;
|
||||
title: string;
|
||||
@ -71,6 +74,8 @@ export type SocialGig = {
|
||||
pay: string;
|
||||
remote: boolean;
|
||||
tags: string[];
|
||||
/** 远程团队:志愿者 / 兼职 / 全职 */
|
||||
kind?: SocialTeamKind;
|
||||
};
|
||||
|
||||
export type SocialRosterProfile = {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user