| 1 |
<?php |
| 2 |
|
| 3 |
use ThemeAtelier\Darkify\Includes\DarkifyUtils; |
| 4 |
|
| 5 |
// don't call the file directly. |
| 6 |
if (!defined('ABSPATH')) { |
| 7 |
exit; |
| 8 |
} |
| 9 |
|
| 10 |
ob_start(); |
| 11 |
$options = get_option('darkify'); |
| 12 |
// Controls |
| 13 |
$enable_default_dark_mode = isset($options['enable_default_dark_mode']) ? $options['enable_default_dark_mode'] : ''; |
| 14 |
$enable_os_aware = isset($options['enable_os_aware']) ? $options['enable_os_aware'] : true; |
| 15 |
$enable_keyboard_shortcut = isset($options['enable_keyboard_shortcut']) ? $options['enable_keyboard_shortcut'] : true; |
| 16 |
$enable_time = isset($options['enable_time']) ? $options['enable_time'] : ""; |
| 17 |
$enable_time_based_dark = isset($enable_time['enable_time_based_dark']) ? $enable_time['enable_time_based_dark'] : ""; |
| 18 |
$enable_time_fields = isset($enable_time['enable_time_fields']) ? $enable_time['enable_time_fields'] : ''; |
| 19 |
$time_based_dark_start = isset($enable_time_fields['time_based_dark_start']) ? $enable_time_fields['time_based_dark_start'] : ""; |
| 20 |
$time_based_dark_stop = isset($enable_time_fields['time_based_dark_end']) ? $enable_time_fields['time_based_dark_end'] : ""; |
| 21 |
|
| 22 |
// Extras |
| 23 |
$enable_scrollbar_dark = isset($options["enable_scrollbar_dark"]) ? $options["enable_scrollbar_dark"] : true; |
| 24 |
$enable_frontend_iframe_dark_mode = isset($options['enable_frontend_iframe_dark_mode']) ? $options['enable_frontend_iframe_dark_mode'] : true; |
| 25 |
$enable_switch_dragging = isset($options['enable_switch_dragging']) ? $options['enable_switch_dragging'] : ""; |
| 26 |
$enable_switch_attention = isset($options['enable_switch_attention']) ? $options['enable_switch_attention'] : ''; |
| 27 |
$switch_attention_effect = isset($options['switch_attention_effect']) ? $options['switch_attention_effect'] : 'pulse'; |
| 28 |
$disallowed_elements = isset($options['disallowed_elements']) ? DarkifyUtils::normalize_restriction_class($options['disallowed_elements']) : ""; |
| 29 |
|
| 30 |
$disallowed_elements_force_to_correct = isset($options['disallowed_elements_force_to_correct']) ? $options['disallowed_elements_force_to_correct'] : true; |
| 31 |
$allowed_elements_force_to_correct = isset($options['allowed_elements_force_to_correct']) ? $options['allowed_elements_force_to_correct'] : true; |
| 32 |
$allowed_elements = isset($options['allowed_elements']) ? DarkifyUtils::normalize_restriction_class($options['allowed_elements']) : ""; |
| 33 |
|
| 34 |
$alternative_dark_mode_switcher = isset($options['alternative_dark_mode_switcher']) ? $options['alternative_dark_mode_switcher'] : ""; |
| 35 |
|
| 36 |
|
| 37 |
// Image Control |
| 38 |
$brightness = isset($options['brightness']) ? $options['brightness'] : ""; |
| 39 |
$enable_low_image_brightness = isset($brightness['enable_low_image_brightness']) ? $brightness['enable_low_image_brightness'] : '1'; |
| 40 |
$low_image_brightness_label = isset($brightness['low_image_brightness_label']) ? 100 - $brightness['low_image_brightness_label'] : 100 - "20"; |
| 41 |
$disallowed_low_brightness_images = isset($brightness['disallowed_low_brightness_images']) ? DarkifyUtils::normalize_image_urls($brightness['disallowed_low_brightness_images']) : ""; |
| 42 |
|
| 43 |
$grayscale = isset($options['grayscale']) ? $options['grayscale'] : ""; |
| 44 |
$enable_image_grayscale = isset($grayscale['enable_image_grayscale']) ? $grayscale['enable_image_grayscale'] : ""; |
| 45 |
$image_grayscale_label = isset($grayscale['image_grayscale_label']) ? $grayscale['image_grayscale_label'] : "80"; |
| 46 |
$disallowed_low_grayscale_images = isset($grayscale['disallowed_low_grayscale_images']) ? DarkifyUtils::normalize_image_urls($grayscale['disallowed_low_grayscale_images']) : ""; |
| 47 |
|
| 48 |
$darken_background = isset($options['darken_background']) ? $options['darken_background'] : ""; |
| 49 |
$enable_low_image_darken = isset($darken_background['enable_low_image_darken']) ? $darken_background['enable_low_image_darken'] : "1"; |
| 50 |
$low_image_darken_label = isset($darken_background['low_image_darken_label']) ? $darken_background['low_image_darken_label'] : '60'; |
| 51 |
|
| 52 |
$enable_invert_inline_svg = isset($options['enable_invert_inline_svg']) ? $options['enable_invert_inline_svg'] : ""; |
| 53 |
|
| 54 |
$invert = isset($options['invert']) ? $options['invert'] : ""; |
| 55 |
$enable_invert_images = isset($invert['enable_invert_images']) ? $invert['enable_invert_images'] : ""; |
| 56 |
$invert_images_allowed_urls = !empty($invert['invert_images_allowed_urls']) ? DarkifyUtils::normalize_image_urls($invert['invert_images_allowed_urls']) : ""; |
| 57 |
|
| 58 |
if ($invert_images_allowed_urls !== "") { |
| 59 |
$invert_images_allowed_urls_explode = explode(',', $invert_images_allowed_urls); |
| 60 |
$invert_images_allowed_urls_arr = json_encode($invert_images_allowed_urls_explode); |
| 61 |
} else { |
| 62 |
$invert_images_allowed_urls_arr = "[]"; |
| 63 |
} |
| 64 |
|
| 65 |
$normal_image_replacements = isset($options["image_replacements"][0]['normal_image']) ? $options["image_replacements"][0]['normal_image'] : ''; |
| 66 |
$dark_image_replacements = isset($options["image_replacements"][0]['dark_image']) ? $options["image_replacements"][0]['dark_image'] : ''; |
| 67 |
if ($normal_image_replacements || $dark_image_replacements) { |
| 68 |
$image_replacements = json_encode($options["image_replacements"]); |
| 69 |
} else { |
| 70 |
$image_replacements = ""; |
| 71 |
} |
| 72 |
|
| 73 |
// Video Control |
| 74 |
$video_brightness = isset($options['video_brightness']) ? $options['video_brightness'] : ""; |
| 75 |
$enable_low_video_brightness = isset($video_brightness['enable_low_video_brightness']) ? $video_brightness['enable_low_video_brightness'] : true; |
| 76 |
$low_video_brightness_label = isset($video_brightness['low_video_brightness_label']) ? 100 - $video_brightness['low_video_brightness_label'] : 100 - "20"; |
| 77 |
|
| 78 |
$video_grayscale = isset($options['video_grayscale']) ? $options['video_grayscale'] : ''; |
| 79 |
$enable_video_grayscale = isset($video_grayscale['enable_video_grayscale']) ? $video_grayscale['enable_video_grayscale'] : ""; |
| 80 |
$video_grayscale_label = isset($video_grayscale['video_grayscale_label']) ? $video_grayscale['video_grayscale_label'] : "80"; |
| 81 |
|
| 82 |
$normal_video_replacements = isset($options["video_replacements"][0]["normal_video"]) ? $options["video_replacements"][0]["normal_video"] : ''; |
| 83 |
$dark_video_replacements = isset($options["video_replacements"][0]["dark_video"]) ? $options["video_replacements"][0]["dark_video"] : ''; |
| 84 |
if ($normal_video_replacements || $dark_video_replacements) { |
| 85 |
$video_replacements = json_encode($options["video_replacements"]); |
| 86 |
} else { |
| 87 |
$video_replacements = "[]"; |
| 88 |
} |
| 89 |
if (!is_admin()) { ?> |
| 90 |
<script type="text/javascript" class="darkify_inline_js">(function(){var s=localStorage.darkify_last_state,t=localStorage.darkify_selected_theme||'set1';if(s==='1'){var h=document.documentElement;h.classList.add('darkify_dark_mode_enabled');h.classList.add('darkify-'+t);}}());</script> |
| 91 |
<style type="text/css" class="darkify_inline_css"> |
| 92 |
:root { |
| 93 |
<?php |
| 94 |
$dark_mode_color_palettes = [ |
| 95 |
'set1' => [ |
| 96 |
'bg' => isset($options["dark_mode_color_set1"]) ? $options["dark_mode_color_set1"]['background'] : '#0F0F0F', |
| 97 |
'secondary_bg' => isset($options["dark_mode_color_set1"]) ? $options["dark_mode_color_set1"]['secondary_background'] : '#171717', |
| 98 |
'text_color' => isset($options["dark_mode_link_color_set1"]) ? $options["dark_mode_link_color_set1"]['text'] : '#BEBEBE', |
| 99 |
'link_color' => isset($options["dark_mode_link_color_set1"]) ? $options["dark_mode_link_color_set1"]['color'] : '#E7E7E7', |
| 100 |
'link_hover_color' => isset($options["dark_mode_link_color_set1"]) ? $options["dark_mode_link_color_set1"]['hover'] : '#BEBEBE', |
| 101 |
'input_bg' => isset($options["dark_mode_input_color_set1"]) ? $options["dark_mode_input_color_set1"]['background'] : '#2D2D2D', |
| 102 |
'input_text_color' => isset($options["dark_mode_input_color_set1"]) ? $options["dark_mode_input_color_set1"]['color'] : '#BEBEBE', |
| 103 |
'input_placeholder_color' => isset($options["dark_mode_input_color_set1"]) ? $options["dark_mode_input_color_set1"]['placeholder'] : '#BEBEBE', |
| 104 |
'border_color' => isset($options["dark_mode_border_color_set1"]) ? $options["dark_mode_border_color_set1"] : '#4A4A4A', |
| 105 |
'btn_text_color' => isset($options["dark_mode_btn_color_set1"]) ? $options["dark_mode_btn_color_set1"]['color'] : '#BEBEBE', |
| 106 |
'btn_bg' => isset($options["dark_mode_btn_color_set1"]) ? $options["dark_mode_btn_color_set1"]['background'] : '#4A4A4A', |
| 107 |
'btn_text_hover_color' => isset($options["dark_mode_btn_color_set1"]) ? $options["dark_mode_btn_color_set1"]['hover_color'] : '#BEBEBE', |
| 108 |
'btn_hover_bg' => isset($options["dark_mode_btn_color_set1"]) ? $options["dark_mode_btn_color_set1"]['hover_background'] : '#2D2D2D', |
| 109 |
], |
| 110 |
'set2' => [ |
| 111 |
'bg' => isset($options["dark_mode_color_set2"]) ? $options["dark_mode_color_set2"]['background'] : '#092635', |
| 112 |
'secondary_bg' => isset($options["dark_mode_color_set2"]) ? $options["dark_mode_color_set2"]['secondary_background'] : '#081E29', |
| 113 |
'text_color' => isset($options["dark_mode_link_color_set2"]) ? $options["dark_mode_link_color_set2"]['text'] : '#BEE0F1', |
| 114 |
'link_color' => isset($options["dark_mode_link_color_set2"]) ? $options["dark_mode_link_color_set2"]['color'] : '#2B97CD', |
| 115 |
'link_hover_color' => isset($options["dark_mode_link_color_set2"]) ? $options["dark_mode_link_color_set2"]['hover'] : '#BEE0F1', |
| 116 |
'input_bg' => isset($options["dark_mode_input_color_set2"]) ? $options["dark_mode_input_color_set2"]['background'] : '#2D2D2D', |
| 117 |
'input_text_color' => isset($options["dark_mode_input_color_set2"]) ? $options["dark_mode_input_color_set2"]['color'] : '#BEE0F1', |
| 118 |
'input_placeholder_color' => isset($options["dark_mode_input_color_set2"]) ? $options["dark_mode_input_color_set2"]['placeholder'] : '#BEE0F1', |
| 119 |
'border_color' => isset($options["dark_mode_border_color_set2"]) ? $options["dark_mode_border_color_set2"] : '#195979', |
| 120 |
'btn_text_color' => isset($options["dark_mode_btn_color_set2"]) ? $options["dark_mode_btn_color_set2"]['color'] : '#BEE0F1', |
| 121 |
'btn_bg' => isset($options["dark_mode_btn_color_set2"]) ? $options["dark_mode_btn_color_set2"]['background'] : '#195979', |
| 122 |
'btn_text_hover_color' => isset($options["dark_mode_btn_color_set2"]) ? $options["dark_mode_btn_color_set2"]['hover_color'] : '#BEE0F1', |
| 123 |
'btn_hover_bg' => isset($options["dark_mode_btn_color_set2"]) ? $options["dark_mode_btn_color_set2"]['hover_background'] : '#2D2D2D', |
| 124 |
], |
| 125 |
'set3' => [ |
| 126 |
'bg' => isset($options["dark_mode_color_set3"]) ? $options["dark_mode_color_set3"]['background'] : '#211e3c', |
| 127 |
'secondary_bg' => isset($options["dark_mode_color_set3"]) ? $options["dark_mode_color_set3"]['secondary_background'] : '#302C57', |
| 128 |
'text_color' => isset($options["dark_mode_link_color_set3"]) ? $options["dark_mode_link_color_set3"]['text'] : '#B1BBD8', |
| 129 |
'link_color' => isset($options["dark_mode_link_color_set3"]) ? $options["dark_mode_link_color_set3"]['color'] : '#8071fb', |
| 130 |
'link_hover_color' => isset($options["dark_mode_link_color_set3"]) ? $options["dark_mode_link_color_set3"]['hover'] : '#B1BBD8', |
| 131 |
'input_bg' => isset($options["dark_mode_input_color_set3"]) ? $options["dark_mode_input_color_set3"]['background'] : '#2A264D', |
| 132 |
'input_text_color' => isset($options["dark_mode_input_color_set3"]) ? $options["dark_mode_input_color_set3"]['color'] : '#B1BBD8', |
| 133 |
'input_placeholder_color' => isset($options["dark_mode_input_color_set3"]) ? $options["dark_mode_input_color_set3"]['placeholder'] : '#B1BBD8', |
| 134 |
'border_color' => isset($options["dark_mode_border_color_set3"]) ? $options["dark_mode_border_color_set3"] : '#4E478D', |
| 135 |
'btn_text_color' => isset($options["dark_mode_btn_color_set3"]) ? $options["dark_mode_btn_color_set3"]['color'] : '#B1BBD8', |
| 136 |
'btn_bg' => isset($options["dark_mode_btn_color_set3"]) ? $options["dark_mode_btn_color_set3"]['background'] : '#4E478D', |
| 137 |
'btn_text_hover_color' => isset($options["dark_mode_btn_color_set3"]) ? $options["dark_mode_btn_color_set3"]['hover_color'] : '#B1BBD8', |
| 138 |
'btn_hover_bg' => isset($options["dark_mode_btn_color_set3"]) ? $options["dark_mode_btn_color_set3"]['hover_background'] : '#2A264D', |
| 139 |
], |
| 140 |
'set4' => [ |
| 141 |
'bg' => isset($options["dark_mode_color_set4"]) ? $options["dark_mode_color_set4"]['background'] : '#1d253a', |
| 142 |
'secondary_bg' => isset($options["dark_mode_color_set4"]) ? $options["dark_mode_color_set4"]['secondary_background'] : '#2B3655', |
| 143 |
'text_color' => isset($options["dark_mode_link_color_set4"]) ? $options["dark_mode_link_color_set4"]['text'] : '#B1BBD8', |
| 144 |
'link_color' => isset($options["dark_mode_link_color_set4"]) ? $options["dark_mode_link_color_set4"]['color'] : '#638eff', |
| 145 |
'link_hover_color' => isset($options["dark_mode_link_color_set4"]) ? $options["dark_mode_link_color_set4"]['hover'] : '#B1BBD8', |
| 146 |
'input_bg' => isset($options["dark_mode_input_color_set4"]) ? $options["dark_mode_input_color_set4"]['background'] : '#242F4C', |
| 147 |
'input_text_color' => isset($options["dark_mode_input_color_set4"]) ? $options["dark_mode_input_color_set4"]['color'] : '#B1BBD8', |
| 148 |
'input_placeholder_color' => isset($options["dark_mode_input_color_set4"]) ? $options["dark_mode_input_color_set4"]['placeholder'] : '#B1BBD8', |
| 149 |
'border_color' => isset($options["dark_mode_border_color_set4"]) ? $options["dark_mode_border_color_set4"] : '#46598C', |
| 150 |
'btn_text_color' => isset($options["dark_mode_btn_color_set4"]) ? $options["dark_mode_btn_color_set4"]['color'] : '#B1BBD8', |
| 151 |
'btn_bg' => isset($options["dark_mode_btn_color_set4"]) ? $options["dark_mode_btn_color_set4"]['background'] : '#46598C', |
| 152 |
'btn_text_hover_color' => isset($options["dark_mode_btn_color_set4"]) ? $options["dark_mode_btn_color_set4"]['hover_color'] : '#B1BBD8', |
| 153 |
'btn_hover_bg' => isset($options["dark_mode_btn_color_set4"]) ? $options["dark_mode_btn_color_set4"]['hover_background'] : '#303D60', |
| 154 |
], |
| 155 |
'set5' => [ |
| 156 |
'bg' => isset($options["dark_mode_color_set5"]) ? $options["dark_mode_color_set5"]['background'] : '#1b1823', |
| 157 |
'secondary_bg' => isset($options["dark_mode_color_set5"]) ? $options["dark_mode_color_set5"]['secondary_background'] : '#352f44', |
| 158 |
'text_color' => isset($options["dark_mode_link_color_set5"]) ? $options["dark_mode_link_color_set5"]['text'] : '#C6C1D5', |
| 159 |
'link_color' => isset($options["dark_mode_link_color_set5"]) ? $options["dark_mode_link_color_set5"]['color'] : '#b094ff', |
| 160 |
'link_hover_color' => isset($options["dark_mode_link_color_set5"]) ? $options["dark_mode_link_color_set5"]['hover'] : '#C6C1D5', |
| 161 |
'input_bg' => isset($options["dark_mode_input_color_set5"]) ? $options["dark_mode_input_color_set5"]['background'] : '#403953', |
| 162 |
'input_text_color' => isset($options["dark_mode_input_color_set5"]) ? $options["dark_mode_input_color_set5"]['color'] : '#C6C1D5', |
| 163 |
'input_placeholder_color' => isset($options["dark_mode_input_color_set5"]) ? $options["dark_mode_input_color_set5"]['placeholder'] : '#C6C1D5', |
| 164 |
'border_color' => isset($options["dark_mode_border_color_set5"]) ? $options["dark_mode_border_color_set5"] : '#54496f', |
| 165 |
'btn_text_color' => isset($options["dark_mode_btn_color_set5"]) ? $options["dark_mode_btn_color_set5"]['color'] : '#C6C1D5', |
| 166 |
'btn_bg' => isset($options["dark_mode_btn_color_set5"]) ? $options["dark_mode_btn_color_set5"]['background'] : '#54496f', |
| 167 |
'btn_text_hover_color' => isset($options["dark_mode_btn_color_set5"]) ? $options["dark_mode_btn_color_set5"]['hover_color'] : '#C6C1D5', |
| 168 |
'btn_hover_bg' => isset($options["dark_mode_btn_color_set5"]) ? $options["dark_mode_btn_color_set5"]['hover_background'] : '#403953', |
| 169 |
], |
| 170 |
'set6' => [ |
| 171 |
'bg' => isset($options["dark_mode_color_set6"]) ? $options["dark_mode_color_set6"]['background'] : '#082032', |
| 172 |
'secondary_bg' => isset($options["dark_mode_color_set6"]) ? $options["dark_mode_color_set6"]['secondary_background'] : '#061825', |
| 173 |
'text_color' => isset($options["dark_mode_link_color_set6"]) ? $options["dark_mode_link_color_set6"]['text'] : '#B5D9F3', |
| 174 |
'link_color' => isset($options["dark_mode_link_color_set6"]) ? $options["dark_mode_link_color_set6"]['color'] : '#61bbff', |
| 175 |
'link_hover_color' => isset($options["dark_mode_link_color_set6"]) ? $options["dark_mode_link_color_set6"]['hover'] : '#B5D9F3', |
| 176 |
'input_bg' => isset($options["dark_mode_input_color_set6"]) ? $options["dark_mode_input_color_set6"]['background'] : '#0E3755', |
| 177 |
'input_text_color' => isset($options["dark_mode_input_color_set6"]) ? $options["dark_mode_input_color_set6"]['color'] : '#B5D9F3', |
| 178 |
'input_placeholder_color' => isset($options["dark_mode_input_color_set6"]) ? $options["dark_mode_input_color_set6"]['placeholder'] : '#B5D9F3', |
| 179 |
'border_color' => isset($options["dark_mode_border_color_set6"]) ? $options["dark_mode_border_color_set6"] : '#144E78', |
| 180 |
'btn_text_color' => isset($options["dark_mode_btn_color_set6"]) ? $options["dark_mode_btn_color_set6"]['color'] : '#B5D9F3', |
| 181 |
'btn_bg' => isset($options["dark_mode_btn_color_set6"]) ? $options["dark_mode_btn_color_set6"]['background'] : '#144E78', |
| 182 |
'btn_text_hover_color' => isset($options["dark_mode_btn_color_set6"]) ? $options["dark_mode_btn_color_set6"]['hover_color'] : '#B5D9F3', |
| 183 |
'btn_hover_bg' => isset($options["dark_mode_btn_color_set6"]) ? $options["dark_mode_btn_color_set6"]['hover_background'] : '#0E3755', |
| 184 |
], |
| 185 |
'set7' => [ |
| 186 |
'bg' => isset($options["dark_mode_color_set7"]) ? $options["dark_mode_color_set7"]['background'] : '#07161b', |
| 187 |
'secondary_bg' => isset($options["dark_mode_color_set7"]) ? $options["dark_mode_color_set7"]['secondary_background'] : '#0d242e', |
| 188 |
'text_color' => isset($options["dark_mode_link_color_set7"]) ? $options["dark_mode_link_color_set7"]['text'] : '#C5E6F0', |
| 189 |
'link_color' => isset($options["dark_mode_link_color_set7"]) ? $options["dark_mode_link_color_set7"]['color'] : '#33c0ec', |
| 190 |
'link_hover_color' => isset($options["dark_mode_link_color_set7"]) ? $options["dark_mode_link_color_set7"]['hover'] : '#C5E6F0', |
| 191 |
'input_bg' => isset($options["dark_mode_input_color_set7"]) ? $options["dark_mode_input_color_set7"]['background'] : '#19495A', |
| 192 |
'input_text_color' => isset($options["dark_mode_input_color_set7"]) ? $options["dark_mode_input_color_set7"]['color'] : '#C5E6F0', |
| 193 |
'input_placeholder_color' => isset($options["dark_mode_input_color_set7"]) ? $options["dark_mode_input_color_set7"]['placeholder'] : '#C5E6F0', |
| 194 |
'border_color' => isset($options["dark_mode_border_color_set7"]) ? $options["dark_mode_border_color_set7"] : '#286F8D', |
| 195 |
'btn_text_color' => isset($options["dark_mode_btn_color_set7"]) ? $options["dark_mode_btn_color_set7"]['color'] : '#C5E6F0', |
| 196 |
'btn_bg' => isset($options["dark_mode_btn_color_set7"]) ? $options["dark_mode_btn_color_set7"]['background'] : '#286F8D', |
| 197 |
'btn_text_hover_color' => isset($options["dark_mode_btn_color_set7"]) ? $options["dark_mode_btn_color_set7"]['hover_color'] : '#C5E6F0', |
| 198 |
'btn_hover_bg' => isset($options["dark_mode_btn_color_set7"]) ? $options["dark_mode_btn_color_set7"]['hover_background'] : '#19495A', |
| 199 |
], |
| 200 |
'set8' => [ |
| 201 |
'bg' => isset($options["dark_mode_color_set8"]) ? $options["dark_mode_color_set8"]['background'] : '#15274C', |
| 202 |
'secondary_bg' => isset($options["dark_mode_color_set8"]) ? $options["dark_mode_color_set8"]['secondary_background'] : '#112244', |
| 203 |
'text_color' => isset($options["dark_mode_link_color_set8"]) ? $options["dark_mode_link_color_set8"]['text'] : '#ACC1EA', |
| 204 |
'link_color' => isset($options["dark_mode_link_color_set8"]) ? $options["dark_mode_link_color_set8"]['color'] : '#6197ff', |
| 205 |
'link_hover_color' => isset($options["dark_mode_link_color_set8"]) ? $options["dark_mode_link_color_set8"]['hover'] : '#ACC1EA', |
| 206 |
'input_bg' => isset($options["dark_mode_input_color_set8"]) ? $options["dark_mode_input_color_set8"]['background'] : '#1a2f5c', |
| 207 |
'input_text_color' => isset($options["dark_mode_input_color_set8"]) ? $options["dark_mode_input_color_set8"]['color'] : '#ACC1EA', |
| 208 |
'input_placeholder_color' => isset($options["dark_mode_input_color_set8"]) ? $options["dark_mode_input_color_set8"]['placeholder'] : '#ACC1EA', |
| 209 |
'border_color' => isset($options["dark_mode_border_color_set8"]) ? $options["dark_mode_border_color_set8"] : '#244892', |
| 210 |
'btn_text_color' => isset($options["dark_mode_btn_color_set8"]) ? $options["dark_mode_btn_color_set8"]['color'] : '#ACC1EA', |
| 211 |
'btn_bg' => isset($options["dark_mode_btn_color_set8"]) ? $options["dark_mode_btn_color_set8"]['background'] : '#244892', |
| 212 |
'btn_text_hover_color' => isset($options["dark_mode_btn_color_set8"]) ? $options["dark_mode_btn_color_set8"]['hover_color'] : '#ACC1EA', |
| 213 |
'btn_hover_bg' => isset($options["dark_mode_btn_color_set8"]) ? $options["dark_mode_btn_color_set8"]['hover_background'] : '#1a2f5c', |
| 214 |
], |
| 215 |
'set9' => [ |
| 216 |
'bg' => isset($options["dark_mode_color_set9"]) ? $options["dark_mode_color_set9"]['background'] : '#04261d', |
| 217 |
'secondary_bg' => isset($options["dark_mode_color_set9"]) ? $options["dark_mode_color_set9"]['secondary_background'] : '#021e16', |
| 218 |
'text_color' => isset($options["dark_mode_link_color_set9"]) ? $options["dark_mode_link_color_set9"]['text'] : '#C1D2BB', |
| 219 |
'link_color' => isset($options["dark_mode_link_color_set9"]) ? $options["dark_mode_link_color_set9"]['color'] : '#00d29a', |
| 220 |
'link_hover_color' => isset($options["dark_mode_link_color_set9"]) ? $options["dark_mode_link_color_set9"]['hover'] : '#C1D2BB', |
| 221 |
'input_bg' => isset($options["dark_mode_input_color_set9"]) ? $options["dark_mode_input_color_set9"]['background'] : '#073d2f', |
| 222 |
'input_text_color' => isset($options["dark_mode_input_color_set9"]) ? $options["dark_mode_input_color_set9"]['color'] : '#C1D2BB', |
| 223 |
'input_placeholder_color' => isset($options["dark_mode_input_color_set9"]) ? $options["dark_mode_input_color_set9"]['placeholder'] : '#C1D2BB', |
| 224 |
'border_color' => isset($options["dark_mode_border_color_set9"]) ? $options["dark_mode_border_color_set9"] : '#095541', |
| 225 |
'btn_text_color' => isset($options["dark_mode_btn_color_set9"]) ? $options["dark_mode_btn_color_set9"]['color'] : '#C1D2BB', |
| 226 |
'btn_bg' => isset($options["dark_mode_btn_color_set9"]) ? $options["dark_mode_btn_color_set9"]['background'] : '#095541', |
| 227 |
'btn_text_hover_color' => isset($options["dark_mode_btn_color_set9"]) ? $options["dark_mode_btn_color_set9"]['hover_color'] : '#C1D2BB', |
| 228 |
'btn_hover_bg' => isset($options["dark_mode_btn_color_set9"]) ? $options["dark_mode_btn_color_set9"]['hover_background'] : '#073d2f', |
| 229 |
], |
| 230 |
'set10' => [ |
| 231 |
'bg' => isset($options["dark_mode_color_set10"]) ? $options["dark_mode_color_set10"]['background'] : '#171004', |
| 232 |
'secondary_bg' => isset($options["dark_mode_color_set10"]) ? $options["dark_mode_color_set10"]['secondary_background'] : '#211706', |
| 233 |
'text_color' => isset($options["dark_mode_link_color_set10"]) ? $options["dark_mode_link_color_set10"]['text'] : '#E0D2BD', |
| 234 |
'link_color' => isset($options["dark_mode_link_color_set10"]) ? $options["dark_mode_link_color_set10"]['color'] : '#e09525', |
| 235 |
'link_hover_color' => isset($options["dark_mode_link_color_set10"]) ? $options["dark_mode_link_color_set10"]['hover'] : '#E0D2BD', |
| 236 |
'input_bg' => isset($options["dark_mode_input_color_set10"]) ? $options["dark_mode_input_color_set10"]['background'] : '#372911', |
| 237 |
'input_text_color' => isset($options["dark_mode_input_color_set10"]) ? $options["dark_mode_input_color_set10"]['color'] : '#E0D2BD', |
| 238 |
'input_placeholder_color' => isset($options["dark_mode_input_color_set10"]) ? $options["dark_mode_input_color_set10"]['placeholder'] : '#E0D2BD', |
| 239 |
'border_color' => isset($options["dark_mode_border_color_set10"]) ? $options["dark_mode_border_color_set10"] : '#5D4010', |
| 240 |
'btn_text_color' => isset($options["dark_mode_btn_color_set10"]) ? $options["dark_mode_btn_color_set10"]['color'] : '#E0D2BD', |
| 241 |
'btn_bg' => isset($options["dark_mode_btn_color_set10"]) ? $options["dark_mode_btn_color_set10"]['background'] : '#5D4010', |
| 242 |
'btn_text_hover_color' => isset($options["dark_mode_btn_color_set10"]) ? $options["dark_mode_btn_color_set10"]['hover_color'] : '#E0D2BD', |
| 243 |
'btn_hover_bg' => isset($options["dark_mode_btn_color_set10"]) ? $options["dark_mode_btn_color_set10"]['hover_background'] : '#372911', |
| 244 |
], |
| 245 |
'set11' => [ |
| 246 |
'bg' => isset($options["dark_mode_color_set11"]) ? $options["dark_mode_color_set11"]['background'] : '#19081b', |
| 247 |
'secondary_bg' => isset($options["dark_mode_color_set11"]) ? $options["dark_mode_color_set11"]['secondary_background'] : '#210a24', |
| 248 |
'text_color' => isset($options["dark_mode_link_color_set11"]) ? $options["dark_mode_link_color_set11"]['text'] : '#c09dc2', |
| 249 |
'link_color' => isset($options["dark_mode_link_color_set11"]) ? $options["dark_mode_link_color_set11"]['color'] : '#c832d4', |
| 250 |
'link_hover_color' => isset($options["dark_mode_link_color_set11"]) ? $options["dark_mode_link_color_set11"]['hover'] : '#c09dc2', |
| 251 |
'input_bg' => isset($options["dark_mode_input_color_set11"]) ? $options["dark_mode_input_color_set11"]['background'] : '#2c082f', |
| 252 |
'input_text_color' => isset($options["dark_mode_input_color_set11"]) ? $options["dark_mode_input_color_set11"]['color'] : '#c09dc2', |
| 253 |
'input_placeholder_color' => isset($options["dark_mode_input_color_set11"]) ? $options["dark_mode_input_color_set11"]['placeholder'] : '#c09dc2', |
| 254 |
'border_color' => isset($options["dark_mode_border_color_set11"]) ? $options["dark_mode_border_color_set11"] : '#440649', |
| 255 |
'btn_text_color' => isset($options["dark_mode_btn_color_set11"]) ? $options["dark_mode_btn_color_set11"]['color'] : '#c09dc2', |
| 256 |
'btn_bg' => isset($options["dark_mode_btn_color_set11"]) ? $options["dark_mode_btn_color_set11"]['background'] : '#440649', |
| 257 |
'btn_text_hover_color' => isset($options["dark_mode_btn_color_set11"]) ? $options["dark_mode_btn_color_set11"]['hover_color'] : '#c09dc2', |
| 258 |
'btn_hover_bg' => isset($options["dark_mode_btn_color_set11"]) ? $options["dark_mode_btn_color_set11"]['hover_background'] : '#2c082f', |
| 259 |
], |
| 260 |
]; |
| 261 |
|
| 262 |
$selected_set_key = isset($options['color_pallets']) ? $options['color_pallets'] : 'set1'; |
| 263 |
$selected_set = $dark_mode_color_palettes[$selected_set_key] ?? $dark_mode_color_palettes['set1']; |
| 264 |
|
| 265 |
// Output as CSS variables |
| 266 |
foreach ($selected_set as $key => $value) { |
| 267 |
echo '--darkify_dark_mode_' . esc_attr($key) . ': ' . esc_attr($value) . ';'; |
| 268 |
} |
| 269 |
?> |
| 270 |
} |
| 271 |
</style> |
| 272 |
<?php } else { ?> |
| 273 |
<script type="text/javascript" class="darkify_inline_js">(function(){var s=localStorage.darkify_admin_panel_last_state,t=localStorage.darkify_selected_theme||'set1';if(s==='1'){var h=document.documentElement;h.classList.add('darkify_dark_mode_enabled');h.classList.add('darkify-'+t);}}());</script> |
| 274 |
<style type="text/css" class="darkify_inline_css"> |
| 275 |
:root { |
| 276 |
--darkify_dark_mode_bg: #181a1b; |
| 277 |
--darkify_dark_mode_secondary_bg: #202324; |
| 278 |
--darkify_dark_mode_text_color: #c8c4bd; |
| 279 |
--darkify_dark_mode_link_color: #6aafe2; |
| 280 |
--darkify_dark_mode_link_hover_color: #4f94c3; |
| 281 |
--darkify_dark_mode_input_bg: #2D2D2D; |
| 282 |
--darkify_dark_mode_input_text_color: #BEBEBE; |
| 283 |
--darkify_dark_mode_input_placeholder_color: #989898; |
| 284 |
--darkify_dark_mode_border_color: #4A4A4A; |
| 285 |
--darkify_dark_mode_btn_bg: #2D2D2D; |
| 286 |
--darkify_dark_mode_btn_text_color: #BEBEBE; |
| 287 |
--darkify_dark_mode_btn_hover_bg: #BEBEBE; |
| 288 |
--darkify_dark_mode_btn_text_hover_color: #2D2D2D; |
| 289 |
} |
| 290 |
</style> |
| 291 |
<?php } |
| 292 |
if ($enable_scrollbar_dark) { |
| 293 |
$dark_mode_scrollbar_track_bg = !empty($options["scrollbar_color"]) ? $options["scrollbar_color"]['dark_mode_scrollbar_track_bg'] : ''; |
| 294 |
$dark_mode_scrollbar_thumb_bg = !empty($options["scrollbar_color"]) ? $options["scrollbar_color"]['dark_mode_scrollbar_thumb_bg'] : ''; |
| 295 |
include DarkifyUtils::darkify_locate_template('views/scrollbar.php'); |
| 296 |
} |
| 297 |
?> |
| 298 |
|
| 299 |
<script type="text/javascript" class="darkify_inline_js"> |
| 300 |
var darkify_switch_unique_id = "<?php echo esc_attr($this->unique_id); ?>"; |
| 301 |
var darkify_is_this_admin_panel = "<?php echo esc_attr(is_admin() ? "1" : "0"); ?>"; |
| 302 |
var darkify_enable_default_dark_mode = "<?php echo esc_attr($enable_default_dark_mode); ?>"; |
| 303 |
var darkify_enable_os_aware = "<?php echo esc_attr($enable_os_aware); ?>"; |
| 304 |
var darkify_enable_keyboard_shortcut = "<?php echo esc_attr($enable_keyboard_shortcut); ?>"; |
| 305 |
var darkify_enable_time_based_dark = "<?php echo esc_attr($enable_time_based_dark); ?>"; |
| 306 |
var darkify_time_based_dark_start = "<?php echo esc_attr($time_based_dark_start ? $time_based_dark_start : "19:00"); ?>"; |
| 307 |
var darkify_time_based_dark_stop = "<?php echo esc_attr($time_based_dark_stop ? $time_based_dark_stop : "07:00"); ?>"; |
| 308 |
var darkify_enable_switch_dragging = "<?php echo esc_attr($enable_switch_dragging); ?>"; |
| 309 |
var darkify_enable_switch_attention = "<?php echo esc_attr($enable_switch_attention); ?>"; |
| 310 |
var darkify_switch_attention_effect = "<?php echo esc_attr($switch_attention_effect); ?>"; |
| 311 |
|
| 312 |
var darkify_alternative_dark_mode_switch = "<?php echo esc_attr($alternative_dark_mode_switcher); ?>"; |
| 313 |
var darkify_enable_frontend_iframe_dark_mode = "<?php echo esc_attr($enable_frontend_iframe_dark_mode); ?>"; |
| 314 |
var darkify_enable_low_image_brightness = "<?php echo esc_attr($enable_low_image_brightness); ?>"; |
| 315 |
var darkify_image_brightness_to = "<?php echo esc_attr($low_image_brightness_label); ?>"; |
| 316 |
var darkify_disallowed_low_brightness_images = "<?php echo esc_attr($disallowed_low_brightness_images); ?>"; |
| 317 |
var darkify_enable_image_grayscale = "<?php echo esc_attr($enable_image_grayscale); ?>"; |
| 318 |
var darkify_image_grayscale_to = "<?php echo esc_attr($image_grayscale_label); ?>"; |
| 319 |
var darkify_disallowed_grayscale_images = "<?php echo esc_attr($disallowed_low_grayscale_images); ?>"; |
| 320 |
var darkify_enable_bg_image_darken = "<?php echo esc_attr($enable_low_image_darken); ?>"; |
| 321 |
var darkify_bg_image_darken_to = "<?php echo esc_attr($low_image_darken_label); ?>"; |
| 322 |
var darkify_enable_invert_inline_svg = "<?php echo esc_attr($enable_invert_inline_svg); ?>"; |
| 323 |
var darkify_enable_invert_images = "<?php echo esc_attr($enable_invert_images); ?>"; |
| 324 |
var darkify_invert_images_allowed_urls = "<?php echo esc_attr($invert_images_allowed_urls_arr); ?>"; |
| 325 |
var darkify_image_replacements = "<?php echo esc_attr($image_replacements) ?>"; |
| 326 |
var darkify_enable_low_video_brightness = "<?php echo esc_attr($enable_low_video_brightness); ?>"; |
| 327 |
var darkify_video_brightness_to = "<?php echo esc_attr($low_video_brightness_label); ?>"; |
| 328 |
var darkify_enable_video_grayscale = "<?php echo esc_attr($enable_video_grayscale); ?>"; |
| 329 |
var darkify_video_grayscale_to = "<?php echo esc_attr($video_grayscale_label); ?>"; |
| 330 |
var darkify_video_replacements = "<?PHP echo esc_attr($video_replacements); ?>"; |
| 331 |
var darkify_allowed_elements = "<?php echo esc_attr($this->utils->generateAllowedElementsStr($options)); ?>"; |
| 332 |
var darkify_allowed_elements_raw = "<?php echo esc_attr($allowed_elements); ?>"; |
| 333 |
var darkify_allowed_elements_force_to_correct = "<?php echo esc_attr($allowed_elements_force_to_correct); ?>"; |
| 334 |
|
| 335 |
var darkify_disallowed_elements = "<?php echo esc_attr($this->utils->generateDisallowedElementsStr($options, $this->external_support)); ?>"; |
| 336 |
var darkify_disallowed_elements_raw = "<?php echo esc_attr($disallowed_elements); ?>"; |
| 337 |
var darkify_disallowed_elements_force_to_correct = "<?php echo esc_attr($disallowed_elements_force_to_correct); ?>"; |
| 338 |
|
| 339 |
var darkify_allowed_btn_class = <?php echo json_encode($this->utils->addButtonClassByDarkify($options)); ?>; |
| 340 |
</script> |
| 341 |
<?php |
| 342 |
$output = ob_get_clean(); |
| 343 |
$tags_allowed_in_output = array( |
| 344 |
'style' => array('type' => array(), 'class' => array()), |
| 345 |
'script' => array('type' => array(), 'class' => array()) |
| 346 |
); |
| 347 |
echo wp_kses($this->utils->minify_string($output), $tags_allowed_in_output); |
| 348 |
|