Unify all flags to rectangular SVG (fix waving emoji inconsistency)
- 원인: MEX·RSA는 이모지 국기(OS별 휘날림/광택), KOR·CZE만 실제 이미지 → 불일치 - 해결: 4개국 전부 flagcdn 직사각형 SVG(public/icons/flags) + object-cover로 통일, 이모지 제거 - 미등록 국가는 이모지 fallback 유지 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
9b35a759a9
commit
f29dbd0454
5 files changed
+18
-20
No files matched your search
+14
-20
@@ -1,7 +1,14 @@
|
||||
import type { Team } from "@/lib/types";
|
||||
|
||||
// 모든 경기에 일반화된 국기 렌더.
|
||||
// KOR = 실제 png 자산, CZE = 인라인 SVG(비율 보존), 그 외 = 이모지(컨테이너 높이에 비례, 안 잘림).
|
||||
// 모든 국기를 직사각형 SVG로 통일 (flagcdn, 퍼블릭 도메인).
|
||||
// 이모지(OS별 휘날림/광택 렌더) 제거 → 일관된 사각형. object-cover로 박스를 꽉 채움(왜곡 없음).
|
||||
const FLAG_FILE: Record<string, string> = {
|
||||
KOR: "kr",
|
||||
CZE: "cz",
|
||||
MEX: "mx",
|
||||
RSA: "za",
|
||||
};
|
||||
|
||||
export default function TeamFlag({
|
||||
team,
|
||||
className = "",
|
||||
@@ -9,30 +16,17 @@ export default function TeamFlag({
|
||||
team: Team;
|
||||
className?: string;
|
||||
}) {
|
||||
if (team.code === "KOR") {
|
||||
const file = FLAG_FILE[team.code];
|
||||
if (file) {
|
||||
return (
|
||||
<img
|
||||
src="/icons/kor.png"
|
||||
src={`/icons/flags/${file}.svg`}
|
||||
alt={team.name}
|
||||
className={`flag-img object-cover ${className}`}
|
||||
className={`border border-[var(--line-d)] object-cover ${className}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
if (team.code === "CZE") {
|
||||
return (
|
||||
<svg
|
||||
viewBox="0 0 6 4"
|
||||
className={`border border-[var(--line-d)] ${className}`}
|
||||
preserveAspectRatio="xMidYMid meet"
|
||||
aria-label={team.name}
|
||||
>
|
||||
<rect width="6" height="2" y="0" fill="#ffffff" />
|
||||
<rect width="6" height="2" y="2" fill="#d7141a" />
|
||||
<polygon points="0,0 3,2 0,4" fill="#11457e" />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
// 그 외 국가 — 이모지 국기. 컨테이너 높이(cqh) 기준으로 크기를 잡아 잘림/찌그러짐 방지.
|
||||
// 미등록 국가 fallback — 이모지(직사각형 박스, 잘림 없음)
|
||||
return (
|
||||
<span
|
||||
className={`grid place-items-center overflow-hidden border border-[var(--line-d)] bg-white/[0.06] ${className}`}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="900" height="600"><path fill="#d7141a" d="M0 0h900v600H0z"/><path fill="#fff" d="M0 0h900v300H0z"/><path d="M450 300 0 0v600z" fill="#11457e"/></svg>
|
||||
|
After Width: | Height: | Size: 210 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="900" height="600" viewBox="-72 -48 144 96"><path fill="#fff" d="M-72-48v96H72v-96z"/><g stroke="#000" stroke-width="4"><path d="M-34.946-37.72-48.26-17.75m4.992 3.328 13.313-19.97m4.992 3.329-13.312 19.969m63.236 42.157 6.101-9.152m1.11-1.664 6.101-9.153m4.993 3.328-6.102 9.153m-1.11 1.664-6.101 9.152m4.992 3.329 6.102-9.153m1.11-1.664 6.1-9.153M-48.259 17.75l13.313 19.97m4.992-3.329-6.102-9.152m-1.109-1.664-6.102-9.153m4.993-3.328 13.312 19.97m63.236-42.158-6.101-9.153m-1.11-1.664-6.101-9.152m4.992-3.328 13.313 19.969m4.992-3.328-6.102-9.153m-1.11-1.664-6.1-9.153"/></g><path fill="#cd2e3a" d="M9.985 6.656A18 18 0 1 1-19.97-13.313a24 24 0 1 1 39.938 26.626"/><path fill="#0047a0" d="M0 0a12 12 0 1 1 19.97 13.313 24 24 0 1 1-39.94-26.626A12 12 0 1 0 0 0"/></svg>
|
||||
|
After Width: | Height: | Size: 817 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg358" width="980" height="560" version="1.1"><style id="style1">.AO{fill:#8f4620}.AP{fill:#ab6d29}.AQ{stroke-width:.35}.AR{fill:#202020}.AS{fill:#fff}.AT{stroke-width:.3}.AU{fill:#04534e}.AV{fill:#8cbebf}.AW{fill:#d2a567}.AX{fill:#dbad6c}.AY{fill:#a8ac71}.AZ{fill:#904720}.Aa{fill:#f8c83c}.Ab{stroke:#04534e}.Ac{stroke-width:.701}.Ad{fill:#0c8489}.Ae{fill:#202220}.Af{fill:#4b4139}.Ag{fill:#1e2121}.Ah{stroke:none}.Ai{fill:#78732e}.Aj{fill:#4d2a15}.Ak{fill:#fcca3e}.Al{stroke:#aa8c30}.Am{fill:#aa8c30}.An{stroke-linejoin:round}.Ao{stroke-linecap:round}.Ap{stroke-width:.409}.Aq{fill:#af7029}.Ar{fill:#816c2a}.As{fill:#fcca3d}.At{fill:#8b441f}.Au{fill:#b27129}</style><defs id="defs6"><path id="D" d="M400.868 265.986c-.845.716-.932 2.022-.194 2.921.736.907 2.019 1.057 2.866.345s.932-2.022.195-2.921-2.02-1.057-2.867-.345"/><path id="E" d="M401.592 265.612s.659-.231.014.151-1.212 2.188-.355 3.007 1.939.618 2.556-.037-.11.356-.11.356l-1.03.62-.824-.127-.957-.374-.539-.921-.167-1.11.376-.876.456-.381z"/><path id="F" d="M404.116 270.426s-.407.294-.237 1.066l.452 2.278-1.858-4.143.988-.361z"/><path id="G" d="M401.966 281.864s1.46.336 2.255-.067.93-1.012 1.126-1.208c.201-.202.401-.944.334-1.416s-1.127-2.087-1.46-2.22-1.46 0-1.657-.203.166-.643-.269-.742c-.429-.1-2.651 2.427-2.255 2.83s.631-.201.762.137c.133.332.035 1.276.035 1.678s1.129 1.212 1.129 1.212z"/><path id="H" d="M404.127 277.144c.174.351.995 1.445 1.327 1.58s1.327.173 1.659.04 1.394-1.147 1.428-1.585a2.26 2.26 0 0 0-.199-1.215c-.199-.437-.084-1.612-.481-1.679s-.572-.122-.771-.353c-.199-.238.124-.659-.175-1.094s-3.848 1.65-3.583 2.052.631-.03.763.237-.167 1.612.033 2.018z"/><path id="I" d="M411.999 276.332c.199-.535.132-2.289-.231-2.66s-.964-.401-.998-.639.432-.338.432-.742-3.948.134-3.683.577c.266.435.931.201.896.467s-.665.605-.73.945.202 1.449.366 1.714c.166.275-.065.605.398.776s.397.169.831.304 1.99.065 2.191-.105c.195-.167.329-.099.528-.637"/><path id="J" d="M404.384 278.604c.325.487-.105 1.66-.37 1.993s-2.033-.152-2.059-.479-.157-.887.075-1.198.828-1.02 1.278-.93c.449.082.96.447 1.076.613zm.479-2.196c-.208.444.09.944.318 1.188s1.499.56 1.846.349.876-2.184.632-2.487-.926-.355-1.157-.321c-.231.041-1.495.963-1.639 1.271m4.229-2.01c-.171.403-.115.959.029 1.131s.971.752 1.458.728c.486-.03.717-1.395.717-1.657s-.145-.374-.488-.523c-.341-.143-1.716.321-1.716.321"/><radialGradient id="A" cx="846.8" cy="88.605" r="25.859" fx="846.8" fy="88.605" gradientTransform="matrix(.16281 .0221 -.01992 .15265 355.694 196.138)" gradientUnits="userSpaceOnUse"><stop id="stop1" offset="0" stop-color="#fff"/><stop id="stop2" offset="1" stop-color="#f15770"/></radialGradient><radialGradient id="B" cx="658.36" cy="538.924" r="25.859" fx="658.36" fy="538.924" gradientTransform="matrix(.02438 -.15857 .14817 .02257 339.958 -141.351)" gradientUnits="userSpaceOnUse"><stop id="stop3" offset="0" stop-color="#fff"/><stop id="stop4" offset="1" stop-color="#f15770"/></radialGradient><radialGradient id="C" cx="680.128" cy="560.573" r="25.859" fx="680.128" fy="560.573" gradientTransform="matrix(.00795 -.16394 .17063 .008 419.804 -238.947)" gradientUnits="userSpaceOnUse"><stop id="stop5" offset="0" stop-color="#fff"/><stop id="stop6" offset="1" stop-color="#f15770"/></radialGradient></defs><path id="path6" fill="#ce1126" d="M0 0h980v560H0z"/><path id="path7" d="M0 0h653.333v560H0z" class="AS" style="fill:#fff;fill-opacity:1"/><path id="path8" fill="#006847" d="M0 0h326.667v560H0z"/><g id="g28" class="Ak Al" transform="translate(-.699 1.184)scale(1.16833)"><path id="path9" d="m466.96 303.53.293 5.878 2.22-1.467-1.702-4.839z" class="AQ"/><circle id="circle9" cx="466.703" cy="301.93" r="1.892" class="AT"/><path id="path10" d="m474 312.69-4.3-4.119-1.932 1.553 5.843 3.405z" class="AQ"/><path id="path11" d="M473.63 315.01c-.608-.815-.403-2.003.446-2.658s2.037-.524 2.645.288c.602.815.403 2.007-.448 2.662s-2.037.52-2.643-.292z" class="AT"/><path id="path12" d="m507.04 251.22 4.407 4.384.512-2.219-4.028-2.7z" class="AQ"/><circle id="circle12" cx="506.451" cy="250.09" r="1.845" class="AT"/><path id="path13" d="m518.65 253.82-6.733 1.921.554-2.224 5.79-.563z" class="AQ"/><circle id="circle13" cx="519.742" cy="252.89" r="1.803" class="AT"/><path id="path14" d="m496.03 287-4.108-6.398.661-.33 4.647 5.489z" class="AQ"/><circle id="circle14" cx="491.518" cy="279.115" r="1.909" class="AT"/><path id="path15" d="m496.29 287.17 5.218.953.192-.715-4.37-1.732z" class="AQ"/><g id="g16" class="AT"><circle id="circle15" cx="503.102" cy="288.18" r="1.889"/><path id="path16" d="M373.59 301.72c0 .91-.714 1.556-1.391 1.556s-1.22-.735-1.22-1.64.548-1.644 1.22-1.644 1.391.824 1.391 1.728z"/></g><path id="path17" d="m373.56 304.65 1.195 6.566-1.59-.628-.57-5.705z" class="AQ"/><g id="g18" class="AT"><path id="path18" d="M375.01 302.42c.767.994-.531 2.511-1.91 2.889s-3.097-.26-3.08-1.522c.018-1.432 2.01-.687 2.545-.853.825-.26 1.62-1.584 2.445Line truncated
|
||||
|
After Width: | Height: | Size: 140 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="900" height="600" viewBox="0 0 90 60"><defs><clipPath id="b"><path d="m0 0 45 30L0 60z"/></clipPath><clipPath id="a"><path d="M0 0h90v60H0z"/></clipPath></defs><path fill="#E03C31" d="M0 0h90v30H45z"/><path fill="#001489" d="M0 60h90V30H45z"/><g fill="none" clip-path="url(#a)"><path stroke="#FFF" stroke-width="20" d="M90 30H45L0 0v60l45-30"/><path fill="#000" stroke="#ffb81c" stroke-width="20" d="m0 0 45 30L0 60" clip-path="url(#b)"/><path stroke="#007749" stroke-width="12" d="m0 0 45 30h45M0 60l45-30"/></g></svg>
|
||||
|
After Width: | Height: | Size: 566 B |
Reference in new issue
Block a user