我如何使图像幻灯片的叠加层正确显示在 css3 动画中

How can i make the overlay of an image slide right to appear the image in css3 animations

我正在 CSS 中制作一个页面加载器,我想显示带有向右滑动覆盖的徽标,就像加载栏一样,但这里想要制作加载徽标而不是栏。所以这是我的代码

.underlay{
    width: 300px;
    height:300px;
    margin-left: 300px;
    margin-top: 15%;
 }
.underlay:before{
    content:"";
    width: 300px;
    height:300px;
    position: absolute;
    top: 15%;
    left: 300px;
    z-index: 99;
    background: rgba(0,0,0,0.9);
    animation-name: slide;
}

<div class="outer">
<div class="underlay">
    <img src="logo.png" alt="loading logo">
</div>
</div>

我希望滑动它underlay:before慢慢向右滑动

@Ahtsham Ul Haq:试试这个代码希望它对你有用!

.outer {
 transition: all 0.3s linear;
}
.underlay img {
    width: 300px;
    height:300px;
  display: block;
  left: 10px
/*     margin-left: 300px; */
/*     margin-top: 15%; */
 }
.underlay:before{
    content: "";
    width: 300px;
    height: 300px;
    position: absolute;
    top: 10px;
/*     left: 300px; */
    z-index: 99;
    background: rgba(0, 0, 0, 0.6);
  transition: all 0.3s linear;
}
.outer:hover .underlay:before { 
  width: 0;
}
<div class="outer">
<div class="underlay">
    <img src="https://i.ibb.co/8M3cFG4/bbb.jpg" alt="loading logo">
</div>
</div>

我有这个,它对我有用。感谢您帮助我@Asiya Fatima

.underlay:before{
    content:"";
    width: 300px;
    height:300px;
    position: absolute;
    top: 200px;
    left:0;
    z-index: 99;
    background: rgba(0,0,0,0.9);
    animation-name: slide;
    animation-duration: 7s;
    animation-timing-function: linear;
}
@-webkit-keyframes slide{
    0%{
        left:510px;
    }
    100%{
        left:850px;
    }
}