| /* |
| Copyright 2020 TATA ELXSI |
| |
| Licensed under the Apache License, Version 2.0 (the 'License'); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in) |
| */ |
| .switches-container { |
| border-bottom: 1px solid #5f5f5f; |
| background-color: #054c8c; |
| border-radius: 2px; |
| width: 230px; |
| position: relative; |
| display: block; |
| padding: 0; |
| line-height: 2em; |
| border-radius: 3rem; |
| margin-left: auto; |
| margin-right: auto; |
| height: 36px; |
| } |
| |
| .switches-container input { |
| visibility: hidden; |
| position: absolute; |
| top: 0; |
| } |
| |
| .switches-container label { |
| width: 50%; |
| padding: 0; |
| margin: 0; |
| text-align: center; |
| cursor: pointer; |
| color: white; |
| font-size: 0.875rem; |
| font-weight: 400; |
| } |
| |
| .switch-wrapper { |
| position: absolute; |
| top: 0; |
| bottom: 0; |
| width: 50%; |
| padding: 0.15rem; |
| z-index: 3; |
| transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1); |
| } |
| |
| .switch { |
| border-radius: 3rem; |
| background: white; |
| height: 100%; |
| width: 110px; |
| margin-top: 1px; |
| margin-right: 1px; |
| } |
| |
| .switch div { |
| width: 100%; |
| text-align: center; |
| opacity: 0; |
| display: block; |
| color: #054c8c; |
| font-size: 0.875rem; |
| font-weight: 400; |
| transition: opacity 0.2s cubic-bezier(0.77, 0, 0.175, 1) 0.125s; |
| will-change: opacity; |
| position: absolute; |
| top: 0; |
| left: 0; |
| } |
| |
| /* slide the switch box from right to left */ |
| .switches-container input:nth-of-type(1):checked ~ .switch-wrapper { |
| transform: translateX(0%); |
| } |
| |
| /* slide the switch box from left to right */ |
| .switches-container input:nth-of-type(2):checked ~ .switch-wrapper { |
| transform: translateX(100%); |
| } |
| |
| /* toggle the switch box labels - first checkbox:checked - show first switch div */ |
| .switches-container input:nth-of-type(1):checked ~ .switch-wrapper .switch div:nth-of-type(1) { |
| opacity: 1; |
| } |
| |
| /* toggle the switch box labels - second checkbox:checked - show second switch div */ |
| .switches-container input:nth-of-type(2):checked ~ .switch-wrapper .switch div:nth-of-type(2) { |
| opacity: 1; |
| } |