/*
 * @Author: donghao donghao@supervision.ltd
 * @Date: 2025-03-06 14:07:57
 * @LastEditors: donghao donghao@supervision.ltd
 * @LastEditTime: 2025-03-06 14:36:56
 * @FilePath: \vite-ai\data-dashboard\src\utils\screen-helper.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
export function showDesignHelper(designWidth: number, designHeight: number) {
    // 创建基准线容器
    const helper = document.createElement('div')
    helper.style.cssText = `
      position: fixed;
      z-index: 9999;
      pointer-events: none;
      width: ${designWidth}px;
      height: ${designHeight}px;
      transform-origin: 0 0;
    `
    document.body.appendChild(helper)
  
    // 动态更新缩放比例
    const updateScale = () => {
      const scale = Math.min(
        window.innerWidth / designWidth,
        window.innerHeight / designHeight
      )
      helper.style.transform = `scale(${scale})`
    }
  
    window.addEventListener('resize', updateScale)
    updateScale()
  }