【前端设计】动画

欢迎来到前端设计专栏,本专栏收藏了一些好看且实用的前端作品,使用简单的html、css语法打造创意有趣的作品,为网站加入更多高级创意的元素。

html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
      <link rel="stylesheet" href="./card1.css">

</head>
<body>
<div class="spinner">
  <span></span>
  <span></span>
  <span></span>
  <span></span>
  <span></span>
  <span></span>
  <span></span>
  <span></span>
</div>
</body>
</html>

 css

.spinner {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
}

.spinner span {
  position: absolute;
  top: 50%;
  left: var(--left);
  width: 35px;
  height: 7px;
  background: #ffff;
  animation: dominos 1s ease infinite;
  box-shadow: 2px 2px 3px 0px black;
}

.spinner span:nth-child(1) {
  --left: 80px;
  animation-delay: 0.125s;
}

.spinner span:nth-child(2) {
  --left: 70px;
  animation-delay: 0.3s;
}

.spinner span:nth-child(3) {
  left: 60px;
  animation-delay: 0.425s;
}

.spinner span:nth-child(4) {
  animation-delay: 0.54s;
  left: 50px;
}

.spinner span:nth-child(5) {
  animation-delay: 0.665s;
  left: 40px;
}

.spinner span:nth-child(6) {
  animation-delay: 0.79s;
  left: 30px;
}

.spinner span:nth-child(7) {
  animation-delay: 0.915s;
  left: 20px;
}

.spinner span:nth-child(8) {
  left: 10px;
}

@keyframes dominos {
  50% {
    opacity: 0.7;
  }

  75% {
    -webkit-transform: rotate(90deg);
    transform: rotate(90deg);
  }

  80% {
    opacity: 1;
  }
}
body{
  background-color: black;
  padding: 20px;
}

相关推荐

  1. 前端动画总结

    2024-01-22 07:08:03       13 阅读
  2. 前端设计模式概论

    2024-01-22 07:08:03       35 阅读
  3. 前端设计模式

    2024-01-22 07:08:03       43 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-01-22 07:08:03       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-01-22 07:08:03       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-01-22 07:08:03       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-01-22 07:08:03       20 阅读

热门阅读

  1. docker常用命令总结

    2024-01-22 07:08:03       36 阅读
  2. 几种排序算法

    2024-01-22 07:08:03       34 阅读
  3. briefly describe the classic sorting algorithm

    2024-01-22 07:08:03       30 阅读
  4. 【python学习】面向对象编程1

    2024-01-22 07:08:03       29 阅读
  5. UI -- React

    2024-01-22 07:08:03       39 阅读
  6. 实现分布式锁:Zookeeper vs Redis

    2024-01-22 07:08:03       29 阅读
  7. web架构师编辑器内容-数据结构设计上面的难点

    2024-01-22 07:08:03       37 阅读