react framer-motion实现简洁选项卡tab切换效果代码

代码语言:html

所属分类:选项卡

代码描述:react framer-motion实现简洁选项卡tab切换效果代码

代码标签: 简洁 选项 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>
:root {
  --line-size: 3px;
  --line-colour: #74c6e5;
  --hover-colour: #07698e;
}

body {
  padding: 30px;
  margin: 0;
  font-family: Helvetica, Arial, sans-serif;
}

ul, li {
  list-style: none;
  padding: 0;
  margin: 0;
}

.wrapper {
  max-width: 1000px;
  padding: 30px;
  margin: 0 auto;
}

.tab-content {
  padding: 30px 0;
  line-height: 1.6;
}

/* Tabs */
.tabs {
  display: block;
  position: relative;
}

.tabs-list {
  display: flex;
  border-bottom: var(--line-size) solid #ecf0f5;
}

.tabs-list__item {
  margin-right: 30px;
}

.tabs-list__tab {
  display: block;
  color: #2c3642;
  padding: 18px 6px;
  background: none;
  transition: background-color 600ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  text-decoration: none;
  font-weight: bold;
  white-space: nowrap;
}

.tabs-list__tab:after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  height: var(--line-size);
  width: 100%;
}

.tabs-list__tab:hover {
  color: var(--hover-colour);
}

.tabs-list__tab.active:after {
  background-color: var(--line-colour);
}

.tabs-list__tab.active.animating:after {
  ba.........完整代码请登录后点击上方下载按钮下载查看

网友评论0