theme_slider.scss (3289B)
1 .toggleWrapper { 2 3 div { 4 z-index: -100; 5 display: inline-block; 6 } 7 input { 8 position: absolute; 9 left: -99em; 10 margin-bottom: 5px; 11 } 12 } 13 14 .toggle { 15 cursor: pointer; 16 display: inline-block; 17 position: relative; 18 width: 90px; 19 height: 40px; 20 background-color: #83D8FF; 21 border-radius: 90px - 6; 22 transition: background-color 200ms cubic-bezier(0.445, 0.05, 0.55, 0.95); 23 24 &:before { 25 content: 'Light'; 26 position: absolute; 27 left: -50px; 28 top: 8px; 29 font-size: 18px; 30 color: #749ED7; 31 } 32 33 &:after { 34 content: 'Dark'; 35 position: absolute; 36 right: -48px; 37 top: 8px; 38 font-size: 18px; 39 color: #434B59; 40 } 41 } 42 43 .toggle__handler { 44 display: inline-block; 45 position: relative; 46 z-index: 1; 47 top: 3px; 48 left: 3px; 49 width: 40px - 6; 50 height: 40px - 6; 51 background-color: #FFCF96; 52 border-radius: 40px; 53 box-shadow: 0 2px 6px rgba(0,0,0,.3); 54 transition: all 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55); 55 //transform: rotate(-45deg); 56 57 .crater { 58 position: absolute; 59 background-color: #E8CDA5; 60 opacity: 0; 61 transition: opacity 200ms ease-in-out; 62 border-radius: 100%; 63 } 64 65 .crater--1 { 66 top: 18px; 67 left: 10px; 68 width: 4px; 69 height: 4px; 70 } 71 72 .crater--2 { 73 top: 23px; 74 left: 17px; 75 width: 6px; 76 height: 6px; 77 } 78 79 .crater--3 { 80 top: 10px; 81 left: 22px; 82 width: 8px; 83 height: 8px; 84 } 85 } 86 87 .star { 88 position: absolute; 89 background-color: #ffffff; 90 transition: all 300ms cubic-bezier(0.445, 0.05, 0.55, 0.95); 91 border-radius: 50%; 92 } 93 94 .star--1 { 95 top: 10px; 96 left: 20px; 97 z-index: 0; 98 width: 30px; 99 height: 3px; 100 } 101 102 .star--2 { 103 top: 18px; 104 left: 21px; 105 z-index: 1; 106 width: 30px; 107 height: 3px; 108 } 109 110 .star--3 { 111 top: 27px; 112 left: 25px; 113 z-index: 0; 114 width: 30px; 115 height: 3px; 116 } 117 118 .star--4, 119 .star--5, 120 .star--6 { 121 opacity: 0; 122 transition: all 300ms 0 cubic-bezier(0.445, 0.05, 0.55, 0.95); 123 } 124 125 .star--4 { 126 top: 16px; 127 left: 11px; 128 z-index: 0; 129 width: 2px; 130 height: 2px; 131 transform: translate3d(3px,0,0); 132 } 133 134 .star--5 { 135 top: 32px; 136 left: 17px; 137 z-index: 0; 138 width: 3px; 139 height: 3px; 140 transform: translate3d(3px,0,0); 141 } 142 143 .star--6 { 144 top: 36px; 145 left: 28px; 146 z-index: 0; 147 width: 2px; 148 height: 2px; 149 transform: translate3d(3px,0,0); 150 } 151 152 input:checked { 153 + .toggle { 154 background-color: #749DD6; 155 156 &:before { 157 color: #626C80; 158 } 159 160 &:after { 161 color: #749ED7; 162 } 163 164 .toggle__handler { 165 background-color: #FFE5B5; 166 transform: translate3d(50px, 0, 0) rotate(0); 167 168 .crater { opacity: 1; } 169 } 170 171 .star--1 { 172 width: 2px; 173 height: 2px; 174 left: 35px; 175 } 176 177 .star--2 { 178 width: 4px; 179 height: 4px; 180 left: 28px; 181 transform: translate3d(-5px, 0, 0); 182 } 183 184 .star--3 { 185 width: 2px; 186 height: 2px; 187 left: 40px; 188 transform: translate3d(-7px, 0, 0); 189 } 190 191 .star--4, 192 .star--5, 193 .star--6 { 194 opacity: 1; 195 transform: translate3d(0,0,0); 196 } 197 .star--4 { 198 transition: all 300ms 200ms cubic-bezier(0.445, 0.05, 0.55, 0.95); 199 } 200 .star--5 { 201 transition: all 300ms 300ms cubic-bezier(0.445, 0.05, 0.55, 0.95); 202 } 203 .star--6 { 204 transition: all 300ms 400ms cubic-bezier(0.445, 0.05, 0.55, 0.95); 205 } 206 } 207 } 208