Track Dashboard without deploying it
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
/node_modules/
|
||||
/.next/
|
||||
/out/
|
||||
/coverage/
|
||||
*.tsbuildinfo
|
||||
next-env.d.ts
|
||||
.env*
|
||||
.DS_Store
|
||||
@@ -0,0 +1,159 @@
|
||||
@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; }
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
import type { Metadata } from "next";
|
||||
import type { ReactNode } from "react";
|
||||
import "./globals.css";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Bedrock · 发现",
|
||||
description: "发现关于独立开发、数字生活与城市漫游的笔记。",
|
||||
};
|
||||
|
||||
export default function RootLayout({ children }: { children: ReactNode }) {
|
||||
return <html lang="zh-CN"><body>{children}</body></html>;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { Bedrock } from "@/components/bedrock";
|
||||
|
||||
export default function Page() {
|
||||
return <Bedrock />;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"$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"
|
||||
}
|
||||
@@ -0,0 +1,332 @@
|
||||
"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>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
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} />;
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
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);
|
||||
@@ -0,0 +1,6 @@
|
||||
import { clsx, type ClassValue } from "clsx";
|
||||
import { twMerge } from "tailwind-merge";
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
Generated
+1852
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "bedrock-frontend",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"engines": { "node": ">=22" },
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"start": "next start"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
plugins: { "@tailwindcss/postcss": {} },
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"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": { "@/*": ["./*"] }
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", ".next/dev/types/**/*.ts"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
Reference in New Issue
Block a user