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>
相关推荐
276695829215 小时前
携程旅行 token1005
java·linux·前端·javascript·携程旅行·token1005·携程酒店
freewlt15 小时前
Cursor与AI编程工具崛起:前端工程师的能力模型重构与职业生存策略
前端·重构·ai编程
墨雪遗痕16 小时前
工程架构认知(三):从传统Web系统到AI大模型驱动系统
前端·人工智能·架构
C澒16 小时前
AI 生码 - PRD2CODE:Schema2PRD 全流程设计与实现
前端·ai编程
掘金者阿豪16 小时前
微信图片已过期或已被清理,真的找不回了吗?完整自救指南
前端·后端
颜酱16 小时前
从 DeepSeek 文本对话到流式输出
前端·javascript·人工智能
Ulyanov16 小时前
打造现代化雷达电子对抗仿真界面 第二篇:雷达电子对抗仿真系统核心功能实现
前端·python·信息可视化·数据可视化·系统仿真·雷达电子战
快乐小土豆~~16 小时前
上传视频时截取正脸照片
前端·音视频·vladmandic
276695829216 小时前
token1005 算法分析
java·前端·javascript·token·token1005·携程酒店·token算法分析
乆夨(jiuze)16 小时前
记录一个css,实现下划线内容显示,支持文本多行显示
前端·css