div+css实现卡通月亮数字跳动提醒消息动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现卡通月亮数字跳动提醒消息动画效果代码

代码标签: div css 卡通 月亮 数字 跳动 提醒 消息 动画

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

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

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

  
  
<style>
body {
	margin: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 100vh;
	background-color: #2a2a2a;
	background-repeat: repeat;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
		"Liberation Mono", "Courier New", monospace;
}

.notificationBox {
	position: relative;
	border: 0;
	background: transparent;
	padding: 25px;
	z-index: 2;
	animation: shake-animation 4.72s ease infinite;
}

.notificationBox svg {
	width: 100px;
	height: 100px;
	animation: push 1.2s infinite alternate-reverse;
	animation-fill-mode: forwards;
	animation-timing-function: all 0.4s ease-in-out;
	transform-origin: center;
	animation-direction: reverse;
	filter: drop-shadow(0px 0px 50px #ecc048);
}
.eyes {
	display: flex;
	gap: 5px;
	position: absolute;
	z-index: 3;
	top: 43px;
	left: 40px;
	animation: eyes 1.2s infinite alternate-reverse;
	animation-fill-mode: forwards;
	animation-timing-function: all 0.4s ease-in-out;
	transform-origin: left center;
	animation-direction: reverse;
}
.eyes span {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	position: relative;
}
.eyes span:after {
	content: "";
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: block;
	background: #000;
	margin: auto;
	position: absolute;
	inset: 0;
}

@keyframes push {
	0,
	100% {
		transform: rotate(0);
	}
	50% {
		transform: rotate(30deg);
	}
}

@keyframes eyes {
	0,
	100% {
		transform: rotate(0);
	}
	50% {
		transform: rotate(30deg);
	}
}
@keyframes shake-animation {
	0% {
		transform: translate(0, 0);
	}
	1.78571% {
		transform: translate(5px, 0);
	}
	3.57143% {
		transform: translate(0, 0);
	}
	5.35714% {
		transform: translate(5px, 0);
	}
	7.14286% {
		transform: translate(0, 0);
	}
	8.92857% {
		transform: translate(5px, 0);
	}
	10.71429% {
		transform: translate(0, 0);
	}
	100% {
		transform: translate(0, 0);
	}
}

.notificationCount {
	width: 30px;
	height: 30px;
	background: #fb5607;
	color: #fff;
	border-radius: 50%;
	text-align: center;
	line-height: 30px;
	font-family: inherit;
	position: absolute;
	right: 30px;
	bottom: 110px;
	animation: leap 1.2s infinite alternate-reverse;
	animation-fill-mode: forwards;
	animation-timing-function: all 0.4s ease-in-out;
	transform-origin: center;
	animation-direction: reverse;
	transform: scale(1.4, 1.4);
	box-s.........完整代码请登录后点击上方下载按钮下载查看

网友评论0