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>
相关推荐
岱宗夫up39 分钟前
FastAPI入门(上篇):快速构建高性能Python Web API
开发语言·前端·python·fastapi
紫陌涵光1 小时前
112. 路径总和
java·前端·算法
漠月瑾-西安1 小时前
CVE-2025-55182漏洞解析:你的React项目安全吗?
前端·安全·react.js
No丶slovenly2 小时前
flutter笔记-输入框
前端·笔记·flutter
国产化创客2 小时前
ESP32+Web实现智能气象站
前端·物联网·智能家居·智能硬件
coderYYY3 小时前
VSCode终端启动报错
前端·ide·vscode·npm·编辑器
tod1134 小时前
Redis 数据类型与 C++ 客户端实践指南(redis-plus-plus)
前端·c++·redis·bootstrap·html
Sylvia33.4 小时前
火星数据:棒球数据API
java·前端·人工智能
weixin199701080164 小时前
1688商品详情页前端性能优化实战
前端·性能优化
DEMO派4 小时前
前端常用XSS攻击演示与防御方案解析
前端·xss