屏幕中的流星效果具体代码:!--在template添加--!--流星--div class=liuxing liuxing1 liuxingFla/divdiv class=liuxing liuxing2 liuxingFla2/divdiv class=liuxing liuxing3 liuxingFla3...
屏幕中的流星效果
具体代码:
<!--在<template>添加-->
<!--流星-->
<div class="liuxing liuxing1 liuxingFla"></div>
<div class="liuxing liuxing2 liuxingFla2"></div>
<div class="liuxing liuxing3 liuxingFla3"></div>
<div class="liuxing liuxing4 liuxingFla4"></div>
/*在<style>中添加*/
/*流星*/
.liuxing{
width: 85px;
height: 85px;
position: absolute;
background: url(../../assets/line.png) no-repeat;
background-size: contain;
}
.liuxing1 {
top: 200px;
left: 200px;
}
.liuxing2 {
top: 200px;
left: 50%;
margin-left: 200px;
}
.liuxing3 {
top: 100px;
right: 300px;
}
.liuxing4 {
top: 150px;
right: 300px;
}
.liuxingFla {
animation: liuxing 5s ease-in infinite;
}
.liuxingFla2 {
animation: liuxing2 4s ease-in infinite;
}
.liuxingFla3 {
animation: liuxing3 3s linear infinite;
}
.liuxingFla4 {
animation: liuxing4 2s linear infinite;
}
/* 流星动画 */
@keyframes liuxing {
0% {
transform: translate(200px, -200px)
}
90% {
transform: translate(-180px, 180px);
opacity: 1;
}
100% {
transform: translate(-200px, 200px);
opacity: 0;
}
}
@keyframes liuxing2 {
0% {
transform: translate(200px, -200px)
}
90% {
transform: translate(-480px, 480px);
opacity: 1;
}
100% {
transform: translate(-500px, 500px);
opacity: 0;
}
}
@keyframes liuxing3 {
0% {
transform: translate(200px, -200px)
}
90% {
transform: translate(-480px, 480px);
opacity: 1;
}
100% {
transform: translate(-500px, 500px);
opacity: 0;
}
}
@keyframes liuxing4 {
0% {
transform: translate(200px, -200px)
}
90% {
transform: translate(-180px, 180px);
opacity: 1;
}
100% {
transform: translate(-200px, 200px);
opacity: 0;
}
}
图片素材:
沃梦达教程
本文标题为:用CSS来实现一些动画在vue中使用之流星滑过(3)
猜你喜欢
- ajax实现输入提示效果 2023-02-14
- vue keep-alive 2023-10-08
- jsPlumb+vue创建字段映射关系 2023-10-08
- 关于 html:如何从 css 表中删除边距和填充 2022-09-21
- 1 Vue - 简介 2023-10-08
- 基于CORS实现WebApi Ajax 跨域请求解决方法 2023-02-14
- layui数据表格以及传数据方式 2022-12-13
- javascript 判断当前浏览器版本并判断ie版本 2023-08-08
- 深入浅析AjaxFileUpload实现单个文件的 Ajax 文件上传库 2022-12-15
- JS实现左侧菜单工具栏 2022-08-31