Problem: Getting a seamless marquee effect with an img to work, but it restarts visibly

Viewed 64

I've been trying to get a marquee effect with a fog image to work for several days now. I tried several tutorials (videos and written ones), but the effect keeps visibly skipping/restarting and the effect is not seamless. The image itself is 1000px wide and is loopable. The two fog images are different and move at a different speed to have a better effect.

I did manage to get it to work with text, with the help of another tutorial, but the img version still poses problems. To clarify: The images are displayed, they move properly, but at some point the animation restarts/skips/jumps instead of seamlessly repeating the images.

My current version looks like the following (its a vue project):

.fog-container {
    top: 0;
    height: 100%;
    overflow: hidden;
    position: absolute;
    width: 100%;
    z-index: 0;
 }
  
.fog-img {
    height: 100%;
    position: absolute;
    width: 300vw;
}
  
.fog-img-first {
    animation: marquee 120s linear infinite;
    background-position: center;
    background-repeat: repeat;
    background-size: contain;
}
  
.fog-img-second {
    animation: marquee 60s linear infinite;
    background-position: center;
    background-size: contain;
    background-repeat: repeat;
}
  
@keyframes marquee {
    0% {
      transform: translate3d(0, 0, 0);
    }
  
    100% {
      transform: translate3d(-200vw, 0, 0);
    }
}
<v-main>
  <div class="fog-container">
    <div
      :style="{'background-image':     
        `url(${require('./assets/pictures/background/fog_1.png')})`}"
      class="fog-img fog-img-first"
    />
    <div
      :style="{'background-image': 
        `url(${require('./assets/pictures/background/fog_2.png')})`}"
      class="fog-img fog-img-second"
    />
  </div>
</v-main>

0 Answers
Related