PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 1.5.3
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v1.5.3
2.1.3 2.1.2 2.1.1 2.1.0 2.0.4 2.0.3 2.0.2 2.0.1 2.0.0 1.5.5 1.5.4 1.5.3 1.5.2 1.5.1 1.5.0 trunk 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.3.0 All 57 releases
darkify / src / Admin / Views / SwitcherStyle.php

SwitcherStyle.php in Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) 1.5.3, at src/Admin/Views/SwitcherStyle.php

743 lines 56.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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\Framework\Classes\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 'title' => esc_html__('SWITCHES', 'darkify'),
32 'icon' => 'icofont-toggle-on',
33 'fields' => array(
34
35 array(
36 'type' => 'section_tab',
37 'tabs' => array(
38 array(
39 'title' => esc_html__('Floating Switch', 'darkify'),
40 'icon' => 'icofont-ui-theme',
41 'fields' => array(
42 array(
43 'id' => 'enable_dark_switcher',
44 'type' => 'image_select',
45 'title' => esc_html__('Switch Toggler', 'darkify'),
46 'title_help' =>
47 '<div class="darkify-info-label">' .
48 __('Choose the default floating switch toggler.', 'darkify') .
49 '</div>' .
50 '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'switches/#switchers') . '" target="_blank" rel="noopener noreferrer">' .
51 esc_html__('Live Demo', 'darkify') .
52 '</a>' .
53 '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'switcher/#switcher-customization') . '" target="_blank" rel="noopener noreferrer">' .
54 esc_html__('Open Docs', 'darkify') .
55 '</a>',
56 'class' => 'icon_select ',
57 'options' => array(
58 'classic' => array(
59 'image' => DARKIFY_DIR_URL . 'src/Admin/Framework/assets/images/classic.svg',
60 'text' => esc_html__('Classic', 'darkify'),
61 'option_demo_url' => '',
62 ),
63
64 'expand' => array(
65 'image' => DARKIFY_DIR_URL . 'src/Admin/Framework/assets/images/expand.svg',
66 'text' => esc_html__('Expand', 'darkify'),
67 'option_demo_url' => '',
68 ),
69
70 'inner-moon' => array(
71 'image' => DARKIFY_DIR_URL . 'src/Admin/Framework/assets/images/inner-moon.svg',
72 'text' => esc_html__('Inner Moon', 'darkify'),
73 'option_demo_url' => '',
74 ),
75
76 'within' => array(
77 'image' => DARKIFY_DIR_URL . 'src/Admin/Framework/assets/images/within.svg',
78 'text' => esc_html__('Within', 'darkify'),
79 'option_demo_url' => '',
80 ),
81 'orbit' => array(
82 'image' => DARKIFY_DIR_URL . 'src/Admin/Framework/assets/images/orbit.svg',
83 'text' => esc_html__('Orbit', 'darkify'),
84 'option_demo_url' => '',
85 ),
86
87 'around' => array(
88 'image' => DARKIFY_DIR_URL . 'src/Admin/Framework/assets/images/around.svg',
89 'text' => esc_html__('Around', 'darkify'),
90 'option_demo_url' => '',
91 'pro_only' => true,
92 ),
93
94 'dark-side' => array(
95 'image' => DARKIFY_DIR_URL . 'src/Admin/Framework/assets/images/dark-side.svg',
96 'text' => esc_html__('Dark Side', 'darkify'),
97 'option_demo_url' => '',
98 'pro_only' => true,
99 ),
100
101 'horizon' => array(
102 'image' => DARKIFY_DIR_URL . 'src/Admin/Framework/assets/images/horizon.svg',
103 'text' => esc_html__('Horizon', 'darkify'),
104 'option_demo_url' => '',
105 'pro_only' => true,
106 ),
107
108 'eclipse' => array(
109 'image' => DARKIFY_DIR_URL . 'src/Admin/Framework/assets/images/eclipse.svg',
110 'text' => esc_html__('Eclipse', 'darkify'),
111 'option_demo_url' => '',
112 'pro_only' => true,
113 ),
114
115 'lightbulb' => array(
116 'image' => DARKIFY_DIR_URL . 'src/Admin/Framework/assets/images/lightbulb.svg',
117 'text' => esc_html__('Lightbulb', 'darkify'),
118 'option_demo_url' => '',
119 'pro_only' => true,
120 ),
121
122 'dark-inner' => array(
123 'image' => DARKIFY_DIR_URL . 'src/Admin/Framework/assets/images/dark-inner.svg',
124 'text' => esc_html__('Dark Inner', 'darkify'),
125 'option_demo_url' => '',
126 'pro_only' => true,
127 ),
128
129 'half-sun' => array(
130 'image' => DARKIFY_DIR_URL . 'src/Admin/Framework/assets/images/half-sun.svg',
131 'text' => esc_html__('Half Sun', 'darkify'),
132 'option_demo_url' => '',
133 'pro_only' => true,
134 ),
135
136 'simple' => array(
137 'image' => DARKIFY_DIR_URL . 'src/Admin/Framework/assets/images/simple.svg',
138 'text' => esc_html__('Simple', 'darkify'),
139 'option_demo_url' => '',
140 'pro_only' => true,
141 ),
142 'duality' => array(
143 'image' => DARKIFY_DIR_URL . 'src/Admin/Framework/assets/images/duality.svg',
144 'text' => esc_html__('Duality', 'darkify'),
145 'option_demo_url' => '',
146 'pro_only' => true,
147 ),
148 'dual' => array(
149 'image' => DARKIFY_DIR_URL . 'src/Admin/Framework/assets/images/dual.svg',
150 'text' => esc_html__('Dual', 'darkify'),
151 'option_demo_url' => '',
152 'pro_only' => true,
153 ),
154 'shift' => array(
155 'image' => DARKIFY_DIR_URL . 'src/Admin/Framework/assets/images/shift.svg',
156 'text' => esc_html__('Shift', 'darkify'),
157 'option_demo_url' => '',
158 'pro_only' => true,
159 ),
160 ),
161 'default' => 'classic',
162 ),
163 array(
164 'id' => 'switch_size',
165 'type' => 'button_set',
166 'title' => esc_html__('Switch Size', 'darkify'),
167 'title_help' => '<div class="darkify-info-label">' . esc_html__('Choose the size of the floating toggle switch as you need.', 'darkify') . '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switchers" target="_blank">' . esc_html__('Live Demo', 'darkify') . '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switch-appearance" target="_blank">' . esc_html__('Open Docs', 'darkify') . '</a>',
168 'options' => array(
169 '0.6' => esc_html__('XS', 'darkify'),
170 '0.8' => esc_html__('S', 'darkify'),
171 '1' => esc_html__('M', 'darkify'),
172 '1.2' => esc_html__('L', 'darkify'),
173 '1.4' => esc_html__('XL', 'darkify'),
174 '1.6' => esc_html__('XXL', 'darkify'),
175 'custom' => esc_html__('Custom', 'darkify'),
176 ),
177 'default' => '1',
178 ),
179 array(
180 'id' => 'switch_size_custom',
181 'type' => 'slider',
182 'title' => esc_html__('Custom Switch Size', 'darkify'),
183 'title_help' => '<div class="darkify-info-label">' . esc_html__('Scale in percentage relative to normal size.', 'darkify') . '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switchers" target="_blank">' . esc_html__('Live Demo', 'darkify') . '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switch-appearance" target="_blank">' . esc_html__('Open Docs', 'darkify') . '</a>',
184 'default' => '100',
185 'min' => 40,
186 'max' => 300,
187 'dependency' => array('switch_size', '==', 'custom')
188 ),
189 array(
190 'id' => 'switch_background',
191 'type' => 'color_group',
192 'title' => esc_html__('Switch Background', 'darkify'),
193 'title_help' => '<div class="darkify-info-label">' .
194 __('Customize the floating switch background to match your design.', 'darkify') .
195 '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switchers" target="_blank" rel="noopener noreferrer">' .
196 __('Live Demo', 'darkify') .
197 '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switch-appearance" target="_blank" rel="noopener noreferrer">' .
198 __('Open Docs', 'darkify') .
199 '</a>',
200 'options' => array(
201 'switch_light_mode_bg' => esc_html__('Light Mode', 'darkify'),
202 'switch_dark_mode_bg' => esc_html__('Dark Mode', 'darkify'),
203 ),
204 'default' => array(
205 'switch_light_mode_bg' => '#121116',
206 'switch_dark_mode_bg' => '#ffffff',
207 )
208 ),
209 array(
210 'id' => 'switch_icon_color',
211 'type' => 'color_group',
212 'title' => esc_html__('Switch Icon Color', 'darkify'),
213 'title_help' => '<div class="darkify-info-label">' .
214 __('Customize the floating switch icon color as needed.', 'darkify') .
215 '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switchers" target="_blank" rel="noopener noreferrer">' .
216 __('Live Demo', 'darkify') .
217 '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switch-appearance" target="_blank" rel="noopener noreferrer">' .
218 __('Open Docs', 'darkify') .
219 '</a>',
220
221 'options' => array(
222 'switch_light_mode_color' => esc_html__('Light Mode', 'darkify'),
223 'switch_dark_mode_color' => esc_html__('Dark Mode', 'darkify'),
224 ),
225 'default' => array(
226 'switch_light_mode_color' => '#ffffff',
227 'switch_dark_mode_color' => '#121116',
228 ),
229 ),
230 array(
231 'id' => 'switch_border',
232 'type' => 'border',
233 'title' => esc_html__('Switch Border', 'darkify'),
234 'title_help' =>
235 '<div class="darkify-info-label">' .
236 __('Customize the floating switch border and border radius.', 'darkify') .
237 '</div>' .
238 '<a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switchers" target="_blank" rel="noopener noreferrer">' .
239 __('Live Demo', 'darkify') .
240 '</a>' .
241 '<a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switch-appearance" target="_blank" rel="noopener noreferrer">' .
242 __('Open Docs', 'darkify') .
243 '</a>',
244 'color' => true,
245 'style' => false,
246 'color2' => false,
247 'all' => true,
248 'radius' => true,
249 'default' => array(
250 'color' => '#121116',
251 'color3' => '#ffffff',
252 'all' => 0,
253 'radius' => 7,
254 ),
255 ),
256
257 array(
258 'id' => 'enable_switch_attention',
259 'type' => 'switcher',
260 'title' => esc_html__('Switch Attention Effect', 'darkify'),
261 'text_on' => esc_html__('Enabled', 'darkify'),
262 'text_off' => esc_html__('Disabled', 'darkify'),
263 'text_width' => '100',
264 'title_help' => '<div class="darkify-info-label">' . esc_html__('Enable an animation to draw visitor attention to the floating dark mode switch.', 'darkify') . '</div>',
265 ),
266 array(
267 'id' => 'switch_attention_effect',
268 'type' => 'button_set',
269 'title' => esc_html__('Attention Effect Style', 'darkify'),
270 'title_help' => '<div class="darkify-info-label">' . esc_html__('Choose the animation style for the attention effect. Hover pauses the animation.', 'darkify') . '</div>',
271 'options' => array(
272 'pulse' => esc_html__('Pulse', 'darkify'),
273 'radiance' => array( 'label' => esc_html__('Radiance', 'darkify'), 'disabled' => true ),
274 'leap' => array( 'label' => esc_html__('Leap', 'darkify'), 'disabled' => true ),
275 'swing' => array( 'label' => esc_html__('Swing', 'darkify'), 'disabled' => true ),
276 'drift' => array( 'label' => esc_html__('Drift', 'darkify'), 'disabled' => true ),
277 'nudge' => array( 'label' => esc_html__('Nudge', 'darkify'), 'disabled' => true ),
278 ),
279 'default' => 'pulse',
280 'dependency' => array('enable_switch_attention', '==', 'true'),
281 ),
282
283 array(
284 'title' => esc_html__('Switch Extra', 'darkify'),
285 'type' => 'heading',
286 ),
287 array(
288 'id' => 'tooltip_on_floating_switch',
289 'type' => 'fieldset',
290 'fields' => array(
291 array(
292 'id' => 'floating_switch_width',
293 'type' => 'switcher',
294 'title' => esc_html__('Tooltip on Floating Switch', 'darkify'),
295 'title_help' =>
296 '<div class="darkify-info-label">' .
297 __('Display a tooltip hint on the dark mode floating switch.', 'darkify') .
298 '</div>' .
299 '<a class="tooltip_btn_primary" href="' . esc_url(DARKIFY_DEMO_URL . 'switches/#custom_switches') . '" target="_blank" rel="noopener noreferrer">' .
300 __('Live Demo', 'darkify') .
301 '</a>' .
302 '<a class="tooltip_btn_secondary" href="' . esc_url(DARKIFY_DOCS_URL . 'switcher/#tooltips') . '" target="_blank" rel="noopener noreferrer">' .
303 __('Open Docs', 'darkify') .
304 '</a>',
305 'text_on' => esc_html__('Enabled', 'darkify'),
306 'text_off' => esc_html__('Disabled', 'darkify'),
307 'text_width' => 100,
308 'default' => false,
309 ),
310 array(
311 'id' => 'tooltip_position',
312 'type' => 'button_set',
313 'title' => esc_html__('Tooltip Position', 'darkify'),
314 'title_help' =>
315 '<div class="darkify-info-label">' .
316 __('Choose where the tooltip should appear relative to the floating switch.', 'darkify') .
317 '</div>' .
318 '<a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#custom_switches" target="_blank">' .
319 __('Live Demo', 'darkify') .
320 '</a>' .
321 '<a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#tooltips" target="_blank">' .
322 __('Open Docs', 'darkify') .
323 '</a>',
324 'options' => array(
325 'left' => esc_html__('Left', 'darkify'),
326 'right' => esc_html__('Right', 'darkify'),
327 'top' => esc_html__('Top', 'darkify'),
328 'bottom' => esc_html__('Bottom', 'darkify'),
329 ),
330 'default' => 'left',
331 'dependency' => array('floating_switch_width', '==', 'true'),
332 ),
333 array(
334 'id' => 'tooltip_text',
335 'type' => 'text',
336 'title' => esc_html__('Tooltip Text', 'darkify'),
337 'title_help' =>
338 '<div class="darkify-info-label">' .
339 __('Add tooltip text for floating switch toggler.', 'darkify') .
340 '</div>' .
341 '<a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switchers" target="_blank">' .
342 __('Live Demo', 'darkify') .
343 '</a>' .
344 '<a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switcher-customization" target="_blank">' .
345 __('Open Docs', 'darkify') .
346 '</a>',
347 'default' => esc_html__('Toggle Dark Mode', 'darkify'),
348 'dependency' => array('floating_switch_width', '==', 'true'),
349 ),
350
351 array(
352 'id' => 'tooltip_color',
353 'type' => 'color_group',
354 'title' => esc_html__('Tooltip Color', 'darkify'),
355 'title_help' =>
356 '<div class="darkify-info-label">' .
357 __('Customize the tooltip colors and appearance.', 'darkify') .
358 '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#custom_switches" target="_blank">' .
359 __('Live Demo', 'darkify') .
360 '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#tooltips" target="_blank">' .
361 __('Open Docs', 'darkify') .
362 '</a>',
363 'options' => array(
364 'tooltip_background_color' => esc_html__('Background', 'darkify'),
365 'tooltip_text_color' => esc_html__('Color', 'darkify'),
366 ),
367 'default' => array(
368 'tooltip_background_color' => '#142434',
369 'tooltip_text_color' => '#B0CBE7',
370 ),
371 'dependency' => array('floating_switch_width', '==', 'true'),
372 ),
373
374 ),
375 ),
376
377 array(
378 'id' => 'switcher_shortcode',
379 'type' => 'switcher_shortcode',
380 'title' => esc_html__('Switcher Shortcode', 'darkify'),
381 'title_help' => '<div class="darkify-info-content">' .
382 __('Copy this shortcode and place it on any page or post to display the switcher. You can customize all values, including Switcher styles 1–5, which are available in the current version of the plugin.', 'darkify') .
383 '</div>' .
384 '<a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#custom_switches" target="_blank" rel="noopener noreferrer">' .
385 __('Live Demo', 'darkify') .
386 '</a>' .
387 '<a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#advanced-options" target="_blank" rel="noopener noreferrer">' .
388 __('Open Docs', 'darkify') .
389 '</a>',
390 'dependency' => array('enable_dark_switcher', 'not-any', 'orbit,duality,dual,shift'),
391 ),
392 array(
393 'id' => 'switcher_shortcode_v2',
394 'type' => 'switcher_shortcode_v2',
395 'title' => esc_html__('Switcher Shortcode', 'darkify'),
396 'title_help' => '<div class="darkify-info-content">' .
397 __('Copy this shortcode and place it on any page or post to display the switcher. You can customize all available options, including switch styles 1–5, which are available in the current version of the plugin.', 'darkify') .
398 '</div>' .
399 '<a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#custom_switches" target="_blank" rel="noopener noreferrer">' .
400 __('Live Demo', 'darkify') .
401 '</a>' .
402 '<a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#advanced-options" target="_blank" rel="noopener noreferrer">' .
403 __('Open Docs', 'darkify') .
404 '</a>',
405 'dependency' => array('enable_dark_switcher', 'any', 'orbit,duality,dual,shift'),
406 ),
407 array(
408 'id' => 'alternative_dark_mode_switcher',
409 'type' => 'text',
410 'title' => esc_html__('Alternative Dark Mode Switch', 'darkify'),
411 'title_help' =>
412 '<div class="darkify-info-label">' .
413 __('Enter comma-separated CSS class or ID selectors to use them as alternative dark mode switches.', 'darkify') .
414 '</div>' .
415 '<a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#custom_switches" target="_blank">' .
416 __('Live Demo', 'darkify') .
417 '</a>' .
418 '<a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#tooltips" target="_blank">' .
419 __('Open Docs', 'darkify') .
420 '</a>',
421 'placeholder' => esc_html__('e.g., .my-dark-switch, #dark-mode-toggle', 'darkify'),
422 ),
423
424 )
425 ),
426 array(
427 'title' => esc_html__('Positioning', 'darkify'),
428 'icon' => 'icofont-hand-drag',
429 'fields' => array(
430 // Switch Position
431 array(
432 'id' => 'switcher_button_position',
433 'type' => 'fieldset',
434 'fields' => array(
435 array(
436 'id' => 'dark_mode_switch_position',
437 'type' => 'button_set',
438 'title' => esc_html__('Switch Position', 'darkify'),
439 'title_help' =>
440 '<div class="darkify-info-label">' .
441 __('Choose the screen position where the floating switch should be displayed.', 'darkify') .
442 '</div>' .
443 '<a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switcher-positioning" target="_blank">' .
444 __('Live Demo', 'darkify') .
445 '</a>' .
446 '<a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switcher-positioning" target="_blank">' .
447 __('Open Docs', 'darkify') .
448 '</a>',
449 'options' => array(
450 'bottom_right' => esc_html__('Bottom Right', 'darkify'),
451 'bottom_left' => esc_html__('Bottom Left', 'darkify'),
452 'top_right' => esc_html__('Top Right', 'darkify'),
453 'top_left' => esc_html__('Top Left', 'darkify'),
454 ),
455 'default' => 'bottom_right',
456 ),
457 array(
458 'id' => 'switch_position_top_right',
459 'type' => 'spacing',
460 'title' => esc_html__('Margin From Top Right', 'darkify'),
461
462 'title_help' =>
463 '<div class="darkify-info-label">' .
464 __('Customize default margin from the top right of the Floating Switch.', 'darkify') .
465 '</div>' .
466 '<a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switcher-positioning" target="_blank">' .
467 __('Live Demo', 'darkify') .
468 '</a>' .
469 '<a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switcher-positioning" target="_blank">' .
470 __('Open Docs', 'darkify') .
471 '</a>',
472
473 'left' => false,
474 'bottom' => false,
475 'units' => ['px'],
476 'default' => array(
477 'top' => '40',
478 'right' => '40',
479 ),
480 'dependency' => array('dark_mode_switch_position', '==', 'top_right'),
481 ),
482 array(
483 'id' => 'switch_position_top_left',
484 'type' => 'spacing',
485 'title' => esc_html__('Margin from Top Left', 'darkify'),
486 'title_help' =>
487 '<div class="darkify-info-label">' .
488 __('Customize the default margin from the top-left position of the floating switch.', 'darkify') .
489 '</div>' .
490 '<a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switcher-positioning" target="_blank">' .
491 __('Live Demo', 'darkify') .
492 '</a>' .
493 '<a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switcher-positioning" target="_blank">' .
494 __('Open Docs', 'darkify') .
495 '</a>',
496
497 'right' => false,
498 'bottom' => false,
499 'units' => ['px'],
500 'default' => array(
501 'top' => '40',
502 'left' => '40',
503 ),
504 'dependency' => array('dark_mode_switch_position', '==', 'top_left'),
505 ),
506 array(
507 'id' => 'switch_position_bottom_right',
508 'type' => 'spacing',
509 'title' => esc_html__('Margin From Bottom Right', 'darkify'),
510
511 'title_help' =>
512 '<div class="darkify-info-label">' .
513 __('Customize the default margin from the bottom-right position of the floating switch.', 'darkify') .
514 '</div>' .
515 '<a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switcher-positioning" target="_blank">' .
516 __('Live Demo', 'darkify') .
517 '</a>' .
518 '<a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switcher-positioning" target="_blank">' .
519 __('Open Docs', 'darkify') .
520 '</a>',
521
522 'left' => false,
523 'top' => false,
524 'units' => ['px'],
525 'default' => array(
526 'bottom' => '40',
527 'right' => '40',
528 ),
529 'dependency' => array('dark_mode_switch_position', '==', 'bottom_right'),
530 ),
531 array(
532 'id' => 'switch_position_bottom_left',
533 'type' => 'spacing',
534 'title' => esc_html__('Margin from Bottom Left', 'darkify'),
535 'title_help' =>
536 '<div class="darkify-info-label">' .
537 __('Customize the default margin from the bottom-left position of the floating switch.', 'darkify') .
538 '</div>' .
539 '<a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switcher-positioning" target="_blank">' .
540 __('Live Demo', 'darkify') .
541 '</a>' .
542 '<a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switcher-positioning" target="_blank">' .
543 __('Open Docs', 'darkify') .
544 '</a>',
545
546 'right' => false,
547 'top' => false,
548 'units' => ['px'],
549 'default' => array(
550 'bottom' => '40',
551 'left' => '40',
552 ),
553 'dependency' => array('dark_mode_switch_position', '==', 'bottom_left'),
554 ),
555 ),
556 ),
557
558 // Different Switch Position in Mobile
559 array(
560 'id' => 'different_switch_in_mobile',
561 'type' => 'fieldset',
562 'fields' => array(
563 array(
564 'id' => 'switch_position_different_in_mobile',
565 'type' => 'switcher',
566 'title' => esc_html__('Different Switch Position on Mobile', 'darkify'),
567 'title_help' =>
568 '<div class="darkify-info-label">' .
569 __('Choose whether the floating switch should be displayed in a different position on mobile devices.', 'darkify') .
570 '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switcher-positioning" target="_blank">' .
571 __('Live Demo', 'darkify') .
572 '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switcher-positioning" target="_blank">' .
573 __('Open Docs', 'darkify') .
574 '</a>',
575
576 'text_on' => esc_html__('Yes', 'darkify'),
577 'text_off' => esc_html__('No', 'darkify'),
578
579 ),
580 array(
581 'id' => 'switch_position_in_mobile',
582 'type' => 'button_set',
583 'title' => esc_html__('Switch Position on Mobile', 'darkify'),
584
585 'title_help' =>
586 '<div class="darkify-info-label">' .
587 __('Choose the screen position where the floating switch should be displayed on mobile devices.', 'darkify') .
588 '</div>' .
589 '<a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switcher-positioning" target="_blank">' .
590 __('Live Demo', 'darkify') .
591 '</a>' .
592 '<a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switcher-positioning" target="_blank">' .
593 __('Open Docs', 'darkify') .
594 '</a>',
595
596 'options' => array(
597 'bottom_right' => esc_html__('Bottom Right', 'darkify'),
598 'bottom_left' => esc_html__('Bottom Left', 'darkify'),
599 'top_right' => esc_html__('Top Right', 'darkify'),
600 'top_left' => esc_html__('Top Left', 'darkify'),
601 ),
602
603 'default' => 'bottom_right',
604 'dependency' => array('switch_position_different_in_mobile', '==', 'true'),
605 ),
606 array(
607 'id' => 'switch_position_top_right_in_mobile',
608 'type' => 'spacing',
609 'title' => esc_html__('Margin from Top Right on Mobile', 'darkify'),
610 'title_help' =>
611 '<div class="darkify-info-label">' .
612 __('Adjust the default margin from the top-right position of the floating switch on mobile devices.', 'darkify') .
613 '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switcher-positioning" target="_blank">' .
614 __('Live Demo', 'darkify') .
615 '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switcher-positioning" target="_blank">' .
616 __('Open Docs', 'darkify') .
617 '</a>',
618
619
620 'left' => false,
621 'bottom' => false,
622 'units' => ['px'],
623 'default' => array(
624 'top' => '40',
625 'right' => '40',
626 ),
627 'dependency' => array('switch_position_different_in_mobile|switch_position_in_mobile', '==|==', 'true|top_right'),
628 ),
629 array(
630 'id' => 'switch_position_top_left_in_mobile',
631 'type' => 'spacing',
632 'title' => esc_html__('Margin from Top Left on Mobile', 'darkify'),
633 'title_help' =>
634 '<div class="darkify-info-label">' .
635 __('Adjust the default margin from the top-left position of the floating switch on mobile devices.', 'darkify') .
636 '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switcher-positioning" target="_blank">' .
637 __('Live Demo', 'darkify') .
638 '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switcher-positioning" target="_blank">' .
639 __('Open Docs', 'darkify') .
640 '</a>',
641
642 'right' => false,
643 'bottom' => false,
644 'units' => ['px'],
645 'default' => array(
646 'top' => '40',
647 'left' => '40',
648 ),
649 'dependency' => array('switch_position_different_in_mobile|switch_position_in_mobile', '==|==', 'true|top_left'),
650 ),
651 array(
652 'id' => 'switch_position_bottom_right_in_mobile',
653 'type' => 'spacing',
654 'title' => esc_html__('Margin from Bottom Right on Mobile', 'darkify'),
655 'title_help' =>
656 '<div class="darkify-info-label">' .
657 __('Adjust the default margin from the bottom-right position of the floating switch on mobile devices.', 'darkify') .
658 '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switcher-positioning" target="_blank">' .
659 __('Live Demo', 'darkify') .
660 '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switcher-positioning" target="_blank">' .
661 __('Open Docs', 'darkify') .
662 '</a>',
663
664 'left' => false,
665 'top' => false,
666 'units' => ['px'],
667 'default' => array(
668 'bottom' => '40',
669 'right' => '40',
670 ),
671 'dependency' => array('switch_position_different_in_mobile|switch_position_in_mobile', '==|==', 'true|bottom_right'),
672 ),
673 array(
674 'id' => 'switch_position_bottom_left_in_mobile',
675 'type' => 'spacing',
676 'title' => esc_html__('Margin from Bottom Left on Mobile', 'darkify'),
677 'title_help' =>
678 '<div class="darkify-info-label">' .
679 __('Adjust the default margin from the bottom-left position of the floating switch on mobile devices.', 'darkify') .
680 '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switcher-positioning" target="_blank">' .
681 __('Live Demo', 'darkify') .
682 '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switcher-positioning" target="_blank">' .
683 __('Open Docs', 'darkify') .
684 '</a>',
685
686 'right' => false,
687 'top' => false,
688 'units' => ['px'],
689 'default' => array(
690 'bottom' => '40',
691 'left' => '40',
692 ),
693 'dependency' => array('switch_position_different_in_mobile|switch_position_in_mobile', '==|==', 'true|bottom_left'),
694 ),
695 ),
696 ),
697 array(
698 'id' => 'enable_absolute_position',
699 'type' => 'switcher',
700 'title' => esc_html__('Absolute Switch Position', 'darkify'),
701
702 'title_help' =>
703 '<div class="darkify-info-label">' .
704 __('Enable this option to allow the floating switch to scroll along with the page.', 'darkify') .
705 '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switcher-positioning" target="_blank">' .
706 __('Live Demo', 'darkify') .
707 '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switcher-positioning" target="_blank">' .
708 __('Open Docs', 'darkify') .
709 '</a>',
710 'text_on' => esc_html__('Enabled', 'darkify'),
711 'text_off' => esc_html__('Disabled', 'darkify'),
712 'text_width' => '100',
713 ),
714
715 array(
716 'id' => 'enable_switch_dragging',
717 'type' => 'switcher',
718 'title' => esc_html__('Draggable Position Change', 'darkify'),
719 'title_help' =>
720 '<div class="darkify-info-label">' .
721 __('Enable this option to allow users to change the floating switch position by dragging it.', 'darkify') .
722 '</div><a class="tooltip_btn_primary" href="' . DARKIFY_DEMO_URL . 'switches/#switcher-positioning" target="_blank">' .
723 __('Live Demo', 'darkify') .
724 '</a><a class="tooltip_btn_secondary" href="' . DARKIFY_DOCS_URL . 'switcher/#switcher-positioning" target="_blank">' .
725 __('Open Docs', 'darkify') .
726 '</a>',
727
728 'text_on' => esc_html__('Enabled', 'darkify'),
729 'text_off' => esc_html__('Disabled', 'darkify'),
730 'text_width' => '100',
731
732 'class' => 'switcher_pro_only',
733 ),
734 )
735 ),
736 )
737 ),
738 )
739 )
740 );
741 }
742 }
743