|
@ -63,14 +63,22 @@ export default { |
|
|
'--reverse-scale', |
|
|
'--reverse-scale', |
|
|
'' |
|
|
'' |
|
|
], |
|
|
], |
|
|
|
|
|
[ |
|
|
|
|
|
'--middle-scale', |
|
|
|
|
|
'' |
|
|
|
|
|
], |
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
if (scaleX > scaleY) { |
|
|
if (scaleX > scaleY) { |
|
|
cssGlobalVariable[0][1] = `scaleX(${1 / scaleX * scaleY})`; |
|
|
// cssGlobalVariable[0][1] = `scaleX(${1 / scaleX * scaleY})`; |
|
|
|
|
|
cssGlobalVariable[0][1] = `scaleX(${1 - (scaleX - scaleY)})`; |
|
|
cssGlobalVariable[1][1] = `scaleY(${1 / scaleX})`; |
|
|
cssGlobalVariable[1][1] = `scaleY(${1 / scaleX})`; |
|
|
|
|
|
cssGlobalVariable[2][1] = `scaleX(${1 - (scaleX - scaleY) / 2})`; |
|
|
} else { |
|
|
} else { |
|
|
cssGlobalVariable[0][1] = `scaleY(${1 / scaleY * scaleX})`; |
|
|
// cssGlobalVariable[0][1] = `scaleY(${1 / scaleY * scaleX})`; |
|
|
|
|
|
cssGlobalVariable[0][1] = `scaleX(${1 - (scaleY - scaleX)})`; |
|
|
cssGlobalVariable[1][1] = `scaleX(${1 / scaleY})`; |
|
|
cssGlobalVariable[1][1] = `scaleX(${1 / scaleY})`; |
|
|
|
|
|
cssGlobalVariable[2][1] = `scaleX(${1 - (scaleY - scaleX) / 2})`; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
cssGlobalVariable.forEach((data) => { |
|
|
cssGlobalVariable.forEach((data) => { |
|
@ -94,47 +102,35 @@ export default { |
|
|
body { |
|
|
body { |
|
|
.keep-ratio { |
|
|
.keep-ratio { |
|
|
transform: var(--keep-ratio); |
|
|
transform: var(--keep-ratio); |
|
|
transition: all .15s linear; |
|
|
|
|
|
|
|
|
|
|
|
&[origin] { |
|
|
|
|
|
transform-origin: attr(origin); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
&-left { |
|
|
|
|
|
transform-origin: left; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
&-right { |
|
|
|
|
|
transform-origin: right; |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
&-bottom { |
|
|
.reverse-ratio { |
|
|
transform-origin: bottom; |
|
|
transform: var(--reverse-scale); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
&-top { |
|
|
.middle-ratio { |
|
|
transform-origin: top; |
|
|
transform: var(--middle-scale); |
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.reverse-scale { |
|
|
.keep-ratio, |
|
|
transform: var(--reverse-scale); |
|
|
.reverse-ratio, |
|
|
|
|
|
.middle-ratio { |
|
|
transition: all .15s linear; |
|
|
transition: all .15s linear; |
|
|
|
|
|
|
|
|
&-left { |
|
|
&[origin="left"] { |
|
|
transform-origin: left; |
|
|
transform-origin: left; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
&-right { |
|
|
&[origin="right"] { |
|
|
transform-origin: right; |
|
|
transform-origin: right; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
&-bottom { |
|
|
&[origin="top"] { |
|
|
transform-origin: bottom; |
|
|
transform-origin: top; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
&-top { |
|
|
&[origin="bottom"] { |
|
|
transform-origin: top; |
|
|
transform-origin: bottom; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|