css 动画效果图

一,心跳

前言;本篇文章为收藏的动画效果以及实现代码
在这里插入图片描述

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>04心跳</title>
		<style>
			img{
				width: 400px;
				height: auto;
				/* animation:动画名称 花费时间 运动曲线 何时开始 播放次数 是否反方向 */
				animation: heart 0.5s infinite;
			}
			
			div{
				width: 100px;
				height: 100px;
				background-color: pink;
				margin: 100px auto;
				animation: heart 0.5s infinite;//一个叫heart的动画 每隔0.5s执行动画 无限次
			}
			@keyframes heart{
				0%{
					transform: scale(1);
				}
				50%{
					transform: scale(1.1);
				}
				100%{
					transform: scale(1);
				} 
			}
		</style>
	</head>
	<body>
		<img src="../images/1.jpg" height="744" width="800" alt="loading" />
		<div></div>
	</body>
</html>

二,sea大海

在这里插入图片描述

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
	* {
		margin: 0;
		padding: 0;
	}
	html, body {
		width: 100%;
		height: 100%;
		background-color: #0EA9B1;
		overflow: hidden;
	}

	img {
		width: 100%;
		height: auto;
		position: absolute;
		bottom: 0;
		left: 0;
	}

	img:first-child {
		animation: move 2s linear infinite;
	}
	img:last-child {
		animation: move 2s linear 0.3s infinite;
	}


	.sun {
		width: 100px;
		height: 100px;
		/*background-color: pink;*/
		margin: 100px;
		position: relative;
	}
	.sun::before, .sun::after {
		content: "";
		position: absolute;
		top: 50%;
		left: 50%;
		width: 50px;
		height: 50px;
		transform: translate(-50%, -50%);
		background: rgba(255, 255, 255, 0.8);
		border-radius: 50%;
		animation: sun 2s infinite;
	}
	.sun::after {
		width: 80px;
		height: 80px;
		background: rgba(255, 255, 255, 0.6);
		animation: sun 3s infinite;
	}

    @keyframes move {
		0% {
			bottom: 0;
		}

		50% {
			bottom: -50px;
		}

		100% {
			bottom: 0;
		}
	}

	@keyframes sun {
		0% {
			transform:translate(-50%, -50%) scale(1);
			box-shadow: 0px 0px 5px rgba(255,255,255,0.7);
		}

		50% {
			transform:translate(-50%, -50%) scale(1.1);
			box-shadow: 0px 0px 30px rgba(255,255,255,0.7);
		}

		100% {
			transform:translate(-50%, -50%) scale(1);
			box-shadow: 0px 0px 5px rgba(255,255,255,0.7);
		}
	}
	</style>
</head>
<body>
	<div class="sun"></div>
	<img src="../images/1.png" height="211" width="2000" alt="loading">
	<img src="../images/2.png" height="211" width="2000" alt="loading">
</body>
</html>

三,泡泡

在这里插入图片描述

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>15泡泡</title>
		<style>
			div{
				width: 300px;
				height: 80px;
				border-radius: 20px;
				
				background:url(../images/paopao.png) no-repeat top left,url(../images/paopao.png) no-repeat right bottom;
				background-color: blue;
				transition: all 3s; 
			}
			div:hover{
				background-position: right bottom,top left; 
			}
		</style>
	</head>
	<body>
		<div></div>
	</body>
</html>

四,电池充电动画

在这里插入图片描述

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="style.css">
    <title>Document</title>
</head>
	<style>
		
	html, body {
  		margin: 0;
  		height: 100%;
	}

	body {
  		display: flex;
  		justify-content: center;
  		align-items: center;
  		background: #ed556a;
	}

section {
  width: 650px;
  height: 300px;
  padding: 10px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

span {
  width: 48px;
  height: 96px;
  display: inline-block;
  position: relative;
  color: white;
  border: 3px solid;
  animation: loading 2s linear infinite alternate;
}

span::before {
  content: '';
  position: absolute;
  top: -15px;
  left: 6px;
  width: 36px;
  height: 12px;
  background-color: white;
}

@keyframes loading {
  0% {
    box-shadow: 0 0 inset
  }
  100% {
    box-shadow: 0 -96px inset
  }
}	
	</style>
<body>
    <section><span></span></section>
</body>
</html>

五,炫酷水波浪Loading过渡动画

在这里插入图片描述

HTML

<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="style.css">
        <title>Document</title>
    </head>

    <body>
        <section>
            <div class="circle">
                <div class="wave"></div>
            </div>
        </section>
    </body>

</html>

CSS

/* 
模版css样式
仅供演示使用 
*/

html, body {
	margin: 0;
	height: 100%;
} 

body {
	display: flex;
	justify-content: center;
	align-items: center;
	background-color: #12383e;
}

section {
	width: 650px;
	height: 300px;
	padding: 10px;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 20px;
	border: 18px solid white;
	overflow: hidden;
}

section::before {
	content: 'CSS';
	width: 150px;
	height: 150px;
	text-align: center;
	line-height: 250px;
	background-color: #00cec9;
	position: absolute;
	top: -76px;
	right: -76px;
	transform: translate(50%, -50%);
	font-size: 32px;
	font-weight: 500;
	font-family: sans-serif;
	color: white;
	transform: rotate(45deg);
}

section::after {
	content: '';
	position: absolute;
	width: 100%;
	height: 100%;
	border: 10px solid white;
	border-radius: 20px;
}

/* 实现代码 */

.circle {
	position: relative;
	width: 200px;
	height: 200px;
	background: #b0f4ff;
	border-radius: 50%;
	overflow: hidden;
	animation: loadingBreath 5s infinite linear;
}

.circle::before {
	content: 'Loading...';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 18px;
	letter-spacing: 2px;
	color: #10a789;
	font-family: sans-serif;
	z-index: 2;
}

.circle::after {
	content: '';
	position: absolute;
	width: 100%;
	height: 25%;
	bottom: 0;
	background-image: linear-gradient(to top, #12c8e0, #36e9ff, #5ffbf1);
	animation: loadingRun 5s linear infinite;
}

.wave::before {
	content: '';
	position: absolute;
	left: -50%;
	width: 200%;
	height: 200%;
	z-index: 1;
	background-color: #85f7fb;
	border-radius: 52% 25% 62% 69%/25% 38%;
	animation: loadingWave 5s linear infinite;
}

.wave::after {
	content: '';
	position: absolute;
	left: -50%;
	width: 200%;
	height: 200%;
	z-index: 1;
	background-color: #d0f4ff;
	border-radius: 42% 38% 40% 62%/28% 35%;
	animation: loadingWave 5s ease-in-out infinite;
}

/* 呼吸灯动画 */

@keyframes loadingBreath {
	0% {
		box-shadow: 0 0 5px 0 #85f7fb;
	}
	25% {
		box-shadow: 0 0 20px 0 #85f7fb;
	}
	50% {
		box-shadow: 0 0 5px 0 #85f7fb;
	}
	75% {
		box-shadow: 0 0 20px 0 #85f7fb;
	}
	100% {
		box-shadow: 0 0 5px 0 #85f7fb;
	}
}

/* 底部液体上升动画 */

@keyframes loadingRun {
	0% {
		height: 25%;
	}
	100% {
		height: 100%;
	}
}

/* wave动画 */

@keyframes loadingWave {
	0% {
		top: -100%;
		transform: rotate(0);
	}
	100% {
		top: -200%;
		transform: rotate(360deg);
	}
}

六,卡通齿轮效果

<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="style.css">
        <title>Document</title>
    </head>
    <body>
        <section>
            <div class="gear">
                <div></div>
                <div></div>
                <div></div>
                <div></div>
            </div>
            <div class="hole"></div>
        </section>
    </body>
</html>
html, body {
	margin: 0;
	height: 100%;
}

body {
	display: flex;
	justify-content: center;
	align-items: center;
	background: gainsboro;
	/* background: #222f3e; */
}

section {
	width: 650px;
	height: 300px;
	padding: 10px;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid orange;
}

.gear {
	width: 120px;
	height: 120px;
	border-radius: 50%;
	background-color: #f98db9;
	display: flex;
	justify-content: center;
	align-items: center;
	animation: rotate 12s infinite linear;
}

.gear div {
	position: absolute;
	width: 30px;
	height: 150px;
	background: #f98db9;
	border-radius: 8px;
}

.gear div:nth-child(1) {
	transform: rotate(0deg);
}

.gear div:nth-child(2) {
	transform: rotate(45deg);
}

.gear div:nth-child(3) {
	transform: rotate(90deg);
}

.gear div:nth-child(4) {
	transform: rotate(135deg);
}

.hole {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 50px;
	height: 50px;
	background-color: white;
	border-radius: 50%;
}

@keyframes rotate {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

七,翻转

1.rotateX

在这里插入图片描述

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>17rotateX</title>
		<style>
			img{
				transition: all 2s;
			}
			img:hover{
				transform: rotateX(360deg);
			}
		</style>
	</head>
	<body>
		<img src="../images/x.jpg" height="226" width="300" alt="loading" />
	</body>
</html>

2.rotateY

在这里插入图片描述

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>18rotateY</title>
		<style>
			body{
				perspective: 500px;
			}
			img{
				transition: all 2s;
			}
			img:hover{
				transform: rotateY(360deg);
			}
		</style>
	</head>
	<body>
		<img src="../images/1498446043198.png" alt="loading" />
	</body>
</html>

3.两面翻转的盒子

在这里插入图片描述

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>18rotateY</title>
		<style>
			body{
				perspective: 500px;
			}
			img{
				transition: all 2s;
			}
			img:hover{
				transform: rotateY(360deg);
			}
		</style>
	</head>
	<body>
		<img src="../images/1498446043198.png" alt="loading" />
	</body>
</html>

参考:https://haihong.blog.csdn.net/category_9815600.html
https://blog.csdn.net/dayexiaofan/article/details/90646354

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

王小王和他的小伙伴

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值