我正面临一个具有混合混合模式属性的元素的“闪烁问题” 。我正在使用 scss 和 gsap 开发 reactjs 项目。
这是结构的代码。
<section className = "section__container">
<div className="section__figure">
<div className="section__figure__title__outer">
<div className="section__figure__title__inner">
<h2 className="section__figure__title fill">
<div className="section__figure__title__line-1">
<span>d</span>
<span>e</span>
<span>s</span>
</div>
<div className="section__figure__title__line-2">
<span>i</span>
<span>g</span>
<span>n</span>
</div>
<div className="section__figure__title__line-3">
<span>e</span>
<span>r</span>
</div>
</h2>
<h2 className="section__figure__title nofill">
<div className="section__figure__title__line-1">
<span>d</span>
<span>e</span>
<span>s</span>
</div>
<div className="section__figure__title__line-2">
<span>i</span>
<span>g</span>
<span>n</span>
</div>
<div className="section__figure__title__line-3">
<span>e</span>
<span>r</span>
</div>
</h2>
</div>
</div>
<figure className="section__figure__img">
<img src={Profil} alt="Avatar"/>
</figure>
</div>
这是SCSS代码
.section {
&__figure {
position: relative;
height: 100%;
width: 100%;
overflow: hidden;
@media #{$medium-up} {
width: 50%;
text-align: right;
}
&__inner {
@media #{$medium-up} {
float: inherit;
margin-left: 19vw;
margin-top: 11vh;
}
}
&__img {
position: absolute;
left: 0;
z-index: 10;
top: 15vh;
height: 75%;
width: 100%;
object-fit: cover;
z-index: -1;
display: block;
overflow: hidden;
margin-top: 0;
>img {
transform: scale(1.3);
width: 100%;
height: auto;
margin-top: -28%;
@media #{$medium-up} {
margin-top: 0;
}
}
&::after {
position: absolute;
content: "";
width: 0;
width: 100%;
height: 100%;
background: white;
bottom: 0;
display: block;
}
}
&__title {
&__outer {
position: absolute;
}
&__inner {
position: relative;
}
position: absolute;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 1em;
text-align: left;
font-size: 2.8rem;
z-index:20;
&.fill {
-webkit-text-fill-color: white;
-webkit-text-stroke: 1px white;
mix-blend-mode: exclusion;
}
&.nofill {
-webkit-text-fill-color: transparent;
color: transparent;
-webkit-text-stroke: 2px black;
}
span {
display: inline-block;
}
}
}
}
这是闪烁问题的演示
我尝试了几个选项,有和没有图像、其他颜色和其他混合选项。似乎没有任何效果。
在此先感谢您的帮助。
祝你有美好的一天