Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions frontend/src/app/layout/app-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,8 @@ const marketingRegisterEntry = `/?${new URLSearchParams({
returnTo: '/workspace',
})}`

const githubRepository = 'https://github.com/1024XEngineer/Windup'

/**
* 公开主页只换导航内容,沿用产品顶栏的布局、触控尺寸和视觉表面。
* 这样两套入口在手机上不会因为各自维护断点而逐渐错位。
Expand Down Expand Up @@ -570,6 +572,14 @@ function MarketingHeaderView({ session, wave, onWave }: MarketingHeaderViewProps
aria-label="账号"
className="relative ml-auto flex shrink-0 items-center gap-1 sm:gap-6"
>
<a
href={githubRepository}
target="_blank"
rel="noreferrer"
className="hidden min-h-11 items-center text-body font-medium text-app-muted transition-colors hover:text-app-accent focus-visible:rounded-md focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-app-accent xl:inline-flex"
>
GitHub
</a>
{session.state.status === 'booting' ? (
<span
aria-label="正在恢复登录状态"
Expand Down
34 changes: 33 additions & 1 deletion frontend/src/pages/landing/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ describe('LandingPage', () => {
['制作流程', '#workflow'],
['资产工作台', '#workspace'],
] as const
const marketingNavigation = screen.getByRole('navigation', { name: '宣传页导航' })
for (const [name, href] of sectionLinks) {
expect(screen.getByRole('link', { name }).getAttribute('href')).toBe(href)
expect(within(marketingNavigation).getByRole('link', { name }).getAttribute('href')).toBe(
href,
)
expect(document.querySelector(href)).not.toBeNull()
}
expect(screen.getByRole('heading', { name: '角色做出来,还要留下来、跑起来。' })).toBeTruthy()
Expand Down Expand Up @@ -115,4 +118,33 @@ describe('LandingPage', () => {
expect(document.querySelector('img[src*="workflow-editor"]')).toBeNull()
expect(document.querySelector('source[srcset*="workflow-editor"]')).toBeNull()
})

it('在收尾插画之后提供真实的开源项目入口', async () => {
render(
<GuestAuthSession>
<MemoryRouter>
<LandingPage />
</MemoryRouter>
</GuestAuthSession>,
)

const footer = await screen.findByRole('contentinfo')
const header = screen.getByRole('navigation', { name: '宣传页导航' }).closest('header')

expect(header).not.toBeNull()
expect(within(header!).getByRole('link', { name: 'GitHub' }).getAttribute('href')).toBe(
'https://github.com/1024XEngineer/Windup',
)
expect(within(footer).getByText('Windup 是一个开源的 2D 角色资产工作台。')).toBeTruthy()
expect(within(footer).getByRole('link', { name: 'GitHub 仓库' }).getAttribute('href')).toBe(
'https://github.com/1024XEngineer/Windup',
)
expect(within(footer).getByRole('link', { name: 'Issues' }).getAttribute('href')).toBe(
'https://github.com/1024XEngineer/Windup/issues',
)
expect(within(footer).getByRole('link', { name: 'Contributors' }).getAttribute('href')).toBe(
'https://github.com/1024XEngineer/Windup/graphs/contributors',
)
expect(within(footer).queryByText(/隐私政策|服务条款|备案/)).toBeNull()
})
})
74 changes: 74 additions & 0 deletions frontend/src/pages/landing/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const creationEntry = `/?${new URLSearchParams({
returnTo: '/workspace',
})}`

const githubRepository = 'https://github.com/1024XEngineer/Windup'

const productCapabilities = [
{
outcome:
Expand Down Expand Up @@ -686,6 +688,78 @@ export function LandingPage() {
</div>
</div>
</main>

<footer className="border-t border-rule bg-paper-sunken px-4 py-12 sm:px-8 lg:px-12">
<div className="mx-auto grid max-w-[82rem] gap-12 md:grid-cols-[minmax(18rem,1fr)_auto_auto] md:gap-20">
<div className="max-w-sm">
<Link
to="/"
aria-label="返回 Windup 宣传页"
className="inline-flex items-center gap-3 rounded-sm focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-app-accent"
>
<img src="/windup-mark.svg" alt="" className="h-7 w-7" />
<strong className="font-serif text-xl tracking-[-0.02em] text-ink">Windup</strong>
</Link>
<p className="mt-5 text-body leading-7 text-ink-muted">
Windup 是一个开源的 2D 角色资产工作台。
</p>
<p className="mt-2 text-body leading-7 text-ink-faint">
查看源码、报告问题,或参与 Windup 的下一步。
</p>
</div>

<nav aria-label="页尾产品导航">
<h2 className="text-meta font-semibold tracking-[0.08em] text-ink-faint uppercase">
产品
</h2>
<ul className="mt-4 grid gap-1 text-body text-ink-muted">
{[
['产品能力', '#capabilities'],
['制作流程', '#workflow'],
['资产工作台', '#workspace'],
].map(([label, href]) => (
<li key={href}>
<a
href={href}
className="inline-flex min-h-10 items-center transition-colors hover:text-ink focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-app-accent"
>
{label}
</a>
</li>
))}
</ul>
</nav>

<nav aria-label="页尾项目导航">
<h2 className="text-meta font-semibold tracking-[0.08em] text-ink-faint uppercase">
项目
</h2>
<ul className="mt-4 grid gap-1 text-body text-ink-muted">
{[
['GitHub 仓库', githubRepository],
['Issues', `${githubRepository}/issues`],
['Contributors', `${githubRepository}/graphs/contributors`],
].map(([label, href]) => (
<li key={href}>
<a
href={href}
target="_blank"
rel="noreferrer"
className="inline-flex min-h-10 items-center transition-colors hover:text-ink focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-app-accent"
>
{label}
</a>
</li>
))}
</ul>
</nav>
</div>

<div className="mx-auto mt-10 flex max-w-[82rem] flex-wrap items-center justify-between gap-3 border-t border-rule pt-5 text-meta text-ink-faint">
<p>© {new Date().getFullYear()} Windup</p>
<p>2D 角色资产工作台</p>
</div>
</footer>
</div>
)
}
Loading