css让文本闪烁,使用简单的CSS实现文本出错闪烁动画效果

CSS

语言:

CSSSCSS

确定

body {

margin: 0;

}

section {

display: -webkit-box;

display: -ms-flexbox;

display: flex;

-webkit-box-align: center;

-ms-flex-align: center;

align-items: center;

-webkit-box-pack: center;

-ms-flex-pack: center;

justify-content: center;

height: 100vh;

background: -webkit-linear-gradient(296deg, black, #141414);

background: linear-gradient(154deg, black, #141414);

color: white;

}

.title {

font-size: 10vw;

-webkit-animation: cray 6s infinite steps(50);

animation: cray 6s infinite steps(50);

font-family: "Roboto";

}

@-webkit-keyframes cray {

2% {

font-weight: 600;

font-style: italic;

text-decoration: none;

text-transform: none;

}

4% {

font-weight: 400;

font-style: normal;

text-decoration: none;

text-transform: none;

}

6% {

font-weight: 300;

font-style: normal;

text-decoration: none;

text-transform: uppercase;

}

8% {

font-weight: 300;

font-style: normal;

text-decoration: none;

text-transform: lowercase;

}

10% {

font-weight: 700;

font-style: italic;

text-decoration: none;

text-transform: capitalize;

}

12% {

font-weight: 400;

font-style: italic;

text-decoration: none;

text-transform: none;

}

14% {

font-weight: 300;

font-style: normal;

text-decoration: line-through;

text-transform: none;

}

16% {

font-weight: 400;

font-style: normal;

text-decoration: none;

text-transform: none;

}

18% {

font-weight: 100;

font-style: normal;

text-decoration: none;

text-transform: none;

}

20% {

font-weight: 100;

font-style: italic;

text-decoration: none;

text-transform: none;

}

22% {

font-weight: 700;

font-style: italic;

text-decoration: none;

text-transform: none;

}

24% {

font-weight: 200;

font-style: normal;

text-decoration: underline;

text-transform: none;

}

26% {

font-weight: 400;

font-style: normal;

text-decoration: none;

text-transform: none;

}

28% {

font-weight: 700;

font-style: normal;

text-decoration: none;

text-transform: none;

}

30% {

font-weight: 200;

font-style: normal;

text-decoration: line-through;

text-transform: capitalize;

}

32% {

font-weight: 600;

font-style: italic;

text-decoration: none;

text-transform: none;

}

34% {

font-weight: 600;

font-style: normal;

text-decoration: none;

text-transform: none;

}

36% {

font-weight: 400;

font-style: normal;

text-decoration: none;

text-transform: uppercase;

}

38% {

font-weight: 700;

font-style: normal;

text-decoration: none;

text-transform: capitalize;

}

40% {

font-weight: 100;

font-style: italic;

text-decoration: none;

text-transform: uppercase;

}

42% {

font-weight: 500;

font-style: normal;

text-decoration: none;

text-transform: capitalize;

}

44% {

font-weight: 600;

font-style: normal;

text-decoration: none;

text-transform: none;

}

46% {

font-weight: 400;

font-style: normal;

text-decoration: none;

text-transform: none;

}

48% {

font-weight: 500;

font-style: normal;

text-decoration: underline;

text-transform: none;

}

50% {

font-weight: 500;

font-style: italic;

text-decoration: underline;

text-transform: capitalize;

}

52% {

font-weight: 700;

font-style: italic;

text-decoration: none;

text-transform: none;

}

54% {

font-weight: 700;

font-style: italic;

text-decoration: none;

text-transform: none;

}

56% {

font-weight: 700;

font-style: normal;

text-decoration: underline;

text-transform: none;

}

58% {

font-weight: 400;

font-style: normal;

text-decoration: none;

text-transform: lowercase;

}

60% {

font-weight: 500;

font-style: italic;

text-decoration: none;

text-transform: none;

}

62% {

font-weight: 100;

font-style: normal;

text-decoration: none;

text-transform: none;

}

64% {

font-weight: 300;

font-style: normal;

text-decoration: none;

text-transform: none;

}

66% {

font-weight: 700;

font-style: normal;

text-decoration: none;

text-transform: none;

}

68% {

font-weight: 100;

font-style: italic;

text-decoration: none;

text-transform: none;

}

70% {

font-weight: 600;

font-style: normal;

text-decoration: none;

text-transform: capitalize;

}

72% {

font-weight: 300;

font-style: normal;

text-decoration: none;

text-transform: none;

}

74% {

font-weight: 200;

font-style: normal;

text-decoration: none;

text-transform: none;

}

76% {

font-weight: 700;

font-style: normal;

text-decoration: none;

text-transform: none;

}

78% {

font-weight: 100;

font-style: normal;

text-decoration: none;

text-transform: uppercase;

}

80% {

font-weight: 700;

font-style: normal;

text-decoration: line-through;

text-transform: none;

}

82% {

font-weight: 400;

font-style: italic;

text-decoration: none;

text-transform: lowercase;

}

84% {

font-weight: 600;

font-style: normal;

text-decoration: none;

text-transform: none;

}

86% {

font-weight: 300;

font-style: normal;

text-decoration: none;

text-transform: none;

}

88% {

font-weight: 100;

font-style: normal;

text-decoration: none;

text-transform: none;

}

90% {

font-weight: 600;

font-style: normal;

text-decoration: none;

text-transform: none;

}

92% {

font-weight: 500;

font-style: normal;

text-decoration: underline;

text-transform: lowercase;

}

94% {

font-weight: 700;

font-style: italic;

text-decoration: line-through;

text-transform: none;

}

96% {

font-weight: 500;

font-style: normal;

text-decoration: none;

text-transform: lowercase;

}

98% {

font-weight: 600;

font-style: normal;

text-decoration: none;

text-transform: none;

}

}

@keyframes cray {

2% {

font-weight: 600;

font-style: italic;

text-decoration: none;

text-transform: none;

}

4% {

font-weight: 400;

font-style: normal;

text-decoration: none;

text-transform: none;

}

6% {

font-weight: 300;

font-style: normal;

text-decoration: none;

text-transform: uppercase;

}

8% {

font-weight: 300;

font-style: normal;

text-decoration: none;

text-transform: lowercase;

}

10% {

font-weight: 700;

font-style: italic;

text-decoration: none;

text-transform: capitalize;

}

12% {

font-weight: 400;

font-style: italic;

text-decoration: none;

text-transform: none;

}

14% {

font-weight: 300;

font-style: normal;

text-decoration: line-through;

text-transform: none;

}

16% {

font-weight: 400;

font-style: normal;

text-decoration: none;

text-transform: none;

}

18% {

font-weight: 100;

font-style: normal;

text-decoration: none;

text-transform: none;

}

20% {

font-weight: 100;

font-style: italic;

text-decoration: none;

text-transform: none;

}

22% {

font-weight: 700;

font-style: italic;

text-decoration: none;

text-transform: none;

}

24% {

font-weight: 200;

font-style: normal;

text-decoration: underline;

text-transform: none;

}

26% {

font-weight: 400;

font-style: normal;

text-decoration: none;

text-transform: none;

}

28% {

font-weight: 700;

font-style: normal;

text-decoration: none;

text-transform: none;

}

30% {

font-weight: 200;

font-style: normal;

text-decoration: line-through;

text-transform: capitalize;

}

32% {

font-weight: 600;

font-style: italic;

text-decoration: none;

text-transform: none;

}

34% {

font-weight: 600;

font-style: normal;

text-decoration: none;

text-transform: none;

}

36% {

font-weight: 400;

font-style: normal;

text-decoration: none;

text-transform: uppercase;

}

38% {

font-weight: 700;

font-style: normal;

text-decoration: none;

text-transform: capitalize;

}

40% {

font-weight: 100;

font-style: italic;

text-decoration: none;

text-transform: uppercase;

}

42% {

font-weight: 500;

font-style: normal;

text-decoration: none;

text-transform: capitalize;

}

44% {

font-weight: 600;

font-style: normal;

text-decoration: none;

text-transform: none;

}

46% {

font-weight: 400;

font-style: normal;

text-decoration: none;

text-transform: none;

}

48% {

font-weight: 500;

font-style: normal;

text-decoration: underline;

text-transform: none;

}

50% {

font-weight: 500;

font-style: italic;

text-decoration: underline;

text-transform: capitalize;

}

52% {

font-weight: 700;

font-style: italic;

text-decoration: none;

text-transform: none;

}

54% {

font-weight: 700;

font-style: italic;

text-decoration: none;

text-transform: none;

}

56% {

font-weight: 700;

font-style: normal;

text-decoration: underline;

text-transform: none;

}

58% {

font-weight: 400;

font-style: normal;

text-decoration: none;

text-transform: lowercase;

}

60% {

font-weight: 500;

font-style: italic;

text-decoration: none;

text-transform: none;

}

62% {

font-weight: 100;

font-style: normal;

text-decoration: none;

text-transform: none;

}

64% {

font-weight: 300;

font-style: normal;

text-decoration: none;

text-transform: none;

}

66% {

font-weight: 700;

font-style: normal;

text-decoration: none;

text-transform: none;

}

68% {

font-weight: 100;

font-style: italic;

text-decoration: none;

text-transform: none;

}

70% {

font-weight: 600;

font-style: normal;

text-decoration: none;

text-transform: capitalize;

}

72% {

font-weight: 300;

font-style: normal;

text-decoration: none;

text-transform: none;

}

74% {

font-weight: 200;

font-style: normal;

text-decoration: none;

text-transform: none;

}

76% {

font-weight: 700;

font-style: normal;

text-decoration: none;

text-transform: none;

}

78% {

font-weight: 100;

font-style: normal;

text-decoration: none;

text-transform: uppercase;

}

80% {

font-weight: 700;

font-style: normal;

text-decoration: line-through;

text-transform: none;

}

82% {

font-weight: 400;

font-style: italic;

text-decoration: none;

text-transform: lowercase;

}

84% {

font-weight: 600;

font-style: normal;

text-decoration: none;

text-transform: none;

}

86% {

font-weight: 300;

font-style: normal;

text-decoration: none;

text-transform: none;

}

88% {

font-weight: 100;

font-style: normal;

text-decoration: none;

text-transform: none;

}

90% {

font-weight: 600;

font-style: normal;

text-decoration: none;

text-transform: none;

}

92% {

font-weight: 500;

font-style: normal;

text-decoration: underline;

text-transform: lowercase;

}

94% {

font-weight: 700;

font-style: italic;

text-decoration: line-through;

text-transform: none;

}

96% {

font-weight: 500;

font-style: normal;

text-decoration: none;

text-transform: lowercase;

}

98% {

font-weight: 600;

font-style: normal;

text-decoration: none;

text-transform: none;

}

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值