| kumaran.m | 3b4814a | 2020-05-01 19:48:54 +0530 | [diff] [blame] | 1 | /* |
| 2 | Copyright 2020 TATA ELXSI |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the 'License'); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | |
| 16 | Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in) |
| SANDHYA.JS | 2657011 | 2024-07-05 21:35:46 +0530 | [diff] [blame] | 17 | */ |
| 18 | .switches-container { |
| 19 | border-bottom: 1px solid #5f5f5f; |
| 20 | background-color: #054c8c; |
| 21 | border-radius: 2px; |
| 22 | width: 230px; |
| 23 | position: relative; |
| 24 | display: block; |
| 25 | padding: 0; |
| 26 | line-height: 2em; |
| 27 | border-radius: 3rem; |
| 28 | margin-left: auto; |
| 29 | margin-right: auto; |
| 30 | height: 36px; |
| 31 | } |
| 32 | |
| 33 | .switches-container input { |
| 34 | visibility: hidden; |
| 35 | position: absolute; |
| 36 | top: 0; |
| 37 | } |
| 38 | |
| 39 | .switches-container label { |
| 40 | width: 50%; |
| 41 | padding: 0; |
| 42 | margin: 0; |
| 43 | text-align: center; |
| 44 | cursor: pointer; |
| 45 | color: white; |
| 46 | font-size: 0.875rem; |
| 47 | font-weight: 400; |
| 48 | } |
| 49 | |
| 50 | .switch-wrapper { |
| 51 | position: absolute; |
| 52 | top: 0; |
| 53 | bottom: 0; |
| 54 | width: 50%; |
| 55 | padding: 0.15rem; |
| 56 | z-index: 3; |
| 57 | transition: transform 0.5s cubic-bezier(0.77, 0, 0.175, 1); |
| 58 | } |
| 59 | |
| 60 | .switch { |
| 61 | border-radius: 3rem; |
| 62 | background: white; |
| 63 | height: 100%; |
| 64 | width: 110px; |
| 65 | margin-top: 1px; |
| 66 | margin-right: 1px; |
| 67 | } |
| 68 | |
| 69 | .switch div { |
| 70 | width: 100%; |
| 71 | text-align: center; |
| 72 | opacity: 0; |
| 73 | display: block; |
| 74 | color: #054c8c; |
| 75 | font-size: 0.875rem; |
| 76 | font-weight: 400; |
| 77 | transition: opacity 0.2s cubic-bezier(0.77, 0, 0.175, 1) 0.125s; |
| 78 | will-change: opacity; |
| 79 | position: absolute; |
| 80 | top: 0; |
| 81 | left: 0; |
| 82 | } |
| 83 | |
| 84 | /* slide the switch box from right to left */ |
| 85 | .switches-container input:nth-of-type(1):checked ~ .switch-wrapper { |
| 86 | transform: translateX(0%); |
| 87 | } |
| 88 | |
| 89 | /* slide the switch box from left to right */ |
| 90 | .switches-container input:nth-of-type(2):checked ~ .switch-wrapper { |
| 91 | transform: translateX(100%); |
| 92 | } |
| 93 | |
| 94 | /* toggle the switch box labels - first checkbox:checked - show first switch div */ |
| 95 | .switches-container input:nth-of-type(1):checked ~ .switch-wrapper .switch div:nth-of-type(1) { |
| 96 | opacity: 1; |
| 97 | } |
| 98 | |
| 99 | /* toggle the switch box labels - second checkbox:checked - show second switch div */ |
| 100 | .switches-container input:nth-of-type(2):checked ~ .switch-wrapper .switch div:nth-of-type(2) { |
| 101 | opacity: 1; |
| 102 | } |