Updated display name and heads display

This commit is contained in:
2025-09-07 22:51:48 +02:00
parent e0a54114d0
commit fbfd8b8bbc
4 changed files with 14 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
"use client" "use client"
import { head } from "@/lib/hypixel/general"
import { getHeads } from "@/lib/hypixel/skywars/skywars" import { getHeads } from "@/lib/hypixel/skywars/skywars"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils"
import Image from "next/image" import Image from "next/image"
@@ -36,7 +37,7 @@ export function PresigeousHeads({ heads }: { heads: { username: string, timestam
data-id="presigeous-heads" data-id="presigeous-heads"
data-tooltip-id="presigeous-heads" data-tooltip-id="presigeous-heads"
data-tooltip-content={text} data-tooltip-content={text}
src={`https://minotar.net/helm/${username}/24.png`} src={head(username, 24)}
width={24} width={24}
height={24} height={24}
alt={username} alt={username}

View File

@@ -81,6 +81,7 @@ async function SuspendedPage({ ign: pign }: { ign: string }) {
<div className="flex flex-col items-center pb-5"> <div className="flex flex-col items-center pb-5">
<DisplayName <DisplayName
ign={player.displayname} ign={player.displayname}
uuid={player.uuid}
rank={player.newPackageRank} rank={player.newPackageRank}
monthly={player.monthlyPackageRank} monthly={player.monthlyPackageRank}
rankColor={player.monthlyRankColor} rankColor={player.monthlyRankColor}

View File

@@ -1,4 +1,5 @@
import { getColor } from "@/lib/colors" import { getColor } from "@/lib/colors"
import { head } from "@/lib/hypixel/general"
import { Player } from "@/lib/schema/player" import { Player } from "@/lib/schema/player"
import Image from "next/image" import Image from "next/image"
import Link from "next/link" import Link from "next/link"
@@ -9,8 +10,9 @@ type MonthlyPackageRank = Player["player"]["monthlyPackageRank"]
type RankColor = Player["player"]["monthlyRankColor"] type RankColor = Player["player"]["monthlyRankColor"]
export default function DisplayName( export default function DisplayName(
{ ign, rank, monthly, rankColor, plusColor, guildTag, tagColor, specialRank, lastLogin, lastLogout, prefix }: { { ign, uuid, rank, monthly, rankColor, plusColor, guildTag, tagColor, specialRank, lastLogin, lastLogout, prefix }: {
ign: string ign: string
uuid: string
rank: NewPackageRank rank: NewPackageRank
monthly: MonthlyPackageRank monthly: MonthlyPackageRank
rankColor: RankColor rankColor: RankColor
@@ -25,11 +27,11 @@ export default function DisplayName(
) { ) {
return ( return (
<div className="flex gap-2 items-center mt-35"> <div className="flex gap-2 items-center mt-35">
<Link href={`/player/${ign}`}> <Link href={`https://namemc.com/profile/${uuid}`}>
<Image <Image
src={`https://minotar.net/helm/${ign}/36.png`} src={head(uuid, 40)}
width={36} width={40}
height={36} height={40}
alt={ign} alt={ign}
unoptimized unoptimized
className="shadow-2xl" className="shadow-2xl"

View File

@@ -78,3 +78,7 @@ export function romanize(num: number) {
const thousands = Number(digits.join("")) const thousands = Number(digits.join(""))
return "M".repeat(thousands) + roman return "M".repeat(thousands) + roman
} }
export function head(val: string, size: number) {
return `https://vzge.me/face/${size}/${val}?no-shadow,cape,ears,overlay`
}