css实现太极图

html 复制代码
<template>
  <div>
    <!-- 太极图 -->
    <div class="all">
      <div class="left box"></div>
      <div class="right box"></div>
      <div class="black">
        <div class="inner_white"></div>
      </div>
      <div class="white">
      <div class="inner_black"></div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {};
  },
  watch: {},
  created() {},
  methods: {},
};
</script>
<style lang='less' scoped>
.all{
  border:5px solid black;
  border-radius: 50%;
  width: 300px;
  height: 300px;
  margin:0 auto;
  margin-top:15%;
  overflow: hidden;
  display: flex;
  position: relative;

  animation: action 5s linear infinite;
  .box{
    width: 50%;
    height: 100%;

  }
  .left{
    background: #fff;
  }
  .right{
    background: #000;
  }
  .black{
    background: #000;
    width: 145px;
    height: 145px;
    border-radius: 50%;
    box-sizing: border-box;
    position: absolute;
    left:50%;
    margin-left: -75px;
    display: flex;
    align-items: center;
    justify-content: center;
    .inner_white{
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background: #fff;

    }
  }
  .white{
    background: #fff;
    width: 145px;
    height: 145px;
    border-radius: 50%;
    box-sizing: border-box;
    position: absolute;
    left:50%;
    bottom:0;
    margin-left: -75px;
    display: flex;
    align-items: center;
    justify-content: center;
    .inner_black{
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background: #000;

    }
  }
}

@keyframes action {
  0%{
    transform: rotate(0);
  }
  25%{
    transform: rotate(-90deg);
  }
  50%{

    transform: rotate(-180deg);
  }
  75%{
    transform: rotate(-270deg);
  }
  100%{
    transform: rotate(-360deg);
  }
}
</style>
相关推荐
我是大卫4 分钟前
React源码解析-第二部分:更新与调度
前端·react.js·源码
狸礼li8 分钟前
web网站设计作品--第二大脑
前端
2603_9552797018 分钟前
C++23新特性在CLion中的实战体验
前端·javascript·c++23
梨子同志20 分钟前
HTTP
前端
kidding72331 分钟前
旋转大转盘小程序
前端·css·微信小程序·小程序·前端框架
道友可好33 分钟前
Claude Code 泄露源码里的 89 个秘密
前端·人工智能·后端
Tian_Hang38 分钟前
Eclipse Ditto 的权限策略
java·服务器·前端·网络·ide·ubuntu·eclipse
lichenyang4531 小时前
从 0 新增一个 `has.echo`:我如何理解小程序容器里的 API 调用链路
前端
leptune2 小时前
Mac 使用 Microsoft Word 批量将 DOCX 转 PDF(保持原排版)
前端
大龄秃头程序员2 小时前
Flutter 长列表 1 万条滑动卡顿治理:Baseline vs Optimized 可跑 Demo
前端