| 1 |
.king-addons-image-comparison { |
| 2 |
display: grid; |
| 3 |
place-content: center; |
| 4 |
position: relative; |
| 5 |
overflow: hidden; |
| 6 |
width: 100%; |
| 7 |
--position: 50%; |
| 8 |
} |
| 9 |
|
| 10 |
.king-addons-image-comparison-container { |
| 11 |
position: relative; |
| 12 |
display: grid; |
| 13 |
width: 100%; |
| 14 |
max-height: inherit; |
| 15 |
} |
| 16 |
|
| 17 |
.king-addons-image-comparison-image-after, |
| 18 |
.king-addons-image-comparison-image-before { |
| 19 |
grid-area: 1 / 1; |
| 20 |
} |
| 21 |
|
| 22 |
.king-addons-image-comparison-image-after { |
| 23 |
max-height: inherit; |
| 24 |
} |
| 25 |
|
| 26 |
.king-addons-image-comparison-image-after img { |
| 27 |
display: block; |
| 28 |
width: 100%; |
| 29 |
height: auto; |
| 30 |
max-width: 100%; |
| 31 |
max-height: inherit; |
| 32 |
object-position: left center; |
| 33 |
} |
| 34 |
|
| 35 |
.king-addons-image-comparison-image-before { |
| 36 |
position: relative; |
| 37 |
z-index: 1; |
| 38 |
width: 100%; |
| 39 |
height: 100%; |
| 40 |
overflow: hidden; |
| 41 |
clip-path: inset(0 calc(100% - var(--position)) 0 0); |
| 42 |
} |
| 43 |
|
| 44 |
.king-addons-image-comparison-image-before img { |
| 45 |
display: block; |
| 46 |
position: absolute; |
| 47 |
inset: 0; |
| 48 |
width: 100%; |
| 49 |
height: 100%; |
| 50 |
max-width: none; |
| 51 |
object-position: left center; |
| 52 |
} |
| 53 |
|
| 54 |
.king-addons-image-comparison-slider { |
| 55 |
position: absolute; |
| 56 |
inset: 0; |
| 57 |
cursor: pointer; |
| 58 |
opacity: 0; |
| 59 |
width: 100%; |
| 60 |
height: 100%; |
| 61 |
z-index: 3; |
| 62 |
} |
| 63 |
|
| 64 |
.king-addons-image-comparison-slider:focus-visible ~ .king-addons-image-comparison-slider-button { |
| 65 |
outline: 5px solid black; |
| 66 |
outline-offset: 3px; |
| 67 |
} |
| 68 |
|
| 69 |
.king-addons-image-comparison-slider-line { |
| 70 |
position: absolute; |
| 71 |
inset: 0; |
| 72 |
width: .2rem; |
| 73 |
height: 100%; |
| 74 |
left: var(--position); |
| 75 |
transform: translateX(-50%); |
| 76 |
pointer-events: none; |
| 77 |
z-index: 2; |
| 78 |
} |
| 79 |
|
| 80 |
.king-addons-image-comparison-slider-button { |
| 81 |
position: absolute; |
| 82 |
color: black; |
| 83 |
display: grid; |
| 84 |
place-items: center; |
| 85 |
top: 50%; |
| 86 |
left: var(--position); |
| 87 |
transform: translate(-50%, -50%); |
| 88 |
pointer-events: none; |
| 89 |
z-index: 2; |
| 90 |
} |
| 91 |
|