All files / types/constants ui.ts

100% Statements 14/14
100% Branches 0/0
100% Functions 0/0
100% Lines 14/14

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                                    245x                           245x                                                                 245x                                 245x                                 245x                               245x                               245x                           245x                                                                   245x                               245x                             245x                           245x                                                                                     245x                             245x                            
/**
 * UI constants for Black Trigram Korean martial arts interface.
 *
 * @module types/constants/ui
 * @category UI Constants
 * @korean UI상수
 */
 
import { KOREAN_COLORS } from "./colors";
 
/**
 * Safe area inset defaults for notched devices
 * iOS devices: iPhone X+ have notches and home indicators
 * Android devices: Various implementations
 * 
 * @category UI Constants
 * @korean 안전영역삽입
 */
export const SAFE_AREA_INSETS = {
  TOP: 44, // Status bar and notch area
  BOTTOM: 34, // Home indicator area
  LEFT: 0, // No side notches on most devices
  RIGHT: 0, // No side notches on most devices
} as const;
 
/**
 * Layout dimension constants for UI components.
 *
 * @constant
 * @category UI Constants
 * @korean UI치수
 */
export const UI_DIMENSIONS = {
  HEADER_HEIGHT: 80,
  FOOTER_HEIGHT: 60,
  SIDEBAR_WIDTH: 250,
  CONTENT_PADDING: 20,
 
  // Button sizes
  BUTTON_SMALL: { width: 80, height: 32 },
  BUTTON_MEDIUM: { width: 120, height: 40 },
  BUTTON_LARGE: { width: 200, height: 50 },
 
  // Modal sizes
  MODAL_SMALL: { width: 400, height: 300 },
  MODAL_MEDIUM: { width: 600, height: 450 },
  MODAL_LARGE: { width: 800, height: 600 },
 
  // Default screen dimensions for fallback calculations
  DEFAULT_SCREEN_WIDTH: 1920,
  DEFAULT_SCREEN_HEIGHT: 1080,
 
  // Mobile touch target sizes (iOS/Android guidelines: 48px minimum)
  TOUCH_TARGET_MIN: 48,
  TOUCH_TARGET_COMFORTABLE: 56,
  TOUCH_TARGET_SPACING: 8, // Minimum spacing between touch targets
} as const;
 
/**
 * Z-index layer values for UI stacking context.
 *
 * @constant
 * @category UI Constants
 * @korean Z인덱스레이어
 */
export const Z_INDEX = {
  BACKGROUND: 0,
  GAME_WORLD: 100,
  UI_BACKGROUND: 200,
  UI_ELEMENTS: 300,
  MODALS: 400,
  TOOLTIPS: 500,
  DEBUG_OVERLAY: 1000,
} as const;
 
/**
 * Spacing values in pixels for consistent layout margins and padding.
 *
 * @constant
 * @category UI Constants
 * @korean UI간격
 */
export const SPACING = {
  XS: 4,
  SM: 8,
  MD: 16,
  LG: 24,
  XL: 32,
  XXL: 48,
  COMPACT: 12, // Mobile compact spacing
} as const;
 
/**
 * Border radius values in pixels for consistent rounded corners.
 *
 * @constant
 * @category UI Constants
 * @korean 테두리반경
 */
export const BORDER_RADIUS = {
  NONE: 0,
  SM: 4,
  MD: 8,
  LG: 12,
  XL: 16,
  ROUND: 9999,
} as const;
 
/**
 * Box shadow definitions for depth and elevation effects.
 *
 * @constant
 * @category UI Constants
 * @korean UI그림자
 */
export const SHADOWS = {
  SM: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
  MD: "0 4px 6px -1px rgba(0, 0, 0, 0.1)",
  LG: "0 10px 15px -3px rgba(0, 0, 0, 0.1)",
  XL: "0 20px 25px -5px rgba(0, 0, 0, 0.1)",
  CYBER: "0 0 20px rgba(0, 255, 255, 0.3)",
  KOREAN_GLOW: "0 0 15px rgba(255, 215, 0, 0.4)",
} as const;
 
/**
 * Animation curve CSS transition strings for UI.
 *
 * @constant
 * @category UI Constants
 * @korean UI애니메이션타이밍
 */
export const UI_ANIMATIONS = {
  FAST: "150ms ease-out",
  NORMAL: "250ms ease-in-out",
  SLOW: "400ms ease-in-out",
  BOUNCE: "300ms cubic-bezier(0.68, -0.55, 0.265, 1.55)",
} as const;
 
/**
 * Button state color tokens for normal, hover, pressed, and disabled states.
 *
 * @constant
 * @category UI Constants
 * @korean 버튼상태
 */
export const BUTTON_STATES = {
  NORMAL: {
    background: KOREAN_COLORS.UI_BACKGROUND_MEDIUM,
    border: KOREAN_COLORS.UI_BORDER,
    text: KOREAN_COLORS.TEXT_PRIMARY,
    alpha: 1.0,
  },
  HOVER: {
    background: KOREAN_COLORS.UI_BACKGROUND_LIGHT,
    border: KOREAN_COLORS.ACTIVE_BORDER,
    text: KOREAN_COLORS.TEXT_ACCENT,
    alpha: 1.0,
  },
  PRESSED: {
    background: KOREAN_COLORS.UI_BACKGROUND_DARK,
    border: KOREAN_COLORS.ACTIVE_BORDER,
    text: KOREAN_COLORS.TEXT_ACCENT,
    alpha: 0.8,
  },
  DISABLED: {
    background: KOREAN_COLORS.UI_DISABLED_FILL,
    border: KOREAN_COLORS.UI_DISABLED_BORDER,
    text: KOREAN_COLORS.TEXT_TERTIARY,
    alpha: 0.5,
  },
} as const;
 
/**
 * Health bar color thresholds for player vital display.
 *
 * @constant
 * @category UI Constants
 * @korean 체력바색상
 */
export const HEALTH_COLORS = {
  FULL: KOREAN_COLORS.POSITIVE_GREEN,
  HIGH: KOREAN_COLORS.ACCENT_YELLOW,
  MEDIUM: KOREAN_COLORS.WARNING_ORANGE,
  LOW: KOREAN_COLORS.WARNING_YELLOW,
  CRITICAL: KOREAN_COLORS.NEGATIVE_RED,
  UNCONSCIOUS: KOREAN_COLORS.UI_GRAY,
} as const;
 
/**
 * Status effect color tokens for positive, negative, and neutral effects.
 *
 * @constant
 * @category UI Constants
 * @korean 상태효과색상
 */
export const STATUS_COLORS = {
  POSITIVE: KOREAN_COLORS.POSITIVE_GREEN,
  NEGATIVE: KOREAN_COLORS.NEGATIVE_RED,
  NEUTRAL: KOREAN_COLORS.TEXT_SECONDARY,
  TEMPORARY: KOREAN_COLORS.ACCENT_YELLOW,
  PERMANENT: KOREAN_COLORS.ACCENT_PURPLE,
} as const;
 
/**
 * Combat feedback color tokens for hit, block, and special strike results.
 *
 * @constant
 * @category UI Constants
 * @korean 전투피드백색상
 */
export const COMBAT_FEEDBACK_COLORS = {
  HIT: KOREAN_COLORS.ACCENT_RED,
  CRITICAL_HIT: KOREAN_COLORS.CRITICAL_HIT,
  BLOCKED: KOREAN_COLORS.BLOCKED_ATTACK,
  MISS: KOREAN_COLORS.UI_GRAY,
  PERFECT: KOREAN_COLORS.PERFECT_STRIKE,
  COUNTER: KOREAN_COLORS.ACCENT_CYAN,
  VITAL_POINT: KOREAN_COLORS.VITAL_POINT_HIT,
} as const;
 
/**
 * UI Layout and component constants for Korean martial arts game
 */
 
export const UI_CONSTANTS = {
  // Layout dimensions
  HEADER_HEIGHT: 80,
  FOOTER_HEIGHT: 60,
  SIDEBAR_WIDTH: 240,
  PANEL_WIDTH: 320,
 
  // Component sizes
  BUTTON_HEIGHT: 48,
  BUTTON_WIDTH: 160,
  INPUT_HEIGHT: 40,
  CARD_MIN_HEIGHT: 120,
 
  // Spacing
  MARGIN_SMALL: 8,
  MARGIN_MEDIUM: 16,
  MARGIN_LARGE: 24,
  MARGIN_XLARGE: 32,
 
  // Borders and radii
  BORDER_RADIUS: 8,
  BORDER_WIDTH: 2,
 
  // Animation durations (ms)
  ANIMATION_FAST: 150,
  ANIMATION_NORMAL: 300,
  ANIMATION_SLOW: 500,
 
  // Z-index layers
  Z_BACKGROUND: 0,
  Z_CONTENT: 10,
  Z_OVERLAY: 100,
  Z_MODAL: 1000,
  Z_TOOLTIP: 2000,
} as const;
 
/**
 * Cyberpunk visual-effect intensity values for glows, flickers, and scanlines.
 *
 * @constant
 * @category UI Constants
 * @korean 사이버팡크UI효과
 */
export const CYBERPUNK_UI_EFFECTS = {
  GLOW_INTENSITY: 0.3,
  PULSE_SPEED: 2.0,
  FLICKER_FREQUENCY: 0.1,
  SCAN_LINE_OPACITY: 0.1,
  NOISE_INTENSITY: 0.05,
} as const;
 
/**
 * Korean traditional layout proportions and spacing ratios.
 *
 * @constant
 * @category UI Constants
 * @korean 한국UI레이아웃
 */
export const KOREAN_UI_LAYOUTS = {
  // Traditional Korean proportions
  GOLDEN_RATIO: 1.618,
  HANGEUL_LINE_HEIGHT: 1.4,
  KOREAN_ENGLISH_RATIO: 0.7,
 
  // Text hierarchy
  TITLE_SCALE: 2.0,
  SUBTITLE_SCALE: 1.5,
  BODY_SCALE: 1.0,
  CAPTION_SCALE: 0.8,
} as const;
 
export default UI_CONSTANTS;