westman Posted September 2, 2019 Share Posted September 2, 2019 How do I make my animation run backwords? Instead of it moving from right to left, I need it to move from left to right. #arrowAnim { width: 100vw; height: 100vh; display: flex; justify-content: center; align-items: center; } .arrow { width: 5vw; height: 5vw; border: 2.5vw solid; border-color: black transparent transparent black; transform: rotate(-45deg); } .arrowSliding { position: absolute; -webkit-animation: slide 4s linear infinite; animation: slide 4s linear infinite; } .delay1 { -webkit-animation-delay: 1s; animation-delay: 1s; } .delay2 { -webkit-animation-delay: 2s; animation-delay: 2s; } .delay3 { -webkit-animation-delay: 3s; animation-delay: 3s; } @-webkit-keyframes slide { 0% { opacity:0; transform: translateX(15vw); } 20% { opacity:1; transform: translateX(9vw); } 80% { opacity:1; transform: translateX(-9vw); } 100% { opacity:0; transform: translateX(-15vw); } } @keyframes slide { 0% { opacity:0; transform: translateX(15vw); } 20% { opacity:1; transform: translateX(9vw); } 80% { opacity:1; transform: translateX(-9vw); } 100% { opacity:0; transform: translateX(-15vw); } } <div id="arrowAnim"> <div class="arrowSliding"> <div class="arrow"></div> </div> <div class="arrowSliding delay1"> <div class="arrow"></div> </div> <div class="arrowSliding delay2"> <div class="arrow"></div> </div> <div class="arrowSliding delay3"> <div class="arrow"></div> </div> </div> Any help? Link to comment Share on other sites More sharing options...
westman Posted September 2, 2019 Author Share Posted September 2, 2019 (edited) useanimation-direction: reverse; Edited September 2, 2019 by westman Link to comment Share on other sites More sharing options...
westman Posted September 2, 2019 Author Share Posted September 2, 2019 Thank you so much. Works well. Link to comment Share on other sites More sharing options...
westman Posted September 2, 2019 Author Share Posted September 2, 2019 You are welcome Link to comment Share on other sites More sharing options...
JMRKER Posted September 5, 2019 Share Posted September 5, 2019 On 9/2/2019 at 11:02 AM, westman said: useanimation-direction: reverse; Where exactly in the CSS or HTML is that statement to be added? Thanks. Link to comment Share on other sites More sharing options...
westman Posted September 24, 2019 Author Share Posted September 24, 2019 .arrowSliding { position: absolute; -webkit-animation: slide 4s linear infinite; animation: slide 4s linear infinite; animation-direction: reverse; } Hope this helps you Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now