| 1 |
import getIcon from '../../utils/get-icon'; |
| 2 |
import metadata from './block.json'; |
| 3 |
import edit from './edit'; |
| 4 |
import save from './save'; |
| 5 |
|
| 6 |
const { name } = metadata; |
| 7 |
|
| 8 |
export { metadata, name }; |
| 9 |
|
| 10 |
export const settings = { |
| 11 |
icon: getIcon('block-image-compare', true), |
| 12 |
ghostkit: { |
| 13 |
previewUrl: 'https://www.ghostkit.io/docs/blocks/image-compare/', |
| 14 |
customStylesCallback(attributes) { |
| 15 |
const styles = { |
| 16 |
'--gkt-image-compare__position': undefined, |
| 17 |
'--gkt-image-compare--divider__background-color': |
| 18 |
attributes.colorDivider || undefined, |
| 19 |
'--gkt-image-compare--divider-icons__color': |
| 20 |
attributes.colorDividerIcon || undefined, |
| 21 |
}; |
| 22 |
|
| 23 |
if ( |
| 24 |
typeof attributes.position !== 'undefined' && |
| 25 |
attributes.position !== '' |
| 26 |
) { |
| 27 |
styles['--gkt-image-compare__position'] = |
| 28 |
`${attributes.position}%`; |
| 29 |
} |
| 30 |
|
| 31 |
return styles; |
| 32 |
}, |
| 33 |
}, |
| 34 |
edit, |
| 35 |
save, |
| 36 |
}; |
| 37 |
|