Skip to content

Commit 2d2619f

Browse files
committed
refactor: Update IP geolocation API endpoints and adjust profile card layout with VRChat bio line count.
1 parent c9f125c commit 2d2619f

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/components/map-card.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ function useVisitorGeo() {
8484
const [geo, setGeo] = useState<VisitorGeo | null>(null);
8585
useEffect(() => {
8686
let cancelled = false;
87-
fetch("http://ip-api.com/json/?fields=city,lat,lon&lang=zh-CN")
87+
fetch("https://ipapi.co/json/")
8888
.then((r) => r.json())
8989
.then((data) => {
90-
if (!cancelled && data.lat && data.lon) {
91-
setGeo({ city: data.city, lat: data.lat, lon: data.lon });
90+
if (!cancelled && data.latitude && data.longitude) {
91+
setGeo({ city: data.city, lat: data.latitude, lon: data.longitude });
9292
}
9393
})
9494
.catch(() => { /* silently fail */ });

src/components/profile-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function ProfileCard({ avatarImages }: ProfileCardProps) {
5252
: [siteConfig.profile.avatar];
5353

5454
return (
55-
<GlassCard className="flex flex-col items-center text-center gap-4 p-5 md:p-6 md:flex-row md:text-left md:items-start md:gap-5 h-full">
55+
<GlassCard className="flex flex-col items-center justify-center text-center gap-4 p-5 md:p-6 md:flex-row md:text-left md:items-center md:gap-5 h-full">
5656
{/* Avatar Carousel */}
5757
<AvatarCarousel images={images} alt={name} />
5858

src/components/weather-card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ function useDynamicLocation() {
196196

197197
// 2. Fallback to IP-API
198198
try {
199-
const ipRes = await fetch("http://ip-api.com/json/?fields=city,lat,lon&lang=zh-CN");
199+
const ipRes = await fetch("https://ip-api.com/json/?fields=city,lat,lon&lang=zh-CN");
200200
const ipData = await ipRes.json();
201201
if (mounted && ipData.lat && ipData.lon) {
202202
setLocation({

src/config/site.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ export const siteConfig: SiteConfig = {
243243
vrchat: {
244244
apiBase: "https://vrcx-cloud.iacg.moe",
245245
userId: "usr_dcf7bc56-34d4-482a-b21f-fb2c05dcfb2f",
246-
bioLines: 6,
246+
bioLines: 5,
247247
},
248248

249249
map: {

0 commit comments

Comments
 (0)