Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize the effect of Racing Lantern by vue+animation

Shulou Source: shulou.com Published: 2022-06-01 00:42:27 10月02日 Update

This article mainly explains "how to achieve the racing lantern effect in vue+animation". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to achieve the racing lantern effect in vue+animation".

1. Display in a single line, with only one line per line

Effect picture

Upper code

{{item.name}} {{item.name}} export default {name: "activity", data () {return {lists: [{name: "Ma Yun Asa"}, {name: "Lei Jun"}, {name: "Wang Qin ah"} {name: "waiting for Lunlun"}]} },}; .box {width: 100%; height: 0.6remt; background-color: # b32855; overflow: hidden;}. Box ul {animation-name: move; / * the time spent dynamically setting each li in style is 2s * / / * animation-duration: 8s; * / animation-timing-function: linear; animation-iteration-count: infinite;} ul li {float: left; height: 0.6; display: flex; align-items: center } ul li .content {height: 0.4rem.padding: 00.2rem.border-radius: 0.2rem.background-color: rgba (0,0,0,0.2); color: # fff; display: flex; align-items: center; justify-content: space-around;} @ keyframes move {0 {transform: translateX (0) } 100% {/ * translate 50% of its own width 50% of the width of ul, and the remaining 50% will be used to occupy the space on the next display * / transform: translateX (- 50%);}}

2. Display in a single line, with multiple entries in each line

Effect picture

Upper code

{{item.name}} {{item.name}} Thank you for your reading. The above is the content of "how to achieve the racing lantern effect in vue+animation". After the study of this article, I believe you have a deeper understanding of how to achieve the racing lantern effect in vue+animation, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Effect racing lantern learning previous generation content width effect diagram dynamic multiple that is ideas situations articles time more knowledge knowledge points articles follow questions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Shulou Tech Info Shulou Information Xiaomi Docker