// @ts-check

// 前面放大图片默认信息
export const frontTextDefault = {
  // frontText: "西北大漠依旧热浪翻滚，机群轰陆空联合作战强势出击空军西安飞行学院组织的 “西飞利剑演兵画卷徐徐展开",
  frontText: "",
  count: 0,
  title: "",
  url: "",
}

// 转动列表默认信息
export const knowledgeListDefault = [{
    className: "top",
    content: "",
  },
  {
    className: "left",
    content: "",
  },
  {
    className: "right",
    content: "",
  },
  {
    className: "front",
    content: "",
  },
]

// 图片节点默认
export const imagesDefault = [
  { url: "", treeId: "point-tree", pointId: "point", zIndex: 2 },
  { url: "", treeId: "point-r-tree", pointId: "point-r", zIndex: 5 },
  { url: "", treeId: "point-f-tree", pointId: "point-f", zIndex: 4 },
  { url: "", treeId: "point-l-tree", pointId: "point-l", zIndex: 3 },
]

// 初始化数据
export const initDataDefault = {
  // 后面
  Back: {
    id: "Back",
    x: 320, // center
    y: 310, // center
    r: 321, // radius
    a: 4.71, // angle (from 0 to Math.PI * 2)
    move: 0.05,
    point: ".point",
    tree: ".point-tree",
  },
  // 右边
  Right: {
    id: "Right",
    x: 320, // center
    y: 310, // center
    r: 321, // radius
    a: 0.05, // angle (from 0 to Math.PI * 2)
    move: 1.601,
    point: ".point-r",
    tree: ".point-r-tree",
  },
  // 前面
  Front: {
    id: "Front",
    x: 320, // center
    y: 310, // center
    r: 321, // radius
    a: 1.601, // angle (from 0 to Math.PI * 2)
    move: 3.201,
    point: ".point-f",
    tree: ".point-f-tree",
  },
  // 左边
  Left: {
    id: "Left",
    x: 320, // center
    y: 310, // center
    r: 321, // radius
    a: 3.201, // angle (from 0 to Math.PI * 2)
    move: 4.71,
    point: ".point-l",
    tree: ".point-l-tree",
  },
}

// 设置位置
export const rotate = (point, id) => {
  let px = point.x + point.r * Math.cos(point.a); // <-- that's the maths you need
  let py = point.y + point.r * Math.sin(point.a);

  if (id && document.querySelector(id)) {
    document.querySelector(id).style.left = px + "px";
    document.querySelector(id).style.top = py + "px";
  }
}