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>
相关推荐
Never_Satisfied几秒前
在JavaScript / Node.js中,Web服务器参数处理与编码指南
前端·javascript·node.js
进阶的鱼4 分钟前
React+ts+vite脚手架搭建(五)【规范篇】
前端·react.js·vite
盼哥PyAI实验室7 分钟前
序列的力量——Python 内置方法的魔法解密
java·前端·python
Rhys..12 分钟前
POM思想的理解与示例
前端·javascript·python·html·pom
前端snow14 分钟前
记录:用window.open打开的页面如何进行数据交互?
前端·javascript
Jagger_22 分钟前
读完《刻意练习》,我终于知道该怎么摆脱“CRUD”式重复了
前端·aigc
丘耳25 分钟前
@tiptap/vue-2 知识点笔记-02
前端·javascript·vue.js
ijunn26 分钟前
Tailwindcss安装及安装无效解决方案
前端
丘耳28 分钟前
@tiptap/vue-2 知识点笔记-01
前端·javascript·vue.js
写不来代码的草莓熊32 分钟前
vue前端面试题——记录一次面试当中遇到的题(8)
前端