html网页动态泡泡的代码,气泡菜单.html

本文探讨了如何运用CSS动画为Web页面增添动态效果,通过逐个元素的交互式过渡,展示前沿的前端开发实践。从基础的transform和opacity变化到复杂路径动画,理解并掌握这些技术将提升用户体验和设计感。
摘要由CSDN通过智能技术生成
Document

body {

background-color: #33325d;

}

ul {

display: block;

margin: 50px auto 0;

width: 70px;

height: 70px;

padding: 0;

position: relative;

}

li {

display: block;

width: 70px;

height: 70px;

background-color: blue;

border-radius: 50%;

opacity: 0.6;

position: absolute;

top: 0;

left: 0;

transition: transform 0.12s ease-out, opacity 0.12s ease-out, color 0.12s ease-out;

cursor: pointer;

text-align: center;

line-height: 70px;

color: white;

font-family: 'fontawesome';

color: transparent;

/*

li:after{

content: "";

display: block;

bottom: 100%;

left: 50%;

height: ($offsetAmount*100%)-100;

margin-left: -1px;

position: absolute;

width: 4px;

background-color: inherit;

opacity: 0;

transition: opacity $transitionTime ease-out;

}

*/

}

li:first-child:after {

display: none;

}

li:nth-child(1) {

background-color: #004db3;

transform: translate(0, -20%);

z-index: 3;

transition-duration: 0.12s;

}

li:nth-child(2) {

background-color: #26b85a;

transform: translate(20%, 0);

z-index: 2;

transition-duration: 0.24s;

}

li:nth-child(3) {

background-color: #ffcb00;

transform: translate(0, 20%);

z-index: 1;

transition-duration: 0.36s;

}

li:nth-child(4) {

background-color: #d88e8e;

transform: translate(-20%, 0);

z-index: 0;

transition-duration: 0.48s;

}

ul:hover {

height: 308px;

}

ul:hover li {

color: white;

}

ul:hover li:nth-child(1) {

transform: translate(0, 0%);

}

ul:hover li:nth-child(1):hover {

opacity: 1;

transition-timing-function: cubic-bezier(0.5, 0, 0.5, 1);

transform: translate(0, 0%) scale(1.15, 1.15);

transition-duration: 0.24s;

}

ul:hover li:nth-child(1):after {

opacity: 1;

transition-delay: 0.08s;

}

ul:hover li:nth-child(2) {

transform: translate(0, 110%);

}

ul:hover li:nth-child(2):hover {

opacity: 1;

transition-timing-function: cubic-bezier(0.5, 0, 0.5, 1);

transform: translate(0, 110%) scale(1.15, 1.15);

transition-duration: 0.24s;

}

ul:hover li:nth-child(2):after {

opacity: 1;

transition-delay: 0.16s;

}

ul:hover li:nth-child(3) {

transform: translate(0, 220%);

}

ul:hover li:nth-child(3):hover {

opacity: 1;

transition-timing-function: cubic-bezier(0.5, 0, 0.5, 1);

transform: translate(0, 220%) scale(1.15, 1.15);

transition-duration: 0.24s;

}

ul:hover li:nth-child(3):after {

opacity: 1;

transition-delay: 0.24s;

}

ul:hover li:nth-child(4) {

transform: translate(0, 330%);

}

ul:hover li:nth-child(4):hover {

opacity: 1;

transition-timing-function: cubic-bezier(0.5, 0, 0.5, 1);

transform: translate(0, 330%) scale(1.15, 1.15);

transition-duration: 0.24s;

}

ul:hover li:nth-child(4):after {

opacity: 1;

transition-delay: 0.32s;

}

  • About
  • News
  • Contacts
  • Home

一键复制

编辑

Web IDE

原始数据

按行查看

历史

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值