mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-05-24 22:58:08 +00:00
## Summary <!-- One sentence describing what changed and why. --> Polish and fix UI for new website ## Changes - **What**: <!-- Core functionality added/modified --> - [x] update about video - [x] update Moment factory story content - [x] update homepage visual - [x] update customer story visual - [x] put images and videos to bucket ## Review Focus <!-- Critical design decisions or edge cases that need attention --> <!-- If this PR fixes an issue, uncomment and update the line below --> <!-- Fixes #ISSUE_NUMBER --> ## Screenshots (if applicable) <!-- Add screenshots or video recording to help explain your changes --> ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-11363-feat-website-Polish-and-fix-UI-3466d73d365081f895aff84b594450c9) by [Unito](https://www.unito.io) --------- Co-authored-by: DrJKL <DrJKL0424@gmail.com> Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: GitHub Action <action@github.com> Co-authored-by: Alexander Brown <drjkl@comfy.org> Co-authored-by: github-actions <github-actions@github.com>
28 lines
750 B
TypeScript
28 lines
750 B
TypeScript
export async function fetchGitHubStars(
|
|
owner: string,
|
|
repo: string
|
|
): Promise<number | null> {
|
|
try {
|
|
const res = await fetch(`https://api.github.com/repos/${owner}/${repo}`, {
|
|
headers: { Accept: 'application/vnd.github.v3+json' }
|
|
})
|
|
if (!res.ok) return null
|
|
const data = await res.json()
|
|
return data.stargazers_count ?? null
|
|
} catch {
|
|
return null
|
|
}
|
|
}
|
|
|
|
export function formatStarCount(count: number): string {
|
|
if (count >= 1_000_000) {
|
|
const m = count / 1_000_000
|
|
return `${m >= 10 ? Math.round(m) : m.toFixed(1).replace(/\.0$/, '')}M`
|
|
}
|
|
if (count >= 1_000) {
|
|
const k = count / 1_000
|
|
return `${k >= 10 ? Math.round(k) : k.toFixed(1).replace(/\.0$/, '')}K`
|
|
}
|
|
return count.toString()
|
|
}
|