PluginProbe
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) / 1.3.0
Darkify – Dark Mode & Night Mode for Website & Admin (Dark Theme Included) v1.3.0
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.3.0, at src/Admin/Views/SwitcherStyle.php

447 lines 26.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Views class for Shortcode generator 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__('SWITCHER STYLE', 'darkify'),
32 'icon' => 'icofont-toggle-on',
33 'fields' => array(
34 array(
35 'type' => 'heading',
36 'content' => esc_html__('Switch Version', 'darkify'),
37 ),
38 array(
39 'id' => 'enable_dark_switcher',
40 'type' => 'layout_preset',
41 'title' => esc_html__('Floating Switch', 'darkify'),
42 'desc' => esc_html__('Choose default floating switch', 'darkify'),
43 'class' => 'icon_select',
44 'options' => array(
45 'classic' => array(
46 'image' => DARKIFY_DIR_URL . 'src/Admin/image/icon-01.jpg',
47 'text' => esc_html__('Classic', 'darkify'),
48 'option_demo_url' => '',
49 ),
50 'expand' => array(
51 'image' => DARKIFY_DIR_URL . 'src/Admin/image/icon-02.jpg',
52 'text' => esc_html__('Expand', 'darkify'),
53 'option_demo_url' => '',
54 ),
55 'inner-moon' => array(
56 'image' => DARKIFY_DIR_URL . 'src/Admin/image/icon-03.jpg',
57 'text' => esc_html__('Inner Moon', 'darkify'),
58 'option_demo_url' => '',
59 ),
60 'within' => array(
61 'image' => DARKIFY_DIR_URL . 'src/Admin/image/icon-04.jpg',
62 'text' => esc_html__('Within', 'darkify'),
63 'option_demo_url' => '',
64 ),
65 'around' => array(
66 'image' => DARKIFY_DIR_URL . 'src/Admin/image/icon-05.jpg',
67 'text' => esc_html__('Around', 'darkify'),
68 'option_demo_url' => '',
69 'pro_only' => true,
70 ),
71 'dark-side' => array(
72 'image' => DARKIFY_DIR_URL . 'src/Admin/image/icon-06.jpg',
73 'text' => esc_html__('Dark Side', 'darkify'),
74 'option_demo_url' => '',
75 'pro_only' => true,
76 ),
77 'horizon' => array(
78 'image' => DARKIFY_DIR_URL . 'src/Admin/image/icon-07.jpg',
79 'text' => esc_html__('Horizon', 'darkify'),
80 'option_demo_url' => '',
81 'pro_only' => true,
82 ),
83 'eclipse' => array(
84 'image' => DARKIFY_DIR_URL . 'src/Admin/image/icon-08.jpg',
85 'text' => esc_html__('Eclipse', 'darkify'),
86 'option_demo_url' => '',
87 'pro_only' => true,
88 ),
89 'lightbulb' => array(
90 'image' => DARKIFY_DIR_URL . 'src/Admin/image/icon-09.jpg',
91 'text' => esc_html__('Lightbulb', 'darkify'),
92 'option_demo_url' => '',
93 'pro_only' => true,
94 ),
95 'dark-inner' => array(
96 'image' => DARKIFY_DIR_URL . 'src/Admin/image/icon-10.jpg',
97 'text' => esc_html__('Dark Inner', 'darkify'),
98 'option_demo_url' => '',
99 'pro_only' => true,
100 ),
101 'half-sun' => array(
102 'image' => DARKIFY_DIR_URL . 'src/Admin/image/icon-11.jpg',
103 'text' => esc_html__('Half Sun', 'darkify'),
104 'option_demo_url' => '',
105 'pro_only' => true,
106 ),
107 'simple' => array(
108 'image' => DARKIFY_DIR_URL . 'src/Admin/image/icon-12.jpg',
109 'text' => esc_html__('Simple', 'darkify'),
110 'option_demo_url' => '',
111 'pro_only' => true,
112 ),
113 ),
114 'default' => 'classic',
115 ),
116 // Enable Tooltip on Floating Switch
117 array(
118 'id' => 'tooltip_on_floating_switch',
119 'type' => 'fieldset',
120 'fields' => array(
121 array(
122 'id' => 'floating_switch_width',
123 'type' => 'switcher',
124 'title' => esc_html__('Enable or Disable Tooltip on Floating Switch', 'darkify'),
125 'desc' => esc_html__('Want to show a hint on dark mode floating switch as tooltip?', 'darkify'),
126 'text_on' => esc_html__('Enabled', 'darkify-pro'),
127 'text_off' => esc_html__('Disabled', 'darkify-pro'),
128 'text_width' => 100,
129 'default' => false,
130 ),
131 array(
132 'id' => 'tooltip_position',
133 'type' => 'select',
134 'title' => esc_html__('Tooltip Position', 'darkify'),
135 'desc' => esc_html__('Choose the position where the tooltip should be displaed relative to the floating switch.', 'darkify'),
136 'options' => array(
137 'top' => esc_html__('Top', 'darkify'),
138 'bottom' => esc_html__('Bottom', 'darkify'),
139 'left' => esc_html__('Left', 'darkify'),
140 'right' => esc_html__('Right', 'darkify'),
141 ),
142 'default' => 'left',
143 'dependency' => array('floating_switch_width', '==', 'true'),
144 ),
145 array(
146 'id' => 'tooltip_text',
147 'type' => 'text',
148 'title' => esc_html__('Tooltip Text', 'darkify'),
149 'desc' => esc_html__('Customize text to be displayed on the tooltip.', 'darkify'),
150 'default' => esc_html__('Tooltip Text', 'darkify'),
151 'dependency' => array('floating_switch_width', '==', 'true'),
152 ),
153 array(
154 'id' => 'tooltip_background_color',
155 'type' => 'color',
156 'title' => esc_html__('Tooltip Background Color', 'darkify'),
157 'desc' => esc_html__('Customize the background color of the floating switch tooltip.', 'darkify'),
158 'dependency' => array('floating_switch_width', '==', 'true'),
159 'default' => '#142434',
160 ),
161 array(
162 'id' => 'tooltip_text_color',
163 'type' => 'color',
164 'title' => esc_html__('Tooltip Text Color', 'darkify'),
165 'desc' => esc_html__('Customize default margin from the left of the Floating Switch in Mobile.', 'darkify'),
166 'dependency' => array('floating_switch_width', '==', 'true'),
167 'default' => '#B0CBE7',
168 ),
169 ),
170 ),
171 array(
172 'type' => 'heading',
173 'content' => esc_html__('Position Customization', 'darkify'),
174 ),
175
176 // Switch Position
177 array(
178 'id' => 'switcher_button_position',
179 'type' => 'fieldset',
180 'fields' => array(
181 array(
182 'id' => 'dark_mode_switch_position',
183 'type' => 'select',
184 'title' => esc_html__('Switch Position', 'darkify'),
185 'desc' => esc_html__('Choose the screen position where the Floating Switch should be displayed.', 'darkify'),
186 'options' => array(
187 'top_right' => esc_html__('Top Right', 'darkify'),
188 'top_left' => esc_html__('Top Left', 'darkify'),
189 'bottom_right' => esc_html__('Bottom Right', 'darkify'),
190 'bottom_left' => esc_html__('Bottom Left', 'darkify'),
191 ),
192 'default' => 'bottom_right',
193 ),
194 array(
195 'id' => 'switch_position_top_right',
196 'type' => 'spacing',
197 'title' => esc_html__('Margin From Top Right', 'darkify'),
198 'desc' => esc_html__('Customize default margin from the top right of the Floating Switch.', 'darkify'),
199 'left' => false,
200 'bottom' => false,
201 'default' => array(
202 'top' => '40',
203 'right' => '40',
204 'unit' => 'px',
205 ),
206 'dependency' => array('dark_mode_switch_position', '==', 'top_right'),
207 ),
208 array(
209 'id' => 'switch_position_top_left',
210 'type' => 'spacing',
211 'title' => esc_html__('Margin From Top Left', 'darkify'),
212 'desc' => esc_html__('Customize default margin from the top left of the Floating Switch.', 'darkify'),
213 'right' => false,
214 'bottom' => false,
215 'default' => array(
216 'top' => '40',
217 'left' => '40',
218 'unit' => 'px',
219 ),
220 'dependency' => array('dark_mode_switch_position', '==', 'top_left'),
221 ),
222 array(
223 'id' => 'switch_position_bottom_right',
224 'type' => 'spacing',
225 'title' => esc_html__('Margin From Bottom Right', 'darkify'),
226 'desc' => esc_html__('Customize default margin from the bottom right of the Floating Switch.', 'darkify'),
227 'left' => false,
228 'top' => false,
229 'default' => array(
230 'bottom' => '40',
231 'right' => '40',
232 'unit' => 'px',
233 ),
234 'dependency' => array('dark_mode_switch_position', '==', 'bottom_right'),
235 ),
236 array(
237 'id' => 'switch_position_bottom_left',
238 'type' => 'spacing',
239 'title' => esc_html__('Margin from bottom left', 'darkify'),
240 'desc' => esc_html__('Customize default margin from the bottom left of the Floating Switch.', 'darkify'),
241 'right' => false,
242 'top' => false,
243 'default' => array(
244 'bottom' => '40',
245 'left' => '40',
246 'unit' => 'px',
247 ),
248 'dependency' => array('dark_mode_switch_position', '==', 'bottom_left'),
249 ),
250 ),
251 ),
252
253 // Different Switch Position in Mobile
254 array(
255 'id' => 'different_switch_in_mobile',
256 'type' => 'fieldset',
257 'fields' => array(
258 array(
259 'id' => 'switch_position_different_in_mobile',
260 'type' => 'switcher',
261 'title' => esc_html__('Enable or Disable Different Switch Position in Mobile', 'darkify'),
262 'desc' => esc_html__('Should the Floating Switch be displayed on different position in mobile?', 'darkify'),
263 'text_on' => esc_html__('Enabled', 'darkify-pro'),
264 'text_off' => esc_html__('Disabled', 'darkify-pro'),
265 'text_width' => 100,
266 'default' => true,
267 ),
268 array(
269 'id' => 'switch_position_in_mobile',
270 'type' => 'select',
271 'title' => esc_html__('Switch Position in Mobile', 'darkify'),
272 'desc' => esc_html__('Choose the screen position where the Floating Switch should be displayed in mobile.', 'darkify'),
273 'options' => array(
274 'top_right' => esc_html__('Top Right', 'darkify'),
275 'top_left' => esc_html__('Top Left', 'darkify'),
276 'bottom_right' => esc_html__('Bottom Right', 'darkify'),
277 'bottom_left' => esc_html__('Bottom Left', 'darkify'),
278 ),
279 'dependency' => array('switch_position_different_in_mobile', '==', 'true'),
280 ),
281 array(
282 'id' => 'switch_position_top_right_in_mobile',
283 'type' => 'spacing',
284 'title' => esc_html__('Margin From Top Right in Mobile', 'darkify'),
285 'desc' => esc_html__('Customize default margin from the top right of the Floating Switch.', 'darkify'),
286 'left' => false,
287 'bottom' => false,
288 'default' => array(
289 'top' => '40',
290 'right' => '40',
291 'unit' => 'px',
292 ),
293 'dependency' => array('switch_position_different_in_mobile|switch_position_in_mobile', '==|==', 'true|top_right'),
294 ),
295 array(
296 'id' => 'switch_position_top_left_in_mobile',
297 'type' => 'spacing',
298 'title' => esc_html__('Margin From Top Left in Mobile', 'darkify'),
299 'desc' => esc_html__('Customize default margin from the top left of the Floating Switch.', 'darkify'),
300 'right' => false,
301 'bottom' => false,
302 'default' => array(
303 'top' => '40',
304 'left' => '40',
305 'unit' => 'px',
306 ),
307 'dependency' => array('switch_position_different_in_mobile|switch_position_in_mobile', '==|==', 'true|top_left'),
308 ),
309 array(
310 'id' => 'switch_position_bottom_right_in_mobile',
311 'type' => 'spacing',
312 'title' => esc_html__('Margin From Bottom Right in Mobile', 'darkify'),
313 'desc' => esc_html__('Customize default margin from the bottom right of the Floating Switch.', 'darkify'),
314 'left' => false,
315 'top' => false,
316 'default' => array(
317 'bottom' => '40',
318 'right' => '40',
319 'unit' => 'px',
320 ),
321 'dependency' => array('switch_position_different_in_mobile|switch_position_in_mobile', '==|==', 'true|bottom_right'),
322 ),
323 array(
324 'id' => 'switch_position_bottom_left_in_mobile',
325 'type' => 'spacing',
326 'title' => esc_html__('Margin From Bottom Left in Mobile', 'darkify'),
327 'desc' => esc_html__('Customize default margin from the bottom left of the Floating Switch.', 'darkify'),
328 'right' => false,
329 'top' => false,
330 'default' => array(
331 'bottom' => '40',
332 'left' => '40',
333 'unit' => 'px',
334 ),
335 'dependency' => array('switch_position_different_in_mobile|switch_position_in_mobile', '==|==', 'true|bottom_left'),
336 ),
337 ),
338 ),
339 array(
340 'id' => 'enable_absolute_position',
341 'type' => 'switcher',
342 'title' => esc_html__('Absolute Switch Position', 'darkify'),
343 'text_on' => esc_html__('Enabled', 'darkify'),
344 'text_off' => esc_html__('Disabled', 'darkify'),
345 'text_width' => '100',
346 'desc' => esc_html__('Enable to make the floating switch scroll from its position with page scrolling.', 'darkify'),
347 ),
348 array(
349 'id' => 'enable_switch_dragging',
350 'type' => 'switcher',
351 'title' => esc_html__('Draggable Position Change', 'darkify'),
352 'text_on' => esc_html__('Enabled', 'darkify'),
353 'text_off' => esc_html__('Disabled', 'darkify'),
354 'text_width' => '100',
355 'desc' => esc_html__('Allow/Disallow users to change the floating switch position by dragging to where they want.', 'darkify'),
356 'class' => 'switcher_pro_only',
357 ),
358
359 array(
360 'type' => 'heading',
361 'content' => esc_html__('Advanced Customization', 'darkify'),
362 ),
363
364 array(
365 'id' => 'switch_width_height',
366 'type' => 'dimensions',
367 'title' => esc_html__('Floating Switch Size', 'darkify'),
368 'desc' => esc_html__('Customize the Selected Switch Design in Your Way.', 'darkify'),
369 'height' => false,
370 'default' => array(
371 'width' => '60',
372 )
373 ),
374 array(
375 'id' => 'switch_icon_size',
376 'type' => 'dimensions',
377 'title' => esc_html__('Floating Switch Icon Size', 'darkify'),
378 'desc' => esc_html__('Customize the Selected Switch Icon Size.', 'darkify'),
379 'height' => false,
380 'default' => array(
381 'width' => '50',
382 )
383 ),
384 array(
385 'id' => 'switch_border_radius',
386 'type' => 'spacing',
387 'title' => esc_html__('Border Radius', 'darkify'),
388 'desc' => esc_html__('Set the border radius of the Floating Switch in pixel.', 'darkify'),
389 'all' => true,
390 'default' => array(
391 'all' => '7',
392 'unit' => 'px',
393 )
394 ),
395 array(
396 'id' => 'switch_light_mode_bg',
397 'type' => 'color',
398 'title' => esc_html__('Switch Background on Light Mode', 'darkify'),
399 'desc' => esc_html__('Set the background color of the Floating Switch in light mode.', 'darkify'),
400 'default' => '#121116',
401 ),
402 array(
403 'id' => 'switch_dark_mode_bg',
404 'type' => 'color',
405 'title' => esc_html__('Switch Background on Dark Mode', 'darkify'),
406 'desc' => esc_html__('Set the background color of the Floating Switch in dark mode.', 'darkify'),
407 'default' => '#ffffff',
408 ),
409 array(
410 'id' => 'switch_light_mode_color',
411 'type' => 'color',
412 'title' => esc_html__('Switch Icon Color on Light Mode', 'darkify'),
413 'desc' => esc_html__('Set the color color of the Floating Switch in light mode.', 'darkify'),
414 'default' => '#ffffff',
415 ),
416 array(
417 'id' => 'switch_dark_mode_color',
418 'type' => 'color',
419 'title' => esc_html__('Switch Icon Color on Dark Mode', 'darkify'),
420 'desc' => esc_html__('Set the color color of the Floating Switch in dark mode.', 'darkify'),
421 'default' => '#121116',
422 ),
423 array(
424 'type' => 'heading',
425 'content' => esc_html__('Switch Extras', 'darkify'),
426 ),
427
428 array(
429 'id' => 'alternative_dark_mode_switcher',
430 'type' => 'text',
431 'title' => esc_html__('Treat an element as switch', 'darkify'),
432 'desc' => esc_html__('Enter comma-separated CSS class or ID selectors to treat them as dark mode switch.', 'darkify'),
433 ),
434
435
436 array(
437 'id' => 'switcher_shortcode',
438 'type' => 'switcher_shortcode',
439 'title' => esc_html__('Switcher Shortcode', 'darkify'),
440 'desc' => esc_html__('Copy this shortcode and put any page or post to show switcher. You will able to customize all value including swtich 1-12 currently available in this version of plugin.', 'darkify'),
441 ),
442 ),
443 ),
444 );
445 }
446 }
447