Я создаю полноэкранную заставку. Мне нужно создать выпадающие столбцы, которые меняют цвет фона с темного на светлый и раскрывают содержимое. Но мне нужно, чтобы основной заголовок (текст) обрезался до цвета фона - по мере анимации он меняется.
![enter image description here](https://i.stack.imgur.com/bXCTz.png)
На светлом фоне текст должен быть черным
Есть JSFiddle
S CSS
.header{
display: flex;
flex-direction: column;
position: relative;
height: 100%;
.overlay{
display: flex;
flex-direction: row;
align-items: flex-end;
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 1;
.col{
flex: 1;
width: 100%;
height: 100%;
background-color: black;
}
}
.content{
flex: 1;
display: flex;
flex-direction: column;
> div{
flex: 1;
}
.title{
position: relative;
color: white;
z-index: 2;
}
.posts{
display: flex;
position: relative;
z-index: 0;
a{
display: block;
width: 100%;
height: 100%;
background: lightblue;
text-align: center;
}
}
}
}
И JS
$(document).ready(function(){
setTimeout(function () {
$(".overlay .col").each(function (i) {
var col = $(this);
setTimeout(function () {
if(!col.hasClass('animated')){
col.addClass('animated');
col.slideUp(500);
}
}, 150 * i);
});
}, 500);
});
Также существует некоторая ошибка между анимациями, я хотел знать, почему это происходит
РАЗРЕШЕНО
добавить к .header
background: white;
и к .header .content .title {
mix-blend-mode: exclusion;
NEW JSFiddle