div+css实现跳出水面又落入水中涟漪动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现跳出水面又落入水中涟漪动画效果代码

代码标签: div css 跳出 水面 落入 水中 涟漪 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

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

<head>
  <meta charset="UTF-8">
  


  
  
  
<style>
:root {
	--loader: #111;
	--blue: #2196f3;
	--spd: 1.725s;
}

* { 
	transform-style: preserve-3d;
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 0;
	width: 100vw;
	height: 100vh;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	perspective: 100vmin;
	background: var(--blue);
}

.content {
	width: 70vmin;
	height: 50vmin;
	display: flex;
	align-items: center;
	justify-content: center;
}

.surface {
	width: 70vmin;
	height: 70vmin;
	transform: rotateX(60deg);
}

.surface:before,
.surface:after {
	content: "";
	background: 
		linear-gradient(180deg, #fff0 1.35vmin, var(--blue) 0 1.7vmin, #fff0 0 0vmin),
		radial-gradient(circle at 50% 95%, #fff0 1vmin, var(--blue) calc(1vmin + 1px) 1.5vmin, #fff0 0 100%), 
		radial-gradient(circle at 50% 5%, #fff0 1vmin, var(--blue) calc(1vmin + 1px) 1.5vmin, #fff0 0 100%);
	width: 2.15vmin;
	height: 3vmin;
	position: absolute;
	left: 14.95vmin;
	top: 34vmin;
	transform: rotateX(90deg);
	border-radius: 5px;
	animation: hide var(--spd) 0s infinite;
	opacity: 0;
}

.surface:after {
	left: 52.8vmin;
	animation-delay: calc(var(--spd) / 2);
}

@keyframes hide {
	0%, 10% { opacity: 1; }	
	15%, 100% { opacity: 0; }
}

.loaders { 
	position: absolute;
	width: 40vmin;
	height: 40vmin;
	clip-path: polygon(0 0, 100% 0, 100% 50%, 0 50%);
}

.loader { 
	position: absolute;
	width: 40vmin;
	height: 40vmin;
	background: 
		radial-gradient(circle at 20vmin 50%, #fff0 18.1vmin, var(--loader) calc(18.1vmin + 1px) 100%),
		radial-gradient(circle at 50% 50%, var(--loader) 0.9vmin, #fff0 calc(0.9vmin + 1px) 100%),
		radial-gradient(circle at 50% 50%, var(--loader) 0.9vmin, #fff0 calc(0.9vmin + 1px) 100%);
	background-size: 6vmin 6vmin, 2vmin 2vmin, 2vmin 2vmin;
	background-pos.........完整代码请登录后点击上方下载按钮下载查看

网友评论0