按 Stitch 原稿还原 Home 并初始化三个前端工作区 #36
@@ -4,7 +4,11 @@ on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths-ignore:
|
||||
- 'home/**'
|
||||
- 'dashboard/**'
|
||||
- 'repository/**'
|
||||
- 'package.json'
|
||||
- 'package-lock.json'
|
||||
|
||||
concurrency:
|
||||
group: bedrock-rust-deploy
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/target
|
||||
/bedrock.sqlite3
|
||||
/bedrock.sqlite3-*
|
||||
|
||||
/node_modules/
|
||||
|
||||
@@ -1,159 +0,0 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
@theme inline {
|
||||
--color-background: var(--background);
|
||||
--color-foreground: var(--foreground);
|
||||
--color-primary: var(--primary);
|
||||
--color-primary-foreground: var(--primary-foreground);
|
||||
--color-muted: var(--muted);
|
||||
--color-muted-foreground: var(--muted-foreground);
|
||||
--color-border: var(--border);
|
||||
--color-ring: var(--primary);
|
||||
--color-like: #a33850;
|
||||
}
|
||||
|
||||
:root {
|
||||
--background: #f8f7f2;
|
||||
--foreground: #202923;
|
||||
--primary: #265849;
|
||||
--primary-foreground: #ffffff;
|
||||
--muted: #edf0e8;
|
||||
--muted-foreground: #58665f;
|
||||
--border: #dfe4da;
|
||||
--surface: #fffefa;
|
||||
}
|
||||
|
||||
body {
|
||||
min-height: 100vh;
|
||||
background: var(--background);
|
||||
color: var(--foreground);
|
||||
font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
|
||||
}
|
||||
|
||||
button, summary { cursor: pointer; }
|
||||
:where(button, summary, input):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
|
||||
.site-header { position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--border); background: var(--surface); }
|
||||
.header-inner {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr minmax(13rem, 23rem) auto auto;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
min-height: 68px;
|
||||
max-width: 1480px;
|
||||
margin-inline: auto;
|
||||
padding-inline: clamp(16px, 4vw, 56px);
|
||||
}
|
||||
.brand { display: inline-flex; justify-self: start; align-items: center; gap: 9px; font-size: 23px; font-weight: 800; letter-spacing: -.065em; }
|
||||
.brand-mark { display: inline-grid; width: 34px; height: 34px; place-items: center; border-radius: 10px; color: #f3f3df; background: var(--primary); }
|
||||
.brand-period { margin-left: -7px; color: #578370; }
|
||||
.search { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 0 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--background); color: var(--muted-foreground); }
|
||||
.search > svg { flex: none; }
|
||||
.search input { min-width: 0; width: 100%; height: 39px; padding: 0; background: transparent; color: var(--foreground); font-size: 14px; }
|
||||
.search:focus-within { outline: 2px solid var(--primary); outline-offset: 1px; }
|
||||
.search input:focus-visible { outline: none; }
|
||||
.header-avatar { overflow: hidden; width: 35px; height: 35px; border-radius: 50%; background: var(--muted); }
|
||||
|
||||
.site-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 154px minmax(0, 1fr) minmax(208px, 263px);
|
||||
align-items: start;
|
||||
gap: clamp(18px, 3vw, 46px);
|
||||
max-width: 1480px;
|
||||
margin-inline: auto;
|
||||
padding: 32px clamp(16px, 4vw, 56px) 64px;
|
||||
}
|
||||
.rail, .discovery { position: sticky; top: 100px; }
|
||||
.rail-nav { display: grid; gap: 6px; }
|
||||
.nav-entry { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 0 13px; border-radius: 10px; text-align: left; white-space: nowrap; font-size: 14px; font-weight: 600; }
|
||||
.nav-entry:hover, .nav-active { background: #e8eee4; color: var(--primary); }
|
||||
|
||||
.view-heading { display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
|
||||
.view-heading h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; line-height: 1.1; letter-spacing: -.04em; }
|
||||
.feed-switch, .column-switch { display: flex; flex: none; padding: 3px; border: 1px solid var(--border); border-radius: 11px; background: var(--muted); }
|
||||
.feed-switch button { border-radius: 8px; padding: 7px 12px; color: var(--muted-foreground); font-size: 13px; font-weight: 650; }
|
||||
.feed-switch [aria-pressed=true], .column-switch [aria-pressed=true] { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px #20292318; }
|
||||
.feed-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
|
||||
.channels { display: flex; flex-wrap: wrap; gap: 6px; }
|
||||
.chip { padding: 5px 11px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); white-space: nowrap; font-size: 13px; }
|
||||
.chip:hover { border-color: var(--primary); }
|
||||
.chip[aria-pressed=true] { border-color: var(--primary); background: var(--primary); color: var(--primary-foreground); }
|
||||
.column-switch button { width: 30px; height: 29px; }
|
||||
|
||||
.note-grid { columns: var(--feed-columns, 3); column-gap: 14px; }
|
||||
.note-grid[data-columns="1"] { --feed-columns: 1; max-width: 580px; margin-inline: auto; }
|
||||
.note-grid[data-columns="2"] { --feed-columns: 2; }
|
||||
.note-card { break-inside: avoid; display: inline-block; width: 100%; margin-bottom: 14px; padding: 5px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); vertical-align: top; }
|
||||
.note-open { display: block; border-radius: 10px; }
|
||||
.note-image { position: relative; overflow: hidden; background: #e0e7db; border-radius: 10px; }
|
||||
.media-icon, .pin { position: absolute; top: 9px; display: grid; place-items: center; background: #1d2520df; color: #fff; }
|
||||
.media-icon { right: 9px; width: 28px; height: 28px; border-radius: 50%; }
|
||||
.pin { left: 9px; padding: 3px 7px; border-radius: 5px; font-size: 11px; }
|
||||
.empty-state { padding: 45px 20px; border: 1px dashed var(--border); border-radius: 14px; text-align: center; color: var(--muted-foreground); }
|
||||
|
||||
.discovery { display: grid; gap: 15px; }
|
||||
.discovery-panel { padding: 17px 15px 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); font-size: 13px; }
|
||||
.discovery-panel h2 { margin-bottom: 6px; font-size: 16px; font-weight: 800; }
|
||||
.topic { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 5px; padding: 10px 0; text-align: left; color: var(--primary); }
|
||||
.topic:hover b { text-decoration: underline; }
|
||||
.topic small { display: block; margin-top: 2px; color: var(--muted-foreground); }
|
||||
.topic + .topic, .suggestion + .suggestion { border-top: 1px solid var(--border); }
|
||||
.suggestion { display: flex; align-items: center; gap: 8px; padding: 10px 0; }
|
||||
.suggestion-avatar { display: grid; width: 32px; height: 32px; flex: none; place-items: center; border-radius: 50%; background: #e2ebe0; color: var(--primary); font-weight: 750; }
|
||||
|
||||
.profile-card { border: 1px solid var(--border); border-radius: 17px; background: var(--surface); }
|
||||
.profile-cover { width: 100%; height: clamp(130px, 21vw, 215px); border-radius: 16px 16px 0 0; background: #d4e0d2; object-fit: cover; }
|
||||
.profile-body { padding: 0 clamp(14px, 4vw, 27px) 20px; }
|
||||
.profile-actions { display: flex; min-height: 55px; align-items: center; gap: 12px; }
|
||||
.profile-avatar { width: clamp(64px, 12vw, 96px); aspect-ratio: 1; z-index: 1; margin-top: -38px; border: 4px solid var(--surface); border-radius: 22px; background: var(--muted); object-fit: cover; }
|
||||
.profile-name { display: flex; align-items: center; gap: 7px; font-size: 29px; font-weight: 800; }
|
||||
.verified { display: grid; width: 19px; height: 19px; place-items: center; border-radius: 50%; background: var(--primary); color: white; }
|
||||
.profile-bio { margin-block: 13px; font-size: 14px; }
|
||||
.profile-meta, .profile-stats { display: flex; flex-wrap: wrap; gap: 10px 16px; color: var(--muted-foreground); font-size: 13px; }
|
||||
.profile-meta > * { display: inline-flex; align-items: center; gap: 5px; }
|
||||
.profile-meta button:hover { text-decoration: underline; }
|
||||
.profile-stats { margin-top: 15px; }
|
||||
.profile-stats b { color: var(--foreground); }
|
||||
.profile-tabs { display: flex; gap: 5px; margin: 15px 0; overflow-x: auto; }
|
||||
.profile-tabs button { padding: 9px 13px; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 14px; }
|
||||
.profile-tabs [aria-pressed=true] { border-color: var(--primary); color: var(--primary); font-weight: 750; }
|
||||
.profile-menu { position: relative; }
|
||||
.profile-menu summary { display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--border); border-radius: 8px; list-style: none; }
|
||||
.profile-menu summary::-webkit-details-marker { display: none; }
|
||||
.menu-panel { position: absolute; z-index: 2; top: calc(100% + 7px); right: 0; width: 155px; padding: 5px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 24px #20292319; }
|
||||
.menu-panel button { display: flex; width: 100%; align-items: center; gap: 7px; padding: 7px; border-radius: 6px; text-align: left; font-size: 13px; }
|
||||
.menu-panel button:hover { background: var(--muted); }
|
||||
|
||||
.dialog { position: fixed; inset: 0; z-index: 10; width: min(540px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--foreground); }
|
||||
.dialog::backdrop { background: #161e19a6; }
|
||||
.dialog-content { position: relative; display: grid; gap: 13px; padding: 24px; }
|
||||
.dialog-close { position: absolute; top: 10px; right: 10px; }
|
||||
.modal-cover { width: 100%; max-height: 52vh; background: var(--muted); object-fit: contain; border-radius: 10px; }
|
||||
.account-details > div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 14px; }
|
||||
.account-details dt { color: var(--muted-foreground); }
|
||||
.notice { position: fixed; z-index: 6; right: 16px; bottom: 20px; max-width: calc(100vw - 32px); overflow-wrap: anywhere; padding: 10px 15px; border-radius: 8px; background: var(--primary); color: white; }
|
||||
|
||||
@media (max-width: 1100px) {
|
||||
.site-grid { grid-template-columns: 134px minmax(0, 1fr); }
|
||||
.discovery { display: none; }
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.site-grid { display: block; padding-top: 18px; padding-bottom: calc(75px + env(safe-area-inset-bottom)); }
|
||||
.rail { position: fixed; inset: auto 0 0; z-index: 5; border-top: 1px solid var(--border); background: var(--surface); padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); }
|
||||
.rail-nav { grid-template-columns: repeat(4, 1fr); }
|
||||
.nav-entry { justify-content: center; flex-direction: column; gap: 2px; padding: 4px; font-size: 11px; }
|
||||
.header-inner { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 6px; min-height: 56px; }
|
||||
.brand { gap: 0; font-size: 0; }
|
||||
.brand-period { display: none; }
|
||||
.search { padding-inline: 7px; gap: 5px; }
|
||||
.search input { font-size: 16px; }
|
||||
.view-heading { min-height: 43px; }
|
||||
.note-grid { column-gap: 9px; }
|
||||
.note-card { margin-bottom: 9px; }
|
||||
.notice { bottom: 70px; }
|
||||
}
|
||||
|
||||
@media (max-width: 400px) {
|
||||
.feed-toolbar { align-items: flex-start; }
|
||||
.chip { padding-inline: 8px; }
|
||||
}
|
||||
@@ -1,11 +1,7 @@
|
||||
import type { Metadata } from "next";
|
||||
import type { ReactNode } from "react";
|
||||
import "./globals.css";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Bedrock · 发现",
|
||||
description: "发现关于独立开发、数字生活与城市漫游的笔记。",
|
||||
};
|
||||
export const metadata: Metadata = { title: "Dashboard" };
|
||||
|
||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
||||
return <html lang="zh-CN"><body>{children}</body></html>;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { Bedrock } from "@/components/bedrock";
|
||||
|
||||
export default function Page() {
|
||||
return <Bedrock />;
|
||||
return <main><h1>Dashboard</h1></main>;
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
{
|
||||
"$schema": "https://ui.shadcn.com/schema.json",
|
||||
"style": "new-york",
|
||||
"rsc": true,
|
||||
"tsx": true,
|
||||
"tailwind": {
|
||||
"config": "",
|
||||
"css": "app/globals.css",
|
||||
"baseColor": "neutral",
|
||||
"cssVariables": true,
|
||||
"prefix": ""
|
||||
},
|
||||
"aliases": {
|
||||
"components": "@/components",
|
||||
"utils": "@/lib/utils",
|
||||
"ui": "@/components/ui",
|
||||
"lib": "@/lib",
|
||||
"hooks": "@/hooks"
|
||||
},
|
||||
"iconLibrary": "lucide"
|
||||
}
|
||||
@@ -1,332 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import {
|
||||
ArrowDownRight, ArrowLeft, ArrowUpRight, Bell, Bookmark, CalendarDays,
|
||||
Check, CircleHelp, Compass, Grid2X2, Heart, House, LayoutGrid, Link2,
|
||||
MapPin, MessageCircle, MoreHorizontal, Play, Search, Square, UserRound, X,
|
||||
} from "lucide-react";
|
||||
import { useEffect, useRef, useState, type ReactNode } from "react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { feedNotes, notes, profile, type Note } from "@/lib/demo-data";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const channels = ["推荐", "旅行", "游戏", "视频", "职场", "情感"];
|
||||
const profileTabs = ["笔记", "收藏", "点赞", "浏览记录"] as const;
|
||||
const ownedNotes = ["workspace", "ai-tools", "voxel-model"];
|
||||
const accounts = [
|
||||
{ name: "极客小分队", handle: "@geek_squad_cn", initials: "极" },
|
||||
{ name: "Low Quality Memes", handle: "@ipostlqmemes", initials: "LM" },
|
||||
];
|
||||
const count = new Intl.NumberFormat("zh-CN");
|
||||
const columns = [
|
||||
{ value: 1, icon: Square },
|
||||
{ value: 2, icon: Grid2X2 },
|
||||
{ value: 3, icon: LayoutGrid },
|
||||
] as const;
|
||||
|
||||
function Picture({ src, alt, className }: { src: string; alt: string; className?: string }) {
|
||||
// The prototype supplies remote image URLs with no fixed source dimensions.
|
||||
// eslint-disable-next-line @next/next/no-img-element
|
||||
return <img src={src} alt={alt} className={className} loading="lazy" />;
|
||||
}
|
||||
|
||||
function Card({
|
||||
note, liked, onLike, onOpen, pinned,
|
||||
}: {
|
||||
note: Note;
|
||||
liked: boolean;
|
||||
onLike: () => void;
|
||||
onOpen: () => void;
|
||||
pinned?: boolean;
|
||||
}) {
|
||||
const likes = note.likes + Number(liked) - Number(note.initiallyLiked);
|
||||
|
||||
return (
|
||||
<article className="note-card">
|
||||
<button className="note-open group w-full text-left" onClick={onOpen}>
|
||||
<div className="note-image" style={{ aspectRatio: note.ratio }}>
|
||||
<Picture src={note.cover} alt={note.alt} className="size-full object-cover transition-transform duration-300 group-hover:scale-[1.04]" />
|
||||
{note.video && <span className="media-icon" title="视频封面"><Play size={14} fill="currentColor" /></span>}
|
||||
{pinned && <span className="pin">置顶</span>}
|
||||
</div>
|
||||
<h2 className="px-3 pt-3 text-[15px] font-bold">{note.title}</h2>
|
||||
</button>
|
||||
<div className="flex items-center justify-between gap-1 px-3 pb-2 pt-1 text-xs text-muted-foreground">
|
||||
<span className="flex min-w-0 items-center gap-2">
|
||||
<Picture src={note.avatar} alt="" className="size-5 shrink-0 rounded-full bg-muted object-cover" />
|
||||
<span className="truncate">{note.author}</span>
|
||||
</span>
|
||||
<Button variant="ghost" size="sm" className={cn("gap-1 px-1.5", liked && "text-like")} aria-pressed={liked} aria-label={liked ? "取消点赞" : "点赞"} onClick={onLike}>
|
||||
<Heart fill={liked ? "currentColor" : "none"} /> {count.format(likes)}
|
||||
</Button>
|
||||
</div>
|
||||
</article>
|
||||
);
|
||||
}
|
||||
|
||||
type ProfileTab = (typeof profileTabs)[number];
|
||||
type DialogContent =
|
||||
| { type: "note"; note: Note }
|
||||
| { type: "about" }
|
||||
| { type: "topics" }
|
||||
| { type: "notifications" }
|
||||
| { type: "messages" };
|
||||
|
||||
export function Bedrock() {
|
||||
const [view, setView] = useState<"home" | "profile">("home");
|
||||
const [feed, setFeed] = useState<"all" | "following">("all");
|
||||
const [channel, setChannel] = useState("推荐");
|
||||
const [columnCount, setColumnCount] = useState<1 | 2 | 3>();
|
||||
const [compact, setCompact] = useState(false);
|
||||
const activeColumns = columnCount ?? (compact ? 2 : 3);
|
||||
const [query, setQuery] = useState("");
|
||||
const [tab, setTab] = useState<ProfileTab>("笔记");
|
||||
const [liked, setLiked] = useState(() => notes.filter((note) => note.initiallyLiked).map((note) => note.id));
|
||||
const [saved, setSaved] = useState(["stairs"]);
|
||||
const [history, setHistory] = useState<string[]>([]);
|
||||
const [follows, setFollows] = useState<string[]>([]);
|
||||
const [dialogContent, setDialogContent] = useState<DialogContent | null>(null);
|
||||
const [notice, setNotice] = useState("");
|
||||
const dialog = useRef<HTMLDialogElement>(null);
|
||||
const search = useRef<HTMLInputElement>(null);
|
||||
const menu = useRef<HTMLDetailsElement>(null);
|
||||
const normalizedQuery = query.trim().toLowerCase();
|
||||
|
||||
useEffect(() => {
|
||||
function openLinkedProfile() {
|
||||
setView(window.location.hash === "#" + profile.handle ? "profile" : "home");
|
||||
}
|
||||
const viewport = window.matchMedia("(max-width: 720px)");
|
||||
const syncViewport = () => setCompact(viewport.matches);
|
||||
|
||||
openLinkedProfile();
|
||||
syncViewport();
|
||||
window.addEventListener("hashchange", openLinkedProfile);
|
||||
viewport.addEventListener("change", syncViewport);
|
||||
return () => {
|
||||
window.removeEventListener("hashchange", openLinkedProfile);
|
||||
viewport.removeEventListener("change", syncViewport);
|
||||
};
|
||||
}, []);
|
||||
|
||||
function changeView(next: "home" | "profile") {
|
||||
setView(next);
|
||||
const url = new URL(window.location.href);
|
||||
url.hash = next === "profile" ? profile.handle : "";
|
||||
window.history.replaceState(window.history.state, "", url);
|
||||
window.scrollTo(0, 0);
|
||||
}
|
||||
|
||||
function browse(next = "推荐") {
|
||||
setFeed("all");
|
||||
setChannel(next);
|
||||
setQuery("");
|
||||
changeView("home");
|
||||
}
|
||||
|
||||
function toggleInList(set: (update: (current: string[]) => string[]) => void, id: string) {
|
||||
set((current) => current.includes(id) ? current.filter((entry) => entry !== id) : [...current, id]);
|
||||
}
|
||||
|
||||
function show(content: DialogContent) {
|
||||
setDialogContent(content);
|
||||
dialog.current?.showModal();
|
||||
}
|
||||
|
||||
function openNote(note: Note) {
|
||||
setHistory((current) => [note.id, ...current.filter((id) => id !== note.id)]);
|
||||
show({ type: "note", note });
|
||||
}
|
||||
|
||||
async function copyProfile() {
|
||||
menu.current?.removeAttribute("open");
|
||||
const url = new URL(window.location.pathname, window.location.href);
|
||||
url.hash = profile.handle;
|
||||
try {
|
||||
await navigator.clipboard.writeText(url.href);
|
||||
setNotice("已复制主页链接");
|
||||
} catch {
|
||||
setNotice(url.href);
|
||||
}
|
||||
}
|
||||
|
||||
const following = follows.includes(profile.handle);
|
||||
const matches = feedNotes.filter((note) =>
|
||||
(feed === "all" || note.following || (following && note.author === profile.name)) &&
|
||||
(channel === "推荐" || note.category === channel) &&
|
||||
(!normalizedQuery || [note.title, note.author, note.category].some((value) => value.toLowerCase().includes(normalizedQuery))),
|
||||
);
|
||||
const profileIds = { 笔记: ownedNotes, 收藏: saved, 点赞: liked, 浏览记录: history }[tab];
|
||||
const profileNotes = profileIds.flatMap((id) => notes.find((note) => note.id === id) ?? []);
|
||||
|
||||
function renderCard(note: Note, pinned = false) {
|
||||
return <Card key={note.id} note={note} pinned={pinned} liked={liked.includes(note.id)} onLike={() => toggleInList(setLiked, note.id)} onOpen={() => openNote(note)} />;
|
||||
}
|
||||
|
||||
function followButton(id: string, className?: string) {
|
||||
const active = follows.includes(id);
|
||||
return <Button variant={active ? "outline" : "default"} size="sm" className={className} aria-pressed={active} onClick={() => toggleInList(setFollows, id)}>{active ? "已关注" : "关注"}</Button>;
|
||||
}
|
||||
|
||||
function closeMenuAndShow(content: DialogContent) {
|
||||
menu.current?.removeAttribute("open");
|
||||
show(content);
|
||||
}
|
||||
|
||||
let modal: ReactNode;
|
||||
if (dialogContent?.type === "note") {
|
||||
const { note } = dialogContent;
|
||||
modal = <>
|
||||
<Picture src={note.cover} alt={note.alt} className="modal-cover" />
|
||||
<p className="text-sm text-muted-foreground">{note.category} · {note.author}</p>
|
||||
<h2 id="dialog-title" className="text-2xl font-bold">{note.title}</h2>
|
||||
{note.video && <p className="text-sm text-muted-foreground">示例笔记仅提供视频封面。</p>}
|
||||
<div className="flex gap-2">
|
||||
<Button variant="outline" aria-pressed={liked.includes(note.id)} onClick={() => toggleInList(setLiked, note.id)}>
|
||||
<Heart fill={liked.includes(note.id) ? "currentColor" : "none"} /> {liked.includes(note.id) ? "已点赞" : "点赞"}
|
||||
</Button>
|
||||
<Button variant="outline" aria-pressed={saved.includes(note.id)} onClick={() => toggleInList(setSaved, note.id)}>
|
||||
<Bookmark fill={saved.includes(note.id) ? "currentColor" : "none"} /> {saved.includes(note.id) ? "已收藏" : "收藏"}
|
||||
</Button>
|
||||
</div>
|
||||
</>;
|
||||
} else if (dialogContent?.type === "about") {
|
||||
modal = <>
|
||||
<h2 id="dialog-title" className="text-2xl font-bold">关于此账号</h2>
|
||||
<p>{profile.name} · @{profile.handle}</p>
|
||||
<dl className="account-details">
|
||||
<div><dt>加入时间</dt><dd>2022 年 4 月</dd></div>
|
||||
<div><dt>账号属地</dt><dd>中国 · 四川</dd></div>
|
||||
<div><dt>认证时间</dt><dd>2024 年 3 月</dd></div>
|
||||
</dl>
|
||||
</>;
|
||||
} else if (dialogContent?.type === "topics") {
|
||||
modal = <>
|
||||
<h2 id="dialog-title" className="text-2xl font-bold">关注的话题</h2>
|
||||
<div className="flex flex-wrap gap-2">{["游戏", "视频", "职场"].map((topic) =>
|
||||
<Button key={topic} variant="outline" onClick={() => { dialog.current?.close(); browse(topic); }}>{topic}</Button>,
|
||||
)}</div>
|
||||
</>;
|
||||
} else if (dialogContent) {
|
||||
const label = dialogContent.type === "messages" ? "消息" : "通知";
|
||||
modal = <><h2 id="dialog-title" className="text-2xl font-bold">{label}</h2><p className="text-muted-foreground">暂无{label}</p></>;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="site-shell" onClick={() => { if (notice) setNotice(""); }}>
|
||||
<header className="site-header">
|
||||
<div className="header-inner">
|
||||
<button className="brand" onClick={() => browse()} aria-label="Bedrock 首页">
|
||||
<span className="brand-mark"><ArrowDownRight size={23} strokeWidth={2.7} /></span>
|
||||
Bedrock<span className="brand-period">.</span>
|
||||
</button>
|
||||
<form className="search" role="search" onSubmit={(event) => { event.preventDefault(); changeView("home"); }}>
|
||||
<Search aria-hidden="true" size={18} />
|
||||
<input ref={search} type="search" aria-label="搜索笔记" placeholder="搜索笔记、创作者" value={query} onChange={(event) => { setQuery(event.target.value); changeView("home"); }} />
|
||||
</form>
|
||||
<Button variant="ghost" size="icon" aria-label="通知" onClick={() => show({ type: "notifications" })}><Bell /></Button>
|
||||
<button className="header-avatar" aria-label="打开个人主页" onClick={() => changeView("profile")}>
|
||||
<Picture src={profile.avatar} alt="" className="size-full object-cover" />
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div className="site-grid">
|
||||
<aside className="rail">
|
||||
<nav aria-label="主导航" className="rail-nav">
|
||||
<button className={cn("nav-entry", view === "home" && "nav-active")} aria-current={view === "home" ? "page" : undefined} onClick={() => browse()}><House size={19} /><span>首页</span></button>
|
||||
<button className="nav-entry" onClick={() => { browse(); search.current?.focus(); }}><Compass size={19} /><span>探索</span></button>
|
||||
<button className="nav-entry" onClick={() => show({ type: "messages" })}><MessageCircle size={19} /><span>消息</span></button>
|
||||
<button className={cn("nav-entry", view === "profile" && "nav-active")} aria-current={view === "profile" ? "page" : undefined} onClick={() => changeView("profile")}><UserRound size={19} /><span>个人主页</span></button>
|
||||
</nav>
|
||||
</aside>
|
||||
|
||||
<main id="main" className="min-w-0">
|
||||
{view === "home" ? <>
|
||||
<div className="view-heading">
|
||||
<h1>发现</h1>
|
||||
<div className="feed-switch" aria-label="信息流">
|
||||
<button aria-pressed={feed === "all"} onClick={() => setFeed("all")}>为你推荐</button>
|
||||
<button aria-pressed={feed === "following"} onClick={() => setFeed("following")}>正在关注</button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="feed-toolbar">
|
||||
<div className="channels" aria-label="频道">
|
||||
{channels.map((item) => <button key={item} className="chip" aria-pressed={channel === item} onClick={() => setChannel(item)}>{item}</button>)}
|
||||
</div>
|
||||
<div className="column-switch" aria-label="瀑布流列数">
|
||||
{columns.map(({ value, icon: Icon }) => <Button key={value} variant="ghost" size="icon" aria-pressed={activeColumns === value} aria-label={value + " 列"} onClick={() => setColumnCount(value)}><Icon /></Button>)}
|
||||
</div>
|
||||
</div>
|
||||
{matches.length ? <div className="note-grid" data-columns={activeColumns}>{matches.map((note) => renderCard(note))}</div> :
|
||||
<p className="empty-state">没有符合条件的笔记。</p>}
|
||||
</> : <>
|
||||
<div className="flex items-center gap-2 pb-4">
|
||||
<Button variant="outline" size="icon" aria-label="返回首页" onClick={() => changeView("home")}><ArrowLeft /></Button>
|
||||
<span className="text-sm font-semibold">个人主页</span>
|
||||
</div>
|
||||
<section className="profile-card">
|
||||
<Picture src={profile.cover} alt="" className="profile-cover" />
|
||||
<div className="profile-body">
|
||||
<div className="profile-actions">
|
||||
<Picture src={profile.avatar} alt="" className="profile-avatar" />
|
||||
<div className="ml-auto flex items-center gap-2">
|
||||
<details className="profile-menu" ref={menu}>
|
||||
<summary aria-label="更多账号操作"><MoreHorizontal size={19} /></summary>
|
||||
<div className="menu-panel">
|
||||
<button onClick={() => closeMenuAndShow({ type: "about" })}><CircleHelp size={16} /> 关于此账号</button>
|
||||
<button onClick={() => closeMenuAndShow({ type: "topics" })}><Compass size={16} /> 查看话题</button>
|
||||
<button onClick={() => void copyProfile()}><Link2 size={16} /> 复制主页链接</button>
|
||||
</div>
|
||||
</details>
|
||||
<Button variant="outline" size="icon" aria-label="消息" onClick={() => show({ type: "messages" })}><MessageCircle /></Button>
|
||||
{followButton(profile.handle)}
|
||||
</div>
|
||||
</div>
|
||||
<h1 className="profile-name">{profile.name}<span className="verified" aria-label="已认证"><Check size={13} strokeWidth={3} /></span></h1>
|
||||
<p className="text-sm text-muted-foreground">@{profile.handle} · 小红书号 {profile.account}</p>
|
||||
<p className="profile-bio">Software is eating the world, AI is eating software. 分享 AI 产品拆解、独立开发实验与数字生活灵感。</p>
|
||||
<div className="profile-meta">
|
||||
<span><MapPin size={15} /> 成都 · 四川</span>
|
||||
<button onClick={() => show({ type: "about" })}><CalendarDays size={15} /> 2022 年 4 月加入 <ArrowUpRight size={12} /></button>
|
||||
</div>
|
||||
<div className="profile-stats">
|
||||
<span><b>128</b> 笔记</span><span><b>10</b> 关注</span><span><b>{87 + Number(following)}</b> 粉丝</span><span><b>2,987</b> 获赞与收藏</span>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<nav className="profile-tabs" aria-label="个人主页内容">
|
||||
{profileTabs.map((item) => <button key={item} aria-pressed={tab === item} onClick={() => setTab(item)}>{item}</button>)}
|
||||
</nav>
|
||||
{profileNotes.length ? <div className="note-grid" data-columns={compact ? 2 : 3}>{profileNotes.map((note) => renderCard(note, tab === "笔记" && note.id === "workspace"))}</div> :
|
||||
<p className="empty-state">{tab === "浏览记录" ? "近期浏览的笔记会显示在这里,仅自己可见。" : "这里暂时没有笔记。"}</p>}
|
||||
</>}
|
||||
</main>
|
||||
|
||||
<aside className="discovery" aria-label="发现更多">
|
||||
<section className="discovery-panel">
|
||||
<h2>热门话题</h2>
|
||||
<button className="topic" onClick={() => browse("职场")}><span><b>#AICoding2026</b><small>科技 · 热门</small></span><ArrowUpRight size={16} /></button>
|
||||
<button className="topic" onClick={() => browse("旅行")}><span><b>城市漫游</b><small>旅行 · 热门</small></span><ArrowUpRight size={16} /></button>
|
||||
</section>
|
||||
<section className="discovery-panel">
|
||||
<h2>推荐关注</h2>
|
||||
{accounts.map(({ name, handle, initials }) => <div className="suggestion" key={handle}>
|
||||
<span className="suggestion-avatar">{initials}</span>
|
||||
<span className="min-w-0 flex-1"><b className="block truncate">{name}</b><small className="block truncate text-muted-foreground">{handle}</small></span>
|
||||
{followButton(handle)}
|
||||
</div>)}
|
||||
</section>
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
<dialog ref={dialog} className="dialog" aria-labelledby="dialog-title" onClick={(event) => { if (event.target === event.currentTarget) dialog.current?.close(); }}>
|
||||
<div className="dialog-content">
|
||||
<Button variant="outline" size="icon" aria-label="关闭" className="dialog-close" onClick={() => dialog.current?.close()}><X /></Button>
|
||||
{modal}
|
||||
</div>
|
||||
</dialog>
|
||||
<p className={cn("notice", !notice && "sr-only")} role="status">{notice}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
import { Slot } from "@radix-ui/react-slot";
|
||||
import { cva, type VariantProps } from "class-variance-authority";
|
||||
import type { ComponentProps } from "react";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const buttonVariants = cva(
|
||||
"inline-flex shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-lg text-sm font-semibold transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-4 [&_svg]:shrink-0",
|
||||
{
|
||||
variants: {
|
||||
variant: {
|
||||
default: "bg-primary text-primary-foreground hover:bg-primary/85",
|
||||
outline: "border border-border bg-background hover:bg-muted",
|
||||
ghost: "hover:bg-muted",
|
||||
},
|
||||
size: {
|
||||
default: "h-10 px-4",
|
||||
sm: "h-8 px-3",
|
||||
icon: "size-9",
|
||||
},
|
||||
},
|
||||
defaultVariants: { variant: "default", size: "default" },
|
||||
},
|
||||
);
|
||||
|
||||
export function Button({
|
||||
asChild,
|
||||
className,
|
||||
variant,
|
||||
size,
|
||||
type = "button",
|
||||
...props
|
||||
}: ComponentProps<"button"> & VariantProps<typeof buttonVariants> & { asChild?: boolean }) {
|
||||
const Component = asChild ? Slot : "button";
|
||||
return <Component data-slot="button" type={asChild ? undefined : type} className={cn(buttonVariants({ variant, size }), className)} {...props} />;
|
||||
}
|
||||
@@ -1,181 +0,0 @@
|
||||
export interface Note {
|
||||
id: string;
|
||||
title: string;
|
||||
category: string;
|
||||
following: boolean;
|
||||
cover: string;
|
||||
alt: string;
|
||||
avatar: string;
|
||||
author: string;
|
||||
likes: number;
|
||||
ratio: number;
|
||||
video: boolean;
|
||||
initiallyLiked: boolean;
|
||||
}
|
||||
|
||||
export const profile = {
|
||||
"name": "有点AI思",
|
||||
"handle": "you_dian_ai",
|
||||
"account": "18665824520",
|
||||
"avatar": "https://lh3.googleusercontent.com/aida/ALJJyrDLyg7AU1ySfjAJjEDtdYKmClLRc_jv7DEclZtibuFCOccxah3R_teEs94FDau5tCxP5qu0qAzh-OytVAKb3OCIhtevXViHcuv-SN-cnoBgB1RnnXU1qUcmKlNM8iwvkcKb81j6gATNWLc-NhRs0GO9aiJ1cx9BmMQOuT7pwPL_EP7IszhcmgezNmbsp2D3shvSaQiSU0P_HBJYdZUBW4HIBvNnnve82NoCWhhgnHbzgP4yxbcq0WO3GkHK",
|
||||
"cover": "https://lh3.googleusercontent.com/aida/ALJJyrDgbA2N_BJwKgfmqQfakS7hlGq0oIDnnTRSVAZaX9Dcgox48cXNFAHUL6VfFngxxhe1oHNjjuK9vizuYaV9kZyaC0uHjuER0cdL2WjfyW8zMHjPJ4YQHG1gTVzDBoOl_benuwg2e0J5pGEz0YcAoZzQmNsg6WnKdsAmby6yfbLEgcjJwNSQ9l0gPVt7-kGrF3zqiD6fSjYPsyEkvYiLLLLR146vsfMPMorPvGuPS1GVkmwkh1BloDcarj4a"
|
||||
};
|
||||
|
||||
export const notes: Note[] = [
|
||||
{
|
||||
"id": "fish-game",
|
||||
"title": "这游戏能卖80万美元",
|
||||
"category": "游戏",
|
||||
"following": true,
|
||||
"cover": "https://lh3.googleusercontent.com/aida/ALJJyrDM_KJSb3l6cS8Fv2ZcrEhqDaktKGnyxizi9jitLmIM7D6UPRYNycUAZB0OcF8MfGemxqjJjaUy6uLfTN45s4ejnY-HKnxfP8x2VccvbMQPD2LIPjKATdnyVfRITrL20JoNiVKDeviBHYFIrUO_D92aMw_zD_XRZGUDECkSM1JA949da4ggw5N13N-Rq2oVy3MjRvx78wSxPhs4A4zo-E1F4MEpE_pZo_mplnvoD6GSE5pBe-imED8",
|
||||
"alt": "彩色手绘小鱼游戏封面",
|
||||
"avatar": "https://lh3.googleusercontent.com/aida/ALJJyrC8Q9cUcSFFfS0wgl1S6HITWqi_FWVxLrL9kQw31PftNrhzPV_nHAkLmbLNbH938re11IoasVukTbT96dYhYml875S6Td2bWZcNiKv0W1v1HWk8AWOfKrE5qspihwEpM3i3rB5p2_6NwYnQ6t2R7ul3VMwCtw9BZUQL9o-sSysUownvWu3dCJjX8J1NEPN0AojxQXQQXh3EuMhHezo5buKHRErlEoVAE0Q0aYfzTS9F9d4RVQKs-g",
|
||||
"author": "BBGame",
|
||||
"likes": 483,
|
||||
"ratio": 1.22,
|
||||
"video": false,
|
||||
"initiallyLiked": false
|
||||
},
|
||||
{
|
||||
"id": "rainy-harbor",
|
||||
"title": "雨夜海港太治愈",
|
||||
"category": "视频",
|
||||
"following": true,
|
||||
"cover": "https://lh3.googleusercontent.com/aida/ALJJyrB27N9q0MiQaidLuFbDqg5yrfBpZiFTSo88dc4u-03Q1efk-bDnP0tTu3VZRO_ahsdmeBZ3wRdkR1w9HPCODx5cWdb_G5Z1iQp_C5Vp--V5_SsLJG_8G_ngeB7-KlZwfMGP6C11sztsodVIeSVaP_ZUgmU3fjzHCnLsf4s58a439jnVDeQ5hpw8JE3oWxgJ4hUCKJzY62NoTU6oiE6G9xRU0p_RdmtDSHpTfohuZJaJ5aKR79A_urNK",
|
||||
"alt": "雨夜海港小镇体素场景",
|
||||
"avatar": "https://lh3.googleusercontent.com/aida/ALJJyrCJUQvJlwy1PVCocqRx7lro8OLrOooMNn3LuRLNn1k0O_U9oFH0iUCwwOPNeC2tnoThvKi3LZAedt_jMFpDZ9WvOhG00kpUicHEBJPxFpq0DKGyN2zm0yLA93RIgEtbl1LHnv0y7z7Vw7W9iIQhe2MxWA3IPCExhxkNVRFDjTqfaJF891PhvMlaV8pCMVZ-cHmmINCRaC5aRoxngW7rZ9lDdB1wVCuQB6hf-T0-B9FZudmKBCpfukjA8cc",
|
||||
"author": "像素造梦师",
|
||||
"likes": 1284,
|
||||
"ratio": 0.94,
|
||||
"video": true,
|
||||
"initiallyLiked": false
|
||||
},
|
||||
{
|
||||
"id": "golden-retriever",
|
||||
"title": "小金毛太粘人啦",
|
||||
"category": "情感",
|
||||
"following": false,
|
||||
"cover": "https://lh3.googleusercontent.com/aida/ALJJyrA34_bEl_4q1VF3HVrk8FKRGQEQ3tmZrLwCby_tCuvo2wbW0MwI_zg8AEuGZKcXTrwKkMuLaoIaeY7-k7TWQoB9Y2JinNCQibxrH0BRp-cUlu2UArrf8RXEKygznTXXkgQz33-YZA4fZSd4d5DD6KzSYIgQGgcmgj2DIHH6H3IVU0zgYlFkFTdtrG1mRsq2MY8FM-ohGKHQCG48ww-gOdoxb5_ZstA2yRTws7uELlMukb3I836_lLRQKvgs",
|
||||
"alt": "家里新来的小金毛",
|
||||
"avatar": "https://lh3.googleusercontent.com/aida/ALJJyrA0TvsCD1PZ4wc2c3pB99eescnCgrZaOKBdu8-xCXDX9X_19qN_dj0dHUl4wuBvZIXTy3OB7SLF-LveVugEtj0ZYIZIVB8RISgxU10owhbvA1pYOpMRDVkteDUjeqW84PS59o-v2YYOakuRzwgAbbRk2AmAaK_XkkqY8WcIO5KDVbS-L76QCGlBVjm7nDq4g4pzAV8o8zppwNQD6Z1ZzdliwAcBRs6l7YTTzVeUVYyGc3ddfNe56w",
|
||||
"author": "单棱镜",
|
||||
"likes": 1520,
|
||||
"ratio": 1.07,
|
||||
"video": false,
|
||||
"initiallyLiked": true
|
||||
},
|
||||
{
|
||||
"id": "chengdu",
|
||||
"title": "成都到底有几个圈?",
|
||||
"category": "旅行",
|
||||
"following": true,
|
||||
"cover": "https://lh3.googleusercontent.com/aida/ALJJyrC5AEKgA5yWjjrXTEsJ9u99nMzsBgcbKVfpRa2JMUStCftg6UvIKEJiMBsMWHNsL-GaPyuD6yJftHvr4HonQwou9DV0ABgOS7QvKx8qQ8WJ0bA3M759B82pbvbJwO0-WavDKWyeyEZWipOhsl_JxIh-Qf5ukdhIzA8f2r9-meY1t-z3cMFGoBSw7J5AYHc6-dpcWqZIvIakEd49V5P8JFcv0pNb9O99s0J24moIgYKd6sKOY8FvJEQhScRYIQ",
|
||||
"alt": "成都环形城市航拍图",
|
||||
"avatar": "https://lh3.googleusercontent.com/aida/ALJJyrCu3MmDoy8sttsOKFnz8_y77z5ogBiV78OVUWY7-hn2kPgzHlMHi26qhlOhU1jnyylouj6e_nPk4opjbrxn3OXuX3JqkLytOtpR5DsVQ8t0JFaiKaLzIslhqpP430XTAiT8OiXCEMWWVRUBTKDjiWE3Y7IfhUs8sS0iVtBAJxKMAm1bw8_uCQPrxsGY-HxFGu88-quG9emrYKt5dau_HVwpS7zhTyiq4XZh2XPmiTRUeUqi5W2tvOLSK5A",
|
||||
"author": "西游兔",
|
||||
"likes": 3936,
|
||||
"ratio": 0.94,
|
||||
"video": false,
|
||||
"initiallyLiked": false
|
||||
},
|
||||
{
|
||||
"id": "dungeon",
|
||||
"title": "独立游戏一周目实录",
|
||||
"category": "游戏",
|
||||
"following": true,
|
||||
"cover": "https://lh3.googleusercontent.com/aida/ALJJyrDqA-q-z_rb8IW-D9cpfWaeTRM3ZLaFPB4G7HQgjoHR74mcOa5-NWgKg9zBMmMY864jlE42tqxJg-feS0BePP-8GlWjF94hpALIyinCnFo639dH_DvBs8NVo5HCV8QFuuxxKbm3d3zOz-PKikwUf9bxvfrhWRhWMnTApLSosFa0XDiAUe45x0e9UzqnKgvVEXgpOUKCKj5UImJ9sFLFLde4WI5ObBw2_bnE7ZGDJqrS76j_Xi5QZSw0TUJSjg",
|
||||
"alt": "像素地牢独立游戏画面",
|
||||
"avatar": "https://lh3.googleusercontent.com/aida/ALJJyrCu3MmDoy8sttsOKFnz8_y77z5ogBiV78OVUWY7-hn2kPgzHlMHi26qhlOhU1jnyylouj6e_nPk4opjbrxn3OXuX3JqkLytOtpR5DsVQ8t0JFaiKaLzIslhqpP430XTAiT8OiXCEMWWVRUBTKDjiWE3Y7IfhUs8sS0iVtBAJxKMAm1bw8_uCQPrxsGY-HxFGu88-quG9emrYKt5dau_HVwpS7zhTyiq4XZh2XPmiTRUeUqi5W2tvOLSK5A",
|
||||
"author": "阿宅玩游戏",
|
||||
"likes": 742,
|
||||
"ratio": 1.24,
|
||||
"video": false,
|
||||
"initiallyLiked": false
|
||||
},
|
||||
{
|
||||
"id": "ai-tools",
|
||||
"title": "AI助手实测对比",
|
||||
"category": "职场",
|
||||
"following": true,
|
||||
"cover": "https://lh3.googleusercontent.com/aida/ALJJyrAphvHXFcdTnvB5ovTSTgbQ32hhfV2jl8MEX-LrTyY-z9jI-qUb8T-7G0jFIbs4rd_yBJFI8zV7MR4pi48EAq9ZxkuJ6i1tDq_KBCeD5N2mliBhEHXAVLFqxiBZMK1vyoO7ENrK2YgGYwZnoQDJ-gWqS7XniyxJF3yZ5_bJYCKJXCEtkYoYZU6Gs4-2bJTcIHK1GcwmBdKeqr1IRCNuPhHRSYYJlLA2bf-ulpManRHvCAgxrbim",
|
||||
"alt": "拿着地图思考的插画人物",
|
||||
"avatar": "https://lh3.googleusercontent.com/aida/ALJJyrDLyg7AU1ySfjAJjEDtdYKmClLRc_jv7DEclZtibuFCOccxah3R_teEs94FDau5tCxP5qu0qAzh-OytVAKb3OCIhtevXViHcuv-SN-cnoBgB1RnnXU1qUcmKlNM8iwvkcKb81j6gATNWLc-NhRs0GO9aiJ1cx9BmMQOuT7pwPL_EP7IszhcmgezNmbsp2D3shvSaQiSU0P_HBJYdZUBW4HIBvNnnve82NoCWhhgnHbzgP4yxbcq0WO3GkHK",
|
||||
"author": "有点AI思",
|
||||
"likes": 612,
|
||||
"ratio": 0.87,
|
||||
"video": false,
|
||||
"initiallyLiked": false
|
||||
},
|
||||
{
|
||||
"id": "skyline",
|
||||
"title": "夜幕降临的城市天际线",
|
||||
"category": "旅行",
|
||||
"following": false,
|
||||
"cover": "https://lh3.googleusercontent.com/aida/ALJJyrAomhWvWAcsKRWKC9wQTf-kgm9598la3HGFFNMEbp8HnBo7pdhI93FLodW4W17n8CWJxngYrfFDNcLP7zo_4eyJx-myQW9KqUVV3JmGFjOyKV6bY--lrxLXeCjF5m9uabNVHBfmS3LK93Hx69a3gL8fjG-K8E90PzO38NOvsWqK_QKN1XlV30ReLcZa6tPLCoQnKOLZpr-fmJzcJWvG_hlLnSzfyy5lDcVAtXW8IwjS5KqPfyEA0g",
|
||||
"alt": "夜色雾气中的城市天际线",
|
||||
"avatar": "https://lh3.googleusercontent.com/aida/ALJJyrCJUQvJlwy1PVCocqRx7lro8OLrOooMNn3LuRLNn1k0O_U9oFH0iUCwwOPNeC2tnoThvKi3LZAedt_jMFpDZ9WvOhG00kpUicHEBJPxFpq0DKGyN2zm0yLA93RIgEtbl1LHnv0y7z7Vw7W9iIQhe2MxWA3IPCExhxkNVRFDjTqfaJF891PhvMlaV8pCMVZ-cHmmINCRaC5aRoxngW7rZ9lDdB1wVCuQB6hf-T0-B9FZudmKBCpfukjA8cc",
|
||||
"author": "Wingman",
|
||||
"likes": 528,
|
||||
"ratio": 1.3,
|
||||
"video": false,
|
||||
"initiallyLiked": false
|
||||
},
|
||||
{
|
||||
"id": "workspace",
|
||||
"title": "午后光影工作台灵感",
|
||||
"category": "职场",
|
||||
"following": true,
|
||||
"cover": "https://lh3.googleusercontent.com/aida/ALJJyrC_IgaqfQsq07LymAsO_kvJouQxHW9suv7nmj0icGTiZkvmi9p1siRckVjd7orlRJ0h0y72ekjlRmps3rUKd4YZKyfyxTS6Q7rfhHPrcfQxT-5Bb1PmFX3N-WDLUVPewD0DvOzNeI8bAmxgQP8RTwJS8xxwlb6R-E2C6rpShU3DgHuQVpGABxLPETzfQjKaGqscEHPwcOCb2O2Qxp3nj9y0HxWkuHYRGzP4UZhx91ZnA8o1Zz5DwzRic2VoWA",
|
||||
"alt": "彩色玻璃光影工作台",
|
||||
"avatar": "https://lh3.googleusercontent.com/aida/ALJJyrDLyg7AU1ySfjAJjEDtdYKmClLRc_jv7DEclZtibuFCOccxah3R_teEs94FDau5tCxP5qu0qAzh-OytVAKb3OCIhtevXViHcuv-SN-cnoBgB1RnnXU1qUcmKlNM8iwvkcKb81j6gATNWLc-NhRs0GO9aiJ1cx9BmMQOuT7pwPL_EP7IszhcmgezNmbsp2D3shvSaQiSU0P_HBJYdZUBW4HIBvNnnve82NoCWhhgnHbzgP4yxbcq0WO3GkHK",
|
||||
"author": "有点AI思",
|
||||
"likes": 842,
|
||||
"ratio": 1.14,
|
||||
"video": false,
|
||||
"initiallyLiked": true
|
||||
},
|
||||
{
|
||||
"id": "film-walk",
|
||||
"title": "城市街头胶片漫步",
|
||||
"category": "旅行",
|
||||
"following": false,
|
||||
"cover": "https://lh3.googleusercontent.com/aida/ALJJyrCC5lFRMVV6rKxGmBKspBP600lJGGg0VqL5lQpA3AJgK6cGd5aWMf8L-HAVEDc-Gyxb5WVbmQ2uORSCscxU1vOPz7fhy8BHUBYgrEjxhWEXVpcZQnBW2hqtQ-NCAA-KZI6r_7txERA87B7cARdh-lWYx7kc1qbGBC0snMmClhFwWSHlT2ZnVquHmkzsAgeVR41x6lHoYT3YWK07nMv_PH0N8iurg6jAD2qIwycNb_JMulh2ZxKxuHEwdLc",
|
||||
"alt": "街头漫步摄影",
|
||||
"avatar": "https://lh3.googleusercontent.com/aida/ALJJyrCu3MmDoy8sttsOKFnz8_y77z5ogBiV78OVUWY7-hn2kPgzHlMHi26qhlOhU1jnyylouj6e_nPk4opjbrxn3OXuX3JqkLytOtpR5DsVQ8t0JFaiKaLzIslhqpP430XTAiT8OiXCEMWWVRUBTKDjiWE3Y7IfhUs8sS0iVtBAJxKMAm1bw8_uCQPrxsGY-HxFGu88-quG9emrYKt5dau_HVwpS7zhTyiq4XZh2XPmiTRUeUqi5W2tvOLSK5A",
|
||||
"author": "胶片日志",
|
||||
"likes": 946,
|
||||
"ratio": 0.9,
|
||||
"video": false,
|
||||
"initiallyLiked": false
|
||||
},
|
||||
{
|
||||
"id": "stairs",
|
||||
"title": "极简楼梯光影构图参考",
|
||||
"category": "推荐",
|
||||
"following": false,
|
||||
"cover": "https://lh3.googleusercontent.com/aida/ALJJyrC4bk0D_GGy5i0mZs9_cMgwchYZdVZecSND2FfG6uovacRGq5l3a96YDhC61_RGxEg2T_4I8mOaUN0w3nLedj4kF1DDfJXJB-1h2PUjnFprPxKebA-JNKx6BaIZ_sQgBbiWPtYrccCRhxCGFg3c8USr_I1eYExkw518uj8gVCOLwRU8EGWw-mmID2bK3-o4o8s9Mp1OK4Lqmlb39xLZKpiP4SlruhsVAD3XpI4jEV9O1vmYG6NJ",
|
||||
"alt": "建筑楼梯光影摄影",
|
||||
"avatar": "https://lh3.googleusercontent.com/aida/ALJJyrCJUQvJlwy1PVCocqRx7lro8OLrOooMNn3LuRLNn1k0O_U9oFH0iUCwwOPNeC2tnoThvKi3LZAedt_jMFpDZ9WvOhG00kpUicHEBJPxFpq0DKGyN2zm0yLA93RIgEtbl1LHnv0y7z7Vw7W9iIQhe2MxWA3IPCExhxkNVRFDjTqfaJF891PhvMlaV8pCMVZ-cHmmINCRaC5aRoxngW7rZ9lDdB1wVCuQB6hf-T0-B9FZudmKBCpfukjA8cc",
|
||||
"author": "建筑笔记",
|
||||
"likes": 1200,
|
||||
"ratio": 1.2,
|
||||
"video": false,
|
||||
"initiallyLiked": false
|
||||
},
|
||||
{
|
||||
"id": "voxel-model",
|
||||
"title": "用体素引擎做海港微缩模型",
|
||||
"category": "视频",
|
||||
"following": false,
|
||||
"cover": "https://lh3.googleusercontent.com/aida/ALJJyrB27N9q0MiQaidLuFbDqg5yrfBpZiFTSo88dc4u-03Q1efk-bDnP0tTu3VZRO_ahsdmeBZ3wRdkR1w9HPCODx5cWdb_G5Z1iQp_C5Vp--V5_SsLJG_8G_ngeB7-KlZwfMGP6C11sztsodVIeSVaP_ZUgmU3fjzHCnLsf4s58a439jnVDeQ5hpw8JE3oWxgJ4hUCKJzY62NoTU6oiE6G9xRU0p_RdmtDSHpTfohuZJaJ5aKR79A_urNK",
|
||||
"alt": "雨夜海港小镇体素场景",
|
||||
"avatar": "https://lh3.googleusercontent.com/aida/ALJJyrDLyg7AU1ySfjAJjEDtdYKmClLRc_jv7DEclZtibuFCOccxah3R_teEs94FDau5tCxP5qu0qAzh-OytVAKb3OCIhtevXViHcuv-SN-cnoBgB1RnnXU1qUcmKlNM8iwvkcKb81j6gATNWLc-NhRs0GO9aiJ1cx9BmMQOuT7pwPL_EP7IszhcmgezNmbsp2D3shvSaQiSU0P_HBJYdZUBW4HIBvNnnve82NoCWhhgnHbzgP4yxbcq0WO3GkHK",
|
||||
"author": "有点AI思",
|
||||
"likes": 429,
|
||||
"ratio": 1.2,
|
||||
"video": true,
|
||||
"initiallyLiked": false
|
||||
}
|
||||
];
|
||||
|
||||
export const feedNotes = notes.slice(0, 9);
|
||||
@@ -1,6 +0,0 @@
|
||||
import { clsx, type ClassValue } from "clsx";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
const config: NextConfig = {
|
||||
agentRules: false,
|
||||
devIndicators: false,
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -1,30 +1,20 @@
|
||||
{
|
||||
"name": "bedrock-frontend",
|
||||
"version": "0.1.0",
|
||||
"name": "@bedrock/dashboard",
|
||||
"private": true,
|
||||
"engines": { "node": ">=22" },
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"dev": "next dev --hostname 127.0.0.1 --port 3001",
|
||||
"build": "next build",
|
||||
"start": "next start"
|
||||
"start": "next start --hostname 127.0.0.1 --port 3001"
|
||||
},
|
||||
"dependencies": {
|
||||
"@radix-ui/react-slot": "1.5.0",
|
||||
"class-variance-authority": "0.7.1",
|
||||
"clsx": "2.1.1",
|
||||
"lucide-react": "0.577.0",
|
||||
"next": "16.4.6",
|
||||
"react": "19.3.1",
|
||||
"react-dom": "19.3.1",
|
||||
"tailwind-merge": "3.7.3"
|
||||
"react-dom": "19.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/postcss": "4.3.5",
|
||||
"@types/node": "22.20.7",
|
||||
"@types/react": "19.3.0",
|
||||
"@types/react-dom": "19.3.0",
|
||||
"postcss": "8.5.34",
|
||||
"tailwindcss": "4.3.5",
|
||||
"typescript": "5.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
export default {
|
||||
plugins: { "@tailwindcss/postcss": {} },
|
||||
};
|
||||
@@ -1,7 +1,11 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2017",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"esnext"
|
||||
],
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
@@ -10,9 +14,28 @@
|
||||
"moduleResolution": "bundler",
|
||||
"isolatedModules": true,
|
||||
"jsx": "react-jsx",
|
||||
"plugins": [{ "name": "next" }],
|
||||
"paths": { "@/*": ["./*"] }
|
||||
"plugins": [
|
||||
{
|
||||
"name": "next"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"./*"
|
||||
]
|
||||
},
|
||||
"allowJs": true,
|
||||
"incremental": true,
|
||||
"resolveJsonModule": true
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", ".next/dev/types/**/*.ts"],
|
||||
"exclude": ["node_modules"]
|
||||
"include": [
|
||||
"next-env.d.ts",
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
".next/types/**/*.ts",
|
||||
".next/dev/types/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/node_modules/
|
||||
/.next/
|
||||
/out/
|
||||
/coverage/
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
.env*
|
||||
.DS_Store
|
||||
@@ -0,0 +1,123 @@
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Instrument Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-stretch: 100%;
|
||||
font-display: swap;
|
||||
src: url(/stitch/instrument-sans-1.woff2) format('woff2');
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Instrument Sans';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-stretch: 100%;
|
||||
font-display: swap;
|
||||
src: url(/stitch/instrument-sans-2.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Instrument Sans';
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
font-stretch: 100%;
|
||||
font-display: swap;
|
||||
src: url(/stitch/instrument-sans-1.woff2) format('woff2');
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Instrument Sans';
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
font-stretch: 100%;
|
||||
font-display: swap;
|
||||
src: url(/stitch/instrument-sans-2.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Instrument Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
font-stretch: 100%;
|
||||
font-display: swap;
|
||||
src: url(/stitch/instrument-sans-1.woff2) format('woff2');
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Instrument Sans';
|
||||
font-style: normal;
|
||||
font-weight: 600;
|
||||
font-stretch: 100%;
|
||||
font-display: swap;
|
||||
src: url(/stitch/instrument-sans-2.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
/* latin-ext */
|
||||
@font-face {
|
||||
font-family: 'Instrument Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-stretch: 100%;
|
||||
font-display: swap;
|
||||
src: url(/stitch/instrument-sans-1.woff2) format('woff2');
|
||||
unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
||||
}
|
||||
/* latin */
|
||||
@font-face {
|
||||
font-family: 'Instrument Sans';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
font-stretch: 100%;
|
||||
font-display: swap;
|
||||
src: url(/stitch/instrument-sans-2.woff2) format('woff2');
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
|
||||
/* fallback */
|
||||
@font-face {
|
||||
font-family: 'Material Symbols Outlined';
|
||||
font-style: normal;
|
||||
font-weight: 100 700;
|
||||
font-display: block;
|
||||
src: url(/stitch/material-symbols-1.woff2) format('woff2');
|
||||
}
|
||||
|
||||
.material-symbols-outlined {
|
||||
font-family: 'Material Symbols Outlined';
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-size: 24px;
|
||||
line-height: 1;
|
||||
letter-spacing: normal;
|
||||
text-transform: none;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
word-wrap: normal;
|
||||
direction: ltr;
|
||||
-webkit-font-feature-settings: 'liga';
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
.material-symbols-outlined, .material-symbols-rounded, .material-symbols-sharp, .material-icons {
|
||||
display: inline-block;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
line-height: 1 !important;
|
||||
box-sizing: content-box;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
direction: ltr;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.no-scrollbar::-webkit-scrollbar { display: none; }
|
||||
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
|
||||
@@ -0,0 +1,13 @@
|
||||
import type { Metadata } from "next";
|
||||
import type { ReactNode } from "react";
|
||||
import "./globals.css";
|
||||
|
||||
export const metadata: Metadata = { title: "X × 小红书 动态交互版" };
|
||||
|
||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
||||
return (
|
||||
<html lang="zh-CN" className="h-full">
|
||||
<body className="min-h-full flex flex-col bg-light-surface text-light-on-surface font-body antialiased">{children}</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { HomeDesign } from "@/components/home-design";
|
||||
import { HomeInteractions } from "@/components/home-interactions";
|
||||
|
||||
export default function Page() {
|
||||
return <><HomeDesign /><HomeInteractions /></>;
|
||||
}
|
||||
@@ -0,0 +1,704 @@
|
||||
export function HomeDesign() {
|
||||
return (
|
||||
<>
|
||||
<div className="flex-1 min-h-screen w-full flex bg-light-surface">
|
||||
|
||||
{/* Left Navigation Rail (X Design: Full on xl, Icon-Only on sm..lg, Hidden on mobile) */}
|
||||
<aside className="hidden sm:flex sm:flex-col sm:justify-between sm:items-center xl:items-stretch w-20 xl:w-60 shrink-0 px-gutter-sm xl:px-gutter-md py-gutter-md self-stretch bg-light-surface">
|
||||
<div className="sticky top-gutter-md flex flex-col items-center xl:items-stretch gap-gutter-xs">
|
||||
<button type="button" data-nav="home" aria-label="X Home" className="nav-switch inline-flex items-center justify-center w-12 h-12 rounded-full hover:bg-light-surface-container transition-colors duration-state-change">
|
||||
<svg viewBox="0 0 24 24" className="w-7 h-7 fill-current text-light-on-surface" aria-hidden="true">
|
||||
<path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"></path>
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<nav aria-label="Primary navigation" className="flex flex-col items-center xl:items-stretch gap-gutter-xs">
|
||||
<button type="button" data-nav="home" aria-current="page" className="nav-switch nav-item inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-title text-title-lg transition-colors duration-state-change text-left">
|
||||
<span className="nav-icon material-symbols-outlined text-headline-lg" style={{ fontVariationSettings: "'FILL' 1" }} aria-hidden="true">home</span>
|
||||
<span className="hidden xl:inline">Home</span>
|
||||
</button>
|
||||
<a href="#explore" className="inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change">
|
||||
<span className="material-symbols-outlined text-headline-lg" aria-hidden="true">search</span>
|
||||
<span className="hidden xl:inline">Explore</span>
|
||||
</a>
|
||||
<a href="#notifications" className="inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change">
|
||||
<span className="relative inline-flex">
|
||||
<span className="material-symbols-outlined text-headline-lg" aria-hidden="true">notifications</span>
|
||||
<span className="absolute -top-1 -right-1 inline-flex items-center justify-center w-4 h-4 rounded-full bg-light-tertiary text-light-on-tertiary font-label text-label-sm">2</span>
|
||||
</span>
|
||||
<span className="hidden xl:inline">Notifications</span>
|
||||
</a>
|
||||
<a href="#follow" className="inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change">
|
||||
<span className="material-symbols-outlined text-headline-lg" aria-hidden="true">person_add</span>
|
||||
<span className="hidden xl:inline">Follow</span>
|
||||
</a>
|
||||
<a href="#chat" className="inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change">
|
||||
<span className="material-symbols-outlined text-headline-lg" aria-hidden="true">mail</span>
|
||||
<span className="hidden xl:inline">Chat</span>
|
||||
</a>
|
||||
<a href="#grok" className="inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change">
|
||||
<span className="material-symbols-outlined text-headline-lg" aria-hidden="true">blur_on</span>
|
||||
<span className="hidden xl:inline">Grok</span>
|
||||
</a>
|
||||
<a href="#bookmarks" className="inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change">
|
||||
<span className="material-symbols-outlined text-headline-lg" aria-hidden="true">bookmark_border</span>
|
||||
<span className="hidden xl:inline">Bookmarks</span>
|
||||
</a>
|
||||
<a href="#creator-studio" className="inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change">
|
||||
<span className="material-symbols-outlined text-headline-lg" aria-hidden="true">science</span>
|
||||
<span className="hidden xl:inline">Creator Studio</span>
|
||||
</a>
|
||||
<a href="#premium" className="inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change">
|
||||
<span className="material-symbols-outlined text-headline-lg" aria-hidden="true">verified</span>
|
||||
<span className="hidden xl:inline">Premium</span>
|
||||
</a>
|
||||
<button type="button" data-nav="profile" className="nav-switch nav-item inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change text-left">
|
||||
<span className="nav-icon material-symbols-outlined text-headline-lg" aria-hidden="true">person_outline</span>
|
||||
<span className="hidden xl:inline">Profile</span>
|
||||
</button>
|
||||
<button type="button" className="inline-flex items-center justify-center xl:justify-start gap-gutter-lg p-2.5 xl:px-gutter-md xl:py-2.5 rounded-full hover:bg-light-surface-container text-light-on-surface font-body text-title-lg transition-colors duration-state-change text-left">
|
||||
<span className="material-symbols-outlined text-headline-lg" aria-hidden="true">pending</span>
|
||||
<span className="hidden xl:inline">More</span>
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
<div className="pt-gutter-md xl:pr-gutter-md">
|
||||
<button type="button" aria-label="Post" className="w-11 h-11 xl:w-full xl:h-auto xl:py-3 xl:px-gutter-xl rounded-full bg-light-primary text-light-on-primary font-label text-label-lg hover:opacity-90 transition-opacity duration-state-change inline-flex items-center justify-center">
|
||||
<span className="material-symbols-outlined text-headline-md xl:hidden" aria-hidden="true">edit</span>
|
||||
<span className="hidden xl:inline">Post</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="button" data-nav="profile" className="nav-switch flex items-center justify-center xl:justify-between gap-gutter-sm p-2 xl:p-gutter-md rounded-full hover:bg-light-surface-container bg-light-surface transition-colors duration-state-change text-left">
|
||||
<div className="flex items-center gap-gutter-md min-w-0">
|
||||
<img src="/stitch/profile-avatar.jpg" alt="有点AI思" className="w-10 h-10 rounded-full object-cover shrink-0" />
|
||||
<div className="hidden xl:flex flex-col min-w-0">
|
||||
<span className="font-title text-title-md text-light-on-surface truncate">有点AI思</span>
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">@you_dian_ai</span>
|
||||
</div>
|
||||
</div>
|
||||
<span className="hidden xl:inline material-symbols-outlined text-title-lg text-light-on-surface-variant shrink-0" aria-hidden="true">more_horiz</span>
|
||||
</button>
|
||||
</aside>
|
||||
|
||||
{/* Center Column: Dynamic Switchable Views (Home Feed <-> User Profile) */}
|
||||
<main className="flex-1 min-w-0 border-x border-light-outline-variant min-h-screen flex flex-col">
|
||||
|
||||
{/* VIEW 1: HOME FEED */}
|
||||
<div id="view-home" className="flex flex-col">
|
||||
{/* Sticky Top Feed Tabs & Channel Strip + Column Switcher */}
|
||||
<header className="sticky top-0 z-20 bg-light-surface/95 border-b border-light-outline-variant">
|
||||
<div role="tablist" aria-label="Timeline feed" className="grid grid-cols-2 border-b border-light-outline-variant">
|
||||
<button role="tab" data-feed="for-you" aria-selected="true" className="feed-tab relative py-gutter-md flex items-center justify-center font-title text-title-md text-light-on-surface hover:bg-light-surface-container-low transition-colors duration-state-change">
|
||||
<span>For you</span>
|
||||
<span className="tab-indicator absolute bottom-0 w-16 h-1 rounded-full bg-x-blue"></span>
|
||||
</button>
|
||||
<button role="tab" data-feed="following" aria-selected="false" className="feed-tab relative py-gutter-md flex items-center justify-center font-title text-title-md text-light-on-surface-variant hover:bg-light-surface-container-low transition-colors duration-state-change">
|
||||
<span>Following</span>
|
||||
<span className="tab-indicator hidden absolute bottom-0 w-20 h-1 rounded-full bg-x-blue"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Xiaohongshu Channel Filter Pills */}
|
||||
<div role="tablist" aria-label="内容频道" className="flex items-center gap-gutter-sm px-gutter-lg py-gutter-sm overflow-x-auto no-scrollbar">
|
||||
<button role="tab" data-category="all" aria-selected="true" className="channel-pill px-gutter-md py-1 rounded-full bg-light-primary text-light-on-primary font-label text-label-md whitespace-nowrap">
|
||||
<span>推荐</span>
|
||||
</button>
|
||||
<button role="tab" data-category="旅行" aria-selected="false" className="channel-pill px-gutter-md py-1 rounded-full bg-light-surface-container text-light-on-surface-variant hover:text-light-on-surface font-label text-label-md whitespace-nowrap">
|
||||
<span>旅行</span>
|
||||
</button>
|
||||
<button role="tab" data-category="游戏" aria-selected="false" className="channel-pill px-gutter-md py-1 rounded-full bg-light-surface-container text-light-on-surface-variant hover:text-light-on-surface font-label text-label-md whitespace-nowrap">
|
||||
<span>游戏</span>
|
||||
</button>
|
||||
<button role="tab" data-category="视频" aria-selected="false" className="channel-pill px-gutter-md py-1 rounded-full bg-light-surface-container text-light-on-surface-variant hover:text-light-on-surface font-label text-label-md whitespace-nowrap">
|
||||
<span>视频</span>
|
||||
</button>
|
||||
<button role="tab" data-category="职场" aria-selected="false" className="channel-pill px-gutter-md py-1 rounded-full bg-light-surface-container text-light-on-surface-variant hover:text-light-on-surface font-label text-label-md whitespace-nowrap">
|
||||
<span>职场</span>
|
||||
</button>
|
||||
<button role="tab" data-category="情感" aria-selected="false" className="channel-pill px-gutter-md py-1 rounded-full bg-light-surface-container text-light-on-surface-variant hover:text-light-on-surface font-label text-label-md whitespace-nowrap">
|
||||
<span>情感</span>
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{/* Responsive Waterfall Grid (2-col on mobile/tablet, 3-col on lg+) */}
|
||||
<div id="home-note-feed" className="p-gutter-sm sm:p-gutter-md columns-2 lg:columns-3 gap-gutter-md space-y-gutter-md">
|
||||
|
||||
|
||||
<article data-category="游戏" data-following="true" className="note-card break-inside-avoid flex flex-col gap-gutter-xs group cursor-pointer">
|
||||
<div className="relative overflow-hidden rounded-md bg-light-surface-container-low border border-light-outline-variant">
|
||||
<img src="/stitch/fish-game.jpg" alt="彩色手绘小鱼游戏封面" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
||||
</div>
|
||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
||||
<h3 className="font-body text-body-md text-light-on-surface truncate">这游戏能卖80万美元</h3>
|
||||
<div className="flex items-center justify-between">
|
||||
<button type="button" data-nav="profile" className="nav-switch flex items-center gap-gutter-xs min-w-0 hover:underline">
|
||||
<img src="/stitch/bbg-avatar.jpg" alt="BBGame" className="w-4 h-4 rounded-full object-cover shrink-0" />
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">BBGame</span>
|
||||
</button>
|
||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="483" aria-label="点赞">
|
||||
<span className="material-symbols-outlined text-body-md like-icon" aria-hidden="true">favorite_border</span>
|
||||
<span className="font-body text-body-sm tabular-nums like-count">483</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
<article data-category="视频" data-following="true" className="note-card break-inside-avoid flex flex-col gap-gutter-xs group cursor-pointer">
|
||||
<div className="relative overflow-hidden rounded-md bg-light-surface-container-low border border-light-outline-variant">
|
||||
<img src="/stitch/rainy-harbor.jpg" alt="雨夜海港小镇体素场景" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
||||
<span className="absolute top-gutter-sm right-gutter-sm inline-flex items-center justify-center w-6 h-6 rounded-full bg-light-primary/70 text-light-on-primary">
|
||||
<span className="material-symbols-outlined text-body-md" style={{ fontVariationSettings: "'FILL' 1" }} aria-hidden="true">play_arrow</span>
|
||||
</span>
|
||||
</div>
|
||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
||||
<h3 className="font-body text-body-md text-light-on-surface truncate">雨夜海港太治愈</h3>
|
||||
<div className="flex items-center justify-between">
|
||||
<button type="button" data-nav="profile" className="nav-switch flex items-center gap-gutter-xs min-w-0 hover:underline">
|
||||
<img src="/stitch/rainy-harbor.jpg" alt="像素造梦师" className="w-4 h-4 rounded-full object-cover shrink-0" />
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">像素造梦师</span>
|
||||
</button>
|
||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="1284" aria-label="点赞">
|
||||
<span className="material-symbols-outlined text-body-md like-icon" aria-hidden="true">favorite_border</span>
|
||||
<span className="font-body text-body-sm tabular-nums like-count">1284</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
<article data-category="情感" data-following="false" className="note-card break-inside-avoid flex flex-col gap-gutter-xs group cursor-pointer">
|
||||
<div className="relative overflow-hidden rounded-md bg-light-surface-container-low border border-light-outline-variant">
|
||||
<img src="/stitch/golden-retriever.jpg" alt="家里新来的小金毛" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
||||
</div>
|
||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
||||
<h3 className="font-body text-body-md text-light-on-surface truncate">小金毛太粘人啦</h3>
|
||||
<div className="flex items-center justify-between">
|
||||
<button type="button" data-nav="profile" className="nav-switch flex items-center gap-gutter-xs min-w-0 hover:underline">
|
||||
<img src="/stitch/golden-retriever.jpg" alt="单棱镜" className="w-4 h-4 rounded-full object-cover shrink-0" />
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">单棱镜</span>
|
||||
</button>
|
||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="1520" aria-label="点赞">
|
||||
<span className="material-symbols-outlined text-body-md like-icon" aria-hidden="true">favorite_border</span>
|
||||
<span className="font-body text-body-sm tabular-nums like-count">1520</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
<article data-category="旅行" data-following="true" className="note-card break-inside-avoid flex flex-col gap-gutter-xs group cursor-pointer">
|
||||
<div className="relative overflow-hidden rounded-md bg-light-surface-container-low border border-light-outline-variant">
|
||||
<img src="/stitch/chengdu.jpg" alt="成都环形城市航拍图" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
||||
<div className="absolute inset-0 bg-light-primary/65 flex flex-col items-center justify-center p-gutter-sm">
|
||||
<span className="font-headline text-title-lg text-light-on-primary">成都</span>
|
||||
<span className="font-title text-title-md text-light-on-primary">巨大的“圈”</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
||||
<h3 className="font-body text-body-md text-light-on-surface truncate">成都到底有几个圈?</h3>
|
||||
<div className="flex items-center justify-between">
|
||||
<button type="button" data-nav="profile" className="nav-switch flex items-center gap-gutter-xs min-w-0 hover:underline">
|
||||
<img src="/stitch/chengdu.jpg" alt="西游兔" className="w-4 h-4 rounded-full object-cover shrink-0" />
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">西游兔</span>
|
||||
</button>
|
||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="3936" aria-label="点赞">
|
||||
<span className="material-symbols-outlined text-body-md like-icon" aria-hidden="true">favorite_border</span>
|
||||
<span className="font-body text-body-sm tabular-nums like-count">3936</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
<article data-category="游戏" data-following="true" className="note-card break-inside-avoid flex flex-col gap-gutter-xs group cursor-pointer">
|
||||
<div className="relative overflow-hidden rounded-md bg-light-surface-container-low border border-light-outline-variant">
|
||||
<img src="/stitch/dungeon.jpg" alt="街机厅的玩家和游戏屏幕" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
||||
</div>
|
||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
||||
<h3 className="font-body text-body-md text-light-on-surface truncate">独立游戏一周目实录</h3>
|
||||
<div className="flex items-center justify-between">
|
||||
<button type="button" data-nav="profile" className="nav-switch flex items-center gap-gutter-xs min-w-0 hover:underline">
|
||||
<img src="/stitch/chengdu.jpg" alt="阿宅玩游戏" className="w-4 h-4 rounded-full object-cover shrink-0" />
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">阿宅玩游戏</span>
|
||||
</button>
|
||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="742" aria-label="点赞">
|
||||
<span className="material-symbols-outlined text-body-md like-icon" aria-hidden="true">favorite_border</span>
|
||||
<span className="font-body text-body-sm tabular-nums like-count">742</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
<article data-category="职场" data-following="true" className="note-card break-inside-avoid flex flex-col gap-gutter-xs group cursor-pointer">
|
||||
<div className="relative overflow-hidden rounded-md bg-light-surface-container-low border border-light-outline-variant p-gutter-sm flex flex-col gap-gutter-xs">
|
||||
<span className="font-title text-title-md text-light-on-surface">AI编程助手</span>
|
||||
<img src="/stitch/ai-tools.jpg" alt="桌面上的笔记本电脑" className="w-full h-auto rounded-sm object-cover" />
|
||||
</div>
|
||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
||||
<h3 className="font-body text-body-md text-light-on-surface truncate">AI助手实测对比</h3>
|
||||
<div className="flex items-center justify-between">
|
||||
<button type="button" data-nav="profile" className="nav-switch flex items-center gap-gutter-xs min-w-0 hover:underline">
|
||||
<img src="/stitch/profile-avatar.jpg" alt="有点AI思" className="w-4 h-4 rounded-full object-cover shrink-0" />
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">有点AI思</span>
|
||||
</button>
|
||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="612" aria-label="点赞">
|
||||
<span className="material-symbols-outlined text-body-md like-icon" aria-hidden="true">favorite_border</span>
|
||||
<span className="font-body text-body-sm tabular-nums like-count">612</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
<article data-category="旅行" data-following="false" className="note-card break-inside-avoid flex flex-col gap-gutter-xs group cursor-pointer">
|
||||
<div className="relative overflow-hidden rounded-md bg-light-surface-container-low border border-light-outline-variant">
|
||||
<img src="/stitch/skyline.jpg" alt="夜色雾气中的城市天际线" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
||||
</div>
|
||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
||||
<h3 className="font-body text-body-md text-light-on-surface truncate">夜幕降临的城市天际线</h3>
|
||||
<div className="flex items-center justify-between">
|
||||
<button type="button" data-nav="profile" className="nav-switch flex items-center gap-gutter-xs min-w-0 hover:underline">
|
||||
<img src="/stitch/rainy-harbor.jpg" alt="Wingman" className="w-4 h-4 rounded-full object-cover shrink-0" />
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">Wingman</span>
|
||||
</button>
|
||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="528" aria-label="点赞">
|
||||
<span className="material-symbols-outlined text-body-md like-icon" aria-hidden="true">favorite_border</span>
|
||||
<span className="font-body text-body-sm tabular-nums like-count">528</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
<article data-category="职场" data-following="true" className="note-card break-inside-avoid flex flex-col gap-gutter-xs group cursor-pointer">
|
||||
<div className="relative overflow-hidden rounded-md bg-light-surface-container-low border border-light-outline-variant">
|
||||
<img src="/stitch/workspace.jpg" alt="光线照进写字台" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
||||
</div>
|
||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
||||
<h3 className="font-body text-body-md text-light-on-surface truncate">午后光影工作台灵感</h3>
|
||||
<div className="flex items-center justify-between">
|
||||
<button type="button" data-nav="profile" className="nav-switch flex items-center gap-gutter-xs min-w-0 hover:underline">
|
||||
<img src="/stitch/profile-avatar.jpg" alt="有点AI思" className="w-4 h-4 rounded-full object-cover shrink-0" />
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">有点AI思</span>
|
||||
</button>
|
||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="true" data-count="842" aria-label="点赞">
|
||||
<span className="material-symbols-outlined text-body-md like-icon text-light-error" style={{ fontVariationSettings: "'FILL' 1" }} aria-hidden="true">favorite</span>
|
||||
<span className="font-body text-body-sm tabular-nums like-count">842</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
|
||||
<article data-category="旅行" data-following="false" className="note-card break-inside-avoid flex flex-col gap-gutter-xs group cursor-pointer">
|
||||
<div className="relative overflow-hidden rounded-md bg-light-surface-container-low border border-light-outline-variant">
|
||||
<img src="/stitch/film-walk.jpg" alt="街头漫步摄影" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
||||
</div>
|
||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
||||
<h3 className="font-body text-body-md text-light-on-surface truncate">城市街头胶片漫步</h3>
|
||||
<div className="flex items-center justify-between">
|
||||
<button type="button" data-nav="profile" className="nav-switch flex items-center gap-gutter-xs min-w-0 hover:underline">
|
||||
<img src="/stitch/chengdu.jpg" alt="胶片日志" className="w-4 h-4 rounded-full object-cover shrink-0" />
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">胶片日志</span>
|
||||
</button>
|
||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="946" aria-label="点赞">
|
||||
<span className="material-symbols-outlined text-body-md like-icon" aria-hidden="true">favorite_border</span>
|
||||
<span className="font-body text-body-sm tabular-nums like-count">946</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* VIEW 2: USER PROFILE */}
|
||||
<div id="view-profile" className="hidden flex-col">
|
||||
{/* Sticky Top Profile Bar (Back Arrow returns to Home) */}
|
||||
<header className="sticky top-0 z-20 bg-light-surface/95 border-b border-light-outline-variant px-gutter-lg py-gutter-sm flex items-center justify-between gap-gutter-md">
|
||||
<div className="flex items-center gap-gutter-lg min-w-0">
|
||||
<button type="button" data-nav="home" aria-label="返回首页" className="nav-switch inline-flex items-center justify-center w-9 h-9 rounded-full hover:bg-light-surface-container text-light-on-surface transition-colors duration-state-change shrink-0">
|
||||
<span className="material-symbols-outlined text-headline-md" aria-hidden="true">arrow_back</span>
|
||||
</button>
|
||||
<div className="flex flex-col min-w-0">
|
||||
<div className="flex items-center gap-gutter-xs">
|
||||
<h1 className="font-headline text-headline-md text-light-on-surface truncate">有点AI思</h1>
|
||||
<span className="material-symbols-outlined text-title-lg text-x-blue shrink-0" style={{ fontVariationSettings: "'FILL' 1" }} aria-label="已认证">verified</span>
|
||||
</div>
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant tabular-nums">128 篇笔记</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-gutter-xs shrink-0">
|
||||
<button type="button" aria-label="搜索TA的笔记" className="inline-flex items-center justify-center w-9 h-9 rounded-full hover:bg-light-surface-container text-light-on-surface transition-colors duration-state-change">
|
||||
<span className="material-symbols-outlined text-headline-md" aria-hidden="true">search</span>
|
||||
</button>
|
||||
<button type="button" aria-label="Grok 总结主页" className="inline-flex items-center justify-center w-9 h-9 rounded-full hover:bg-light-surface-container text-light-on-surface transition-colors duration-state-change">
|
||||
<span className="material-symbols-outlined text-headline-md" aria-hidden="true">blur_on</span>
|
||||
</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{/* Cover Banner & Overlapping Avatar + Actions */}
|
||||
<section aria-label="个人资料头部">
|
||||
<div className="h-48 w-full overflow-hidden bg-light-surface-container">
|
||||
<img src="/stitch/profile-banner.jpg" alt="个人主页背景封面" className="w-full h-full object-cover" />
|
||||
</div>
|
||||
|
||||
<div className="px-gutter-lg pb-gutter-md flex flex-col gap-gutter-md">
|
||||
<div className="flex items-end justify-between gap-gutter-md">
|
||||
<div className="-mt-14 w-28 h-28 rounded-full border-4 border-light-surface overflow-hidden bg-light-surface shrink-0">
|
||||
<img src="/stitch/profile-avatar.jpg" alt="有点AI思头像" className="w-full h-full object-cover" />
|
||||
</div>
|
||||
|
||||
<div className="relative flex items-center gap-gutter-sm pt-gutter-sm">
|
||||
<button id="profile-more-btn" type="button" aria-label="更多选项" aria-expanded="false" aria-haspopup="menu" className="inline-flex items-center justify-center w-9 h-9 rounded-full border border-light-outline bg-light-surface hover:bg-light-surface-container text-light-on-surface transition-colors duration-state-change">
|
||||
<span className="material-symbols-outlined text-title-lg" aria-hidden="true">more_horiz</span>
|
||||
</button>
|
||||
|
||||
<div id="profile-more-menu" role="menu" className="hidden absolute right-0 top-12 z-30 w-60 rounded-lg bg-light-surface border border-light-outline-variant shadow-lg py-gutter-xs">
|
||||
<button id="open-about-btn" type="button" role="menuitem" className="w-full px-gutter-lg py-2.5 flex items-center gap-gutter-md text-left hover:bg-light-surface-container-low text-light-on-surface font-title text-title-md">
|
||||
<span className="material-symbols-outlined text-title-lg text-light-on-surface" aria-hidden="true">info</span>
|
||||
<span>About this account</span>
|
||||
</button>
|
||||
<button type="button" role="menuitem" className="w-full px-gutter-lg py-2.5 flex items-center gap-gutter-md text-left hover:bg-light-surface-container-low text-light-on-surface font-title text-title-md">
|
||||
<span className="material-symbols-outlined text-title-lg text-light-on-surface" aria-hidden="true">chat_bubble_outline</span>
|
||||
<span>View Topics</span>
|
||||
</button>
|
||||
<button type="button" role="menuitem" className="w-full px-gutter-lg py-2.5 flex items-center gap-gutter-md text-left hover:bg-light-surface-container-low text-light-on-surface font-title text-title-md">
|
||||
<span className="material-symbols-outlined text-title-lg text-light-on-surface" aria-hidden="true">link</span>
|
||||
<span>Copy link to profile</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button type="button" aria-label="发送私信" className="inline-flex items-center justify-center w-9 h-9 rounded-full border border-light-outline bg-light-surface hover:bg-light-surface-container text-light-on-surface transition-colors duration-state-change">
|
||||
<span className="material-symbols-outlined text-title-lg" aria-hidden="true">mail</span>
|
||||
</button>
|
||||
<button type="button" aria-label="开启更新提醒" className="inline-flex items-center justify-center w-9 h-9 rounded-full border border-light-outline bg-light-surface hover:bg-light-surface-container text-light-on-surface transition-colors duration-state-change">
|
||||
<span className="material-symbols-outlined text-title-lg" aria-hidden="true">notifications_none</span>
|
||||
</button>
|
||||
<button id="profile-follow-btn" type="button" data-following="false" className="px-gutter-lg py-2 rounded-full bg-light-primary text-light-on-primary font-label text-label-md hover:opacity-90 transition-opacity duration-state-change whitespace-nowrap">
|
||||
<span>Follow</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-col gap-gutter-sm">
|
||||
<div className="flex flex-col gap-gutter-xs">
|
||||
<div className="flex items-center gap-gutter-xs">
|
||||
<h2 className="font-headline text-headline-lg text-light-on-surface">有点AI思</h2>
|
||||
<span className="material-symbols-outlined text-title-lg text-x-blue" style={{ fontVariationSettings: "'FILL' 1" }} aria-label="已认证">verified</span>
|
||||
</div>
|
||||
<div className="flex flex-wrap items-center gap-gutter-sm font-body text-body-sm text-light-on-surface-variant">
|
||||
<span>@you_dian_ai</span>
|
||||
<span aria-hidden="true">·</span>
|
||||
<span className="tabular-nums">小红书号:18665824520</span>
|
||||
<span aria-hidden="true">·</span>
|
||||
<span>IP属地:四川</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p className="font-body text-body-md text-light-on-surface max-w-prose text-pretty">
|
||||
Software is eating the world, AI is eating software. 分享 AI 产品拆解、独立开发实验与数字生活灵感。
|
||||
</p>
|
||||
|
||||
<div className="flex flex-wrap items-center gap-gutter-lg font-body text-body-sm text-light-on-surface-variant">
|
||||
<span className="inline-flex items-center gap-gutter-xs">
|
||||
<span className="material-symbols-outlined text-title-md" aria-hidden="true">location_on</span>
|
||||
<span>成都 · 四川</span>
|
||||
</span>
|
||||
<button id="joined-date-btn" type="button" className="inline-flex items-center gap-gutter-xs hover:underline text-light-on-surface-variant">
|
||||
<span className="material-symbols-outlined text-title-md" aria-hidden="true">calendar_month</span>
|
||||
<span>Joined April 2022</span>
|
||||
<span className="material-symbols-outlined text-title-md" aria-hidden="true">chevron_right</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div className="flex flex-wrap items-center gap-gutter-lg pt-gutter-xs">
|
||||
<span className="inline-flex items-baseline gap-gutter-xs">
|
||||
<span className="font-title text-title-md text-light-on-surface tabular-nums">10</span>
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant">关注</span>
|
||||
</span>
|
||||
<span className="inline-flex items-baseline gap-gutter-xs">
|
||||
<span className="font-title text-title-md text-light-on-surface tabular-nums">87</span>
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant">粉丝</span>
|
||||
</span>
|
||||
<span className="inline-flex items-baseline gap-gutter-xs">
|
||||
<span className="font-title text-title-md text-light-on-surface tabular-nums">2,987</span>
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant">获赞与收藏</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{/* Profile Content Tabs */}
|
||||
<div role="tablist" aria-label="个人主页内容分类" className="grid grid-cols-4 border-b border-light-outline-variant bg-light-surface sticky top-14 z-10">
|
||||
<button role="tab" data-tab="notes" aria-selected="true" className="profile-tab relative py-gutter-md flex items-center justify-center font-title text-title-md text-light-on-surface hover:bg-light-surface-container-low transition-colors duration-state-change">
|
||||
<span>笔记</span>
|
||||
<span className="tab-indicator absolute bottom-0 w-12 h-1 rounded-full bg-x-blue"></span>
|
||||
</button>
|
||||
<button role="tab" data-tab="saved" aria-selected="false" className="profile-tab relative py-gutter-md flex items-center justify-center font-title text-title-md text-light-on-surface-variant hover:bg-light-surface-container-low transition-colors duration-state-change">
|
||||
<span>收藏</span>
|
||||
<span className="tab-indicator hidden absolute bottom-0 w-12 h-1 rounded-full bg-x-blue"></span>
|
||||
</button>
|
||||
<button role="tab" data-tab="likes" aria-selected="false" className="profile-tab relative py-gutter-md flex items-center justify-center font-title text-title-md text-light-on-surface-variant hover:bg-light-surface-container-low transition-colors duration-state-change">
|
||||
<span>点赞</span>
|
||||
<span className="tab-indicator hidden absolute bottom-0 w-12 h-1 rounded-full bg-x-blue"></span>
|
||||
</button>
|
||||
<button role="tab" data-tab="history" aria-selected="false" className="profile-tab relative py-gutter-md flex items-center justify-center font-title text-title-md text-light-on-surface-variant hover:bg-light-surface-container-low transition-colors duration-state-change">
|
||||
<span>浏览记录</span>
|
||||
<span className="tab-indicator hidden absolute bottom-0 w-16 h-1 rounded-full bg-x-blue"></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Profile Panel: 笔记 */}
|
||||
<section id="panel-notes" role="tabpanel" className="p-gutter-lg columns-2 lg:columns-3 gap-gutter-md space-y-gutter-md">
|
||||
<article className="break-inside-avoid flex flex-col gap-gutter-sm group cursor-pointer">
|
||||
<div className="relative overflow-hidden rounded-lg bg-light-surface-container-low border border-light-outline-variant">
|
||||
<img src="/stitch/workspace.jpg" alt="彩色玻璃光影桌面" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
||||
<span className="absolute top-gutter-sm left-gutter-sm px-gutter-sm py-0.5 rounded-full bg-light-primary/75 text-light-on-primary font-label text-label-sm">置顶</span>
|
||||
</div>
|
||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
||||
<h3 className="font-title text-title-md text-light-on-surface truncate">午后光影里的工作台灵感</h3>
|
||||
<div className="flex items-center justify-between pt-gutter-xs">
|
||||
<div className="flex items-center gap-gutter-xs min-w-0">
|
||||
<img src="/stitch/profile-avatar.jpg" alt="有点AI思" className="w-5 h-5 rounded-full object-cover shrink-0" />
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">有点AI思</span>
|
||||
</div>
|
||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-error shrink-0" data-liked="true" data-count="842" aria-label="点赞">
|
||||
<span className="material-symbols-outlined text-title-md like-icon" style={{ fontVariationSettings: "'FILL' 1" }} aria-hidden="true">favorite</span>
|
||||
<span className="font-body text-body-sm tabular-nums like-count">842</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article className="break-inside-avoid flex flex-col gap-gutter-sm group cursor-pointer">
|
||||
<div className="relative overflow-hidden rounded-lg bg-light-surface-container-low border border-light-outline-variant p-gutter-md flex flex-col gap-gutter-sm">
|
||||
<span className="font-title text-title-md text-light-on-surface">AI 编程助手实测对比</span>
|
||||
<img src="/stitch/ai-tools.jpg" alt="AI 编程助手实测插画" className="w-full h-auto rounded-md object-cover" />
|
||||
</div>
|
||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
||||
<h3 className="font-title text-title-md text-light-on-surface truncate">2026 个人开发者工作流</h3>
|
||||
<div className="flex items-center justify-between pt-gutter-xs">
|
||||
<div className="flex items-center gap-gutter-xs min-w-0">
|
||||
<img src="/stitch/profile-avatar.jpg" alt="有点AI思" className="w-5 h-5 rounded-full object-cover shrink-0" />
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">有点AI思</span>
|
||||
</div>
|
||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="615" aria-label="点赞">
|
||||
<span className="material-symbols-outlined text-title-md like-icon" aria-hidden="true">favorite_border</span>
|
||||
<span className="font-body text-body-sm tabular-nums like-count">615</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article className="break-inside-avoid flex flex-col gap-gutter-sm group cursor-pointer">
|
||||
<div className="relative overflow-hidden rounded-lg bg-light-surface-container-low border border-light-outline-variant">
|
||||
<img src="/stitch/rainy-harbor.jpg" alt="雨夜海港小镇体素场景" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
||||
<span className="absolute top-gutter-sm right-gutter-sm inline-flex items-center justify-center w-6 h-6 rounded-full bg-light-primary/70 text-light-on-primary">
|
||||
<span className="material-symbols-outlined text-body-md" style={{ fontVariationSettings: "'FILL' 1" }} aria-hidden="true">play_arrow</span>
|
||||
</span>
|
||||
</div>
|
||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
||||
<h3 className="font-title text-title-md text-light-on-surface truncate">用体素引擎做海港微缩模型</h3>
|
||||
<div className="flex items-center justify-between pt-gutter-xs">
|
||||
<div className="flex items-center gap-gutter-xs min-w-0">
|
||||
<img src="/stitch/profile-avatar.jpg" alt="有点AI思" className="w-5 h-5 rounded-full object-cover shrink-0" />
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">有点AI思</span>
|
||||
</div>
|
||||
<button type="button" className="like-btn inline-flex items-center gap-gutter-xs text-light-on-surface-variant hover:text-light-error shrink-0" data-liked="false" data-count="429" aria-label="点赞">
|
||||
<span className="material-symbols-outlined text-title-md like-icon" aria-hidden="true">favorite_border</span>
|
||||
<span className="font-body text-body-sm tabular-nums like-count">429</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
{/* Profile Panel: 收藏 */}
|
||||
<section id="panel-saved" role="tabpanel" className="hidden p-gutter-lg columns-2 lg:columns-3 gap-gutter-md space-y-gutter-md">
|
||||
<article className="break-inside-avoid flex flex-col gap-gutter-sm group cursor-pointer">
|
||||
<div className="relative overflow-hidden rounded-lg bg-light-surface-container-low border border-light-outline-variant">
|
||||
<img src="/stitch/stairs.jpg" alt="建筑楼梯光影摄影" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
||||
</div>
|
||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
||||
<h3 className="font-title text-title-md text-light-on-surface truncate">极简楼梯光影构图参考</h3>
|
||||
<div className="flex items-center justify-between pt-gutter-xs">
|
||||
<div className="flex items-center gap-gutter-xs min-w-0">
|
||||
<img src="/stitch/rainy-harbor.jpg" alt="建筑笔记" className="w-5 h-5 rounded-full object-cover shrink-0" />
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">建筑笔记</span>
|
||||
</div>
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant tabular-nums">1.2K</span>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
{/* Profile Panel: 点赞 */}
|
||||
<section id="panel-likes" role="tabpanel" className="hidden p-gutter-lg columns-2 lg:columns-3 gap-gutter-md space-y-gutter-md">
|
||||
<article className="break-inside-avoid flex flex-col gap-gutter-sm group cursor-pointer">
|
||||
<div className="relative overflow-hidden rounded-lg bg-light-surface-container-low border border-light-outline-variant">
|
||||
<img src="/stitch/golden-retriever.jpg" alt="小金毛日常" className="w-full h-auto object-cover group-hover:scale-105 transition-transform duration-state-change" />
|
||||
</div>
|
||||
<div className="px-gutter-xs flex flex-col gap-gutter-xs">
|
||||
<h3 className="font-title text-title-md text-light-on-surface truncate">家里新来的小金毛太粘人</h3>
|
||||
<div className="flex items-center justify-between pt-gutter-xs">
|
||||
<div className="flex items-center gap-gutter-xs min-w-0">
|
||||
<img src="/stitch/golden-retriever.jpg" alt="单棱镜" className="w-5 h-5 rounded-full object-cover shrink-0" />
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">单棱镜</span>
|
||||
</div>
|
||||
<span className="font-body text-body-sm text-light-error tabular-nums">1,520</span>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
{/* Profile Panel: 浏览记录 */}
|
||||
<section id="panel-history" role="tabpanel" className="hidden p-gutter-lg flex flex-col items-center justify-center gap-gutter-sm py-section text-center">
|
||||
<span className="material-symbols-outlined text-headline-lg text-light-on-surface-variant" aria-hidden="true">history</span>
|
||||
<p className="font-title text-title-md text-light-on-surface">仅自己可见</p>
|
||||
<p className="font-body text-body-sm text-light-on-surface-variant max-w-prose">近期浏览的笔记记录会保存在这里,方便随时回看。</p>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
|
||||
{/* Right Discovery Sidebar (X Design: Visible md+, Hidden below 768px) */}
|
||||
<aside className="hidden md:flex md:flex-col md:justify-between gap-gutter-lg w-72 xl:w-80 shrink-0 px-gutter-lg xl:px-gutter-xl py-gutter-md self-stretch">
|
||||
<div className="flex flex-col gap-gutter-lg">
|
||||
<div className="sticky top-0 pt-gutter-xs pb-gutter-xs bg-light-surface z-10">
|
||||
<form role="search" className="flex items-center gap-gutter-sm px-gutter-lg py-2.5 rounded-full bg-light-surface border border-light-outline focus-within:border-light-tertiary">
|
||||
<span className="material-symbols-outlined text-title-lg text-light-on-surface-variant" aria-hidden="true">search</span>
|
||||
<input type="search" aria-label="Search X" placeholder="Search" className="w-full bg-transparent border-none p-0 font-body text-body-md text-light-on-surface placeholder:text-light-on-surface-variant focus:ring-0" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<section aria-label="Subscribe to Premium" className="rounded-lg border border-light-outline-variant p-gutter-lg flex flex-col gap-gutter-sm bg-light-surface">
|
||||
<div className="flex items-center justify-between gap-gutter-xs">
|
||||
<h2 className="font-headline text-title-lg text-light-on-surface whitespace-nowrap">Subscribe to Premium</h2>
|
||||
<span className="px-gutter-sm py-0.5 rounded-full bg-light-primary-container text-light-on-primary-container font-label text-label-sm whitespace-nowrap shrink-0">50% off</span>
|
||||
</div>
|
||||
<p className="font-body text-body-md text-light-on-surface">Get rid of ads, see your analytics, boost your replies and unlock 20+ features.</p>
|
||||
<div className="pt-gutter-xs">
|
||||
<button type="button" className="px-gutter-lg py-2 rounded-full bg-light-tertiary text-light-on-tertiary font-label text-label-lg hover:opacity-90">
|
||||
<span>Subscribe</span>
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section aria-label="You might like" className="rounded-lg border border-light-outline-variant p-gutter-lg flex flex-col gap-gutter-md bg-light-surface">
|
||||
<h2 className="font-headline text-headline-md text-light-on-surface">You might like</h2>
|
||||
<div className="flex items-center justify-between gap-gutter-sm">
|
||||
<div className="flex items-center gap-gutter-md min-w-0">
|
||||
<img src="/stitch/bbg-avatar.jpg" alt="Low Quality Memes" className="w-10 h-10 rounded-full object-cover shrink-0" />
|
||||
<div className="flex flex-col min-w-0">
|
||||
<span className="font-title text-title-md text-light-on-surface truncate">Low Quality Memes</span>
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">@ipostlqmemes</span>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" className="follow-btn px-gutter-lg py-1.5 rounded-full bg-light-primary text-light-on-primary font-label text-label-md shrink-0" data-following="false">
|
||||
<span>Follow</span>
|
||||
</button>
|
||||
</div>
|
||||
<div className="flex items-center justify-between gap-gutter-sm">
|
||||
<div className="flex items-center gap-gutter-md min-w-0">
|
||||
<img src="/stitch/ai-tools.jpg" alt="极客小分队" className="w-10 h-10 rounded-full object-cover shrink-0" />
|
||||
<div className="flex flex-col min-w-0">
|
||||
<span className="font-title text-title-md text-light-on-surface truncate">极客小分队</span>
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant truncate">@geek_squad_cn</span>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" className="follow-btn px-gutter-lg py-1.5 rounded-full bg-light-primary text-light-on-primary font-label text-label-md shrink-0" data-following="false">
|
||||
<span>Follow</span>
|
||||
</button>
|
||||
</div>
|
||||
<a href="#show-more-people" className="font-body text-body-md text-light-tertiary hover:underline">Show more</a>
|
||||
</section>
|
||||
|
||||
<section aria-label="What's happening" className="rounded-lg border border-light-outline-variant p-gutter-lg flex flex-col gap-gutter-md bg-light-surface">
|
||||
<h2 className="font-headline text-headline-md text-light-on-surface">What's happening</h2>
|
||||
<div className="flex flex-col gap-gutter-md">
|
||||
<div className="flex flex-col">
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant">Technology · Trending</span>
|
||||
<span className="font-title text-title-md text-light-on-surface">#AICoding2026</span>
|
||||
</div>
|
||||
<div className="flex flex-col">
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant">Design · Trending</span>
|
||||
<span className="font-title text-title-md text-light-on-surface">小红书瀑布流</span>
|
||||
</div>
|
||||
<a href="#show-more" className="font-body text-body-md text-light-tertiary hover:underline">Show more</a>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<footer className="pt-gutter-md pb-gutter-sm flex flex-wrap gap-x-gutter-md gap-y-gutter-xs font-body text-body-sm text-light-on-surface-variant">
|
||||
<a href="#terms" className="hover:underline">Terms of Service</a>
|
||||
<a href="#privacy" className="hover:underline">Privacy Policy</a>
|
||||
<a href="#cookies" className="hover:underline">Cookie Policy</a>
|
||||
<span>© 2026 X Corp.</span>
|
||||
</footer>
|
||||
</aside>
|
||||
|
||||
</div>
|
||||
|
||||
{/* About This Account Modal */}
|
||||
<div id="about-modal" role="dialog" aria-modal="true" aria-labelledby="about-modal-title" className="hidden fixed inset-0 z-40 bg-light-primary/50 flex items-center justify-center p-gutter-lg">
|
||||
<div className="w-full max-w-md rounded-xl bg-light-surface border border-light-outline-variant shadow-xl p-gutter-xl flex flex-col gap-gutter-lg">
|
||||
<div className="flex items-center justify-between">
|
||||
<h2 id="about-modal-title" className="font-headline text-headline-md text-light-on-surface">About this account</h2>
|
||||
<button id="close-about-btn" type="button" aria-label="关闭弹窗" className="inline-flex items-center justify-center w-8 h-8 rounded-full hover:bg-light-surface-container text-light-on-surface">
|
||||
<span className="material-symbols-outlined text-title-lg" aria-hidden="true">close</span>
|
||||
</button>
|
||||
</div>
|
||||
<div className="flex items-center gap-gutter-md">
|
||||
<img src="/stitch/profile-avatar.jpg" alt="有点AI思" className="w-12 h-12 rounded-full object-cover shrink-0" />
|
||||
<div className="flex flex-col">
|
||||
<span className="font-title text-title-lg text-light-on-surface">有点AI思</span>
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant">@you_dian_ai · 小红书号 18665824520</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col gap-gutter-md border-t border-light-outline-variant pt-gutter-md">
|
||||
<div className="flex items-center gap-gutter-md">
|
||||
<span className="material-symbols-outlined text-title-lg text-light-on-surface-variant" aria-hidden="true">calendar_month</span>
|
||||
<div className="flex flex-col">
|
||||
<span className="font-title text-title-md text-light-on-surface">Date joined</span>
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant">April 2022</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-gutter-md">
|
||||
<span className="material-symbols-outlined text-title-lg text-light-on-surface-variant" aria-hidden="true">public</span>
|
||||
<div className="flex flex-col">
|
||||
<span className="font-title text-title-md text-light-on-surface">Account based in</span>
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant">Sichuan, China (IP属地:四川)</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-gutter-md">
|
||||
<span className="material-symbols-outlined text-title-lg text-x-blue" style={{ fontVariationSettings: "'FILL' 1" }} aria-hidden="true">verified</span>
|
||||
<div className="flex flex-col">
|
||||
<span className="font-title text-title-md text-light-on-surface">Verified</span>
|
||||
<span className="font-body text-body-sm text-light-on-surface-variant">Subscribed since March 2024</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Floating Bottom-Right Dock */}
|
||||
<div className="hidden md:flex fixed bottom-gutter-lg right-gutter-lg z-30 flex-col gap-gutter-sm">
|
||||
<button type="button" aria-label="Open Grok" className="inline-flex items-center justify-center w-11 h-11 rounded-md bg-light-surface border border-light-outline shadow-sm text-light-on-surface hover:bg-light-surface-container-low">
|
||||
<span className="material-symbols-outlined text-headline-md" aria-hidden="true">blur_on</span>
|
||||
</button>
|
||||
<button type="button" aria-label="Open Messages" className="inline-flex items-center justify-center w-11 h-11 rounded-md bg-light-surface border border-light-outline shadow-sm text-light-on-surface hover:bg-light-surface-container-low">
|
||||
<span className="material-symbols-outlined text-headline-md" aria-hidden="true">mail</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect } from "react";
|
||||
|
||||
function selectTab(button: HTMLElement, selector: string) {
|
||||
document.querySelectorAll<HTMLElement>(selector).forEach((tab) => {
|
||||
const active = tab === button;
|
||||
tab.setAttribute("aria-selected", String(active));
|
||||
tab.classList.toggle("text-light-on-surface", active);
|
||||
tab.classList.toggle("text-light-on-surface-variant", !active);
|
||||
tab.querySelector(".tab-indicator")?.classList.toggle("hidden", !active);
|
||||
});
|
||||
}
|
||||
|
||||
export function HomeInteractions() {
|
||||
useEffect(() => {
|
||||
const byId = (id: string) => document.getElementById(id);
|
||||
const home = byId("view-home");
|
||||
const profile = byId("view-profile");
|
||||
const menu = byId("profile-more-menu");
|
||||
const menuButton = byId("profile-more-btn");
|
||||
const dialog = byId("about-modal");
|
||||
let feed = "for-you";
|
||||
let category = "all";
|
||||
|
||||
function switchView(view: string) {
|
||||
const homeActive = view === "home";
|
||||
home?.classList.toggle("hidden", !homeActive);
|
||||
home?.classList.toggle("flex", homeActive);
|
||||
profile?.classList.toggle("hidden", homeActive);
|
||||
profile?.classList.toggle("flex", !homeActive);
|
||||
|
||||
document.querySelectorAll<HTMLElement>(".nav-item").forEach((item) => {
|
||||
const active = item.dataset.nav === view;
|
||||
if (active) item.setAttribute("aria-current", "page");
|
||||
else item.removeAttribute("aria-current");
|
||||
item.classList.toggle("font-title", active);
|
||||
item.classList.toggle("font-body", !active);
|
||||
const icon = item.querySelector<HTMLElement>(".nav-icon");
|
||||
if (icon) {
|
||||
icon.textContent = item.dataset.nav === "home" ? "home" : active ? "person" : "person_outline";
|
||||
icon.style.fontVariationSettings = active ? "'FILL' 1" : "'FILL' 0";
|
||||
}
|
||||
});
|
||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||
}
|
||||
|
||||
function updateCards() {
|
||||
document.querySelectorAll<HTMLElement>("#home-note-feed .note-card").forEach((card) => {
|
||||
const categoryMatches = category === "all" || card.dataset.category === category;
|
||||
const feedMatches = feed === "for-you" || card.dataset.following === "true";
|
||||
card.style.display = categoryMatches && feedMatches ? "" : "none";
|
||||
});
|
||||
}
|
||||
|
||||
function changeChannel(button: HTMLElement) {
|
||||
category = button.dataset.category ?? "all";
|
||||
document.querySelectorAll(".channel-pill").forEach((pill) => {
|
||||
const active = pill === button;
|
||||
pill.setAttribute("aria-selected", String(active));
|
||||
pill.classList.toggle("bg-light-primary", active);
|
||||
pill.classList.toggle("text-light-on-primary", active);
|
||||
pill.classList.toggle("bg-light-surface-container", !active);
|
||||
pill.classList.toggle("text-light-on-surface-variant", !active);
|
||||
});
|
||||
updateCards();
|
||||
}
|
||||
|
||||
function toggleFollow(button: HTMLElement) {
|
||||
const following = button.dataset.following !== "true";
|
||||
button.dataset.following = String(following);
|
||||
for (const name of ["border", "border-light-outline", "bg-light-surface", "text-light-on-surface"]) {
|
||||
button.classList.toggle(name, following);
|
||||
}
|
||||
for (const name of ["bg-light-primary", "text-light-on-primary"]) {
|
||||
button.classList.toggle(name, !following);
|
||||
}
|
||||
const label = button.querySelector("span");
|
||||
if (label) label.textContent = following ? "Following" : "Follow";
|
||||
}
|
||||
|
||||
function toggleLike(button: HTMLElement) {
|
||||
const liked = button.dataset.liked !== "true";
|
||||
const count = Math.max(0, Number(button.dataset.count ?? "0") + (liked ? 1 : -1));
|
||||
button.dataset.liked = String(liked);
|
||||
button.dataset.count = String(count);
|
||||
button.setAttribute("aria-pressed", String(liked));
|
||||
button.classList.toggle("text-light-error", liked);
|
||||
button.classList.toggle("text-light-on-surface-variant", !liked);
|
||||
const icon = button.querySelector<HTMLElement>(".like-icon");
|
||||
if (icon) {
|
||||
icon.textContent = liked ? "favorite" : "favorite_border";
|
||||
icon.style.fontVariationSettings = liked ? "'FILL' 1" : "'FILL' 0";
|
||||
}
|
||||
const countLabel = button.querySelector(".like-count");
|
||||
if (countLabel) countLabel.textContent = String(count);
|
||||
}
|
||||
|
||||
function setMenu(open: boolean) {
|
||||
menu?.classList.toggle("hidden", !open);
|
||||
menuButton?.setAttribute("aria-expanded", String(open));
|
||||
}
|
||||
|
||||
function handleClick(event: MouseEvent) {
|
||||
const target = event.target;
|
||||
if (!(target instanceof Element)) return;
|
||||
const button = target.closest<HTMLElement>("button");
|
||||
|
||||
if (button === menuButton && menu) {
|
||||
setMenu(menu.classList.contains("hidden"));
|
||||
return;
|
||||
}
|
||||
if (!menu?.contains(target)) setMenu(false);
|
||||
if (target === dialog || button?.id === "close-about-btn") {
|
||||
dialog?.classList.add("hidden");
|
||||
return;
|
||||
}
|
||||
if (!button) return;
|
||||
|
||||
if (button.matches(".nav-switch") && button.dataset.nav) {
|
||||
switchView(button.dataset.nav);
|
||||
} else if (button.matches(".feed-tab")) {
|
||||
feed = button.dataset.feed ?? "for-you";
|
||||
selectTab(button, ".feed-tab");
|
||||
updateCards();
|
||||
} else if (button.matches(".channel-pill")) {
|
||||
changeChannel(button);
|
||||
} else if (button.matches(".profile-tab")) {
|
||||
selectTab(button, ".profile-tab");
|
||||
for (const panel of ["notes", "saved", "likes", "history"]) {
|
||||
byId("panel-" + panel)?.classList.toggle("hidden", panel !== button.dataset.tab);
|
||||
}
|
||||
} else if (button.id === "profile-follow-btn") {
|
||||
toggleFollow(button);
|
||||
} else if (button.matches(".like-btn")) {
|
||||
toggleLike(button);
|
||||
} else if (button.id === "open-about-btn" || button.id === "joined-date-btn") {
|
||||
setMenu(false);
|
||||
dialog?.classList.remove("hidden");
|
||||
}
|
||||
}
|
||||
|
||||
function handleKey(event: KeyboardEvent) {
|
||||
if (event.key === "Escape") {
|
||||
setMenu(false);
|
||||
dialog?.classList.add("hidden");
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener("click", handleClick);
|
||||
document.addEventListener("keydown", handleKey);
|
||||
return () => {
|
||||
document.removeEventListener("click", handleClick);
|
||||
document.removeEventListener("keydown", handleKey);
|
||||
};
|
||||
}, []);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
const config: NextConfig = {
|
||||
agentRules: false,
|
||||
devIndicators: false,
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "@bedrock/home",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev --hostname 127.0.0.1 --port 3000",
|
||||
"build": "next build",
|
||||
"start": "next start --hostname 127.0.0.1 --port 3000"
|
||||
},
|
||||
"dependencies": {
|
||||
"next": "16.4.6",
|
||||
"react": "19.3.1",
|
||||
"react-dom": "19.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "22.20.7",
|
||||
"@types/react": "19.3.0",
|
||||
"@types/react-dom": "19.3.0",
|
||||
"typescript": "5.9.3",
|
||||
"@tailwindcss/container-queries": "0.1.1",
|
||||
"@tailwindcss/forms": "0.5.10",
|
||||
"autoprefixer": "10.4.21",
|
||||
"postcss": "8.5.34",
|
||||
"tailwindcss": "3.4.17"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export default {
|
||||
plugins: {
|
||||
tailwindcss: {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
Five original design images were embedded in the shared Stitch screen.
|
||||
The following Unsplash photos are sample content used under the Unsplash License
|
||||
https://unsplash.com/license
|
||||
|
||||
golden-retriever.jpg https://unsplash.com/photos/brown-dog-m07bsa3nG_4
|
||||
dungeon.jpg https://unsplash.com/photos/a-group-of-people-playing-video-games-in-a-room-TobedMw621U
|
||||
ai-tools.jpg https://unsplash.com/photos/a-laptop-computer-sitting-on-top-of-a-desk-ysZnFnexwRE
|
||||
skyline.jpg https://unsplash.com/photos/a-view-of-a-city-at-night-from-the-top-of-a-building-xuNtZ_hEAhY
|
||||
workspace.jpg https://unsplash.com/s/photos/writers-desk
|
||||
film-walk.jpg https://unsplash.com/photos/a-group-of-people-walking-across-a-cross-walk-yCFKOJ5-F6U
|
||||
profile-banner.jpg https://unsplash.com/photos/a-view-of-a-city-with-mountains-in-the-background-mxWViyBwOBM
|
||||
stairs.jpg https://unsplash.com/photos/shadow-and-sunlight-cast-upon-a-concrete-staircase-xDV6YuFBkAo
|
||||
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 315 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 171 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 76 KiB |
@@ -0,0 +1,93 @@
|
||||
Copyright 2022 The Instrument Sans Project Authors (https://github.com/Instrument/instrument-sans)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
https://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 137 KiB |
|
After Width: | Height: | Size: 179 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 75 KiB |
|
After Width: | Height: | Size: 93 KiB |
@@ -0,0 +1,93 @@
|
||||
const forms = require("@tailwindcss/forms");
|
||||
const containerQueries = require("@tailwindcss/container-queries");
|
||||
|
||||
module.exports = {
|
||||
content: { relative: true, files: ["./app/**/*.tsx", "./components/**/*.{ts,tsx}"] },
|
||||
plugins: [forms, containerQueries],
|
||||
...{
|
||||
darkMode: 'class',
|
||||
theme: {
|
||||
extend: {
|
||||
colors: {
|
||||
'x-blue': '#1D9BF0',
|
||||
'x-blue-dark': '#0B7BC1',
|
||||
'light-primary': '#0F1419',
|
||||
'light-on-primary': '#FFFFFF',
|
||||
'light-primary-container': '#E8F5FD',
|
||||
'light-on-primary-container': '#0A74B7',
|
||||
'light-secondary': '#536471',
|
||||
'light-on-secondary': '#FFFFFF',
|
||||
'light-secondary-container': '#EFF3F4',
|
||||
'light-on-secondary-container': '#0F1419',
|
||||
'light-tertiary': '#0B7BC1',
|
||||
'light-on-tertiary': '#FFFFFF',
|
||||
'light-error': '#F4212E',
|
||||
'light-on-error': '#131313',
|
||||
'light-background': '#FFFFFF',
|
||||
'light-on-background': '#0F1419',
|
||||
'light-surface': '#FFFFFF',
|
||||
'light-surface-container-low': '#F7F9F9',
|
||||
'light-surface-container': '#EFF3F4',
|
||||
'light-surface-container-high': '#E7E9EA',
|
||||
'light-on-surface': '#0F1419',
|
||||
'light-on-surface-variant': '#536471',
|
||||
'light-outline': '#CFD9DE',
|
||||
'light-outline-variant': '#EFF3F4',
|
||||
'dark-primary': '#EFF3F4',
|
||||
'dark-on-primary': '#0F1419',
|
||||
'dark-surface': '#000000',
|
||||
'dark-surface-container-low': '#16181C',
|
||||
'dark-surface-container': '#202327',
|
||||
'dark-on-surface': '#E7E9EA',
|
||||
'dark-on-surface-variant': '#71767B',
|
||||
'dark-outline': '#2F3336',
|
||||
'dark-outline-variant': '#2F3336',
|
||||
},
|
||||
borderRadius: {
|
||||
'sm': '6px',
|
||||
'DEFAULT': '10px',
|
||||
'md': '12px',
|
||||
'lg': '16px',
|
||||
'xl': '20px',
|
||||
'full': '9999px',
|
||||
},
|
||||
spacing: {
|
||||
'gutter-xs': '4px',
|
||||
'gutter-sm': '8px',
|
||||
'gutter-md': '12px',
|
||||
'gutter-lg': '16px',
|
||||
'gutter-xl': '24px',
|
||||
'section': '32px',
|
||||
'page-margin': '16px',
|
||||
},
|
||||
fontFamily: {
|
||||
'headline': ['"Instrument Sans"', 'sans-serif'],
|
||||
'title': ['"Instrument Sans"', 'sans-serif'],
|
||||
'body': ['"Instrument Sans"', 'sans-serif'],
|
||||
'label': ['"Instrument Sans"', 'sans-serif'],
|
||||
},
|
||||
fontSize: {
|
||||
'headline-lg': ['22px', { lineHeight: '28px', letterSpacing: '-0.2px', fontWeight: '700' }],
|
||||
'headline-md': ['20px', { lineHeight: '24px', letterSpacing: '-0.1px', fontWeight: '700' }],
|
||||
'title-lg': ['17px', { lineHeight: '22px', letterSpacing: '0px', fontWeight: '600' }],
|
||||
'title-md': ['15px', { lineHeight: '20px', letterSpacing: '0px', fontWeight: '600' }],
|
||||
'body-lg': ['19px', { lineHeight: '24px', letterSpacing: '0px', fontWeight: '400' }],
|
||||
'body-md': ['15px', { lineHeight: '20px', letterSpacing: '0px', fontWeight: '400' }],
|
||||
'body-sm': ['13px', { lineHeight: '16px', letterSpacing: '0px', fontWeight: '400' }],
|
||||
'label-lg': ['15px', { lineHeight: '20px', letterSpacing: '0px', fontWeight: '700' }],
|
||||
'label-md': ['13px', { lineHeight: '16px', letterSpacing: '0px', fontWeight: '500' }],
|
||||
'label-sm': ['12px', { lineHeight: '14px', letterSpacing: '0px', fontWeight: '600' }],
|
||||
},
|
||||
transitionDuration: {
|
||||
'state-change': '120ms',
|
||||
},
|
||||
transitionDelay: {
|
||||
'state-change': '0ms',
|
||||
},
|
||||
transitionTimingFunction: {
|
||||
'state-change': 'ease-out',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2017",
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"esnext"
|
||||
],
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"isolatedModules": true,
|
||||
"jsx": "react-jsx",
|
||||
"plugins": [
|
||||
{
|
||||
"name": "next"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"./*"
|
||||
]
|
||||
},
|
||||
"allowJs": true,
|
||||
"incremental": true,
|
||||
"resolveJsonModule": true
|
||||
},
|
||||
"include": [
|
||||
"next-env.d.ts",
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
".next/types/**/*.ts",
|
||||
".next/dev/types/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "bedrock-web-workspaces",
|
||||
"private": true,
|
||||
"engines": {
|
||||
"node": ">=22"
|
||||
},
|
||||
"workspaces": [
|
||||
"home",
|
||||
"dashboard",
|
||||
"repository"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/node_modules/
|
||||
/.next/
|
||||
/out/
|
||||
/coverage/
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
.env*
|
||||
.DS_Store
|
||||
@@ -0,0 +1,8 @@
|
||||
import type { Metadata } from "next";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
export const metadata: Metadata = { title: "Repository" };
|
||||
|
||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
||||
return <html lang="zh-CN"><body>{children}</body></html>;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export default function Page() {
|
||||
return <main><h1>Repository</h1></main>;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
const config: NextConfig = {
|
||||
agentRules: false,
|
||||
devIndicators: false,
|
||||
};
|
||||
|
||||
export default config;
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "@bedrock/repository",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev --hostname 127.0.0.1 --port 3002",
|
||||
"build": "next build",
|
||||
"start": "next start --hostname 127.0.0.1 --port 3002"
|
||||
},
|
||||
"dependencies": {
|
||||
"next": "16.4.6",
|
||||
"react": "19.3.1",
|
||||
"react-dom": "19.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "22.20.7",
|
||||
"@types/react": "19.3.0",
|
||||
"@types/react-dom": "19.3.0",
|
||||
"typescript": "5.9.3"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2017",
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"esnext"
|
||||
],
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"isolatedModules": true,
|
||||
"jsx": "react-jsx",
|
||||
"plugins": [
|
||||
{
|
||||
"name": "next"
|
||||
}
|
||||
],
|
||||
"paths": {
|
||||
"@/*": [
|
||||
"./*"
|
||||
]
|
||||
},
|
||||
"allowJs": true,
|
||||
"incremental": true,
|
||||
"resolveJsonModule": true
|
||||
},
|
||||
"include": [
|
||||
"next-env.d.ts",
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
".next/types/**/*.ts",
|
||||
".next/dev/types/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||