react framer-motion实现彩色选项卡tab切换效果代码
代码语言:html
所属分类:选项卡
代码描述:react framer-motion实现彩色选项卡tab切换效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/css?family=Karla:400,700&display=swap" rel="stylesheet">
<style>
body {
background-color: #5B37B7;
padding: 20px;
margin: 0;
font-family: Helvetica, Arial, sans-serif;
transition: background-color 0.5s ease;
}
@media (min-width: 600px) {
body {
padding: 30px;
}
}
ul, li {
list-style: none;
padding: 0;
margin: 0;
}
/* Tabs */
.tabs-wrapper {
margin: 0 auto;
max-width: 1000px;
padding: 20px;
border-radius: 20px;
background: #FFF;
}
@media (min-width: 600px) {
.tabs-wrapper {
padding: 40px;
}
}
.tabs {
display: block;
position: relative;
}
.tabs-list {
display: flex;
}
.tabs-list__item {
flex: 1 1 auto;
}
@media (min-width: 600px) {
.tabs-list__item {
flex: initial;
}
}
.tabs-list__tab {
text-align: center;
display: block;
line-height: 60px;
padding: 0 10px;
background: transparent;
color: #272727;
position: relative;
text-decoration: none;
font-weight: bold;
white-space: nowrap;
font-size: 14px;
}
@media (min-width: 600px) {
.tabs-list__tab {
font-size: 16px;
padding: 0 20px;
}
}
.tabs-list__tab span {
position: relative;
color: #272727;
transition: color 600ms cubic-bezier(0.4, 0, 0.2, 1);
}
.tabs-list__tab:before {
content: '';
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
border-radius: 30px;
}
.tabs-list__tab:hover {
}
.tabs-list__tab.active {
}
.tabs-list__tab.active:before {
background-color: currentColor;
}
.tabs-list__tab.active.animating:before {
background-color: transparent;
}
.tabs-list__active {
position: absolute;
top: 0;
left: 0;
height: 100%;
background-color: #d.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0