Dot dotdot dotdotdot as loading?

前端 未结 8 2376
借酒劲吻你
借酒劲吻你 2021-01-31 07:43

I wanna create some loading dots, like this:

At 0000 miliseconds the span content is: .

At 0100 miliseconds the span content is: ..

8条回答
  •  别跟我提以往
    2021-01-31 08:23

    Or.. you can do it with CSS ;)

    Loading

    .loading:after { content: ' .'; animation: dots 1s steps(5, end) infinite; } @keyframes dots { 0%, 20% { color: rgba(0,0,0,0); text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0);} 40% { color: white; text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0);} 60% { text-shadow: .25em 0 0 white, .5em 0 0 rgba(0,0,0,0);} 80%, 100% { text-shadow: .25em 0 0 white, .5em 0 0 white;}}

    Codepen sample

提交回复
热议问题