Home > Software design >  CSS, Rotate Marquee
CSS, Rotate Marquee

Time:11-12

I would like to create a rotate marquee, Reference

CodePudding user response:

Define a slight larger width(here 150vw) than the screen and than translate from 0 to that extra width(150vw-100vw)

Also you can use a extra container and rotate it 6deg to remove a glitch kind of effect when animation restarts

body {
  overflow: hidden;
}

.roll {
  margin-top: 100px;
  width: 150vw;
  height: 50px;
  background-size: auto 100%;
  z-index: 2;
  position: relative;
  animation: scroll-left 2s linear infinite;
  color: #000;
  transform-origin: center center;
}

.roll1 {
  transform: rotate(6deg);
}

@keyframes scroll-left {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50vw);
  }
}
<div class="roll1">
  <div class="roll">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
    in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.></div>
</div>
<iframe name="sif2" sandbox="allow-forms allow-modals allow-scripts" frameborder="0"></iframe>

  • Related