This commit is contained in:
maojindao55
2025-02-27 10:12:10 +08:00
parent 8d0d2b64bd
commit 5f1c2d003c
4 changed files with 17 additions and 20 deletions

6
package-lock.json generated
View File

@@ -8,6 +8,7 @@
"name": "chat-ui", "name": "chat-ui",
"version": "1.0.0", "version": "1.0.0",
"dependencies": { "dependencies": {
"@fontsource/audiowide": "^5.1.1",
"@radix-ui/react-avatar": "^1.1.3", "@radix-ui/react-avatar": "^1.1.3",
"@radix-ui/react-dialog": "^1.1.6", "@radix-ui/react-dialog": "^1.1.6",
"@radix-ui/react-dropdown-menu": "^2.1.6", "@radix-ui/react-dropdown-menu": "^2.1.6",
@@ -731,6 +732,11 @@
"resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.9.tgz", "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.9.tgz",
"integrity": "sha512-MDWhGtE+eHw5JW7lq4qhc5yRLS11ERl1c7Z6Xd0a58DozHES6EnNNwUWbMiG4J9Cgj053Bhk8zvlhFYKVhULwg==" "integrity": "sha512-MDWhGtE+eHw5JW7lq4qhc5yRLS11ERl1c7Z6Xd0a58DozHES6EnNNwUWbMiG4J9Cgj053Bhk8zvlhFYKVhULwg=="
}, },
"node_modules/@fontsource/audiowide": {
"version": "5.1.1",
"resolved": "https://registry.npmmirror.com/@fontsource/audiowide/-/audiowide-5.1.1.tgz",
"integrity": "sha512-Jb2X0h1TQ+TIfjquviRMxVLMrilq4G8OaUdBNjURDospyrEa3kk5xOYNALAUzjnJHRPtTFHhzOmykV7xlGHEKA=="
},
"node_modules/@isaacs/cliui": { "node_modules/@isaacs/cliui": {
"version": "8.0.2", "version": "8.0.2",
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",

View File

@@ -8,6 +8,7 @@
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
"@fontsource/audiowide": "^5.1.1",
"@radix-ui/react-avatar": "^1.1.3", "@radix-ui/react-avatar": "^1.1.3",
"@radix-ui/react-dialog": "^1.1.6", "@radix-ui/react-dialog": "^1.1.6",
"@radix-ui/react-dropdown-menu": "^2.1.6", "@radix-ui/react-dropdown-menu": "^2.1.6",

1
public/img/logo.svg Normal file
View File

@@ -0,0 +1 @@
<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Layer_1" width="245.555" height="248.768" viewBox="0 0 245.555 248.768" style="overflow:visible;enable-background:new 0 0 245.555 248.768;" xml:space="preserve"><g><path style="fill:#81C5E8;stroke:#81C5E8;stroke-width:25;stroke-linecap:round;stroke-linejoin:round;" d="M75.957,144.232h76.309 c11.045,0,20.082-9.036,20.082-20.081V32.581c0-11.045-9.037-20.081-20.082-20.081H32.581C21.537,12.5,12.5,21.536,12.5,32.581 v91.569v62.653L75.957,144.232z"/></g><g><path style="fill:#FF78C9;stroke:#FF78C9;stroke-width:25;stroke-linecap:round;stroke-linejoin:round;" d="M104.174,168.435 h76.309c11.045,0,20.081-9.037,20.081-20.082V56.783c0-11.044-9.036-20.081-20.081-20.081H60.798 c-11.044,0-20.082,9.036-20.082,20.081v91.569v62.653L104.174,168.435z"/></g><g><path style="fill:#FFCC66;stroke:#FFCC66;stroke-width:25;stroke-linecap:round;stroke-linejoin:round;" d="M136.665,193.695h76.31 c11.045,0,20.081-9.035,20.081-20.08v-91.57c0-11.044-9.036-20.081-20.081-20.081H93.289c-11.044,0-20.081,9.037-20.081,20.081 v91.57v62.652L136.665,193.695z"/></g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -1,31 +1,20 @@
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
import GitHubButton from 'react-github-btn'; import GitHubButton from 'react-github-btn';
import '@fontsource/audiowide';
const Header: React.FC = () => { const Header: React.FC = () => {
useEffect(() => {
const fetchGitHubStars = async () => {
try {
const response = await fetch('https://api.github.com/repos/maojindao55/botgroup.chat');
const data = await response.json();
const starsElement = document.getElementById('github-stars');
if (starsElement) {
starsElement.textContent = data.stargazers_count.toLocaleString();
}
} catch (error) {
console.error('Failed to fetch GitHub stars:', error);
}
};
fetchGitHubStars();
}, []);
return ( return (
<header className="bg-transparent fixed top-0 left-0 right-0 z-50 hidden md:block"> <header className="bg-transparent fixed top-0 left-0 right-0 z-50 hidden md:block">
<div className="w-full px-2 h-10 flex items-center"> <div className="w-full px-2 h-10 flex items-center" >
{/* Logo */} {/* Logo */}
<div className="flex-1 flex items-center"> <div className="flex-1 flex items-center">
<a href="/" className="text-sm font-medium text-gray-700 hover:text-gray-500"> <a href="/" className="flex items-center">
botgroup.chat <img src="/img/logo.svg" alt="logo" className="h-6 w-6 mr-2" />
<span style={{ fontFamily: 'Audiowide, system-ui', color: '#ff6600' }} className="text-2xl">
botgroup.chat
</span>
</a> </a>
</div> </div>