简体   繁体   English

如何将选项卡 css 从选项卡 1 转换为选项卡 2?

[英]How do i translate a tab css from tab 1 to tab 2?

How do i translate tab 1 Neumorphic css to tab 2 when I click on tab 2 like the example below like sliding from tab 1 to tab 2?当我单击选项卡 2 时,如何将选项卡 1 Neumorphic css 转换为选项卡 2,如下例所示,例如从选项卡 1 滑动到选项卡 2?

https://dribbble.com/shots/10805627-Neumorphic-Tab https://dribbble.com/shots/10805627-Neumorphic-Tab

在此处输入图像描述

import styled from 'styled-components';

const PostsTabWrapper = styled.div`
  .react-tabs {
    width: 100%;
    font-size: 20px;
    font-weight: 500;
    @media (max-width: 768px) {
      font-size: 16px;
    }
  }
  
  .react-tabs__tab-list {
    margin: 0 25px 20px 25px;
    background: 3af740;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 
      inset 0 0 15px rgba(55, 84, 170,0),
      inset 0 0 20px rgba(255, 255, 255,0),
      7px 7px 15px rgba(55, 84, 170,.15),
      -7px -7px 20px rgba(255, 255, 255,1),
      inset 0px 0px 4px rgba(255, 255, 255,.2);
  }
  
  .react-tabs__tab {
    display: inline-block;
    position: relative;
    list-style: none;
    padding: 16px 24px;
    cursor: pointer;
  }
  
  .react-tabs__tab--selected {
    border-radius: 10px;
    box-shadow: 
    inset 7px 7px 15px rgba(55, 84, 170,.15),
    inset -7px -7px 20px rgba(255, 255, 255,1),
    0px 0px 4px rgba(255, 255, 255,.2);
    transition: 0.4s ease-in-out;
  }
  
  .react-tabs__tab--disabled {
    // color: GrayText;
    cursor: default;
  }
  
  .react-tabs__tab:focus {
    // box-shadow: 0 0 5px hsl(208, 99%, 50%);
    // border-color: hsl(208, 99%, 50%);
    // outline: none;
  }
  
  .react-tabs__tab:focus:after {
    content: "";
    position: absolute;
    height: 5px;
    left: -4px;
    right: -4px;
    bottom: -5px;
    // background: #fff;
  }
  
  .react-tabs__tab-panel {
    display: none;
  }
  
  .react-tabs__tab-panel--selected {
    display: block;
  }
`;

export default PostsTabWrapper

check when you click on the input then you do translateX(distance)检查何时单击输入,然后执行 translateX(distance)

for exemple:举个例子:

input{
&.active {
    background: #7395D2;
    color: #7395D2;
    #swipe{
      transform: translateX(120px);
      background: #C6CEF6;
    }
   }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何防止标签更改 - How do I prevent the tab from changing 如何将CSS选项卡ui导入导航栏 - How do I make CSS tab ui into a nav bar CSS标签控件-如何仅显示第一个div? - CSS Tab Control - How do I show only the first div? 关闭新标签页后如何返回现有标签页? - How do I return to an existing tab after closing a new tab? 如何在事件中使用javascript和jquery以编程方式从应用程序的当前选项卡切换到另一个选项卡 - How do I switch to another tab from current tab in the application programmatically using javascript and jquery on an event 如何使用 javascript 和 jquery 以编程方式从主选项卡切换到辅助选项卡 - How do I programmatically toggle from a primary tab to a secondary tab using javascript and jquery 如何在不使用标签索引的情况下在标签容器中设置活动标签? - How do i set the active tab in a tab container without using the index of the tab? 如何从另一个页面链接到特定的javascript标签? - How do I link to a specific javascript tab from another page? 如何从greasemonkey脚本关闭firefox选项卡? - How do I close a firefox tab from a greasemonkey script? 如何在引导程序中从另一个页面激活动态选项卡? - How do I activate a dynamic tab from another page in bootstrap?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM