类似antdesign悬浮按钮上浮小动画【已验证,正常运行】

在这里插入图片描述
以下是基于vue2的完整代码,习惯用vue写了,如果是其他框架复制div和css就行
部分代码来自我搭建的GPT4o/Claude

<template>
  <div class="progress-container">
    <div class="circlenav-container">
      <div class="circle-nav-list" :class="{'fade-in':showCircleNav,'show-circle':showCircleNav}">
        <div class="circle circle1"></div>
        <div class="circle circle2"></div>
        <div class="circle circle3"></div>
        <div class="circle circle4"></div>
      </div>
      <div class="home-circle" @click="showClick">
        <div>
          <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor"><title>Theme icon</title><g fill-rule="evenodd"><g fill-rule="nonzero"><path d="M7.02 3.635l12.518 12.518a1.863 1.863 0 010 2.635l-1.317 1.318a1.863 1.863 0 01-2.635 0L3.068 7.588A2.795 2.795 0 117.02 3.635zm2.09 14.428a.932.932 0 110 1.864.932.932 0 010-1.864zm-.043-9.747L7.75 9.635l9.154 9.153 1.318-1.317-9.154-9.155zM3.52 12.473c.514 0 .931.417.931.931v.932h.932a.932.932 0 110 1.864h-.932v.931a.932.932 0 01-1.863 0l-.001-.931h-.93a.932.932 0 010-1.864h.93v-.932c0-.514.418-.931.933-.931zm15.374-3.727a1.398 1.398 0 110 2.795 1.398 1.398 0 010-2.795zM4.385 4.953a.932.932 0 000 1.317l2.046 2.047L7.75 7 5.703 4.953a.932.932 0 00-1.318 0zM14.701.36a.932.932 0 01.931.932v.931h.932a.932.932 0 010 1.864h-.933l.001.932a.932.932 0 11-1.863 0l-.001-.932h-.93a.932.932 0 110-1.864h.93v-.931a.932.932 0 01.933-.932z"></path></g></g></svg>
        </div>
        
      </div>
    </div>

  </div>
</template>

<script>
export default {
  name: 'ProgressChart',
  data() {
    return {
      showCircleNav:false
    }
  },
  methods: {
    showClick() {
      this.showCircleNav = !this.showCircleNav
    }
  },
}
</script>

<style scoped>
.progress-container {
  width: 800px;
  height: 800px;
  position: relative;
}
.circlenav-container {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.home-circle {
  width: 50px;
  height: 50px;
  /* background: #000; */
  border: 1px solid #000;
  border-radius: 50%;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.circle-nav-list {
  opacity: 0;
}
.circle {
  width: 50px;
  height: 50px;
  border: 1px solid #000;
  border-radius: 50%;
  /* box-shadow: ; */
}
.show-circle {
  opacity: 1;
}
.fade-in {
  animation: fadeIn .3s ease-in-out;
}
@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(50px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}
</style>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

吉吉安

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值