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>
相关推荐
早睡的叶子2 分钟前
AI 编译器中的 SRAM 内存分配管理算法调研
前端·人工智能·算法
yqcoder2 分钟前
uni-app 之 uni.showModal
前端·javascript·uni-app
夜空孤狼啸6 分钟前
npm、yarn、pnpm清理缓存
前端·缓存·npm
HIT_Weston7 分钟前
56、【Ubuntu】【Gitlab】拉出内网 Web 服务:http.server 单/多线程分析(八)
前端·ubuntu·gitlab
大模型真好玩8 分钟前
轻松搞定年度报告可视化,五分钟用 AntV + Trae Solo 快速构建智能图表生成器!
前端·人工智能·trae
艾小码12 分钟前
Vue Router 进阶指南:打造丝滑的滚动控制与惊艳的路由动画
前端·javascript·vue.js
苏打水com8 小时前
第九篇:Day25-27 Vue进阶——组件复用与状态管理(对标职场“复杂项目”需求)
前端·javascript·vue.js
PineappleCoder8 小时前
别让页面 “鬼畜跳”!Google 钦点的 3 个性能指标,治好了我 80% 的用户投诉
前端·性能优化
卤代烃9 小时前
🕹️ [AI] Chrome DevTools MCP 原理分析
前端·mcp
梦里不知身是客119 小时前
flink对于迟到数据的处理
前端·javascript·flink