1 Star 7 Fork 4

无名开发者 / css_only_bottombar

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.css 1.94 KB
一键复制 编辑 原始数据 按行查看 历史
无名开发者 提交于 2022-09-28 15:14 . ok
:root {
--color: #222327
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background: var(--color);
}
.container {
width: 440px;
height: 70px;
background: #fff;
display: flex;
justify-content: center;
align-items: center;
border-radius: 10px;
position: relative;
}
.item {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 100px;
}
.icon {
position: absolute;
font-size: 1.7em;
color: var(--color);
font-weight: bold;
transition: 0.5s;
}
.text {
transform: translateY(20px);
font-size: 0.75em;
font-weight: bold;
transition: 0.5s;
opacity: 0;
}
.item.active .icon {
transform: translateY(-32px);
z-index: 1;
}
.item.active .text {
opacity: 1;
transform: translateY(10px);
}
.indicator{
position: absolute;
width: 70px;
height: 70px;
background: #29fd53;
left: 35px;
top: -50%;
border-radius: 50%;
border: 6px solid var(--color);
transition: 0.5s;
}
.indicator::before{
content: '';
position: absolute;
top: 50%;
left: -22px;
width: 20px;
height: 20px;
background: transparent;
border-top-right-radius: 20px;
box-shadow: 0 -10px 0 0 var(--color);
}
.indicator::after{
content: '';
position: absolute;
top: 50%;
right: -22px;
width: 20px;
height: 20px;
background: transparent;
border-top-left-radius: 20px;
box-shadow: 0 -10px 0 0 var(--color);
}
.item:nth-child(1).active ~ .indicator{
transform: translateX(calc(100px * 0));
}
.item:nth-child(2).active ~ .indicator{
transform: translateX(calc(100px * 1));
}
.item:nth-child(3).active ~ .indicator{
transform: translateX(calc(100px * 2));
}
.item:nth-child(4).active ~ .indicator{
transform: translateX(calc(100px * 3));
}
CSS
1
https://gitee.com/ezitku/css_only_bottom.git
git@gitee.com:ezitku/css_only_bottom.git
ezitku
css_only_bottom
css_only_bottombar
master

搜索帮助