我想把退出登录的按钮做成一个悬浮球的样子,带动画的那种。Q9z免费资源网

实现是这个样子:Q9z免费资源网

手边没有球形图。随便找一个,功能这里演示的为单机悬浮球注销登录Q9z免费资源网

Q9z免费资源网

Q9z免费资源网

嗯,具体代码:Q9z免费资源网

:class="['meun-switch animated flex-row',uploadflag ? 'active rubberBand off' : 'leave jello']"

@mouseleave="uploadleave"

@mouseenter="uploadenter"

v-if="uploadShow"

@click.stop="logout"

>

dataQ9z免费资源网

uploadShow: false,

uploadflag: true,

js方法Q9z免费资源网

uploadenter() {

this.uploadflag = true;

},

uploadleave() {

this.uploadflag = false;

},

uploadanimated() {

setTimeout(() => {

this.uploadShow = true;

setTimeout(() => {

this.uploadleave();

}, 1000);

}, 1000);

},

cssQ9z免费资源网

.off{

-webkit-animation:1s seconddiv;

background: transparent;

}

@keyframes seconddiv{

0% {transform: scale(1.4,1.4);}

10% {transform: scale(1,1);}

25% {transform: scale(1.2,1.2);}

50% {transform: scale(1,1);}

70% {transform: scale(1.2,1.2);}

100% {transform: scale(1,1);}

}

.meun-switch {

position: fixed;

top: 90px;

left: 0px;

z-index: 2001;

cursor: pointer;

width: 150px;

height: 150px;

padding: 5px;

transition: all 0.25s;

&.leave {

left: -65px;

}

&.active {

left: 0;

}

&:hover {

transform: scale(1.02);

}

img {

width: 120px;

height: 120px;

}

}

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐