| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* SwitcherStyle class for Switcher options. |
| 5 |
* |
| 6 |
* @link https://themeatelier.net |
| 7 |
* @since 1.0.0 |
| 8 |
* |
| 9 |
* @package darkify |
| 10 |
* @subpackage darkify/src/Admin/Views/SwitcherStyle |
| 11 |
* @author ThemeAtelier<themeatelierbd@gmail.com> |
| 12 |
*/ |
| 13 |
|
| 14 |
namespace ThemeAtelier\Darkify\Admin\Views; |
| 15 |
|
| 16 |
use ThemeAtelier\Darkify\Admin\Schema\SchemaRegistry as Darkify; |
| 17 |
|
| 18 |
class SwitcherStyle |
| 19 |
{ |
| 20 |
/** |
| 21 |
* Create Option fields for the setting options. |
| 22 |
* |
| 23 |
* @param string $prefix Option setting key prefix. |
| 24 |
* @return void |
| 25 |
*/ |
| 26 |
public static function options($prefix) |
| 27 |
{ |
| 28 |
Darkify::createSection( |
| 29 |
$prefix, |
| 30 |
array( |
| 31 |
// See Control.php: ids are pinned so routes never follow the |
| 32 |
// translated title. |
| 33 |
'id' => 'switches', |
| 34 |
'title' => esc_html__('Switches', 'darkify'), |
| 35 |
'icon' => 'icofont-toggle-on', |
| 36 |
'fields' => array( |
| 37 |
|
| 38 |
array( |
| 39 |
'type' => 'section_tab', |
| 40 |
'tabs' => array( |
| 41 |
array( |
| 42 |
'id' => 'floating-switch', |
| 43 |
'title' => esc_html__('Floating Switch', 'darkify'), |
| 44 |
'icon' => 'icofont-ui-theme', |
| 45 |
'fields' => array( |
| 46 |
// Intro line, rendered plain above the section cards. |
| 47 |
array( |
| 48 |
'type' => 'page_hint', |
| 49 |
'content' => sprintf( |
| 50 |
/* translators: %s: "Open the live preview" action link */ |
| 51 |
esc_html__('Design the floating dark-mode switch and choose where it sits. %s to see changes instantly.', 'darkify'), |
| 52 |
'<a href="#" data-darkify-open-preview>' . esc_html__('Open the live preview', 'darkify') . '</a>' |
| 53 |
), |
| 54 |
), |
| 55 |
array( |
| 56 |
'title' => esc_html__('Floating Switch Styles', 'darkify'), |
| 57 |
'type' => 'heading', |
| 58 |
'section_start' => true, |
| 59 |
), |
| 60 |
array( |
| 61 |
'id' => 'enable_dark_switcher', |
| 62 |
'type' => 'image_select', |
| 63 |
'title' => esc_html__('Switch Toggler', 'darkify'), |
| 64 |
'title_help' => |
| 65 |
'<div class="darkify-info-label">' . |
| 66 |
__('Choose the default floating switch toggler.', 'darkify') . |
| 67 |
'</div>', |
| 68 |
'class' => 'icon_select ', |
| 69 |
'options' => array( |
| 70 |
'orbit' => array( |
| 71 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/orbit.svg', |
| 72 |
'text' => esc_html__('Orbit', 'darkify'), |
| 73 |
'option_demo_url' => '', |
| 74 |
), |
| 75 |
|
| 76 |
'classic' => array( |
| 77 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/classic.svg', |
| 78 |
'text' => esc_html__('Classic', 'darkify'), |
| 79 |
'option_demo_url' => '', |
| 80 |
), |
| 81 |
|
| 82 |
'expand' => array( |
| 83 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/expand.svg', |
| 84 |
'text' => esc_html__('Expand', 'darkify'), |
| 85 |
'option_demo_url' => '', |
| 86 |
), |
| 87 |
|
| 88 |
'inner-moon' => array( |
| 89 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/inner-moon.svg', |
| 90 |
'text' => esc_html__('Inner Moon', 'darkify'), |
| 91 |
'option_demo_url' => '', |
| 92 |
), |
| 93 |
|
| 94 |
'within' => array( |
| 95 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/within.svg', |
| 96 |
'text' => esc_html__('Within', 'darkify'), |
| 97 |
'option_demo_url' => '', |
| 98 |
), |
| 99 |
|
| 100 |
'around' => array( |
| 101 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/around.svg', |
| 102 |
'text' => esc_html__('Around', 'darkify'), |
| 103 |
'option_demo_url' => '', |
| 104 |
'pro_only' => true, |
| 105 |
), |
| 106 |
|
| 107 |
'dark-side' => array( |
| 108 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/dark-side.svg', |
| 109 |
'text' => esc_html__('Dark Side', 'darkify'), |
| 110 |
'option_demo_url' => '', |
| 111 |
'pro_only' => true, |
| 112 |
), |
| 113 |
|
| 114 |
'horizon' => array( |
| 115 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/horizon.svg', |
| 116 |
'text' => esc_html__('Horizon', 'darkify'), |
| 117 |
'option_demo_url' => '', |
| 118 |
'pro_only' => true, |
| 119 |
), |
| 120 |
|
| 121 |
'eclipse' => array( |
| 122 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/eclipse.svg', |
| 123 |
'text' => esc_html__('Eclipse', 'darkify'), |
| 124 |
'option_demo_url' => '', |
| 125 |
'pro_only' => true, |
| 126 |
), |
| 127 |
|
| 128 |
'lightbulb' => array( |
| 129 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/lightbulb.svg', |
| 130 |
'text' => esc_html__('Lightbulb', 'darkify'), |
| 131 |
'option_demo_url' => '', |
| 132 |
'pro_only' => true, |
| 133 |
), |
| 134 |
|
| 135 |
'dark-inner' => array( |
| 136 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/dark-inner.svg', |
| 137 |
'text' => esc_html__('Dark Inner', 'darkify'), |
| 138 |
'option_demo_url' => '', |
| 139 |
'pro_only' => true, |
| 140 |
), |
| 141 |
|
| 142 |
'half-sun' => array( |
| 143 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/half-sun.svg', |
| 144 |
'text' => esc_html__('Half Sun', 'darkify'), |
| 145 |
'option_demo_url' => '', |
| 146 |
'pro_only' => true, |
| 147 |
), |
| 148 |
|
| 149 |
'simple' => array( |
| 150 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/simple.svg', |
| 151 |
'text' => esc_html__('Simple', 'darkify'), |
| 152 |
'option_demo_url' => '', |
| 153 |
'pro_only' => true, |
| 154 |
), |
| 155 |
'duality' => array( |
| 156 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/duality.svg', |
| 157 |
'text' => esc_html__('Duality', 'darkify'), |
| 158 |
'option_demo_url' => '', |
| 159 |
'pro_only' => true, |
| 160 |
), |
| 161 |
'dual' => array( |
| 162 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/dual.svg', |
| 163 |
'text' => esc_html__('Dual', 'darkify'), |
| 164 |
'option_demo_url' => '', |
| 165 |
'pro_only' => true, |
| 166 |
), |
| 167 |
'shift' => array( |
| 168 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/shift.svg', |
| 169 |
'text' => esc_html__('Shift', 'darkify'), |
| 170 |
'option_demo_url' => '', |
| 171 |
'pro_only' => true, |
| 172 |
), |
| 173 |
), |
| 174 |
'default' => 'orbit', |
| 175 |
), |
| 176 |
array( |
| 177 |
'id' => 'switch_size', |
| 178 |
'type' => 'button_set', |
| 179 |
'title' => esc_html__('Switch Size', 'darkify'), |
| 180 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Choose the size of the floating toggle switch as you need.', 'darkify') . '</div>', |
| 181 |
'options' => array( |
| 182 |
'0.6' => esc_html__('XS', 'darkify'), |
| 183 |
'0.8' => esc_html__('S', 'darkify'), |
| 184 |
'1' => esc_html__('M', 'darkify'), |
| 185 |
'1.2' => esc_html__('L', 'darkify'), |
| 186 |
'1.4' => esc_html__('XL', 'darkify'), |
| 187 |
'1.6' => esc_html__('XXL', 'darkify'), |
| 188 |
'custom' => esc_html__('Custom', 'darkify'), |
| 189 |
), |
| 190 |
'default' => '1', |
| 191 |
), |
| 192 |
array( |
| 193 |
'id' => 'switch_size_custom', |
| 194 |
'type' => 'slider', |
| 195 |
'title' => esc_html__('Custom Switch Size', 'darkify'), |
| 196 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Scale in percentage relative to normal size.', 'darkify') . '</div>', |
| 197 |
'default' => '100', |
| 198 |
'min' => 40, |
| 199 |
'max' => 300, |
| 200 |
'dependency' => array('switch_size', '==', 'custom') |
| 201 |
), |
| 202 |
array( |
| 203 |
'id' => 'switch_background', |
| 204 |
'type' => 'color_group', |
| 205 |
'title' => esc_html__('Switch Background', 'darkify'), |
| 206 |
'title_help' => '<div class="darkify-info-label">' . |
| 207 |
__('Customize the floating switch background to match your design.', 'darkify') . |
| 208 |
'</div>', |
| 209 |
'options' => array( |
| 210 |
'switch_light_mode_bg' => esc_html__('Light Mode', 'darkify'), |
| 211 |
'switch_dark_mode_bg' => esc_html__('Dark Mode', 'darkify'), |
| 212 |
), |
| 213 |
'default' => array( |
| 214 |
'switch_light_mode_bg' => '#121116', |
| 215 |
'switch_dark_mode_bg' => '#ffffff', |
| 216 |
) |
| 217 |
), |
| 218 |
array( |
| 219 |
'id' => 'switch_icon_color', |
| 220 |
'type' => 'color_group', |
| 221 |
'title' => esc_html__('Switch Icon Color', 'darkify'), |
| 222 |
'title_help' => '<div class="darkify-info-label">' . |
| 223 |
__('Customize the floating switch icon color as needed.', 'darkify') . |
| 224 |
'</div>', |
| 225 |
|
| 226 |
'options' => array( |
| 227 |
'switch_light_mode_color' => esc_html__('Light Mode', 'darkify'), |
| 228 |
'switch_dark_mode_color' => esc_html__('Dark Mode', 'darkify'), |
| 229 |
), |
| 230 |
'default' => array( |
| 231 |
'switch_light_mode_color' => '#ffffff', |
| 232 |
'switch_dark_mode_color' => '#121116', |
| 233 |
), |
| 234 |
), |
| 235 |
array( |
| 236 |
'id' => 'switch_border', |
| 237 |
'type' => 'border', |
| 238 |
'title' => esc_html__('Switch Border', 'darkify'), |
| 239 |
'title_help' => |
| 240 |
'<div class="darkify-info-label">' . |
| 241 |
__('Customize the floating switch border and border radius.', 'darkify') . |
| 242 |
'</div>' . |
| 243 |
'' . |
| 244 |
'', |
| 245 |
'color' => true, |
| 246 |
'style' => false, |
| 247 |
'color2' => false, |
| 248 |
// The switch has a separate border colour per mode: `color` is |
| 249 |
// light, `color3` is dark. Both are read by |
| 250 |
// DarkifyUtils::generateSwitchStyles() and the [darkify] |
| 251 |
// shortcode, so the dark one needs a control of its own. |
| 252 |
'color3' => true, |
| 253 |
'all' => true, |
| 254 |
'radius' => true, |
| 255 |
'default' => array( |
| 256 |
'color' => '#121116', |
| 257 |
'color3' => '#ffffff', |
| 258 |
'all' => 0, |
| 259 |
'radius' => 7, |
| 260 |
), |
| 261 |
), |
| 262 |
array( |
| 263 |
'title' => esc_html__('Switch Positioning', 'darkify'), |
| 264 |
'type' => 'heading', |
| 265 |
'section_start' => true, |
| 266 |
), |
| 267 |
array( |
| 268 |
'id' => 'switcher_button_position', |
| 269 |
'type' => 'fieldset', |
| 270 |
'fields' => array( |
| 271 |
array( |
| 272 |
'id' => 'dark_mode_switch_position', |
| 273 |
// Corner tiles rather than a button row: the choice is |
| 274 |
// spatial, so the diagram reads faster than the words. |
| 275 |
// Presentation only — the stored keys, the default and |
| 276 |
// the dependencies below are unchanged. |
| 277 |
'type' => 'position_select', |
| 278 |
'title' => esc_html__('Switch Position', 'darkify'), |
| 279 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Choose the screen position where the Floating Switch should be displayed.', 'darkify') . '</div>', |
| 280 |
'options' => array( |
| 281 |
'bottom_right' => esc_html__('Bottom Right', 'darkify'), |
| 282 |
'bottom_left' => esc_html__('Bottom Left', 'darkify'), |
| 283 |
'top_right' => esc_html__('Top Right', 'darkify'), |
| 284 |
'top_left' => esc_html__('Top Left', 'darkify'), |
| 285 |
), |
| 286 |
'default' => 'bottom_right', |
| 287 |
), |
| 288 |
array( |
| 289 |
'id' => 'switch_position_top_right', |
| 290 |
'type' => 'spacing', |
| 291 |
'title' => esc_html__('Margin From Top Right', 'darkify'), |
| 292 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Customize default margin from the top right of the Floating Switch.', 'darkify') . '</div>', |
| 293 |
'left' => false, |
| 294 |
'bottom' => false, |
| 295 |
'units' => ['px'], |
| 296 |
'default' => array( |
| 297 |
'top' => '40', |
| 298 |
'right' => '40', |
| 299 |
), |
| 300 |
'dependency' => array('dark_mode_switch_position', '==', 'top_right'), |
| 301 |
), |
| 302 |
array( |
| 303 |
'id' => 'switch_position_top_left', |
| 304 |
'type' => 'spacing', |
| 305 |
'title' => esc_html__('Margin From Top Left', 'darkify'), |
| 306 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Customize default margin from the top left of the Floating Switch.', 'darkify') . '</div>', |
| 307 |
'right' => false, |
| 308 |
'bottom' => false, |
| 309 |
'units' => ['px'], |
| 310 |
'default' => array( |
| 311 |
'top' => '40', |
| 312 |
'left' => '40', |
| 313 |
), |
| 314 |
'dependency' => array('dark_mode_switch_position', '==', 'top_left'), |
| 315 |
), |
| 316 |
array( |
| 317 |
'id' => 'switch_position_bottom_right', |
| 318 |
'type' => 'spacing', |
| 319 |
'title' => esc_html__('Margin From Bottom Right', 'darkify'), |
| 320 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Customize default margin from the bottom right of the Floating Switch.', 'darkify') . '</div>', |
| 321 |
'left' => false, |
| 322 |
'top' => false, |
| 323 |
'units' => ['px'], |
| 324 |
'default' => array( |
| 325 |
'bottom' => '40', |
| 326 |
'right' => '40', |
| 327 |
), |
| 328 |
'dependency' => array('dark_mode_switch_position', '==', 'bottom_right'), |
| 329 |
), |
| 330 |
array( |
| 331 |
'id' => 'switch_position_bottom_left', |
| 332 |
'type' => 'spacing', |
| 333 |
'title' => esc_html__('Margin From Bottom Left', 'darkify'), |
| 334 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Customize default margin from the bottom left of the Floating Switch.', 'darkify') . '</div>', |
| 335 |
'right' => false, |
| 336 |
'top' => false, |
| 337 |
'units' => ['px'], |
| 338 |
'default' => array( |
| 339 |
'bottom' => '40', |
| 340 |
'left' => '40', |
| 341 |
), |
| 342 |
'dependency' => array('dark_mode_switch_position', '==', 'bottom_left'), |
| 343 |
), |
| 344 |
), |
| 345 |
), |
| 346 |
array( |
| 347 |
'id' => 'enable_absolute_position', |
| 348 |
'type' => 'switcher', |
| 349 |
'title' => esc_html__('Absolute Switch Position', 'darkify'), |
| 350 |
'text_on' => esc_html__('Enabled', 'darkify'), |
| 351 |
'text_off' => esc_html__('Disabled', 'darkify'), |
| 352 |
'text_width' => '100', |
| 353 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Enable to make the floating switch scroll from its position with page scrolling.', 'darkify') . '</div>', |
| 354 |
), |
| 355 |
array( |
| 356 |
'id' => 'enable_switch_dragging', |
| 357 |
'type' => 'switcher', |
| 358 |
'title' => esc_html__('Draggable Position Change', 'darkify'), |
| 359 |
'text_on' => esc_html__('Enabled', 'darkify'), |
| 360 |
'text_off' => esc_html__('Disabled', 'darkify'), |
| 361 |
'text_width' => '100', |
| 362 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Allow/Disallow users to change the floating switch position by dragging to where they want.', 'darkify') . '</div>', |
| 363 |
|
| 364 |
// Free-only: dragging is a Pro feature, so the row renders |
| 365 |
// locked with an upgrade prompt. Pro has no such marker. |
| 366 |
'class' => 'switcher_pro_only', |
| 367 |
), |
| 368 |
array( |
| 369 |
'title' => esc_html__('Switch Extra', 'darkify'), |
| 370 |
'type' => 'heading', |
| 371 |
'section_start' => true, |
| 372 |
), |
| 373 |
array( |
| 374 |
'id' => 'enable_switch_attention', |
| 375 |
'type' => 'switcher', |
| 376 |
'title' => esc_html__('Switch Attention Effect', 'darkify'), |
| 377 |
'text_on' => esc_html__('Enabled', 'darkify'), |
| 378 |
'text_off' => esc_html__('Disabled', 'darkify'), |
| 379 |
'text_width' => '100', |
| 380 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Enable an animation to draw visitor attention to the floating dark mode switch.', 'darkify') . '</div>', |
| 381 |
), |
| 382 |
array( |
| 383 |
'id' => 'switch_attention_effect', |
| 384 |
'type' => 'button_set', |
| 385 |
'title' => esc_html__('Attention Effect Style', 'darkify'), |
| 386 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Choose the animation style for the attention effect. Hover pauses the animation.', 'darkify') . '</div>', |
| 387 |
'options' => array( |
| 388 |
'pulse' => esc_html__('Pulse', 'darkify'), |
| 389 |
'radiance' => array('label' => esc_html__('Radiance', 'darkify'), 'disabled' => true), |
| 390 |
'leap' => array('label' => esc_html__('Leap', 'darkify'), 'disabled' => true), |
| 391 |
'swing' => array('label' => esc_html__('Swing', 'darkify'), 'disabled' => true), |
| 392 |
'drift' => array('label' => esc_html__('Drift', 'darkify'), 'disabled' => true), |
| 393 |
'nudge' => array('label' => esc_html__('Nudge', 'darkify'), 'disabled' => true), |
| 394 |
), |
| 395 |
'default' => 'pulse', |
| 396 |
'dependency' => array('enable_switch_attention', '==', 'true'), |
| 397 |
), |
| 398 |
array( |
| 399 |
'id' => 'tooltip_on_floating_switch', |
| 400 |
'type' => 'fieldset', |
| 401 |
'fields' => array( |
| 402 |
array( |
| 403 |
'id' => 'floating_switch_width', |
| 404 |
'type' => 'switcher', |
| 405 |
'title' => esc_html__('Tooltip on Floating Switch', 'darkify'), |
| 406 |
'title_help' => |
| 407 |
'<div class="darkify-info-label">' . |
| 408 |
__('Display a tooltip hint on the dark mode floating switch.', 'darkify') . |
| 409 |
'</div>' . |
| 410 |
'' . |
| 411 |
'', |
| 412 |
'text_on' => esc_html__('Enabled', 'darkify'), |
| 413 |
'text_off' => esc_html__('Disabled', 'darkify'), |
| 414 |
'text_width' => 100, |
| 415 |
'default' => false, |
| 416 |
), |
| 417 |
array( |
| 418 |
'id' => 'tooltip_position', |
| 419 |
'type' => 'button_set', |
| 420 |
'title' => esc_html__('Tooltip Position', 'darkify'), |
| 421 |
'title_help' => |
| 422 |
'<div class="darkify-info-label">' . |
| 423 |
__('Choose where the tooltip should appear relative to the floating switch.', 'darkify') . |
| 424 |
'</div>' . |
| 425 |
'' . |
| 426 |
'', |
| 427 |
'options' => array( |
| 428 |
'left' => esc_html__('Left', 'darkify'), |
| 429 |
'right' => esc_html__('Right', 'darkify'), |
| 430 |
'top' => esc_html__('Top', 'darkify'), |
| 431 |
'bottom' => esc_html__('Bottom', 'darkify'), |
| 432 |
), |
| 433 |
'default' => 'left', |
| 434 |
'dependency' => array('floating_switch_width', '==', 'true'), |
| 435 |
), |
| 436 |
array( |
| 437 |
'id' => 'tooltip_text', |
| 438 |
'type' => 'text', |
| 439 |
'title' => esc_html__('Tooltip Text', 'darkify'), |
| 440 |
'title_help' => |
| 441 |
'<div class="darkify-info-label">' . |
| 442 |
__('Add tooltip text for floating switch toggler.', 'darkify') . |
| 443 |
'</div>' . |
| 444 |
'' . |
| 445 |
'', |
| 446 |
'default' => esc_html__('Toggle Dark Mode', 'darkify'), |
| 447 |
'dependency' => array('floating_switch_width', '==', 'true'), |
| 448 |
), |
| 449 |
|
| 450 |
array( |
| 451 |
'id' => 'tooltip_color', |
| 452 |
'type' => 'color_group', |
| 453 |
'title' => esc_html__('Tooltip Color', 'darkify'), |
| 454 |
'title_help' => |
| 455 |
'<div class="darkify-info-label">' . |
| 456 |
__('Customize the tooltip colors and appearance.', 'darkify') . |
| 457 |
'</div>', |
| 458 |
'options' => array( |
| 459 |
'tooltip_background_color' => esc_html__('Background', 'darkify'), |
| 460 |
'tooltip_text_color' => esc_html__('Color', 'darkify'), |
| 461 |
), |
| 462 |
'default' => array( |
| 463 |
'tooltip_background_color' => '#142434', |
| 464 |
'tooltip_text_color' => '#B0CBE7', |
| 465 |
), |
| 466 |
'dependency' => array('floating_switch_width', '==', 'true'), |
| 467 |
), |
| 468 |
|
| 469 |
), |
| 470 |
), |
| 471 |
array( |
| 472 |
'title' => esc_html__('Switch Visibility', 'darkify'), |
| 473 |
'type' => 'heading', |
| 474 |
'section_start' => true, |
| 475 |
), |
| 476 |
array( |
| 477 |
'id' => 'hide_on_desktop', |
| 478 |
'type' => 'switcher', |
| 479 |
'title' => esc_html__('Hide Dark Mode Switch on Desktop', 'darkify'), |
| 480 |
'title_help' => |
| 481 |
'<div class="darkify-info-label">' . |
| 482 |
__('Hide the dark mode floating switch when users are browsing on a desktop or laptop.', 'darkify') . |
| 483 |
'</div>' . |
| 484 |
'' . |
| 485 |
'', |
| 486 |
|
| 487 |
'text_on' => esc_html__('Yes', 'darkify'), |
| 488 |
'text_off' => esc_html__('No', 'darkify'), |
| 489 |
|
| 490 |
), |
| 491 |
array( |
| 492 |
'id' => 'hide_on_mobile', |
| 493 |
'type' => 'fieldset', |
| 494 |
'fields' => array( |
| 495 |
array( |
| 496 |
'id' => 'hide_dark_mode_on_mobile', |
| 497 |
'type' => 'switcher', |
| 498 |
'title' => esc_html__('Hide Dark Mode on Mobile', 'darkify'), |
| 499 |
'title_help' => |
| 500 |
'<div class="darkify-info-label">' . |
| 501 |
__('Hide the dark mode floating switch when users are browsing on mobile devices.', 'darkify') . |
| 502 |
'</div>' . |
| 503 |
'' . |
| 504 |
'', |
| 505 |
|
| 506 |
'text_on' => esc_html__('Yes', 'darkify'), |
| 507 |
'text_off' => esc_html__('No', 'darkify'), |
| 508 |
|
| 509 |
), |
| 510 |
array( |
| 511 |
'id' => 'type_of_hide_by', |
| 512 |
'type' => 'button_set', |
| 513 |
'title' => esc_html__('Hide Detection Method', 'darkify'), |
| 514 |
|
| 515 |
'title_help' => |
| 516 |
'<div class="darkify-info-label">' . |
| 517 |
__('Choose how mobile devices are detected: by User Agent, by Screen Size, or use Both for maximum accuracy.', 'darkify') . |
| 518 |
'</div>' . |
| 519 |
'' . |
| 520 |
'', |
| 521 |
|
| 522 |
'options' => array( |
| 523 |
'user_agent' => esc_html__('User Agent', 'darkify'), |
| 524 |
'screen_size' => esc_html__('Screen Size', 'darkify'), |
| 525 |
'both' => esc_html__('Both', 'darkify'), |
| 526 |
), |
| 527 |
|
| 528 |
'default' => 'both', |
| 529 |
'dependency' => array('hide_dark_mode_on_mobile', '==', 'true'), |
| 530 |
), |
| 531 |
), |
| 532 |
), |
| 533 |
array( |
| 534 |
'title' => esc_html__('Mobile Switch', 'darkify'), |
| 535 |
'type' => 'heading', |
| 536 |
'section_start' => true, |
| 537 |
), |
| 538 |
array( |
| 539 |
'id' => 'dark_switcher_switch_in_mobile', |
| 540 |
'type' => 'switcher', |
| 541 |
'title' => esc_html__('Different Switch in Mobile', 'darkify'), |
| 542 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Should the Floating Switch be displayed on different in mobile?', 'darkify') . '</div>', |
| 543 |
'text_on' => esc_html__('Yes', 'darkify'), |
| 544 |
'text_off' => esc_html__('No', 'darkify'), |
| 545 |
), |
| 546 |
array( |
| 547 |
'id' => 'enable_dark_switcher_in_mobile', |
| 548 |
'type' => 'image_select', |
| 549 |
'title' => esc_html__('Switch Toggler', 'darkify'), |
| 550 |
'title_help' => |
| 551 |
'<div class="darkify-info-label">' . |
| 552 |
__('Choose the default floating switch toggler.', 'darkify') . |
| 553 |
'</div>' . |
| 554 |
'' . |
| 555 |
'', |
| 556 |
'class' => 'icon_select ', |
| 557 |
'options' => array( |
| 558 |
'orbit' => array( |
| 559 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/orbit.svg', |
| 560 |
'text' => esc_html__('Orbit', 'darkify'), |
| 561 |
'option_demo_url' => '', |
| 562 |
), |
| 563 |
|
| 564 |
'classic' => array( |
| 565 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/classic.svg', |
| 566 |
'text' => esc_html__('Classic', 'darkify'), |
| 567 |
'option_demo_url' => '', |
| 568 |
), |
| 569 |
|
| 570 |
'expand' => array( |
| 571 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/expand.svg', |
| 572 |
'text' => esc_html__('Expand', 'darkify'), |
| 573 |
'option_demo_url' => '', |
| 574 |
), |
| 575 |
|
| 576 |
'inner-moon' => array( |
| 577 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/inner-moon.svg', |
| 578 |
'text' => esc_html__('Inner Moon', 'darkify'), |
| 579 |
'option_demo_url' => '', |
| 580 |
), |
| 581 |
|
| 582 |
'within' => array( |
| 583 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/within.svg', |
| 584 |
'text' => esc_html__('Within', 'darkify'), |
| 585 |
'option_demo_url' => '', |
| 586 |
), |
| 587 |
|
| 588 |
'around' => array( |
| 589 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/around.svg', |
| 590 |
'text' => esc_html__('Around', 'darkify'), |
| 591 |
'option_demo_url' => '', |
| 592 |
'pro_only' => true, |
| 593 |
), |
| 594 |
|
| 595 |
'dark-side' => array( |
| 596 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/dark-side.svg', |
| 597 |
'text' => esc_html__('Dark Side', 'darkify'), |
| 598 |
'option_demo_url' => '', |
| 599 |
'pro_only' => true, |
| 600 |
), |
| 601 |
|
| 602 |
'horizon' => array( |
| 603 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/horizon.svg', |
| 604 |
'text' => esc_html__('Horizon', 'darkify'), |
| 605 |
'option_demo_url' => '', |
| 606 |
'pro_only' => true, |
| 607 |
), |
| 608 |
|
| 609 |
'eclipse' => array( |
| 610 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/eclipse.svg', |
| 611 |
'text' => esc_html__('Eclipse', 'darkify'), |
| 612 |
'option_demo_url' => '', |
| 613 |
'pro_only' => true, |
| 614 |
), |
| 615 |
|
| 616 |
'lightbulb' => array( |
| 617 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/lightbulb.svg', |
| 618 |
'text' => esc_html__('Lightbulb', 'darkify'), |
| 619 |
'option_demo_url' => '', |
| 620 |
'pro_only' => true, |
| 621 |
), |
| 622 |
|
| 623 |
'dark-inner' => array( |
| 624 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/dark-inner.svg', |
| 625 |
'text' => esc_html__('Dark Inner', 'darkify'), |
| 626 |
'option_demo_url' => '', |
| 627 |
'pro_only' => true, |
| 628 |
), |
| 629 |
|
| 630 |
'half-sun' => array( |
| 631 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/half-sun.svg', |
| 632 |
'text' => esc_html__('Half Sun', 'darkify'), |
| 633 |
'option_demo_url' => '', |
| 634 |
'pro_only' => true, |
| 635 |
), |
| 636 |
|
| 637 |
'simple' => array( |
| 638 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/simple.svg', |
| 639 |
'text' => esc_html__('Simple', 'darkify'), |
| 640 |
'option_demo_url' => '', |
| 641 |
'pro_only' => true, |
| 642 |
), |
| 643 |
'duality' => array( |
| 644 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/duality.svg', |
| 645 |
'text' => esc_html__('Duality', 'darkify'), |
| 646 |
'option_demo_url' => '', |
| 647 |
'pro_only' => true, |
| 648 |
), |
| 649 |
'dual' => array( |
| 650 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/dual.svg', |
| 651 |
'text' => esc_html__('Dual', 'darkify'), |
| 652 |
'option_demo_url' => '', |
| 653 |
'pro_only' => true, |
| 654 |
), |
| 655 |
'shift' => array( |
| 656 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/shift.svg', |
| 657 |
'text' => esc_html__('Shift', 'darkify'), |
| 658 |
'option_demo_url' => '', |
| 659 |
'pro_only' => true, |
| 660 |
), |
| 661 |
), |
| 662 |
'default' => 'orbit', |
| 663 |
'dependency' => array('dark_switcher_switch_in_mobile', '==', 'true'), |
| 664 |
), |
| 665 |
array( |
| 666 |
'id' => 'switch_size_in_mobile', |
| 667 |
'type' => 'button_set', |
| 668 |
'title' => esc_html__('Switch Size', 'darkify'), |
| 669 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Choose the size of the floating toggle switch as you need.', 'darkify') . '</div>', |
| 670 |
'options' => array( |
| 671 |
'0.6' => esc_html__('XS', 'darkify'), |
| 672 |
'0.8' => esc_html__('S', 'darkify'), |
| 673 |
'1' => esc_html__('M', 'darkify'), |
| 674 |
'1.2' => esc_html__('L', 'darkify'), |
| 675 |
'1.4' => esc_html__('XL', 'darkify'), |
| 676 |
'1.6' => esc_html__('XXL', 'darkify'), |
| 677 |
'custom' => esc_html__('Custom', 'darkify'), |
| 678 |
), |
| 679 |
'default' => '1', |
| 680 |
'dependency' => array('dark_switcher_switch_in_mobile', '==', 'true'), |
| 681 |
), |
| 682 |
array( |
| 683 |
'id' => 'switch_size_custom_in_mobile', |
| 684 |
'type' => 'slider', |
| 685 |
'title' => esc_html__('Custom Switch Size', 'darkify'), |
| 686 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Scale in percentage relative to normal size.', 'darkify') . '</div>', |
| 687 |
'default' => '100', |
| 688 |
'min' => 40, |
| 689 |
'max' => 300, |
| 690 |
'dependency' => array('switch_size_in_mobile|dark_switcher_switch_in_mobile', '==|==', 'custom|true') |
| 691 |
), |
| 692 |
array( |
| 693 |
'id' => 'switch_background_in_mobile', |
| 694 |
'type' => 'color_group', |
| 695 |
'title' => esc_html__('Switch Background', 'darkify'), |
| 696 |
'title_help' => '<div class="darkify-info-label">' . |
| 697 |
__('Customize the floating switch background to match your design.', 'darkify') . |
| 698 |
'</div>', |
| 699 |
'options' => array( |
| 700 |
'switch_light_mode_bg' => esc_html__('Light Mode', 'darkify'), |
| 701 |
'switch_dark_mode_bg' => esc_html__('Dark Mode', 'darkify'), |
| 702 |
), |
| 703 |
'default' => array( |
| 704 |
'switch_light_mode_bg' => '#121116', |
| 705 |
'switch_dark_mode_bg' => '#ffffff', |
| 706 |
), |
| 707 |
'dependency' => array('dark_switcher_switch_in_mobile', '==', 'true'), |
| 708 |
), |
| 709 |
array( |
| 710 |
'id' => 'switch_icon_color_in_mobile', |
| 711 |
'type' => 'color_group', |
| 712 |
'title' => esc_html__('Switch Icon Color', 'darkify'), |
| 713 |
'title_help' => '<div class="darkify-info-label">' . |
| 714 |
__('Customize the floating switch icon color as needed.', 'darkify') . |
| 715 |
'</div>', |
| 716 |
|
| 717 |
'options' => array( |
| 718 |
'switch_light_mode_color' => esc_html__('Light Mode', 'darkify'), |
| 719 |
'switch_dark_mode_color' => esc_html__('Dark Mode', 'darkify'), |
| 720 |
), |
| 721 |
'default' => array( |
| 722 |
'switch_light_mode_color' => '#ffffff', |
| 723 |
'switch_dark_mode_color' => '#121116', |
| 724 |
), |
| 725 |
'dependency' => array('dark_switcher_switch_in_mobile', '==', 'true'), |
| 726 |
), |
| 727 |
array( |
| 728 |
'id' => 'switch_border_in_mobile', |
| 729 |
'type' => 'border', |
| 730 |
'title' => esc_html__('Switch Border', 'darkify'), |
| 731 |
'title_help' => |
| 732 |
'<div class="darkify-info-label">' . |
| 733 |
__('Customize the floating switch border and border radius.', 'darkify') . |
| 734 |
'</div>' . |
| 735 |
'' . |
| 736 |
'', |
| 737 |
'color' => true, |
| 738 |
'style' => false, |
| 739 |
'color2' => false, |
| 740 |
// Light (`color`) / dark (`color3`) border colours — see the |
| 741 |
// desktop Switch Border field above. |
| 742 |
'color3' => true, |
| 743 |
'all' => true, |
| 744 |
'radius' => true, |
| 745 |
'default' => array( |
| 746 |
'color' => '#121116', |
| 747 |
'color3' => '#ffffff', |
| 748 |
'all' => 0, |
| 749 |
'radius' => 7, |
| 750 |
), |
| 751 |
'dependency' => array('dark_switcher_switch_in_mobile', '==', 'true'), |
| 752 |
), |
| 753 |
|
| 754 |
array( |
| 755 |
'id' => 'enable_switch_attention_in_mobile', |
| 756 |
'type' => 'switcher', |
| 757 |
'title' => esc_html__('Switch Attention Effect', 'darkify'), |
| 758 |
'text_on' => esc_html__('Enabled', 'darkify'), |
| 759 |
'text_off' => esc_html__('Disabled', 'darkify'), |
| 760 |
'text_width' => '100', |
| 761 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Enable an animation to draw visitor attention to the floating dark mode switch.', 'darkify') . '</div>', |
| 762 |
'dependency' => array('dark_switcher_switch_in_mobile', '==', 'true'), |
| 763 |
), |
| 764 |
array( |
| 765 |
'id' => 'switch_attention_effect_in_mobile', |
| 766 |
'type' => 'button_set', |
| 767 |
'title' => esc_html__('Attention Effect Style', 'darkify'), |
| 768 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Choose the animation style for the attention effect. Hover pauses the animation.', 'darkify') . '</div>', |
| 769 |
'options' => array( |
| 770 |
'pulse' => esc_html__('Pulse', 'darkify'), |
| 771 |
'radiance' => array('label' => esc_html__('Radiance', 'darkify'), 'disabled' => true), |
| 772 |
'leap' => array('label' => esc_html__('Leap', 'darkify'), 'disabled' => true), |
| 773 |
'swing' => array('label' => esc_html__('Swing', 'darkify'), 'disabled' => true), |
| 774 |
'drift' => array('label' => esc_html__('Drift', 'darkify'), 'disabled' => true), |
| 775 |
'nudge' => array('label' => esc_html__('Nudge', 'darkify'), 'disabled' => true), |
| 776 |
), |
| 777 |
'default' => 'pulse', |
| 778 |
'dependency' => array('enable_switch_attention_in_mobile|dark_switcher_switch_in_mobile', '==|==', 'true|true'), |
| 779 |
), |
| 780 |
array( |
| 781 |
'id' => 'different_switch_in_mobile', |
| 782 |
'type' => 'fieldset', |
| 783 |
'fields' => array( |
| 784 |
array( |
| 785 |
'id' => 'switch_position_different_in_mobile', |
| 786 |
'type' => 'switcher', |
| 787 |
'title' => esc_html__('Different Switch Position in Mobile', 'darkify'), |
| 788 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Should the Floating Switch be displayed on different position in mobile?', 'darkify') . '</div>', |
| 789 |
'text_on' => esc_html__('Yes', 'darkify'), |
| 790 |
'text_off' => esc_html__('No', 'darkify'), |
| 791 |
|
| 792 |
), |
| 793 |
array( |
| 794 |
'id' => 'switch_position_in_mobile', |
| 795 |
'type' => 'position_select', |
| 796 |
'title' => esc_html__('Switch Position in Mobile', 'darkify'), |
| 797 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Choose the screen position where the Floating Switch should be displayed in mobile.', 'darkify') . '</div>', |
| 798 |
'options' => array( |
| 799 |
'bottom_right' => esc_html__('Bottom Right', 'darkify'), |
| 800 |
'bottom_left' => esc_html__('Bottom Left', 'darkify'), |
| 801 |
'top_right' => esc_html__('Top Right', 'darkify'), |
| 802 |
'top_left' => esc_html__('Top Left', 'darkify'), |
| 803 |
), |
| 804 |
|
| 805 |
'default' => 'bottom_right', |
| 806 |
'dependency' => array('switch_position_different_in_mobile', '==', 'true'), |
| 807 |
), |
| 808 |
array( |
| 809 |
'id' => 'switch_position_top_right_in_mobile', |
| 810 |
'type' => 'spacing', |
| 811 |
'title' => esc_html__('Margin From Top Right in Mobile', 'darkify'), |
| 812 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Customize default margin from the top right of the Floating Switch.', 'darkify') . '</div>', |
| 813 |
'left' => false, |
| 814 |
'bottom' => false, |
| 815 |
'units' => ['px'], |
| 816 |
'default' => array( |
| 817 |
'top' => '40', |
| 818 |
'right' => '40', |
| 819 |
), |
| 820 |
'dependency' => array('switch_position_different_in_mobile|switch_position_in_mobile', '==|==', 'true|top_right'), |
| 821 |
), |
| 822 |
array( |
| 823 |
'id' => 'switch_position_top_left_in_mobile', |
| 824 |
'type' => 'spacing', |
| 825 |
'title' => esc_html__('Margin From Top Left in Mobile', 'darkify'), |
| 826 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Customize default margin from the top left of the Floating Switch.', 'darkify') . '</div>', |
| 827 |
'right' => false, |
| 828 |
'bottom' => false, |
| 829 |
'units' => ['px'], |
| 830 |
'default' => array( |
| 831 |
'top' => '40', |
| 832 |
'left' => '40', |
| 833 |
), |
| 834 |
'dependency' => array('switch_position_different_in_mobile|switch_position_in_mobile', '==|==', 'true|top_left'), |
| 835 |
), |
| 836 |
array( |
| 837 |
'id' => 'switch_position_bottom_right_in_mobile', |
| 838 |
'type' => 'spacing', |
| 839 |
'title' => esc_html__('Margin From Bottom Right in Mobile', 'darkify'), |
| 840 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Customize default margin from the bottom right of the Floating Switch.', 'darkify') . '</div>', |
| 841 |
'left' => false, |
| 842 |
'top' => false, |
| 843 |
'units' => ['px'], |
| 844 |
'default' => array( |
| 845 |
'bottom' => '40', |
| 846 |
'right' => '40', |
| 847 |
), |
| 848 |
'dependency' => array('switch_position_different_in_mobile|switch_position_in_mobile', '==|==', 'true|bottom_right'), |
| 849 |
), |
| 850 |
array( |
| 851 |
'id' => 'switch_position_bottom_left_in_mobile', |
| 852 |
'type' => 'spacing', |
| 853 |
'title' => esc_html__('Margin From Bottom Left in Mobile', 'darkify'), |
| 854 |
'title_help' => '<div class="darkify-info-label">' . esc_html__('Customize default margin from the bottom left of the Floating Switch.', 'darkify') . '</div>', |
| 855 |
'right' => false, |
| 856 |
'top' => false, |
| 857 |
'units' => ['px'], |
| 858 |
'default' => array( |
| 859 |
'bottom' => '40', |
| 860 |
'left' => '40', |
| 861 |
), |
| 862 |
'dependency' => array('switch_position_different_in_mobile|switch_position_in_mobile', '==|==', 'true|bottom_left'), |
| 863 |
), |
| 864 |
), |
| 865 |
), |
| 866 |
) |
| 867 |
), |
| 868 |
array( |
| 869 |
'id' => 'other-switches', |
| 870 |
'title' => esc_html__('Other Switches', 'darkify'), |
| 871 |
'icon' => 'icofont-toggle-off', |
| 872 |
'fields' => array( |
| 873 |
// Intro line, rendered plain above the section cards. |
| 874 |
array( |
| 875 |
'type' => 'page_hint', |
| 876 |
'content' => esc_html__('Add dark-mode switches inside menus or anywhere on your site with a shortcode, and register custom elements as switches.', 'darkify'), |
| 877 |
), |
| 878 |
array( |
| 879 |
'title' => esc_html__('Menu Switch', 'darkify'), |
| 880 |
'type' => 'heading', |
| 881 |
'section_start' => true, |
| 882 |
), |
| 883 |
array( |
| 884 |
'id' => 'show_in_menu', |
| 885 |
'type' => 'fieldset', |
| 886 |
// Divide the master toggle from the per-switch group below it. |
| 887 |
'class' => 'fieldset-divided', |
| 888 |
'fields' => array( |
| 889 |
array( |
| 890 |
'id' => 'enable_switch_in_menu', |
| 891 |
'type' => 'switcher', |
| 892 |
'title' => esc_html__('Enable Menu Switch', 'darkify'), |
| 893 |
|
| 894 |
'title_help' => |
| 895 |
'<div class="darkify-info-label">' . |
| 896 |
__('Display a dark mode switch inside a WordPress menu.', 'darkify') . |
| 897 |
'</div>' . |
| 898 |
'' . |
| 899 |
'', |
| 900 |
|
| 901 |
'text_on' => esc_html__('Yes', 'darkify'), |
| 902 |
'text_off' => esc_html__('No', 'darkify'), |
| 903 |
|
| 904 |
), |
| 905 |
array( |
| 906 |
'id' => 'select_menus', |
| 907 |
'type' => 'group', |
| 908 |
'title' => esc_html__('Menu Switches', 'darkify'), |
| 909 |
|
| 910 |
'title_help' => |
| 911 |
'<div class="darkify-info-label">' . |
| 912 |
__('Choose the menu and position for your switch.', 'darkify') . |
| 913 |
'</div>' . |
| 914 |
'' . |
| 915 |
'', |
| 916 |
|
| 917 |
'add_more_text' => sprintf( |
| 918 |
/* translators: %s: URL to the Darkify Pro pricing page. */ |
| 919 |
__( |
| 920 |
'Want to use the switch in an unlimited number of menus? <a target="_blank" href="%s"><strong>Upgrade to Pro</strong></a>.', |
| 921 |
'darkify' |
| 922 |
), |
| 923 |
esc_url(DARKIFY_DEMO_URL . 'pricing/?ref=1') |
| 924 |
), |
| 925 |
|
| 926 |
// Same accordion-title pattern as Pro (menu name + placement |
| 927 |
// once chosen, numbered "Menu Switch #1" fallback before |
| 928 |
// that) — kept in sync even though Free is capped at one row. |
| 929 |
'accordion_title_number' => false, |
| 930 |
'accordion_title_auto' => true, |
| 931 |
'accordion_title_by' => array('switch_in_menu_location', 'select_menu_position'), |
| 932 |
'accordion_title_by_prefix' => ' — ', |
| 933 |
'accordion_title_require' => 'switch_in_menu_location', |
| 934 |
'row_title' => esc_html__('Menu Switch', 'darkify'), |
| 935 |
'class' => 'select_menus', |
| 936 |
'empty_title' => esc_html__('No menu switches configured', 'darkify'), |
| 937 |
'empty_desc' => esc_html__('Add a switch and choose the WordPress menu where it should appear.', 'darkify'), |
| 938 |
'button_title' => esc_html__('Add Menu Switch', 'darkify'), |
| 939 |
'max' => 1, |
| 940 |
|
| 941 |
'fields' => array( |
| 942 |
array( |
| 943 |
'id' => 'switch_in_menu_location', |
| 944 |
'type' => 'select', |
| 945 |
'class' => 'select_menu_location', |
| 946 |
'title' => esc_html__('Menu', 'darkify'), |
| 947 |
'title_help' => |
| 948 |
'<div class="darkify-info-label">' . |
| 949 |
esc_html__('Choose the WordPress menu where this switch should appear.', 'darkify') . |
| 950 |
'</div>' . |
| 951 |
'' . |
| 952 |
'', |
| 953 |
'placeholder' => esc_html__('Choose a menu…', 'darkify'), |
| 954 |
'empty_message' => esc_html__( |
| 955 |
'You have not created a menu yet. If you are using a Full Site Editing (FSE) theme, copy the shortcode below and paste it where you want the switch to appear.', |
| 956 |
'darkify' |
| 957 |
), |
| 958 |
'options' => 'menus', |
| 959 |
), |
| 960 |
array( |
| 961 |
'id' => 'select_menu_position', |
| 962 |
'type' => 'button_set', |
| 963 |
'title' => esc_html__('Switch Placement', 'darkify'), |
| 964 |
'title_help' => |
| 965 |
'<div class="darkify-info-label">' . |
| 966 |
esc_html__('Choose whether the dark mode switch appears at the beginning or end of the selected menu.', 'darkify') . |
| 967 |
'</div>' . |
| 968 |
'' . |
| 969 |
'', |
| 970 |
|
| 971 |
// Options relabeled for clarity; keys unchanged |
| 972 |
// ('after'/'before') so existing saved rows keep |
| 973 |
// their exact stored placement. |
| 974 |
'options' => array( |
| 975 |
'after' => esc_html__('End of Menu', 'darkify'), |
| 976 |
'before' => esc_html__('Beginning of Menu', 'darkify'), |
| 977 |
), |
| 978 |
|
| 979 |
'default' => 'after', |
| 980 |
), |
| 981 |
array( |
| 982 |
'id' => 'darkify_menu_shortcode_helper', |
| 983 |
'type' => 'menu_switch_shortcode', |
| 984 |
'title' => esc_html__('Shortcode', 'darkify'), |
| 985 |
'title_help' => |
| 986 |
'<div class="darkify-info-label">' . |
| 987 |
__('Automatically generated from the settings above.', 'darkify') . |
| 988 |
'</div>' . |
| 989 |
'' . |
| 990 |
'', |
| 991 |
'default' => '[darkify switch="1"]', |
| 992 |
), |
| 993 |
), |
| 994 |
'dependency' => array('enable_switch_in_menu', '==', 'true'), |
| 995 |
), |
| 996 |
), |
| 997 |
), |
| 998 |
array( |
| 999 |
'title' => esc_html__('Shortcode', 'darkify'), |
| 1000 |
'type' => 'heading', |
| 1001 |
'section_start' => true, |
| 1002 |
), |
| 1003 |
array( |
| 1004 |
'id' => 'shortcode_use_global_switch_settings', |
| 1005 |
'type' => 'switcher', |
| 1006 |
'title' => esc_html__('Use Global Switch Settings', 'darkify'), |
| 1007 |
'title_help' => |
| 1008 |
'<div class="darkify-info-label">' . |
| 1009 |
__('Use the same switch style, size, and colors as your site-wide floating switch. Turn this off to customize this shortcode independently, without changing the floating switch.', 'darkify') . |
| 1010 |
'</div>', |
| 1011 |
'text_on' => esc_html__('Yes', 'darkify'), |
| 1012 |
'text_off' => esc_html__('No', 'darkify'), |
| 1013 |
// Off by default so the customizable style controls are visible. |
| 1014 |
'default' => false, |
| 1015 |
), |
| 1016 |
// Mirrors the Floating Switch's own style controls (same field |
| 1017 |
// ids, nested here) so `buildSwitcherShortcode()` on the React |
| 1018 |
// side can generate this shortcode's styling exactly the same |
| 1019 |
// way it does for the global one. `pro_only` flags on the style |
| 1020 |
// options match the Floating Switch tab's own list so this panel |
| 1021 |
// can't be used to bypass the tier gate on switch styles. |
| 1022 |
array( |
| 1023 |
'id' => 'shortcode_custom_switch_settings', |
| 1024 |
'type' => 'fieldset', |
| 1025 |
'title' => esc_html__('Custom Switch Style', 'darkify'), |
| 1026 |
'title_help' => |
| 1027 |
'<div class="darkify-info-label">' . |
| 1028 |
__('These settings apply only to this shortcode, not your site-wide floating switch.', 'darkify') . |
| 1029 |
'</div>', |
| 1030 |
'dependency' => array('shortcode_use_global_switch_settings', '==', 'false'), |
| 1031 |
'fields' => array( |
| 1032 |
array( |
| 1033 |
'id' => 'enable_dark_switcher', |
| 1034 |
'type' => 'image_select', |
| 1035 |
'title' => esc_html__('Switch Style', 'darkify'), |
| 1036 |
'class' => 'icon_select ', |
| 1037 |
'options' => array( |
| 1038 |
'orbit' => array( |
| 1039 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/orbit.svg', |
| 1040 |
'text' => esc_html__('Orbit', 'darkify'), |
| 1041 |
'option_demo_url' => '', |
| 1042 |
), |
| 1043 |
'classic' => array( |
| 1044 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/classic.svg', |
| 1045 |
'text' => esc_html__('Classic', 'darkify'), |
| 1046 |
'option_demo_url' => '', |
| 1047 |
), |
| 1048 |
'expand' => array( |
| 1049 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/expand.svg', |
| 1050 |
'text' => esc_html__('Expand', 'darkify'), |
| 1051 |
'option_demo_url' => '', |
| 1052 |
), |
| 1053 |
'inner-moon' => array( |
| 1054 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/inner-moon.svg', |
| 1055 |
'text' => esc_html__('Inner Moon', 'darkify'), |
| 1056 |
'option_demo_url' => '', |
| 1057 |
), |
| 1058 |
'within' => array( |
| 1059 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/within.svg', |
| 1060 |
'text' => esc_html__('Within', 'darkify'), |
| 1061 |
'option_demo_url' => '', |
| 1062 |
), |
| 1063 |
'around' => array( |
| 1064 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/around.svg', |
| 1065 |
'text' => esc_html__('Around', 'darkify'), |
| 1066 |
'option_demo_url' => '', |
| 1067 |
'pro_only' => true, |
| 1068 |
), |
| 1069 |
'dark-side' => array( |
| 1070 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/dark-side.svg', |
| 1071 |
'text' => esc_html__('Dark Side', 'darkify'), |
| 1072 |
'option_demo_url' => '', |
| 1073 |
'pro_only' => true, |
| 1074 |
), |
| 1075 |
'horizon' => array( |
| 1076 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/horizon.svg', |
| 1077 |
'text' => esc_html__('Horizon', 'darkify'), |
| 1078 |
'option_demo_url' => '', |
| 1079 |
'pro_only' => true, |
| 1080 |
), |
| 1081 |
'eclipse' => array( |
| 1082 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/eclipse.svg', |
| 1083 |
'text' => esc_html__('Eclipse', 'darkify'), |
| 1084 |
'option_demo_url' => '', |
| 1085 |
'pro_only' => true, |
| 1086 |
), |
| 1087 |
'lightbulb' => array( |
| 1088 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/lightbulb.svg', |
| 1089 |
'text' => esc_html__('Lightbulb', 'darkify'), |
| 1090 |
'option_demo_url' => '', |
| 1091 |
'pro_only' => true, |
| 1092 |
), |
| 1093 |
'dark-inner' => array( |
| 1094 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/dark-inner.svg', |
| 1095 |
'text' => esc_html__('Dark Inner', 'darkify'), |
| 1096 |
'option_demo_url' => '', |
| 1097 |
'pro_only' => true, |
| 1098 |
), |
| 1099 |
'half-sun' => array( |
| 1100 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/half-sun.svg', |
| 1101 |
'text' => esc_html__('Half Sun', 'darkify'), |
| 1102 |
'option_demo_url' => '', |
| 1103 |
'pro_only' => true, |
| 1104 |
), |
| 1105 |
'simple' => array( |
| 1106 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/simple.svg', |
| 1107 |
'text' => esc_html__('Simple', 'darkify'), |
| 1108 |
'option_demo_url' => '', |
| 1109 |
'pro_only' => true, |
| 1110 |
), |
| 1111 |
'duality' => array( |
| 1112 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/duality.svg', |
| 1113 |
'text' => esc_html__('Duality', 'darkify'), |
| 1114 |
'option_demo_url' => '', |
| 1115 |
'pro_only' => true, |
| 1116 |
), |
| 1117 |
'dual' => array( |
| 1118 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/dual.svg', |
| 1119 |
'text' => esc_html__('Dual', 'darkify'), |
| 1120 |
'option_demo_url' => '', |
| 1121 |
'pro_only' => true, |
| 1122 |
), |
| 1123 |
'shift' => array( |
| 1124 |
'image' => DARKIFY_DIR_URL . 'src/Admin/assets/images/shift.svg', |
| 1125 |
'text' => esc_html__('Shift', 'darkify'), |
| 1126 |
'option_demo_url' => '', |
| 1127 |
'pro_only' => true, |
| 1128 |
), |
| 1129 |
), |
| 1130 |
'default' => 'orbit', |
| 1131 |
), |
| 1132 |
array( |
| 1133 |
'id' => 'switch_size', |
| 1134 |
'type' => 'button_set', |
| 1135 |
'title' => esc_html__('Switch Size', 'darkify'), |
| 1136 |
'options' => array( |
| 1137 |
'0.6' => esc_html__('XS', 'darkify'), |
| 1138 |
'0.8' => esc_html__('S', 'darkify'), |
| 1139 |
'1' => esc_html__('M', 'darkify'), |
| 1140 |
'1.2' => esc_html__('L', 'darkify'), |
| 1141 |
'1.4' => esc_html__('XL', 'darkify'), |
| 1142 |
'1.6' => esc_html__('XXL', 'darkify'), |
| 1143 |
'custom' => esc_html__('Custom', 'darkify'), |
| 1144 |
), |
| 1145 |
'default' => '1', |
| 1146 |
), |
| 1147 |
array( |
| 1148 |
'id' => 'switch_size_custom', |
| 1149 |
'type' => 'slider', |
| 1150 |
'title' => esc_html__('Custom Switch Size', 'darkify'), |
| 1151 |
'title_help' => '<div class="darkify-info-desc">' . esc_html__('Scale in percentage relative to normal size.', 'darkify') . '</div>', |
| 1152 |
'default' => '100', |
| 1153 |
'min' => 40, |
| 1154 |
'max' => 300, |
| 1155 |
'dependency' => array('switch_size', '==', 'custom'), |
| 1156 |
), |
| 1157 |
array( |
| 1158 |
'id' => 'switch_background', |
| 1159 |
'type' => 'color_group', |
| 1160 |
'title' => esc_html__('Switch Background', 'darkify'), |
| 1161 |
'options' => array( |
| 1162 |
'switch_light_mode_bg' => esc_html__('Light Mode', 'darkify'), |
| 1163 |
'switch_dark_mode_bg' => esc_html__('Dark Mode', 'darkify'), |
| 1164 |
), |
| 1165 |
'default' => array( |
| 1166 |
'switch_light_mode_bg' => '#121116', |
| 1167 |
'switch_dark_mode_bg' => '#ffffff', |
| 1168 |
), |
| 1169 |
), |
| 1170 |
array( |
| 1171 |
'id' => 'switch_icon_color', |
| 1172 |
'type' => 'color_group', |
| 1173 |
'title' => esc_html__('Switch Icon Color', 'darkify'), |
| 1174 |
'options' => array( |
| 1175 |
'switch_light_mode_color' => esc_html__('Light Mode', 'darkify'), |
| 1176 |
'switch_dark_mode_color' => esc_html__('Dark Mode', 'darkify'), |
| 1177 |
), |
| 1178 |
'default' => array( |
| 1179 |
'switch_light_mode_color' => '#ffffff', |
| 1180 |
'switch_dark_mode_color' => '#121116', |
| 1181 |
), |
| 1182 |
'dependency' => array('enable_dark_switcher', 'not-any', 'duality,dual,shift'), |
| 1183 |
), |
| 1184 |
array( |
| 1185 |
'id' => 'switch_text_color', |
| 1186 |
'type' => 'color_group', |
| 1187 |
'title' => esc_html__('Switch Text Color', 'darkify'), |
| 1188 |
'options' => array( |
| 1189 |
'switch_text_light_mode_color' => esc_html__('Light Mode', 'darkify'), |
| 1190 |
'switch_text_dark_mode_color' => esc_html__('Dark Mode', 'darkify'), |
| 1191 |
), |
| 1192 |
'default' => array( |
| 1193 |
'switch_text_light_mode_color' => '#121116', |
| 1194 |
'switch_text_dark_mode_color' => '#ffffff', |
| 1195 |
), |
| 1196 |
'dependency' => array('enable_dark_switcher', 'any', 'dual'), |
| 1197 |
), |
| 1198 |
array( |
| 1199 |
'id' => 'switch_border', |
| 1200 |
'type' => 'border', |
| 1201 |
'title' => esc_html__('Switch Border', 'darkify'), |
| 1202 |
'color' => true, |
| 1203 |
'style' => false, |
| 1204 |
'color2' => false, |
| 1205 |
'color3' => true, |
| 1206 |
'all' => true, |
| 1207 |
'radius' => true, |
| 1208 |
'default' => array( |
| 1209 |
'color' => '#121116', |
| 1210 |
'color3' => '#ffffff', |
| 1211 |
'all' => 0, |
| 1212 |
'radius' => 7, |
| 1213 |
), |
| 1214 |
), |
| 1215 |
), |
| 1216 |
), |
| 1217 |
array( |
| 1218 |
'id' => 'switcher_shortcode', |
| 1219 |
'type' => 'switcher_shortcode', |
| 1220 |
'title' => esc_html__('Dark Mode Switch Shortcode', 'darkify'), |
| 1221 |
'title_help' => '<div class="darkify-info-content">' . |
| 1222 |
__('Use the shortcode below to display a dark mode switch anywhere WordPress shortcodes are supported.', 'darkify') . |
| 1223 |
'</div>' . |
| 1224 |
'' . |
| 1225 |
'', |
| 1226 |
'dependency' => array('enable_dark_switcher', 'not-any', 'orbit,duality,dual,shift'), |
| 1227 |
), |
| 1228 |
array( |
| 1229 |
'id' => 'switcher_shortcode_v2', |
| 1230 |
'type' => 'switcher_shortcode_v2', |
| 1231 |
'title' => esc_html__('Dark Mode Switch Shortcode', 'darkify'), |
| 1232 |
'title_help' => '<div class="darkify-info-content">' . |
| 1233 |
__('Use the shortcode below to display a dark mode switch anywhere WordPress shortcodes are supported.', 'darkify') . |
| 1234 |
'</div>' . |
| 1235 |
'' . |
| 1236 |
'', |
| 1237 |
'dependency' => array('enable_dark_switcher', 'any', 'orbit,duality,dual,shift'), |
| 1238 |
), |
| 1239 |
array( |
| 1240 |
'title' => esc_html__('Custom Switch Selectors', 'darkify'), |
| 1241 |
'type' => 'heading', |
| 1242 |
'section_start' => true, |
| 1243 |
), |
| 1244 |
array( |
| 1245 |
'id' => 'alternative_dark_mode_switcher', |
| 1246 |
'type' => 'text', |
| 1247 |
'title' => esc_html__('Alternative Switch Selectors', 'darkify'), |
| 1248 |
'title_help' => |
| 1249 |
'<div class="darkify-info-label">' . |
| 1250 |
__('Enter CSS selectors for elements that should toggle dark mode when clicked. Separate multiple selectors with commas.', 'darkify') . |
| 1251 |
'</div>' . |
| 1252 |
'' . |
| 1253 |
'', |
| 1254 |
'placeholder' => esc_html__('e.g., .my-dark-switch, #dark-mode-toggle', 'darkify'), |
| 1255 |
'validate' => 'css_selectors', |
| 1256 |
), |
| 1257 |
) |
| 1258 |
), |
| 1259 |
) |
| 1260 |
), |
| 1261 |
) |
| 1262 |
) |
| 1263 |
); |
| 1264 |
} |
| 1265 |
} |
| 1266 |
|