|
@ -42,16 +42,21 @@ export const handleScreenAuto = id => { |
|
|
|
|
|
|
|
|
// 还需要将缩放后的content 相对于flex_center容器进行充满
|
|
|
// 还需要将缩放后的content 相对于flex_center容器进行充满
|
|
|
export const handleScreenToFlexCenter = (contentId, flexId) => { |
|
|
export const handleScreenToFlexCenter = (contentId, flexId) => { |
|
|
// const originEle = document.querySelector(contentId)
|
|
|
|
|
|
// const targetEle = document.querySelector(flexId)
|
|
|
|
|
|
// // 需要判断缩放后的高度是否超过了容器高度
|
|
|
|
|
|
// const scale =
|
|
|
|
|
|
// originEle.clientWidth / originEle.clientHeight <
|
|
|
|
|
|
// targetEle.clientWidth / targetEle.clientHeight
|
|
|
|
|
|
// ? originEle.clientWidth / targetEle.clientWidth
|
|
|
|
|
|
// : originEle.clientHeight / targetEle.clientHeight
|
|
|
|
|
|
// document.querySelector(contentId).style['transform-origin'] = 'center center'
|
|
|
|
|
|
// document.querySelector(contentId).style.transform = `scale(${scale})`
|
|
|
|
|
|
|
|
|
const clientWidth = document.documentElement.clientWidth |
|
|
|
|
|
const clientHeight = document.documentElement.clientHeight |
|
|
|
|
|
if (clientWidth <= 1600 && clientHeight < 1080) { |
|
|
|
|
|
const originEle = document.querySelector(contentId) |
|
|
|
|
|
const targetEle = document.querySelector(flexId) |
|
|
|
|
|
// 需要判断缩放后的高度是否超过了容器高度
|
|
|
|
|
|
const scale = |
|
|
|
|
|
originEle.clientWidth / originEle.clientHeight < |
|
|
|
|
|
targetEle.clientWidth / targetEle.clientHeight |
|
|
|
|
|
? originEle.clientWidth / targetEle.clientWidth |
|
|
|
|
|
: originEle.clientHeight / targetEle.clientHeight |
|
|
|
|
|
document.querySelector(contentId).style['transform-origin'] = |
|
|
|
|
|
'center center' |
|
|
|
|
|
document.querySelector(contentId).style.transform = `scale(${scale})` |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const handleBottomFont = (id, scale) => { |
|
|
const handleBottomFont = (id, scale) => { |
|
|