| 1 |
.ghostkit-image-compare-images-divider { |
| 2 |
position: absolute; |
| 3 |
top: 0; |
| 4 |
left: var(--gkt-image-compare__position); |
| 5 |
width: var(--gkt-image-compare--divider__width); |
| 6 |
height: 100%; |
| 7 |
margin-left: calc(var(--gkt-image-compare--divider__width) / -2); |
| 8 |
background-color: var(--gkt-image-compare--divider__background-color); |
| 9 |
transition-timing-function: var(--gkt-image-compare__transition-easing); |
| 10 |
transition-duration: var(--gkt-image-compare__transition-duration); |
| 11 |
transition-property: left; |
| 12 |
will-change: left, top; |
| 13 |
|
| 14 |
// Vertical compare. |
| 15 |
.ghostkit-image-compare-vertical & { |
| 16 |
top: var(--gkt-image-compare__position); |
| 17 |
left: 0; |
| 18 |
width: 100%; |
| 19 |
height: var(--gkt-image-compare--divider__width); |
| 20 |
margin-top: calc(var(--gkt-image-compare--divider__width) / -2); |
| 21 |
margin-left: 0; |
| 22 |
transition-property: top; |
| 23 |
|
| 24 |
&::after { |
| 25 |
top: 50%; |
| 26 |
right: 0; |
| 27 |
bottom: auto; |
| 28 |
left: 0; |
| 29 |
width: auto; |
| 30 |
height: var(--gkt-image-compare--divider-button__width); |
| 31 |
cursor: row-resize; |
| 32 |
transform: translateY(-50%); |
| 33 |
} |
| 34 |
} |
| 35 |
|
| 36 |
&:hover, |
| 37 |
&:focus { |
| 38 |
--gkt-image-compare--divider-icons__offset: var(--gkt-image-compare--divider-hover-icons__offset); |
| 39 |
} |
| 40 |
|
| 41 |
// Button. |
| 42 |
&::before { |
| 43 |
position: absolute; |
| 44 |
top: 50%; |
| 45 |
left: 50%; |
| 46 |
display: block; |
| 47 |
width: var(--gkt-image-compare--divider-button__width); |
| 48 |
height: var(--gkt-image-compare--divider-button__height); |
| 49 |
content: ""; |
| 50 |
background-color: var(--gkt-image-compare--divider-button__background-color); |
| 51 |
border-radius: var(--gkt-image-compare--divider-button__width); |
| 52 |
transform: translateX(-50%) translateY(-50%); |
| 53 |
} |
| 54 |
|
| 55 |
// Zone cursor. |
| 56 |
&::after { |
| 57 |
position: absolute; |
| 58 |
top: 0; |
| 59 |
bottom: 0; |
| 60 |
left: 50%; |
| 61 |
display: block; |
| 62 |
width: var(--gkt-image-compare--divider-button__width); |
| 63 |
cursor: col-resize; |
| 64 |
content: ""; |
| 65 |
transform: translateX(-50%); |
| 66 |
} |
| 67 |
} |
| 68 |
|
| 69 |
.ghostkit-image-compare-images-divider-button-arrow-left, |
| 70 |
.ghostkit-image-compare-images-divider-button-arrow-right { |
| 71 |
position: absolute; |
| 72 |
top: 50%; |
| 73 |
left: 50%; |
| 74 |
font-size: var(--gkt-image-compare--divider-icons__font-size); |
| 75 |
color: var(--gkt-image-compare--divider-icons__color); |
| 76 |
transition-timing-function: var(--gkt-image-compare__transition-easing); |
| 77 |
transition-duration: var(--gkt-image-compare__transition-duration); |
| 78 |
transition-property: margin-left; |
| 79 |
transform: translateX(-50%) translateY(-50%); |
| 80 |
|
| 81 |
// Vertical compare. |
| 82 |
.ghostkit-image-compare-vertical & { |
| 83 |
transition-property: margin-top; |
| 84 |
} |
| 85 |
|
| 86 |
svg { |
| 87 |
display: block; |
| 88 |
width: 1em; |
| 89 |
max-width: none; |
| 90 |
height: 1em; |
| 91 |
color: inherit; |
| 92 |
} |
| 93 |
} |
| 94 |
|
| 95 |
.ghostkit-image-compare-images-divider-button-arrow-left { |
| 96 |
margin-left: calc(-1 * var(--gkt-image-compare--divider-icons__offset)); |
| 97 |
|
| 98 |
.ghostkit-image-compare-vertical & { |
| 99 |
margin-top: calc(-1 * var(--gkt-image-compare--divider-icons__offset)); |
| 100 |
margin-left: 0; |
| 101 |
|
| 102 |
> svg { |
| 103 |
transform: rotate(90deg); |
| 104 |
} |
| 105 |
} |
| 106 |
} |
| 107 |
|
| 108 |
.ghostkit-image-compare-images-divider-button-arrow-right { |
| 109 |
margin-left: var(--gkt-image-compare--divider-icons__offset); |
| 110 |
|
| 111 |
.ghostkit-image-compare-vertical & { |
| 112 |
margin-top: var(--gkt-image-compare--divider-icons__offset); |
| 113 |
margin-left: 0; |
| 114 |
|
| 115 |
> svg { |
| 116 |
transform: rotate(90deg); |
| 117 |
} |
| 118 |
} |
| 119 |
} |
| 120 |
|