chore(website): add social media link; add star
This commit is contained in:
@@ -11,7 +11,7 @@ The GUI Agent Living in Your Webpage. Control web interfaces with natural langua
|
|||||||
|
|
||||||
🌐 **English** | [中文](./docs/README-zh.md)
|
🌐 **English** | [中文](./docs/README-zh.md)
|
||||||
|
|
||||||
👉 <a href="https://alibaba.github.io/page-agent/" target="_blank"><b>🚀 Demo</b></a> | <a href="https://alibaba.github.io/page-agent/docs/introduction/overview" target="_blank"><b>📖 Documentation</b></a> | <a href="https://news.ycombinator.com/item?id=47264138" target="_blank"><b>📢 Join HN Discussion</b></a>
|
👉 <a href="https://alibaba.github.io/page-agent/" target="_blank"><b>🚀 Demo</b></a> | <a href="https://alibaba.github.io/page-agent/docs/introduction/overview" target="_blank"><b>📖 Documentation</b></a> | <a href="https://news.ycombinator.com/item?id=47264138" target="_blank"><b>📢 Join HN Discussion</b></a> | <a href="https://x.com/simonluvramen" target="_blank"><b>𝕏 Follow on X</b></a>
|
||||||
|
|
||||||
<video id="demo-video" src="https://github.com/user-attachments/assets/a1f2eae2-13fb-4aae-98cf-a3fc1620a6c2" controls crossorigin muted></video>
|
<video id="demo-video" src="https://github.com/user-attachments/assets/a1f2eae2-13fb-4aae-98cf-a3fc1620a6c2" controls crossorigin muted></video>
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
🌐 [English](../README.md) | **中文**
|
🌐 [English](../README.md) | **中文**
|
||||||
|
|
||||||
👉 <a href="https://alibaba.github.io/page-agent/" target="_blank"><b>🚀 Demo</b></a> | <a href="https://alibaba.github.io/page-agent/docs/introduction/overview" target="_blank"><b>📖 Documentation</b></a> | <a href="https://news.ycombinator.com/item?id=47264138" target="_blank"><b>📢 Join HN Discussion</b></a>
|
👉 <a href="https://alibaba.github.io/page-agent/" target="_blank"><b>🚀 Demo</b></a> | <a href="https://alibaba.github.io/page-agent/docs/introduction/overview" target="_blank"><b>📖 Documentation</b></a> | <a href="https://news.ycombinator.com/item?id=47264138" target="_blank"><b>📢 Join HN Discussion</b></a> | <a href="https://x.com/simonluvramen" target="_blank"><b>𝕏 Follow on X</b></a>
|
||||||
|
|
||||||
<video id="demo-video" src="https://github.com/user-attachments/assets/a1f2eae2-13fb-4aae-98cf-a3fc1620a6c2" controls crossorigin muted></video>
|
<video id="demo-video" src="https://github.com/user-attachments/assets/a1f2eae2-13fb-4aae-98cf-a3fc1620a6c2" controls crossorigin muted></video>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { siGithub } from 'simple-icons'
|
import { siGithub, siX } from 'simple-icons'
|
||||||
|
|
||||||
import { useLanguage } from '@/i18n/context'
|
import { useLanguage } from '@/i18n/context'
|
||||||
|
|
||||||
@@ -15,6 +15,7 @@ export default function Footer() {
|
|||||||
<p className="text-gray-600 dark:text-gray-300 text-sm">
|
<p className="text-gray-600 dark:text-gray-300 text-sm">
|
||||||
© 2026 page-agent. All rights reserved.
|
© 2026 page-agent. All rights reserved.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div className="flex items-center space-x-6">
|
<div className="flex items-center space-x-6">
|
||||||
<a
|
<a
|
||||||
href="https://github.com/alibaba/page-agent/blob/main/docs/terms-and-privacy.md"
|
href="https://github.com/alibaba/page-agent/blob/main/docs/terms-and-privacy.md"
|
||||||
@@ -24,6 +25,22 @@ export default function Footer() {
|
|||||||
>
|
>
|
||||||
{isZh ? '使用条款与隐私' : 'Terms & Privacy'}
|
{isZh ? '使用条款与隐私' : 'Terms & Privacy'}
|
||||||
</a>
|
</a>
|
||||||
|
<a
|
||||||
|
href="https://x.com/simonluvramen"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-gray-600 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white transition-colors duration-200"
|
||||||
|
aria-label="X (Twitter)"
|
||||||
|
>
|
||||||
|
<svg
|
||||||
|
role="img"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
className="w-4 h-4 fill-current"
|
||||||
|
aria-hidden="true"
|
||||||
|
>
|
||||||
|
<path d={siX.path} />
|
||||||
|
</svg>
|
||||||
|
</a>
|
||||||
<a
|
<a
|
||||||
href="https://github.com/alibaba/page-agent"
|
href="https://github.com/alibaba/page-agent"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { useState } from 'react'
|
|||||||
import { siGithub } from 'simple-icons'
|
import { siGithub } from 'simple-icons'
|
||||||
import { Link } from 'wouter'
|
import { Link } from 'wouter'
|
||||||
|
|
||||||
|
import { formatStars, useGitHubStars } from '@/hooks/useGitHubStars'
|
||||||
import { useLanguage } from '@/i18n/context'
|
import { useLanguage } from '@/i18n/context'
|
||||||
|
|
||||||
import LanguageSwitcher from './LanguageSwitcher'
|
import LanguageSwitcher from './LanguageSwitcher'
|
||||||
@@ -12,6 +13,7 @@ import { HyperText } from './ui/hyper-text'
|
|||||||
export default function Header() {
|
export default function Header() {
|
||||||
const { isZh } = useLanguage()
|
const { isZh } = useLanguage()
|
||||||
const [mobileMenuOpen, setMobileMenuOpen] = useState(false)
|
const [mobileMenuOpen, setMobileMenuOpen] = useState(false)
|
||||||
|
const stars = useGitHubStars()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -34,8 +36,11 @@ export default function Header() {
|
|||||||
className="w-10 h-10 rounded-xl group-hover:scale-110 transition-transform duration-200"
|
className="w-10 h-10 rounded-xl group-hover:scale-110 transition-transform duration-200"
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
<span className="text-base sm:text-xl font-bold text-gray-900 dark:text-white block leading-tight">
|
<span className="text-base sm:text-xl font-bold text-gray-900 dark:text-white leading-tight flex items-baseline gap-1.5">
|
||||||
page-agent
|
page-agent
|
||||||
|
<span className="hidden sm:inline text-[10px] font-mono font-normal text-gray-400 dark:text-gray-500 tabular-nums before:content-['v']">
|
||||||
|
{import.meta.env.VERSION}
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<HyperText
|
<HyperText
|
||||||
as="p"
|
as="p"
|
||||||
@@ -66,7 +71,7 @@ export default function Header() {
|
|||||||
href="https://github.com/alibaba/page-agent"
|
href="https://github.com/alibaba/page-agent"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
className="p-2 rounded-lg text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-200 shrink-0"
|
className="flex items-center gap-1 p-2 rounded-lg text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-200 shrink-0"
|
||||||
aria-label="GitHub"
|
aria-label="GitHub"
|
||||||
>
|
>
|
||||||
<svg
|
<svg
|
||||||
@@ -77,6 +82,9 @@ export default function Header() {
|
|||||||
>
|
>
|
||||||
<path d={siGithub.path} />
|
<path d={siGithub.path} />
|
||||||
</svg>
|
</svg>
|
||||||
|
{stars !== null && (
|
||||||
|
<span className="text-sm tabular-nums">★ {formatStars(stars)}</span>
|
||||||
|
)}
|
||||||
</a>
|
</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
@@ -86,9 +94,6 @@ export default function Header() {
|
|||||||
role="navigation"
|
role="navigation"
|
||||||
aria-label={isZh ? '文档' : 'Docs'}
|
aria-label={isZh ? '文档' : 'Docs'}
|
||||||
>
|
>
|
||||||
<span className="text-xs font-mono text-gray-400 dark:text-gray-500 tabular-nums before:content-['v']">
|
|
||||||
{import.meta.env.VERSION}
|
|
||||||
</span>
|
|
||||||
<Link
|
<Link
|
||||||
href="/docs/introduction/overview"
|
href="/docs/introduction/overview"
|
||||||
className="flex items-center gap-1.5 text-gray-600 dark:text-gray-300 hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-200"
|
className="flex items-center gap-1.5 text-gray-600 dark:text-gray-300 hover:text-blue-600 dark:hover:text-blue-400 transition-colors duration-200"
|
||||||
@@ -112,6 +117,9 @@ export default function Header() {
|
|||||||
<path d={siGithub.path} />
|
<path d={siGithub.path} />
|
||||||
</svg>
|
</svg>
|
||||||
GitHub
|
GitHub
|
||||||
|
{stars !== null && (
|
||||||
|
<span className="text-sm font-medium tabular-nums ">★ {formatStars(stars)}</span>
|
||||||
|
)}
|
||||||
</a>
|
</a>
|
||||||
<ThemeSwitcher />
|
<ThemeSwitcher />
|
||||||
<LanguageSwitcher />
|
<LanguageSwitcher />
|
||||||
@@ -161,6 +169,11 @@ export default function Header() {
|
|||||||
<path d={siGithub.path} />
|
<path d={siGithub.path} />
|
||||||
</svg>
|
</svg>
|
||||||
GitHub
|
GitHub
|
||||||
|
{stars !== null && (
|
||||||
|
<span className="text-xs tabular-nums text-gray-400 dark:text-gray-500">
|
||||||
|
★ {formatStars(stars)}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</a>
|
</a>
|
||||||
<div className="flex items-center gap-3 px-3 py-2">
|
<div className="flex items-center gap-3 px-3 py-2">
|
||||||
<ThemeSwitcher />
|
<ThemeSwitcher />
|
||||||
|
|||||||
27
packages/website/src/hooks/useGitHubStars.ts
Normal file
27
packages/website/src/hooks/useGitHubStars.ts
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import { useEffect, useState } from 'react'
|
||||||
|
|
||||||
|
const STATS_URL = 'https://page-agent.github.io/gh-stats/stats.json'
|
||||||
|
|
||||||
|
let cached: number | null = null
|
||||||
|
|
||||||
|
export function useGitHubStars() {
|
||||||
|
const [stars, setStars] = useState(cached)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (cached !== null) return
|
||||||
|
fetch(STATS_URL)
|
||||||
|
.then((r) => r.json())
|
||||||
|
.then((data) => {
|
||||||
|
cached = data.stargazers_count ?? null
|
||||||
|
setStars(cached)
|
||||||
|
})
|
||||||
|
.catch(() => {})
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
return stars
|
||||||
|
}
|
||||||
|
|
||||||
|
export function formatStars(n: number): string {
|
||||||
|
if (n >= 1000) return `${(n / 1000).toFixed(1).replace(/\.0$/, '')}k`
|
||||||
|
return String(n)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user