css - 具有不透明度和过渡效果的动画混合模式

标签 css mix-blend-mode background-blend-mode

我正在寻找一种改变background-color-blend-mode不透明度的方法
Photoshop。我的目标是为混合模式的不透明度设置动画,使其消失。有任何想法吗 ?



#img-esadvalence {
  background-image: url(http://leodurand.fr/works/planesad/esad1.jpg);
  background-color: #e12a1c;
  background-blend-mode: screen;
}

.all-img-menu {
    background-size: contain;
    background-position: center; 
    width: 110%;
    padding-bottom: 40.75vh;
    display: block;
    top: 50%;
    -ms-transform: translate(0%,-50%);
    -webkit-transform: translate(0%,-50%); 
    transform: translate(0%,-50%);
    position: absolute;
    transition: all 0.6s ease;
}

<div id="img-esadvalence" class="all-img-menu"></div>

最佳答案

混合模式仅在有2个背景时有效。要逐渐取消混合模式,可以设置动画(过渡)为透明背景色。

演示(将图像悬停在图像上可以看到效果):



#img-esadvalence {
  background-image: url(https://placeimg.com/640/480/animals);
  background-color: #e12a1c;
  background-blend-mode: screen;
  transition: background-color 1s;
}


#img-esadvalence:hover {
  background-color: transparent;
}

.all-img-menu {
    background-size: contain;
    background-position: center; 
    width: 110%;
    padding-bottom: 40.75vh;
    display: block;
    top: 50%;
    -ms-transform: translate(0%,-50%);
    -webkit-transform: translate(0%,-50%); 
    transform: translate(0%,-50%);
    position: absolute;
    transition: all 0.6s ease;
}

<div id="img-esadvalence" class="all-img-menu"></div>

关于css - 具有不透明度和过渡效果的动画混合模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45502657/

相关文章:

html - 透明背景在图像调整大小时变为白色

javascript - jquery滚动问题

html - 网页右侧溢出

html - 粘性页脚不起作用。有很大的空间和滚动条

jquery - 如何在 Twitter Bootstrap 工具提示上启用淡入淡出效果?

css - Mix-blend-mode:乘法在 Chrome 中不起作用

android - 将 mix-blend-mode 设置为除 "normal"之外的任何值都会隐藏 Android 9 上 Chrome 中的元素

Bootstrap 旋转木马标题的 CSS 混合模式