// 屏幕缩放
export function screenSize(editorDom) {
  let screenWidth = document.body.clientWidth || document.documentElement.clientWidth;
  let screenHeight = document.body.clientHeight || document.documentElement.clientHeight;
  let defWidth = 1920;
  let defHeight = 1080;
  let xScale = screenWidth / defWidth;
  let yScale = screenHeight / defHeight;
  editorDom.style.cssText += ';transform: scale(' + xScale + ',' + yScale + ')';

  $(window).resize(() => {
    let screenWidth = document.body.clientWidth || document.documentElement.clientWidth;
    let screenHeight = document.body.clientHeight || document.documentElement.clientHeight;
    xScale = screenWidth / defWidth;
    yScale = screenHeight / defHeight;
    editorDom.style.cssText += ';transform: scale(' + xScale + ',' + yScale + ')';
  })
}

export function getWeather(name) {
  const list = [
    {
      name: `云`,
      icon: `icon-duoyun`,
    },

    {
      name: `雪`,
      icon: `icon-xue`,
    },

    {
      name: `晴`,
      icon: `icon-qing`,
    },

    {
      name: `雨`,
      icon: `icon-yu`,
    },

    {
      name: `雪`,
      icon: `icon-xue`,
    },

    {
      name: `雾`,
      icon: `icon-wu`,
    },

    {
      name: `雷`,
      icon: `icon-leidian`,
    },

    {
      name: `风`,
      icon: `icon-feng`,
    },
  ]
  const item = list.find((item) => name.includes(item.name)) || list[0]
  return item
}