mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
fix: 提取滤镜,变换,动画方法到全局
This commit is contained in:
@@ -37,29 +37,3 @@ export const getEditCanvasConfigStyle = (canvas: EditCanvasConfigType) => {
|
||||
...computedBackground
|
||||
}
|
||||
}
|
||||
|
||||
// 动画
|
||||
export const animationsClass = (animations: string[]) => {
|
||||
if (animations.length) {
|
||||
return `animate__animated animate__${animations[0]}`
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
// 滤镜
|
||||
export const getFilterStyle = (styles: StylesType | EditCanvasConfigType) => {
|
||||
const { opacity, saturate, contrast, hueRotate, brightness } = styles
|
||||
return {
|
||||
// 透明度
|
||||
opacity: opacity,
|
||||
filter: `saturate(${saturate}) contrast(${contrast}) hue-rotate(${hueRotate}deg) brightness(${brightness})`,
|
||||
}
|
||||
}
|
||||
|
||||
// 变换
|
||||
export const getTranstormStyle = (styles: StylesType) => {
|
||||
const { rotateZ, rotateX, rotateY, skewX, skewY } = styles
|
||||
return {
|
||||
transform: `rotateZ(${rotateZ || 0}deg) rotateX(${rotateX || 0}deg) rotateY(${rotateY || 0}deg) skewX(${skewX || 0}deg) skewY(${skewY || 0}deg)`,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user