屏幕中的流星效果具体代码:!--在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-01
- Javascript Bootstrap的网格系统,导航栏和轮播详解 2023-08-11
- JS滚动到顶部踩坑解决记录 2023-07-10
- Ajax发送和接收请求 2022-12-15
- Ajax+smarty技术实现无刷新分页 2022-12-15
- uniapp开发微信小程序自定义顶部导航栏功能实例 2022-10-21
- HTML clearfix清除浮动讲解 2022-11-20
- 关于Ajax跨域问题及解决方案详析 2023-02-23
- 使用ajax跨域调用springboot框架的api传输文件 2023-02-23
- cocos creator游戏实现loading加载页面,游戏启动加载动画 2022-10-29