css实现手机立体滑动底部导航条效果代码

代码语言:html

所属分类:菜单导航

代码描述:css实现手机立体滑动底部导航条效果代码

代码标签: css 手机 立体 滑动 底部 导航条

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">

  
  
<style>
:root {
	--icon: #b0bfd8;
}

body {
	width: 100%;
	height: 100vh;
	display: flex;
	justify-content: center;
	align-items: center;
	overflow: hidden;
	margin: 0;
	background-color: #e3efe8;
	background-image: linear-gradient(315deg, #e3efe8 0%, #96a7cf 74%);
}


nav.menu {
	display: flex;
	justify-content: space-between;
	position: relative;
	height: 150px;
	padding: 0 29px 10px;
	background: #fff0;
	align-items: flex-end;
	width: 600px;}

nav.menu:before {
	content: "";
	width: 100%;
	height: 150px;
	background: #181818;
	position: absolute;
	left: 0;
	bottom: 0;
	border-radius: 20px;
	z-index: -1;
	box-shadow: 1px 1px 2px 0px #fff;
}

input { display: none;}

label {
	text-decoration: none;
	font-family: sans-serif;
	text-transform: uppercase;
	font-size: 14px;
	min-width: 100px;
	height: 100px;
	margin: 10px 10px 20px;
	text-align: center;
	display: inline-grid;
	align-items: end;
	color: #b0bfd8;
	position: relative;
	transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) 0s;
	cursor: pointer;
}

label:hover {
	color: #fff;
	text-shadow: 0 0 5px #fff, 0 0 10px #fff;
}

input:checked + label {
	color: #fff;
	height: 130px;
}

.selector {
	--hole: #2196f3;
	background: 
		radial-gradient(circle at 50% 50%, #fff8 30px, #fff0 45px, #fff 50px, #fff0 50px 100%), 
		radial-gradient(circle at 50% 50%, var(--hole) 0 45px, #fff0 50px 100%),
		radial-gradient(circle at 50% 75px, #181818 0 70px, #fff0 71px 100%);
	width: 95px;
	height: 95px;
	position: absolute;
	bottom: 47px;
	left: 0;
	z-index: -1;
	transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) 0s;
	border: 19px solid #181818;
	border-radius: 100%;
}

#m-home:checked ~ .selector {
	left: 23px;
}

#m-search:checked ~ .selector {
	left: 143px;
	filter: hue-rotate(535deg);
}

#m-notification:checked ~ .selector {
	left: 263px;
	filter: hue-rotate(950deg);
}

#m-favorites:checked ~ .selector {
	left: 383px;
	filter: hue-rotate(1580deg);
}

#m-profile:checked ~ .selector {
	left: 502px;
	filter: hue-rotate(1850deg);
}

.selector:after {
	content: "";
	position: absolute;
	bottom: -80px;
	width: 80px;
	height: 10px;
	background: #181818;
	left: calc(50% - 40px);
	border-radius: 5px 5px 15px 15px;
}

input:checked ~ .selector:after {
	box-shadow: 0 -17px 35px 8px var(--hole);
}







/*** ICONS ***/
label:before,
label:after {
	content: "";
	position: absolute;
	box-sizing: border-box;
	transition: all 0.5s ease 0s;
}

label:hover:before,
label:hover:after {
	filter: brightness(1.5) drop-shadow(0px 0px 4px #fff);
	transition: all 0.5s ease 0s;
}

input:checked + label:before, 
input:checked + label:after {
	filter: brightness(1.5) drop-shadow(0px 0px 2px var(--sel));
	transition: all 0.5s ease 0s;
}





label[for=m-home]:before {
	width: 40px;
	height: 40px;
	left: 30px;
	top: 30px;
	transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55) 0s;
	border-radius: 2px;
	background: 
		conic-gradient(from 90deg at 65% 60%, var(--icon) 0 25%, #fff0 0 100%),
		conic-gradient(from 180deg at 35% 60%, var(--icon) 0 25%, #fff0 0 100%),
		conic-gradient(from 135deg at 50% 0%, var(--icon) 0 25%, #fff0 0 100%);
	background-repeat: no-repeat;
	background-size: 100% 100%, 100% 100%, 100% 27px;
}

label[for=m-home]:after {
	width: 40px;
	height: 40px;
	left: 30px;
	top: 24px;
	border: 6px solid var(--icon);
	border-right-width: 0;
	border-bottom-width: 0;
	transform: rotate(45deg);
	borde.........完整代码请登录后点击上方下载按钮下载查看

网友评论0