| @@ -1,0 +1,60 @@ | ||
| 1 | +.king-addons-image-comparison { | |
| 2 | + display: grid; | |
| 3 | + place-content: center; | |
| 4 | + position: relative; | |
| 5 | + overflow: hidden; | |
| 6 | + width: fit-content; | |
| 7 | + --position: 50%; | |
| 8 | +} | |
| 9 | + | |
| 10 | +.king-addons-image-comparison-container { | |
| 11 | + position: relative; | |
| 12 | +} | |
| 13 | + | |
| 14 | +.king-addons-image-comparison-container img { | |
| 15 | + width: 100%; | |
| 16 | + height: 100%; | |
| 17 | + object-fit: none; | |
| 18 | + object-position: left; | |
| 19 | +} | |
| 20 | + | |
| 21 | +.king-addons-image-comparison-image-before { | |
| 22 | + position: absolute; | |
| 23 | + inset: 0; | |
| 24 | + width: var(--position); | |
| 25 | +} | |
| 26 | + | |
| 27 | +.king-addons-image-comparison-slider { | |
| 28 | + position: absolute; | |
| 29 | + inset: 0; | |
| 30 | + cursor: pointer; | |
| 31 | + opacity: 0; | |
| 32 | + width: 100%; | |
| 33 | + height: 100%; | |
| 34 | +} | |
| 35 | + | |
| 36 | +.king-addons-image-comparison-slider:focus-visible ~ .king-addons-image-comparison-slider-button { | |
| 37 | + outline: 5px solid black; | |
| 38 | + outline-offset: 3px; | |
| 39 | +} | |
| 40 | + | |
| 41 | +.king-addons-image-comparison-slider-line { | |
| 42 | + position: absolute; | |
| 43 | + inset: 0; | |
| 44 | + width: .2rem; | |
| 45 | + height: 100%; | |
| 46 | + left: var(--position); | |
| 47 | + transform: translateX(-50%); | |
| 48 | + pointer-events: none; | |
| 49 | +} | |
| 50 | + | |
| 51 | +.king-addons-image-comparison-slider-button { | |
| 52 | + position: absolute; | |
| 53 | + color: black; | |
| 54 | + display: grid; | |
| 55 | + place-items: center; | |
| 56 | + top: 50%; | |
| 57 | + left: var(--position); | |
| 58 | + transform: translate(-50%, -50%); | |
| 59 | + pointer-events: none; | |
| 60 | +} | |