Black Trigram (흑괘) - Korean Martial Arts Combat Simulator API - v0.6.9
    Preparing search index...

    Function detectPlatform

    • Detect device type and platform information

      Combines multiple detection methods for reliability:

      1. User-agent string analysis (most reliable for device type)
      2. Screen dimensions
      3. Touch capability

      This ensures mobile controls are shown on:

      • Standard mobile phones (< 768px width)
      • High-resolution phones (>= 768px width but mobile user-agent)
      • Android 15/16 devices with 2K/4K resolutions (1200px+, 1440px+)
      • Tablets (user preference via touch support)

      User-agent detection takes priority over screen size, ensuring that high-end Android phones with desktop-class resolutions (e.g., Galaxy S23 Ultra, Pixel 9 Pro) are correctly identified as mobile devices.

      Results are cached to avoid re-parsing user-agent on every call. Cache is invalidated when screen dimensions change.

      Returns PlatformInfo

      Complete platform information

      const platform = detectPlatform();

      if (platform.isMobile) {
      // Show mobile controls even on 4K Android phones
      return <MobileControls />;
      }

      플랫폼감지