Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 | 385x 379x 379x 379x 379x 379x 379x 379x 1x 1x 379x 379x 517x 500x 15x 1x 1x 591x 591x 591x 591x 591x 591x 591x 591x 25x 25x 566x 1x 1x 1x 591x 577x 577x 577x 577x 577x 577x 69x 577x 577x 1x 577x 577x 577x 577x 79x 79x 362x 362x 362x 362x 2x 2x 2x 360x 10x 10x 13x 13x 13x 13x 13x 13x 13x 13x 13x 4x 4x 8x 8x 8x 8x | /**
* Korean Theme Helper Utilities for HTML Overlays
*
* Provides consistent Korean martial arts cyberpunk theming across all HTML overlay components.
* These utilities ensure color consistency, bilingual text formatting, and responsive spacing.
*
* @module utils/koreanThemeHelpers
* @category UI Utilities
* @korean 한국테마도우미
*/
import { KOREAN_COLORS, FONT_FAMILY } from "@/types/constants";
import { SPACING, BORDER_RADIUS } from "../types/constants/ui";
import { hexToRgbaString } from "./colorUtils";
import {
getNeonGlowEffect,
getNeonTextShadow,
getLayeredDepthEffect,
getCyberpunkGradient,
getSmoothTransition,
getKoreanFontOptimization,
getHoverStateStyles,
getFocusStateStyles,
getBackdropBlurEffect,
getTrigramSymbolGlow as getTrigramGlowEffect,
combineShadowEffects,
type GlowIntensity,
type HoverAnimationType,
} from "./visualEffects";
/**
* Bilingual text format options
* @korean 이중언어형식
*/
export type BilingualFormat = "pipe" | "parentheses" | "bracket" | "slash";
/**
* Button variant types for Korean theme
* @korean 버튼변형
*/
export type KoreanButtonVariant =
| "primary"
| "secondary"
| "danger"
| "success"
| "warning";
/**
* Responsive spacing size
* @korean 반응형간격크기
*/
export type SpacingSize = "xs" | "sm" | "md" | "lg" | "xl" | "xxl";
/**
* Enhanced overlay styles configuration
* @korean 향상된오버레이스타일설정
*/
export interface EnhancedOverlayConfig {
readonly opacity?: number;
readonly glowIntensity?: GlowIntensity;
readonly includeGradient?: boolean;
readonly includeBackdropBlur?: boolean;
readonly depthLayers?: number;
}
/**
* Base styles for all Korean-themed overlays
*
* Provides consistent dark background with cyan/gold accents
*
* @param opacity - Background opacity (0-1), default 0.9
* @returns React.CSSProperties object with Korean theme
*
* @example
* ```tsx
* <div style={getKoreanOverlayBaseStyles(0.95)}>
* Content
* </div>
* ```
*
* @korean 한국오버레이기본스타일얻기
*/
export function getKoreanOverlayBaseStyles(
opacity: number = 0.9,
): React.CSSProperties {
return {
backgroundColor: hexToRgbaString(KOREAN_COLORS.UI_BACKGROUND_DARK, opacity),
border: `2px solid ${hexToRgbaString(KOREAN_COLORS.PRIMARY_CYAN, 0.8)}`,
borderRadius: `${BORDER_RADIUS.MD}px`,
fontFamily: FONT_FAMILY.KOREAN,
color: hexToRgbaString(KOREAN_COLORS.TEXT_PRIMARY),
boxShadow: `0 4px 20px ${hexToRgbaString(KOREAN_COLORS.BLACK_SOLID, 0.5)}`,
};
}
/**
* Enhanced Korean overlay styles with visual effects
*
* Provides advanced cyberpunk styling with neon glow, depth effects,
* gradients, and backdrop blur for Korean-themed overlays.
*
* @param config - Enhanced overlay configuration
* @returns React.CSSProperties with advanced visual effects
*
* @example
* ```tsx
* const styles = getEnhancedKoreanOverlayStyles({
* opacity: 0.95,
* glowIntensity: 'medium',
* includeGradient: true,
* includeBackdropBlur: true,
* depthLayers: 3,
* });
* <div style={styles}>Enhanced Content</div>
* ```
*
* @korean 향상된한국오버레이스타일얻기
*/
export function getEnhancedKoreanOverlayStyles(
config: EnhancedOverlayConfig = {},
): React.CSSProperties {
const {
opacity = 0.9,
glowIntensity = "medium",
includeGradient = false,
includeBackdropBlur = false,
depthLayers = 2,
} = config;
// Base styles
const baseStyles = getKoreanOverlayBaseStyles(opacity);
// Neon glow effect
const neonGlow = getNeonGlowEffect(
KOREAN_COLORS.PRIMARY_CYAN,
glowIntensity,
true,
);
// Depth effect
const depthShadow = getLayeredDepthEffect({
layers: depthLayers,
baseOffset: 2,
baseBlur: 4,
color: KOREAN_COLORS.BLACK_SOLID,
opacity: 0.5,
});
// Combine shadows
const boxShadow = combineShadowEffects([neonGlow, depthShadow]);
// Optional gradient background
let background = baseStyles.backgroundColor;
if (includeGradient) {
const gradient = getCyberpunkGradient(
KOREAN_COLORS.PRIMARY_CYAN,
KOREAN_COLORS.UI_BACKGROUND_DARK,
135,
);
background = `${gradient}, ${background}`;
}
// Optional backdrop blur
const backdropStyles = includeBackdropBlur
? getBackdropBlurEffect(10, 1.5)
: {};
// Combine all styles
return {
...baseStyles,
...backdropStyles,
background,
boxShadow,
transition: getSmoothTransition("all", "normal"),
...getKoreanFontOptimization(16, "normal"),
};
}
/**
* Format bilingual text with Korean and English
*
* Supports multiple formatting styles:
* - pipe: "한글 | English"
* - parentheses: "한글 (English)"
* - bracket: "한글 [English]"
* - slash: "한글 / English"
*
* @param korean - Korean text
* @param english - English text
* @param format - Format style, default "pipe"
* @returns Formatted bilingual string
*
* @example
* ```tsx
* formatBilingualText('공격', 'Attack', 'pipe') // "공격 | Attack"
* formatBilingualText('방어', 'Defense', 'parentheses') // "방어 (Defense)"
* ```
*
* @korean 이중언어텍스트형식화
*/
export function formatBilingualText(
korean: string,
english: string,
format: BilingualFormat = "pipe",
): string {
switch (format) {
case "pipe":
return `${korean} | ${english}`;
case "parentheses":
return `${korean} (${english})`;
case "bracket":
return `${korean} [${english}]`;
case "slash":
return `${korean} / ${english}`;
default:
return `${korean} | ${english}`;
}
}
/**
* Get Korean button styles with variant support
*
* Returns consistent button styling based on variant:
* - primary: Cyan border, gold text
* - secondary: Gold border, white text
* - danger: Red border, red text
* - success: Green border, green text
* - warning: Orange border, orange text
*
* @param variant - Button variant type
* @param isHovered - Whether button is hovered
* @param isPressed - Whether button is pressed
* @returns React.CSSProperties for button
*
* @example
* ```tsx
* <button style={getKoreanButtonStyles('primary', isHovered, isPressed)}>
* {formatBilingualText('확인', 'Confirm')}
* </button>
* ```
*
* @korean 한국버튼스타일얻기
*/
export function getKoreanButtonStyles(
variant: KoreanButtonVariant = "primary",
isHovered: boolean = false,
isPressed: boolean = false,
): React.CSSProperties {
// Variant-specific colors
const variantColors = {
primary: {
border: KOREAN_COLORS.PRIMARY_CYAN,
text: KOREAN_COLORS.ACCENT_GOLD,
hoverBg: KOREAN_COLORS.PRIMARY_CYAN,
},
secondary: {
border: KOREAN_COLORS.ACCENT_GOLD,
text: KOREAN_COLORS.TEXT_PRIMARY,
hoverBg: KOREAN_COLORS.ACCENT_GOLD,
},
danger: {
border: KOREAN_COLORS.ACCENT_RED,
text: KOREAN_COLORS.ACCENT_RED,
hoverBg: KOREAN_COLORS.ACCENT_RED,
},
success: {
border: KOREAN_COLORS.ACCENT_GREEN,
text: KOREAN_COLORS.ACCENT_GREEN,
hoverBg: KOREAN_COLORS.ACCENT_GREEN,
},
warning: {
border: KOREAN_COLORS.WARNING_ORANGE,
text: KOREAN_COLORS.WARNING_ORANGE,
hoverBg: KOREAN_COLORS.WARNING_ORANGE,
},
};
const colors = variantColors[variant];
let backgroundColor = hexToRgbaString(
KOREAN_COLORS.UI_BACKGROUND_MEDIUM,
0.9,
);
let borderColor = hexToRgbaString(colors.border, 0.8);
const textColor = hexToRgbaString(colors.text);
let boxShadow = "none";
let transform = "scale(1)";
if (isPressed) {
backgroundColor = hexToRgbaString(colors.hoverBg, 0.2);
transform = "scale(0.98)";
} else if (isHovered) {
backgroundColor = hexToRgbaString(colors.hoverBg, 0.1);
borderColor = hexToRgbaString(colors.border, 1.0);
boxShadow = `0 0 10px ${hexToRgbaString(colors.border, 0.5)}`;
}
return {
backgroundColor,
border: `2px solid ${borderColor}`,
borderRadius: `${BORDER_RADIUS.SM}px`,
color: textColor,
fontFamily: FONT_FAMILY.KOREAN,
fontWeight: "bold",
padding: `${SPACING.SM}px ${SPACING.MD}px`,
cursor: "pointer",
transition: "all 0.2s ease",
userSelect: "none",
WebkitUserSelect: "none",
boxShadow,
transform,
textShadow: `0 2px 4px ${hexToRgbaString(KOREAN_COLORS.BLACK_SOLID, 0.5)}`,
};
}
/**
* Enhanced Korean button configuration
* @korean 향상된한국버튼설정
*/
export interface EnhancedButtonConfig {
readonly variant?: KoreanButtonVariant;
readonly isHovered?: boolean;
readonly isPressed?: boolean;
readonly isFocused?: boolean;
readonly glowIntensity?: GlowIntensity;
readonly hoverAnimation?: HoverAnimationType;
}
/**
* Get enhanced Korean button styles with neon glow
*
* Provides advanced button styling with cyberpunk neon effects,
* smooth transitions, and Korean font optimization.
*
* @param config - Enhanced button configuration
* @returns React.CSSProperties with neon glow effects
*
* @example
* ```tsx
* const buttonStyle = getKoreanButtonWithGlow({
* variant: 'primary',
* isHovered: true,
* glowIntensity: 'strong',
* hoverAnimation: 'combined',
* });
* <button style={buttonStyle}>
* {formatBilingualText('공격', 'Attack')}
* </button>
* ```
*
* @korean 네온글로우한국버튼스타일얻기
*/
export function getKoreanButtonWithGlow(
config: EnhancedButtonConfig = {},
): React.CSSProperties {
const {
variant = "primary",
isHovered = false,
isPressed = false,
isFocused = false,
glowIntensity = "medium",
hoverAnimation = "combined",
} = config;
// Get base button styles
const baseStyles = getKoreanButtonStyles(variant, false, isPressed);
// Variant-specific glow colors
const glowColors = {
primary: KOREAN_COLORS.PRIMARY_CYAN,
secondary: KOREAN_COLORS.ACCENT_GOLD,
danger: KOREAN_COLORS.ACCENT_RED,
success: KOREAN_COLORS.ACCENT_GREEN,
warning: KOREAN_COLORS.WARNING_ORANGE,
};
const glowColor = glowColors[variant];
// Hover state with visual effects
let hoverStyles: React.CSSProperties = {};
if (isHovered) {
hoverStyles = getHoverStateStyles(glowColor, hoverAnimation, glowIntensity);
}
// Focus state
let focusStyles: React.CSSProperties = {};
if (isFocused) {
focusStyles = getFocusStateStyles(glowColor, true);
}
// Extract font size from base styles (getKoreanButtonStyles always returns number | string)
const baseFontSize =
typeof baseStyles.fontSize === "number"
? baseStyles.fontSize
: parseInt(String(baseStyles.fontSize), 10) || 14;
// Neon text glow for button text
const textGlow = getNeonTextShadow(
glowColor,
isHovered ? "medium" : "subtle",
);
// Korean font optimization
const fontOptimization = getKoreanFontOptimization(baseFontSize, "bold");
return {
...baseStyles,
...fontOptimization,
...hoverStyles,
...focusStyles,
textShadow: textGlow,
transition: getSmoothTransition("all", "normal"),
};
}
/**
* Get button visual effects only (no color/background/border)
*
* Extracts only visual effects (boxShadow, transition, transform, textShadow) from
* getKoreanButtonWithGlow without color-related properties. This is useful for cases
* where buttons need custom colors (e.g., menu selection states) but want to preserve
* the visual effects system.
*
* This function provides an explicit contract for visual effects extraction, preventing
* fragile coupling that could occur with destructuring patterns. If getKoreanButtonWithGlow
* adds new visual effect properties in the future, they should be explicitly added here.
*
* **Intentionally Excluded Properties:**
* - Layout: fontSize, fontFamily, fontWeight, padding, width, height, cursor
* - Typography: letterSpacing, lineHeight, textRendering, WebkitFontSmoothing, MozOsxFontSmoothing
* - Colors: color, background, backgroundColor, border, borderColor
*
* **Included Visual Effects:**
* - boxShadow: Neon glow effects
* - transition: Smooth state changes (0.2s ease)
* - transform: Hover/press animations (scale)
* - textShadow: Text glow effects
*
* **Note:** If getKoreanButtonWithGlow adds new visual effect properties (e.g., 'filter',
* 'opacity', 'willChange', 'backdropFilter'), they must be explicitly added to this function's
* return type and extraction logic to maintain the explicit contract.
*
* @param config - Same configuration as getKoreanButtonWithGlow
* @returns React.CSSProperties with only visual effects (boxShadow, transition, transform, textShadow)
*
* @example
* ```tsx
* const visualEffects = getButtonVisualEffectsOnly({
* variant: 'primary',
* glowIntensity: 'strong',
* hoverAnimation: 'combined'
* });
*
* <button style={{
* ...visualEffects,
* color: customColor, // Apply custom colors
* background: customBg,
* border: customBorder
* }}>
* Custom Button
* </button>
* ```
*
* @korean 버튼시각효과만얻기
*/
export function getButtonVisualEffectsOnly(
config: Parameters<typeof getKoreanButtonWithGlow>[0],
): Pick<
React.CSSProperties,
"boxShadow" | "transition" | "transform" | "textShadow"
> {
const fullStyles = getKoreanButtonWithGlow(config);
// Explicitly extract only visual effect properties
// Note: This explicitly excludes layout, typography, and color properties.
// If new visual effects (filter, opacity, willChange, etc.) are added to
// getKoreanButtonWithGlow, they must be added here to maintain the contract.
return {
boxShadow: fullStyles.boxShadow,
transition: fullStyles.transition,
transform: fullStyles.transform,
textShadow: fullStyles.textShadow,
};
}
/**
* Get responsive spacing value
*
* Returns SPACING constant value for consistent spacing across components.
* Optionally scales for mobile devices.
*
* **IMPORTANT**: This function accepts lowercase size parameters ('xs', 'sm', 'md', etc.)
* to provide a more intuitive API, then internally converts to uppercase to match
* SPACING constant keys ('XS', 'SM', 'MD', etc.). This design choice prioritizes
* developer experience while maintaining compatibility with the SPACING constants.
*
* @param size - Spacing size constant ('xs', 'sm', 'md', 'lg', 'xl', 'xxl')
* @param isMobile - Whether to apply mobile scaling (87.5% for mobile devices)
* @returns Spacing value in pixels
*
* @example
* ```tsx
* const padding = getResponsiveSpacing('md', isMobile); // 16px desktop, 14px mobile
* <div style={{ padding: `${padding}px` }}>Content</div>
* ```
*
* @korean 반응형간격얻기
*/
export function getResponsiveSpacing(
size: SpacingSize,
isMobile: boolean = false,
): number {
// Convert lowercase API parameter to uppercase SPACING constant key
// This provides a more ergonomic API while maintaining internal consistency
const spacingKey = size.toUpperCase() as keyof typeof SPACING;
const spacingValue = SPACING[spacingKey];
const mobileScale = 0.875; // 87.5% for mobile
// Runtime validation: While TypeScript prevents invalid sizes at compile time,
// this check provides safety for JavaScript consumers and edge cases where
// type assertions bypass TypeScript checks (e.g., 'as any', dynamic values)
if (spacingValue === undefined) {
const fallback = SPACING.MD;
console.warn(
`[koreanThemeHelpers:getResponsiveSpacing] Invalid spacing size "${String(
size,
)}" provided. Falling back to "MD".`,
);
return isMobile ? Math.round(fallback * mobileScale) : fallback;
}
return isMobile ? Math.round(spacingValue * mobileScale) : spacingValue;
}
/**
* Get trigram symbol by name
*
* Returns Unicode trigram symbol for visual embellishment
*
* @param name - Trigram name in Korean
* @returns Unicode trigram symbol
*
* @example
* ```tsx
* <div>{getTrigramSymbol('건')} 건 (Heaven)</div>
* ```
*
* @korean 팔괘기호얻기
*/
export function getTrigramSymbol(
name: "건" | "태" | "리" | "진" | "손" | "감" | "간" | "곤",
): string {
const symbols = {
건: "☰", // Heaven - 乾
태: "☱", // Lake - 兌
리: "☲", // Fire - 離
진: "☳", // Thunder - 震
손: "☴", // Wind - 巽
감: "☵", // Water - 坎
간: "☶", // Mountain - 艮
곤: "☷", // Earth - 坤
};
return symbols[name];
}
/**
* Get trigram symbol styles with glow effect
*
* Enhances trigram symbols (☰☱☲☳☴☵☶☷) with cyberpunk neon glow
* based on stance-specific colors and active state.
*
* @param config - Configuration object
* @param config.stance - Trigram stance identifier ("geon", "tae", etc.)
* @param config.isActive - Whether the trigram stance is currently active
* @param config.size - Font size in pixels (optional, defaults based on active state)
* @returns React.CSSProperties with trigram-specific glow
*
* @example
* ```tsx
* const trigramStyle = getTrigramSymbolWithGlow({ stance: 'geon', isActive: true });
* <div style={trigramStyle}>
* ☰ 건 | Geon
* </div>
* ```
*
* @korean 팔괘기호네온글로우스타일얻기
*/
export function getTrigramSymbolWithGlow(config: {
readonly stance:
| "geon"
| "tae"
| "li"
| "jin"
| "son"
| "gam"
| "gan"
| "gon";
readonly isActive?: boolean;
readonly size?: number;
}): React.CSSProperties & {
WebkitUserSelect?: string;
} {
const { stance, isActive = false, size } = config;
// Map English stance names to Korean
const stanceToKorean = {
geon: "건",
tae: "태",
li: "리",
jin: "진",
son: "손",
gam: "감",
gan: "간",
gon: "곤",
};
const koreanName = stanceToKorean[stance];
// Trigram-specific colors matching KOREAN_COLORS
// Note: Comments reflect actual hex color values
// TODO: Fix source constants (colors.ts lines 84, 87) - TRIGRAM_GEON_PRIMARY should say "Gold" not "White",
// TRIGRAM_JIN_PRIMARY should say "Medium Purple" not "Yellow"
const trigramColors: Record<string, number> = {
건: KOREAN_COLORS.TRIGRAM_GEON_PRIMARY, // Heaven - Gold (0xffd700)
태: KOREAN_COLORS.TRIGRAM_TAE_PRIMARY, // Lake - Sky Blue
리: KOREAN_COLORS.TRIGRAM_LI_PRIMARY, // Fire - Orange Red
진: KOREAN_COLORS.TRIGRAM_JIN_PRIMARY, // Thunder - Medium Purple (0x9370db)
손: KOREAN_COLORS.TRIGRAM_SON_PRIMARY, // Wind - Light Green
감: KOREAN_COLORS.TRIGRAM_GAM_PRIMARY, // Water - Blue
간: KOREAN_COLORS.TRIGRAM_GAN_PRIMARY, // Mountain - Brown
곤: KOREAN_COLORS.TRIGRAM_GON_PRIMARY, // Earth - Dark Gray
};
const trigramColor = trigramColors[koreanName];
// Get glow effect from visualEffects
const glowStyles = getTrigramGlowEffect(trigramColor, isActive);
// Korean font optimization for trigram symbols
const fontSize = size ?? (isActive ? 32 : 28);
const fontStyles = getKoreanFontOptimization(fontSize, "bold");
return {
...fontStyles,
...glowStyles,
fontFamily: FONT_FAMILY.KOREAN,
display: "inline-block",
userSelect: "none",
WebkitUserSelect: "none",
};
}
/**
* Get Korean color name for documentation
*
* Maps hex color to Korean color name for better documentation
*
* @param hexColor - Hex color value from KOREAN_COLORS
* @returns Korean name and English translation
*
* @internal Used primarily for JSDoc documentation
* @korean 한국색상이름얻기
*/
export function getKoreanColorName(hexColor: number): {
korean: string;
english: string;
} {
const colorNames: Record<number, { korean: string; english: string }> = {
[KOREAN_COLORS.PRIMARY_CYAN]: { korean: "청록", english: "Cyan" },
[KOREAN_COLORS.ACCENT_GOLD]: { korean: "금색", english: "Gold" },
[KOREAN_COLORS.ACCENT_RED]: { korean: "빨강", english: "Red" },
[KOREAN_COLORS.ACCENT_GREEN]: { korean: "초록", english: "Green" },
[KOREAN_COLORS.WARNING_ORANGE]: { korean: "주황", english: "Orange" },
[KOREAN_COLORS.TEXT_PRIMARY]: { korean: "흰색", english: "White" },
[KOREAN_COLORS.UI_BACKGROUND_DARK]: {
korean: "어두운배경",
english: "Dark Background",
},
};
return colorNames[hexColor] ?? { korean: "알수없음", english: "Unknown" };
}
/**
* Format stat row with bilingual labels
*
* Creates consistent stat row styling for training/combat statistics
*
* @param korean - Korean label
* @param english - English label
* @param value - Stat value
* @param valueColor - Hex color for value text
* @param isMobile - Mobile responsive mode
* @returns Stat row configuration object for React rendering
*
* @example
* ```tsx
* const statConfig = formatStatRow('점수', 'Score', 1500, KOREAN_COLORS.ACCENT_GOLD, false);
* ```
*
* @korean 통계행형식화
*/
export function formatStatRow(
korean: string,
english: string,
value: string | number,
valueColor: number,
isMobile: boolean,
): {
korean: string;
english: string;
value: string | number;
valueColor: number;
labelSize: string;
subLabelSize: string;
valueSize: string;
} {
const labelSize = isMobile ? "11px" : "12px";
const subLabelSize = isMobile ? "8px" : "9px";
const valueSize = isMobile ? "16px" : "18px";
return {
korean,
english,
value,
valueColor,
labelSize,
subLabelSize,
valueSize,
};
}
|