css实现6种贝塞尔曲线运行动画效果代码

代码语言:html

所属分类:动画

代码描述:css实现6种贝塞尔曲线运行动画效果代码

代码标签: css 贝塞尔 曲线 运行 动画

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

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

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


  
  
<style>
@import url("https://fonts.googleapis.com/css2?family=Genos:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");

:root {
  --height: 15rem;
  --duration: 20s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Genos", sans-serif;
}

#app {
  min-height: 100vh;
  background: linear-gradient(135deg, hsl(0, 0%, 30%), hsl(0, 0%, 20%));
}

.container {
  min-height: 100vh;
  width: 100%;
  z-index: 1;
  display: flex;
  align-content: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: calc(var(--height)/10);
  padding: 0 calc(var(--height)/2);
}

.title {
  width: 100%;
  display: flex;
  justify-content: center;
  flex-direction: column;
}

h1 {
  color: #fff;
  font-size: calc(var(--height)/5);
  text-align: center;
}

p {
  color: #fff;
  font-size: calc(var(--height)/10);
  text-align: center;
  line-height: 1.4;
}

.name p {
  font-size: calc(var(--height)/14);
}

.name {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.inside {
  position: absolute;
  z-index: 10;
}

.circle {
  height: var(--height);
  aspect-ratio: 1;
  border-radius: 50%;
  position: relative;
  border: calc(var(--height)/10) solid;
}

.point {
  position: absolute;
  height: calc(var(--height)/10);
  aspect-ratio: 1;
  border-radius: 50%;
  top: calc(100% + var(--height)/10);
  left: calc(50% - var(--height)/20);
  transform: translateY(calc(var(--height)/-10));
}

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

@keyframes color {
    0% { background: hsl(0, 100%, 50%) }
   10% { background: hsl(36, 100%, 50%) }
   20% { background: hsl(72, 100%, 50%) }
   30% { background: hsl(108, 100%, 50%) }
   40% { background: hsl(144, 100%, 50%) }
   50% { background: hsl(180, 100%, 50%) }
   60% { background: hsl(216, 100%, 50%) }
   70% { background: hsl(252, 100%, 50%) }
   80% { background: hsl(288, 100%, 50%) }
   90% { background: hsl(324, 100%, 50%) }
  100% { background: hsl(0, 100%, 50%); }
}

#linear {
    animation: rotate var(--duration) linear infinite reverse;
}

#ease {
    animation: rotate var(--duration) ease infinite reverse;
}

#ease-in {
    animation: rotate var(--duration) ease-in infinite reverse;
}

#ease-out {
    animation: rotate var(--duration) ease-out infinite reverse;
}

#ease-in-out {
    animation: rotate var(--duration) ease-in-out infinite reverse;
}

#custom {
    animation: rotate var(--duration) cubic-bezier(0.2, 0.8, 0.2, 0.8) infinite reverse;
}

#point-linear {
    animation: color var(--duration) linear infinite reverse;
}

#point-ease {
    animation: color var(--duration) ease infinite reverse;
}

#point-ease-in {
    animation: color var(--duration) ease-in infinite reverse;
}

#point-ease-out {
    animation: color var(--duration) ease-out infinite reverse;
}

#point-ease-in-out {
    animation: color var(--duration) ease-in-out infinite reverse;
}
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0