controller = $controller; $this->options = $controller->get_options(); $enabled = $this->options->enabled; $preview = $this->options->preview_mode; if ($preview || $enabled || $force) { $this->wpfront_notification_bar_css(); $this->div_wpfront_message_css(); $this->a_wpfront_button_css(); $this->open_button_css(); $this->table_css(); $this->div_wpfront_close_css(); $this->div_wpfront_close_hover_css(); $this->display_on_devices(); $this->hide_small_window(); $this->custom_css(); } } protected function wpfront_notification_bar_css() { $id_suffix = $this->controller->get_html_id_suffix(); echo "#wpfront-notification-bar$id_suffix, #wpfront-notification-bar-editor"; ?> { background: options->bar_from_color; ?>; background: -moz-linear-gradient(top, options->bar_from_color; ?> 0%, options->bar_to_color; ?> 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,options->bar_from_color; ?>), color-stop(100%,options->bar_to_color; ?>)); background: -webkit-linear-gradient(top, options->bar_from_color; ?> 0%,options->bar_to_color; ?> 100%); background: -o-linear-gradient(top, options->bar_from_color; ?> 0%,options->bar_to_color; ?> 100%); background: -ms-linear-gradient(top, options->bar_from_color; ?> 0%,options->bar_to_color; ?> 100%); background: linear-gradient(to bottom, options->bar_from_color; ?> 0%, options->bar_to_color; ?> 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='options->bar_from_color; ?>', endColorstr='options->bar_to_color; ?>',GradientType=0 ); background-repeat: no-repeat; options->set_full_width_message) { ?> flex-direction: column; } controller->get_html_id_suffix(); echo "#wpfront-notification-bar-table$id_suffix, .wpfront-notification-bar tbody, .wpfront-notification-bar tr"; ?> { options->set_full_width_message) { ?> width: 100% } controller->get_html_id_suffix(); echo "#wpfront-notification-bar$id_suffix div.wpfront-message, #wpfront-notification-bar-editor.wpfront-message"; ?> { color: options->message_color; ?>; options->set_full_width_message) { ?> width: 100% } controller->get_html_id_suffix(); echo "#wpfront-notification-bar$id_suffix a.wpfront-button, #wpfront-notification-bar-editor a.wpfront-button"; ?> { background: options->button_from_color; ?>; background: -moz-linear-gradient(top, options->button_from_color; ?> 0%, options->button_to_color; ?> 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,options->button_from_color; ?>), color-stop(100%,options->button_to_color; ?>)); background: -webkit-linear-gradient(top, options->button_from_color; ?> 0%,options->button_to_color; ?> 100%); background: -o-linear-gradient(top, options->button_from_color; ?> 0%,options->button_to_color; ?> 100%); background: -ms-linear-gradient(top, options->button_from_color; ?> 0%,options->button_to_color; ?> 100%); background: linear-gradient(to bottom, options->button_from_color; ?> 0%, options->button_to_color; ?> 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='options->button_from_color; ?>', endColorstr='options->button_to_color; ?>',GradientType=0 ); background-repeat: no-repeat; color: options->button_text_color; ?>; } controller->get_html_id_suffix(); echo "#wpfront-notification-bar-open-button$id_suffix"; ?> { background-color: options->open_button_color; ?>; right: options->reopen_button_offset; ?>px; options->reopen_button_image_url)) { echo "background-image: url({$this->options->reopen_button_image_url});"; } ?> } options->reopen_button_image_url)) { $url_top = plugins_url('images/arrow_down.png', $this->controller->get_plugin_file()); $url_bottom = plugins_url('images/arrow_up.png', $this->controller->get_plugin_file()); echo "#wpfront-notification-bar-open-button$id_suffix.top"; ?> { background-image: url(); } { background-image: url(); } controller->get_html_id_suffix(); echo "#wpfront-notification-bar$id_suffix div.wpfront-close"; ?> { border: 1px solid options->close_button_color; ?>; background-color: options->close_button_color; ?>; color: options->close_button_color_x; ?>; } controller->get_html_id_suffix(); echo "#wpfront-notification-bar$id_suffix div.wpfront-close:hover"; ?> { border: 1px solid options->close_button_color_hover; ?>; background-color: options->close_button_color_hover; ?>; } options->hide_small_device) { case 'small': $this->display_on_small_device(); break; case 'large': $this->display_on_large_device(); break; default: $this->display_on_all_device(); break; } } protected function display_on_all_device() { $id_suffix = $this->controller->get_html_id_suffix(); echo " #wpfront-notification-bar-spacer$id_suffix { display:block; }"; } protected function display_on_small_device() { $id_suffix = $this->controller->get_html_id_suffix(); echo " #wpfront-notification-bar-spacer$id_suffix { display:none; }@media screen and (max-device-width:{$this->options->small_device_width}px) { #wpfront-notification-bar-spacer$id_suffix { display:block; } }"; } protected function display_on_large_device() { $id_suffix = $this->controller->get_html_id_suffix(); echo "@media screen and (max-device-width: {$this->options->small_device_width}px) { #wpfront-notification-bar-spacer$id_suffix { display:none; } }"; } protected function hide_small_window() { if ($this->options->hide_small_window) { $id_suffix = $this->controller->get_html_id_suffix(); echo "@media screen and (max-width: {$this->options->small_window_width}px) { #wpfront-notification-bar-spacer$id_suffix { display:none; } }"; } } protected function custom_css() { echo wp_strip_all_tags($this->options->custom_css, true); } } }