| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; |
| 4 |
} |
| 5 |
|
| 6 |
$bppiv_block = call_user_func( function() use ( $get_value, $bppiv_meta, $bppiv_width, $bppiv_height ) { |
| 7 |
return [ |
| 8 |
"blockName" => "panorama/image-3d", |
| 9 |
"attrs" => [ |
| 10 |
"imageUrl" => $get_value('bppiv_image_src', false, 0, 'url'), |
| 11 |
"options" => [ |
| 12 |
"autoRotate" => $get_value('bppiv_auto_rotate', true, true), |
| 13 |
"autoRotateSpeed" => $bppiv_meta['bppiv_speed'] ?? 1, |
| 14 |
"autoRotateInactivityDelay" => $bppiv_meta['auto_rotate_inactivity_delay'] ?? 3000, |
| 15 |
"hideDefaultCtrl" => $get_value('control_show_hide', true), |
| 16 |
"initialView" => $get_value('initial_view', true), |
| 17 |
"initialPosition" => [ |
| 18 |
"x" => (float)$get_value('initial_view_image_property', false, 0, 'top'), |
| 19 |
"y" => (float)$get_value('initial_view_image_property', false, 0, 'right'), |
| 20 |
"z" => (float)$get_value('initial_view_image_property', false, 0, 'bottom') |
| 21 |
], |
| 22 |
"isDeviceMotion" => $get_value('is_motion_button', true) |
| 23 |
], |
| 24 |
"layout" => [ |
| 25 |
"alignSl" => [ |
| 26 |
"desktop" =>$bppiv_meta['bppiv_alignment'] ?? "center", |
| 27 |
"tablet" => $bppiv_meta['bppiv_alignment'] ?? "center", |
| 28 |
"mobile" => $bppiv_meta['bppiv_alignment'] ?? "center" |
| 29 |
], |
| 30 |
"width" => [ |
| 31 |
"desktop" => $bppiv_width, |
| 32 |
"tablet" => $bppiv_width, |
| 33 |
"mobile" => $bppiv_width |
| 34 |
], |
| 35 |
"height" => [ |
| 36 |
"desktop" => $bppiv_height, |
| 37 |
"tablet" => $bppiv_height, |
| 38 |
"mobile" => $bppiv_height |
| 39 |
], |
| 40 |
"buttonColors" => [ |
| 41 |
"color" => $bppiv_meta['motion_button_text_color'] ?? '', |
| 42 |
"bg" => $bppiv_meta['motion_button_btn_bg'] ?? '' |
| 43 |
], |
| 44 |
"buttonHoverColors" => [ |
| 45 |
"color" => $bppiv_meta['hover_motion_button_text_color'] ?? '', |
| 46 |
"bg" => $bppiv_meta['hover_motion_button_btn_bg'] ?? '' |
| 47 |
] |
| 48 |
] |
| 49 |
], |
| 50 |
"innerBlocks" => [], |
| 51 |
"innerHTML" => "", |
| 52 |
"innerContent" => [] |
| 53 |
]; |
| 54 |
} ); |