当前位置:首页 > 技术博客 > CSS > CSS原子环绕标志动画

CSS原子环绕标志动画

5年前 (2021-10-01)CSS1033

CSS原子环绕标志动画

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>CSS原子环绕标志动画-刘执喜的点滴记忆</title>
	<style>
		body {
  background: #333;
  display: flex;
  height: 100vh;
  justify-content: center;
  align-items: center;
  perspective: 1200px;
}

.box {
  position: relative;
  transform-style: preserve-3d;
  animation: hovering 1s infinite alternate-reverse ease-in-out;
}

.logo {
  display: block;
  margin-top: 50px;
  margin-left: 50px;
  width: 300px;
  height: 300px;
  position: relative;
}
.logo:after {
  position: absolute;
  top: 0;
  left: 0;
  content: "";
  background: url("https://www.liuzhixi.cn/logo2.svg") no-repeat 50% 50%;
  background-size: contain;
  width: 300px;
  height: 300px;
  margin-left: -25px;
  transform: scale(0.9);
  transition: 1000ms ease-out;
}
.logo:hover:after {
  transform: scale(1);
}

.ring {
  pointer-events: none;
  width: 400px;
  height: 400px;
  position: absolute;
  top: 0;
  left: 0;
  transform-style: preserve-3d;
}
.ring .particle {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  border: 10px solid;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  border-top: 0;
  border-left: 0;
  border-bottom: 0;
  box-shadow: 0 0 1px 0px currentColor;
  transform-style: preserve-3d;
}
.ring .particle:after {
  position: absolute;
  top: 100%;
  left: 50%;
  display: block;
  content: "";
  width: 5px;
  height: 5px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 5px 0px white;
}

.ring1 {
  color: #00ccff;
  animation: rotateAnimate1 16s infinite reverse linear;
}
.ring1 .particle {
  -webkit-animation: rotateAnimate1 2s infinite linear;
          animation: rotateAnimate1 2s infinite linear;
}

.ring2 {
  color: #fffb19;
  animation: rotateAnimate1 16s infinite reverse linear;
}
.ring2 .particle {
  margin-top: 15px;
  margin-left: 15px;
  width: 370px;
  height: 370px;
  -webkit-animation: rotateAnimate2 2s infinite linear;
          animation: rotateAnimate2 2s infinite linear;
}
.ring2 .particle:after {
  top: 0%;
}

.ring3 {
  color: #ff0f66;
  animation: rotateAnimate1 16s infinite reverse linear;
}
.ring3 .particle {
  margin-top: 30px;
  margin-left: 30px;
  width: 340px;
  height: 340px;
  -webkit-animation: rotateAnimate3 2s infinite linear;
          animation: rotateAnimate3 2s infinite linear;
}

@-webkit-keyframes rotateAnimate1 {
  0% {
    transform: rotateX(45deg) rotateZ(0deg);
  }
  100% {
    transform: rotateX(45deg) rotateZ(360deg);
  }
}

@keyframes rotateAnimate1 {
  0% {
    transform: rotateX(45deg) rotateZ(0deg);
  }
  100% {
    transform: rotateX(45deg) rotateZ(360deg);
  }
}
@-webkit-keyframes rotateAnimate2 {
  0% {
    transform: rotateY(45deg) rotateX(-45deg) rotateZ(0deg);
  }
  100% {
    transform: rotateY(45deg) rotateX(-45deg) rotateZ(-360deg);
  }
}
@keyframes rotateAnimate2 {
  0% {
    transform: rotateY(45deg) rotateX(-45deg) rotateZ(0deg);
  }
  100% {
    transform: rotateY(45deg) rotateX(-45deg) rotateZ(-360deg);
  }
}
@-webkit-keyframes rotateAnimate3 {
  0% {
    transform: rotateY(-45deg) rotateX(-45deg) rotateZ(180deg);
  }
  100% {
    transform: rotateY(-45deg) rotateX(-45deg) rotateZ(540deg);
  }
}
@keyframes rotateAnimate3 {
  0% {
    transform: rotateY(-45deg) rotateX(-45deg) rotateZ(180deg);
  }
  100% {
    transform: rotateY(-45deg) rotateX(-45deg) rotateZ(540deg);
  }
}
@-webkit-keyframes hovering {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(0, -10px, 0);
  }
}
@keyframes hovering {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(0, -10px, 0);
  }
}
	</style>
</head>
<body>
	<div class="box"><a class="logo" href="#"></a>
		<div class="ring ring1">
		<div class="particle"></div>
	</div>
	<div class="ring ring2">
		<div class="particle"></div>
	</div>
	<div class="ring ring3">
		<div class="particle"></div>
	</div>
</div>
</body>


版权声明:本文由 LzxBlog 发布,如需转载请注明出处。

本文链接:https://www.liuzhixi.cn/html/171.html

标签: CSSCss动画

相关文章

夜晚云层动画特效

夜晚云层动画特效

基于css3 keyframes 属性制作乌云密布云层动画,夜晚云层飘过动画特效。可用于网页动态云层背景特效。这是利用animation 和png云图片制作完成...

css颜色渐变数值调试

css颜色渐变数值调试

<style> :root {   --color-background: #e8e0fd; &nbs...

让网站支持苹果的 黑暗模式(深色Dark模式)

让网站支持苹果的 黑暗模式(深色Dark模式)

prefers-color-scheme 用于检测用户的系统主题是浅色或深色,此属性有三个值no-preference 表示用户未指定操作系统模式,其...

CSS3金色阴影文字

CSS3金色阴影文字

主要使用了 CSS3 的线性渐变属性、滤镜属性、变形属性等等。由于这些都是高级属性,所以不兼容 IE 10 及以下的版本。<!DOCTYPE h...

css酷炫的文字悬停效果

css酷炫的文字悬停效果

文字悬停效果的特效在平时的网页制作中是被广泛运用的,很适合年轻时尚类的网页或者开场标题制作,整体颜色醒目亮眼,符合当下年轻人的审美。<html>&n...

CSS 3D 等距文本效果和Javascript

CSS 3D 等距文本效果和Javascript

CSS 3D 等距文本效果 | CSS 和原生 Javascript<!DOCTYPE html> <html> <...

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。