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>
相关推荐
罔闻_spider32 分钟前
爬虫----webpack
前端·爬虫·webpack
吱吱鼠叔33 分钟前
MATLAB数据文件读写:1.格式化读写文件
前端·数据库·matlab
爱喝水的小鼠1 小时前
Vue3(一) Vite创建Vue3工程,选项式API与组合式API;setup的使用;Vue中的响应式ref,reactive
前端·javascript·vue.js
WeiShuai1 小时前
vue-cli3使用DllPlugin优化webpack打包性能
前端·javascript
Wandra1 小时前
很全但是超级易懂的border-radius讲解,让你快速回忆和上手
前端
ice___Cpu1 小时前
Linux 基本使用和 web 程序部署 ( 8000 字 Linux 入门 )
linux·运维·前端
JYbill1 小时前
nestjs使用ESM模块化
前端
加油吧x青年2 小时前
Web端开启直播技术方案分享
前端·webrtc·直播
吕彬-前端2 小时前
使用vite+react+ts+Ant Design开发后台管理项目(二)
前端·react.js·前端框架
小白小白从不日白2 小时前
react hooks--useCallback
前端·react.js·前端框架