PluginProbe ʕ •ᴥ•ʔ
My Sticky Bar – Floating Notification Bar & Sticky Header (formerly myStickymenu) / 2.2.5
My Sticky Bar – Floating Notification Bar & Sticky Header (formerly myStickymenu) v2.2.5
2.9.1 2.9.0 2.8.9 2.8.8 trunk 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9 1.9.1 2.0 2.0.1 2.0.3 2.0.4 2.0.5 2.0.6 2.1 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.6.7 2.6.8 2.6.9 2.7 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7
mystickymenu / welcome-bar.php
mystickymenu Last commit date
css 6 years ago fonts 7 years ago images 6 years ago js 6 years ago languages 7 years ago class-review-box.php 6 years ago index.php 8 years ago mystickymenu-affiliate.php 6 years ago mystickymenu-fonts.php 6 years ago mystickymenu.php 6 years ago readme.txt 6 years ago uninstall.php 7 years ago welcome-bar.php 6 years ago
welcome-bar.php
925 lines
1 <?php
2
3 function mysticky_welcome_bar_backend() {
4 $nonce = wp_create_nonce('mysticky_option_welcomebar_update');
5 $nonce_reset = wp_create_nonce('mysticky_option_welcomebar_reset');
6
7 $welcomebar = get_option( 'mysticky_option_welcomebar' );
8 if ( $welcomebar == '' || empty($welcomebar)) {
9 $welcomebar = mysticky_welcomebar_pro_widget_default_fields();
10 }
11
12 $mysticky_welcomebar_showx_desktop = $mysticky_welcomebar_showx_mobile = '';
13 $mysticky_welcomebar_btn_desktop = $mysticky_welcomebar_btn_mobile = '';
14 $mysticky_welcomebar_display_desktop = $mysticky_welcomebar_display_mobile = '';
15 if( isset($welcomebar['mysticky_welcomebar_x_desktop']) ) {
16 $mysticky_welcomebar_showx_desktop = ' mysticky-welcomebar-showx-desktop';
17 }
18 if( isset($welcomebar['mysticky_welcomebar_x_mobile']) ) {
19 $mysticky_welcomebar_showx_mobile = ' mysticky-welcomebar-showx-mobile';
20 }
21 if( isset($welcomebar['mysticky_welcomebar_btn_desktop']) ) {
22 $mysticky_welcomebar_btn_desktop = ' mysticky-welcomebar-btn-desktop';
23 }
24 if( isset($welcomebar['mysticky_welcomebar_btn_mobile']) ) {
25 $mysticky_welcomebar_btn_mobile = ' mysticky-welcomebar-btn-mobile';
26 }
27 $display_main_class = "mysticky-welcomebar-position-" . $welcomebar['mysticky_welcomebar_position'] . $mysticky_welcomebar_showx_desktop . $mysticky_welcomebar_showx_mobile . $mysticky_welcomebar_btn_desktop . $mysticky_welcomebar_btn_mobile;
28 ?>
29 <form class="mysticky-welcomebar-form" id="mysticky_welcomebar_form" method="post" action="#">
30 <div class="mysticky-welcomebar-header-title">
31 <h3><?php _e('Welcome Bar', 'myStickymenu'); ?></h3>
32 <label for="mysticky-welcomebar-contact-form-enabled" class="mysticky-welcomebar-switch">
33 <input type="checkbox" id="mysticky-welcomebar-contact-form-enabled" name="mysticky_option_welcomebar[mysticky_welcomebar_enable]" value="1" <?php checked( @$welcomebar['mysticky_welcomebar_enable'], '1' );?> />
34 <span class="slider"></span>
35 </label>
36 </div>
37 <div class="mysticky-welcomebar-setting-wrap">
38 <div class="mysticky-welcomebar-setting-left">
39 <div class="mysticky-welcomebar-setting-block">
40 <div class="mysticky-welcomebar-subheader-title">
41 <h4><?php _e('Design', 'myStickymenu'); ?></h4>
42 </div>
43 <div class="mysticky-welcomebar-setting-content mysticky-welcomebar-setting-position">
44 <label><?php _e('Position', 'myStickymenu'); ?></label>
45 <div class="mysticky-welcomebar-setting-content-right">
46 <label>
47 <input name="mysticky_option_welcomebar[mysticky_welcomebar_position]" value= "top" type="radio" <?php checked( @$welcomebar['mysticky_welcomebar_position'], 'top' );?> />
48 <?php _e("Top", 'mystickymenu'); ?>
49 </label>
50 <label>
51 <input name="mysticky_option_welcomebar[mysticky_welcomebar_position]" value="bottom" type="radio" disabled />
52 <?php _e("Bottom", 'mystickymenu'); ?>
53 </label>
54 <span class="myStickymenu-upgrade"><a class="sticky-header-upgrade-now" href="#" target="_blank"><?php _e( 'Upgrade Now', 'mystickymenu' );?></a></span>
55 </div>
56 </div>
57 <div class="mysticky-welcomebar-setting-content">
58 <label><?php _e('Height', 'myStickymenu'); ?></label>
59 <div class="mysticky-welcomebar-setting-content-right">
60 <div class="px-wrap">
61 <input type="number" class="" min="0" step="1" id="mysticky_welcomebar_height" name="mysticky_option_welcomebar[mysticky_welcomebar_height]" value="60" disabled />
62 <span class="input-px">PX</span>
63 </div>
64 <span class="myStickymenu-upgrade"><a class="sticky-header-upgrade-now" href="#" target="_blank"><?php _e( 'Upgrade Now', 'mystickymenu' );?></a></span>
65 </div>
66 </div>
67 <div class="mysticky-welcomebar-setting-content">
68 <label><?php _e('Background Color', 'myStickymenu'); ?></label>
69 <div class="mysticky-welcomebar-setting-content-right mysticky-welcomebar-colorpicker">
70 <input type="text" id="mysticky_welcomebar_bgcolor" name="mysticky_option_welcomebar[mysticky_welcomebar_bgcolor]" class="my-color-field" value="<?php echo $welcomebar['mysticky_welcomebar_bgcolor'];?>" />
71 </div>
72 </div>
73 <div class="mysticky-welcomebar-setting-content">
74 <label><?php _e('Background Text Color', 'myStickymenu'); ?></label>
75 <div class="mysticky-welcomebar-setting-content-right mysticky-welcomebar-colorpicker">
76 <input type="text" id="mysticky_welcomebar_bgtxtcolor" name="mysticky_option_welcomebar[mysticky_welcomebar_bgtxtcolor]" class="my-color-field" value="<?php echo $welcomebar['mysticky_welcomebar_bgtxtcolor'];?>" />
77 </div>
78 </div>
79 <div class="mysticky-welcomebar-setting-content">
80 <label><?php _e('Font', 'myStickymenu'); ?></label>
81 <div class="mysticky-welcomebar-setting-content-right">
82 <select name="mysticky_option_welcomebar[mysticky_welcomebar_font]" class="form-fonts">
83 <option value=""><?php _e( 'Select font family', 'myStickymenu' );?></option>
84 <?php $group= ''; foreach( myStickymenu_fonts() as $key=>$value):
85 if ($value != $group){
86 echo '<optgroup label="' . $value . '">';
87 $group = $value;
88 }
89 ?>
90 <option value="<?php echo esc_attr($key);?>" <?php selected( @$welcomebar['mysticky_welcomebar_font'], $key ); ?>><?php echo esc_html($key);?></option>
91 <?php endforeach;?>
92 </select>
93 </div>
94 </div>
95 <div class="mysticky-welcomebar-setting-content">
96 <label><?php _e('Font Size', 'myStickymenu'); ?></label>
97 <div class="mysticky-welcomebar-setting-content-right">
98 <div class="px-wrap">
99 <input type="number" class="" min="0" step="1" id="mysticky_welcomebar_fontsize" name="mysticky_option_welcomebar[mysticky_welcomebar_fontsize]" value="<?php echo @$welcomebar['mysticky_welcomebar_fontsize'];?>" />
100 <span class="input-px">PX</span>
101 </div>
102 </div>
103 </div>
104 <div class="mysticky-welcomebar-setting-content">
105 <label><?php _e('Bar Text', 'myStickymenu'); ?></label>
106 <div class="mysticky-welcomebar-setting-content-right">
107 <input type="text" id="mysticky_bar_text" class="mystickyinput" name="mysticky_option_welcomebar[mysticky_welcomebar_bar_text]" value="<?php echo esc_attr( stripslashes($welcomebar['mysticky_welcomebar_bar_text']));?>" />
108 </div>
109 </div>
110 <div class="mysticky-welcomebar-setting-content">
111 <label><?php _e('Show X', 'myStickymenu'); ?></label>
112 <div class="mysticky-welcomebar-setting-content-right">
113 <label>
114 <input name="mysticky_option_welcomebar[mysticky_welcomebar_x_desktop]" value= "desktop" type="checkbox" <?php checked( @$welcomebar['mysticky_welcomebar_x_desktop'], 'desktop' );?> />
115 <?php _e( 'Desktop', 'mystickymenu' );?>
116 </label>
117 <label>
118 <input name="mysticky_option_welcomebar[mysticky_welcomebar_x_mobile]" value= "mobile" type="checkbox" <?php checked( @$welcomebar['mysticky_welcomebar_x_mobile'], 'mobile' );?> />
119 <?php _e( 'Mobile', 'mystickymenu' );?>
120 </label>
121 </div>
122 </div>
123 </div>
124 <div class="mysticky-welcomebar-setting-block">
125 <div class="mysticky-welcomebar-subheader-title">
126 <h4><?php _e('Button', 'myStickymenu'); ?></h4>
127 </div>
128 <div class="mysticky-welcomebar-setting-content">
129 <label><?php _e('Button', 'myStickymenu'); ?></label>
130 <div class="mysticky-welcomebar-setting-content-right">
131 <label>
132 <input name="mysticky_option_welcomebar[mysticky_welcomebar_btn_desktop]" value= "desktop" type="checkbox" <?php checked( @$welcomebar['mysticky_welcomebar_btn_desktop'], 'desktop' );?> />
133 <?php _e( 'Desktop', 'mystickymenu' );?>
134 </label>
135 <label>
136 <input name="mysticky_option_welcomebar[mysticky_welcomebar_btn_mobile]" value= "mobile" type="checkbox"<?php checked( @$welcomebar['mysticky_welcomebar_btn_mobile'], 'mobile' );?> />
137 <?php _e( 'Mobile', 'mystickymenu' );?>
138 </label>
139 </div>
140 </div>
141 <div class="mysticky-welcomebar-setting-content">
142 <label><?php _e('Button Color', 'myStickymenu'); ?></label>
143 <div class="mysticky-welcomebar-setting-content-right mysticky-welcomebar-colorpicker">
144 <input type="text" id="mysticky_welcomebar_btncolor" name="mysticky_option_welcomebar[mysticky_welcomebar_btncolor]" class="my-color-field" value="<?php echo esc_attr($welcomebar['mysticky_welcomebar_btncolor']);?>" />
145 </div>
146 </div>
147 <div class="mysticky-welcomebar-setting-content">
148 <label><?php _e('Button Text Color', 'myStickymenu'); ?></label>
149 <div class="mysticky-welcomebar-setting-content-right mysticky-welcomebar-colorpicker">
150 <input type="text" id="mysticky_welcomebar_btntxtcolor" name="mysticky_option_welcomebar[mysticky_welcomebar_btntxtcolor]" class="my-color-field" value="<?php echo $welcomebar['mysticky_welcomebar_btntxtcolor'];?>" />
151 </div>
152 </div>
153 <div class="mysticky-welcomebar-setting-content">
154 <label><?php _e('Button Text', 'myStickymenu'); ?></label>
155 <div class="mysticky-welcomebar-setting-content-right">
156 <input type="text" id="mysticky_welcomebar_btn_text" class="mystickyinput" name="mysticky_option_welcomebar[mysticky_welcomebar_btn_text]" value="<?php echo $welcomebar['mysticky_welcomebar_btn_text'];?>" />
157 </div>
158 </div>
159 <div class="mysticky-welcomebar-setting-content">
160 <label><?php _e('Action', 'myStickymenu'); ?></label>
161 <div class="mysticky-welcomebar-setting-content-right mysticky-welcomebar-setting-redirect-wrap">
162 <div class="mysticky-welcomebar-setting-action">
163 <select name="mysticky_option_welcomebar[mysticky_welcomebar_actionselect]" class="mysticky-welcomebar-action">
164 <option value="redirect_to_url" <?php selected( @$welcomebar['mysticky_welcomebar_actionselect'], 'redirect_to_url' ); ?>><?php _e( 'Redirect to URL', 'myStickymenu' );?></option>
165 <option value="close_bar" <?php selected( @$welcomebar['mysticky_welcomebar_actionselect'], 'close_bar' ); ?>><?php _e( 'Close bar', 'myStickymenu' );?></option>
166 </select>
167 </div>
168 <div class="mysticky-welcomebar-setting-action mysticky-welcomebar-redirect" <?php if ( $welcomebar['mysticky_welcomebar_actionselect'] == 'close_bar' ) : ?> style="display:none;" <?php endif;?> >
169 <input type="text" id="mysticky_welcomebar_redirect" class="mystickyinput" name="mysticky_option_welcomebar[mysticky_welcomebar_redirect]" value="<?php echo esc_url($welcomebar['mysticky_welcomebar_redirect']);?>" placeholder="<?php echo esc_url("https://www.yourdomain.com"); ?>" />
170 </div>
171 <div class="mysticky-welcomebar-setting-newtab mysticky-welcomebar-redirect" <?php if ( $welcomebar['mysticky_welcomebar_actionselect'] == 'close_bar' ) : ?> style="display:none;" <?php endif;?> >
172 <label>
173 <input name="mysticky_option_welcomebar[mysticky_welcomebar_redirect_newtab]" value= "1" type="checkbox" disabled />
174 <?php _e( 'Open in a new tab', 'mystickymenu' );?>
175 </label>
176 <span class="myStickymenu-upgrade"><a class="sticky-header-upgrade-now" href="#" target="_blank"><?php _e( 'Upgrade Now', 'mystickymenu' );?></a></span>
177 </div>
178 </div>
179 </div>
180 <div class="mysticky-welcomebar-setting-content mysticky-welcomebar-setting-remove-getbar">
181 <label><?php _e('Remove Get Bar', 'myStickymenu'); ?></label>
182 <div class="mysticky-welcomebar-setting-content-right">
183 <div class="mysticky-welcomebar-switch">
184 <input type="checkbox" id="mysticky-welcomebar-remove-getbar" name="mysticky_option_welcomebar[mysticky_welcomebar_remove_getbar]" value="1" disabled />
185 <span class="slider"></span>
186 </div>
187 <span class="myStickymenu-upgrade"><a class="sticky-header-upgrade-now" href="#" target="_blank"><?php _e( 'Upgrade Now', 'mystickymenu' );?></a></span>
188 </div>
189 </div>
190 </div>
191 <div class="mysticky-welcomebar-setting-block">
192 <div class="mysticky-welcomebar-subheader-title">
193 <h4><?php _e('Display Rules', 'myStickymenu'); ?></h4>
194 </div>
195 <div class="mysticky-welcomebar-upgrade-main mysticky_device_upgrade">
196 <span class="myStickymenu-upgrade">
197 <a class="sticky-header-upgrade-now" href="#" target="_blank"><?php _e( ' Upgrade Now', 'mystickymenu' );?></a>
198 </span>
199 <div class="mysticky-welcomebar-setting-content">
200 <label><?php _e('Devices', 'myStickymenu'); ?></label>
201 <div class="mysticky-welcomebar-setting-content-right">
202 <label>
203 <input name="mysticky_option_welcomebar[mysticky_welcomebar_device_desktop]" value= "desktop" type="checkbox" checked disabled />
204 <?php _e( 'Desktop', 'mystickymenu' );?>
205 </label>
206 <label>
207 <input name="mysticky_option_welcomebar[mysticky_welcomebar_device_mobile]" value= "mobile" type="checkbox" checked disabled />
208 <?php _e( 'Mobile', 'mystickymenu' );?>
209 </label>
210 </div>
211 </div>
212 <div class="mysticky-welcomebar-setting-content">
213 <label><?php _e('Trigger', 'myStickymenu'); ?></label>
214 <div class="mysticky-welcomebar-setting-content-right">
215 <div class="mysticky-welcomebar-setting-action mysticky-welcomebar-trigger-wrap">
216 <label>
217 <input type="radio" name="mysticky_option_welcomebar[mysticky_welcomebar_trigger]" value="after_a_few_seconds" checked disabled />&nbsp;<?php _e( 'After a few seconds', 'myStickymenu' );?>
218 </label>
219 <label>
220 <input type="radio" name="mysticky_option_welcomebar[mysticky_welcomebar_trigger]" value="after_scroll" disabled />&nbsp;<?php _e( 'After Scroll', 'myStickymenu' );?>
221 </label>
222 </div>
223 <div class="mysticky-welcomebar-setting-action mysticky-welcomebar-triggersec">
224 <div class="px-wrap">
225 <input type="number" class="" min="0" step="1" id="mysticky_welcomebar_triggersec" name="mysticky_option_welcomebar[mysticky_welcomebar_triggersec]" value="0" disabled />
226 <span class="input-px"><?php echo ( isset($welcomebar['mysticky_welcomebar_trigger']) && $welcomebar['mysticky_welcomebar_trigger'] == 'after_scroll' ) ? '%' : 'Sec'; ?></span>
227 </div>
228 </div>
229 </div>
230 </div>
231 <div class="mysticky-welcomebar-setting-content">
232 <label><?php _e('Expiry date', 'myStickymenu'); ?></label>
233 <div class="mysticky-welcomebar-setting-content-right">
234 <div class="mysticky-welcomebar-expirydate">
235 <input type="text" id="mysticky_welcomebar_expirydate" name="mysticky_option_welcomebar[mysticky_welcomebar_expirydate]" placeholder="<?php _e('No expiry date', 'myStickymenu'); ?>" value="" disabled />
236 <span class="dashicons dashicons-calendar-alt"></span>
237 </div>
238 </div>
239 </div>
240 <div class="mysticky-welcomebar-setting-content show-on-apper">
241 <label><?php _e('Page targeting', 'myStickymenu'); ?></label>
242 <div class="mysticky-welcomebar-setting-content-right">
243 <a href="javascript:void(0);" class="create-rule" id="create-rule"><?php esc_html_e( "Add Rule", "mystickyelements" );?></a>
244 </div>
245 <div class="mysticky-welcomebar-page-options-html" style="display: none">
246 <div class="mysticky-welcomebar-page-option">
247 <div class="url-content">
248 <div class="mysticky-welcomebar-url-select">
249 <select name="mysticky_option_welcomebar[page_settings][__count__][shown_on]" id="url_shown_on___count___option" disabled>
250 <option value="show_on"><?php esc_html_e("Show on", "mysticky" );?></option>
251 <option value="not_show_on"><?php esc_html_e("Don't show on", "mysticky" );?></option>
252 </select>
253 </div>
254 <div class="mysticky-welcomebar-url-option">
255 <select class="mysticky-welcomebar-url-options" name="mysticky_option_welcomebar[page_settings][__count__][option]" id="url_rules___count___option" disabled>
256 <option selected="selected" disabled value=""><?php esc_html_e("Select Rule", "mysticky" );?></option>
257 </select>
258 </div>
259 <div class="mysticky-welcomebar-url-box">
260 <span class='mysticky-welcomebar-url'><?php echo site_url("/"); ?></span>
261 </div>
262 <div class="mysticky-welcomebar-url-values">
263 <input type="text" value="" name="mysticky_option_welcomebar[page_settings][__count__][value]" id="url_rules___count___value" disabled />
264 </div>
265 <div class="clear"></div>
266 </div>
267 </div>
268 </div>
269 <div class="mysticky-welcomebar-page-options mysticky-welcomebar-setting-content-right" id="mysticky-welcomebar-page-options" style="display:none"></div>
270 </div>
271 </div>
272 </div>
273 </div>
274 <div class="mysticky-welcomebar-setting-right">
275 <div class="mysticky-welcomebar-header-title">
276 <h3><?php _e('Preview', 'mystickyelements'); ?></h3>
277 </div>
278 <div class="mysticky-welcomebar-preview-screen">
279 <link href="https://fonts.googleapis.com/css?family=<?php echo $welcomebar['mysticky_welcomebar_font'] ?>:400,600,700|Lato:400,500,600,700" rel="stylesheet" type="text/css" class="sfba-google-font">
280 <div class="mysticky-welcomebar-fixed mysticky-welcomebar-display-desktop <?php echo $display_main_class; ?>" >
281 <div class="mysticky-welcomebar-content">
282 <p><?php echo isset($welcomebar['mysticky_welcomebar_bar_text'])? stripslashes($welcomebar['mysticky_welcomebar_bar_text']) :"Get 30% off your first purchase";?></p>
283 </div>
284 <div class="mysticky-welcomebar-btn">
285 <a href="#" ><?php echo isset($welcomebar['mysticky_welcomebar_btn_text']) ? $welcomebar['mysticky_welcomebar_btn_text'] : "Got it!";?></a>
286 </div>
287 <a href="javascript:void(0)" class="mysticky-welcomebar-close">X</a>
288 <a href="#" class="mysticky-welcomebar-getbar"><?php _e( 'Get Bar', 'mystickymenu' );?></a>
289 </div>
290 </div>
291 </div>
292 </div>
293 <div class="mysticky-welcomebar-submit">
294 <input type="submit" name="submit" id="submit" class="button button-primary" value="<?php _e('Save', 'mystickymenu');?>">
295 </div>
296 <input type="hidden" name="nonce" value="<?php echo $nonce; ?>">
297 <input type="hidden" name="active_tab_element" value="1">
298 <input type="hidden" id="save_welcome_bar" name="save_welcome_bar" value="">
299
300 </form>
301 <form class="mysticky-welcomebar-form-reset" method="post" action="#">
302 <div class="mysticky-welcomebar-submit">
303 <input type="submit" name="mysticky_welcomebar_reset" id="reset" class="button button-secondary" value="<?php _e('Reset', 'mystickymenu');?>">
304 </div>
305 <input type="hidden" name="nonce_reset" value="<?php echo $nonce_reset; ?>">
306 <input type="hidden" name="active_tab_element" value="1">
307 </form>
308 <div id="mysticky-welcomebar-save-confirm" style="display:none;" title="<?php esc_attr_e( 'Welcome Bar is currently off', 'mystickymenu' ); ?>">
309 <p>
310 <?php _e('Your Welcome Bar is currently turned off, would you like to save and show it on your site?', 'mystickymenu' ); ?>
311 </p>
312 </div>
313 <style>
314 .mysticky-welcomebar-fixed {
315 height: 60px;
316 background-color: <?php echo $welcomebar['mysticky_welcomebar_bgcolor'] ?>;
317 font-family: <?php echo $welcomebar['mysticky_welcomebar_font'] ?>;
318 position: absolute;
319 left: 0;
320 right: 0;
321 display: none;
322 align-items: center;
323 justify-content: center;
324 padding: 20px 30px 20px 10px;
325 z-index: 9999999;
326 }
327 .mysticky-welcomebar-preview-mobile-screen .mysticky-welcomebar-fixed{
328 padding: 0 25px;
329 }
330 .mysticky-welcomebar-display-desktop.mysticky-welcomebar-fixed {
331 display: flex;
332 }
333 .mysticky-welcomebar-position-top {
334 top:0;
335 }
336 .mysticky-welcomebar-position-bottom {
337 bottom:0;
338 }
339 .mysticky-welcomebar-fixed .mysticky-welcomebar-content p {
340 color: <?php echo $welcomebar['mysticky_welcomebar_bgtxtcolor'] ?>;
341 font-size: <?php echo $welcomebar['mysticky_welcomebar_fontsize'] ?>px;
342 font-family: inherit;
343 margin: 0;
344 padding: 0;
345 line-height: 1.2;
346 font-weight: 400;
347 }
348 .mysticky-welcomebar-fixed .mysticky-welcomebar-btn {
349 padding-left: 30px;
350 display: none;
351 }
352 .mysticky-welcomebar-fixed.mysticky-welcomebar-btn-desktop .mysticky-welcomebar-btn {
353 display: block;
354 }
355 .mysticky-welcomebar-fixed .mysticky-welcomebar-btn a {
356 background-color: <?php echo $welcomebar['mysticky_welcomebar_btncolor'] ?>;
357 font-family: inherit;
358 color: <?php echo $welcomebar['mysticky_welcomebar_btntxtcolor'] ?>;
359 border-radius: 4px;
360 text-decoration: none;
361 display: inline-block;
362 vertical-align: top;
363 line-height: 1.2;
364 font-size: <?php echo $welcomebar['mysticky_welcomebar_fontsize'] ?>px;
365 font-weight: 400;
366 padding: 5px 20px;
367 white-space: nowrap;
368 }
369 .mysticky-welcomebar-fixed .mysticky-welcomebar-btn a:hover {
370 /*opacity: 0.7;*/
371 -moz-box-shadow: 1px 2px 4px rgba(0, 0, 0,0.5);
372 -webkit-box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.5);
373 box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.5);
374 }
375 .mysticky-welcomebar-fixed .mysticky-welcomebar-close {
376 display: none;
377 vertical-align: top;
378 width: 20px;
379 height: 20px;
380 text-align: center;
381 text-decoration: none;
382 line-height: 20px;
383 border-radius: 5px;
384 color: #000;
385 position: absolute;
386 font-family: Lato;
387 top: 5px;
388 right: 5px;
389 -webkit-transition: all 0.5s ease 0s;
390 -moz-transition: all 0.5s ease 0s;
391 transition: all 0.5s ease 0s;
392 -webkit-transform-origin: 50% 50%;
393 -moz-transform-origin: 50% 50%;
394 transform-origin: 50% 50%;
395 }
396 .mysticky-welcomebar-fixed .mysticky-welcomebar-close:hover {
397 opacity: 0.5;
398 -webkit-transform: rotate(180deg);
399 -moz-transform: rotate(180deg);
400 transform: rotate(180deg);
401 }
402 .mysticky-welcomebar-fixed.mysticky-welcomebar-showx-desktop .mysticky-welcomebar-close {
403 display: inline-block;
404 }
405 .mysticky-welcomebar-getbar:focus,
406 .mysticky-welcomebar-getbar:active,
407 .mysticky-welcomebar-getbar {
408 background-color: rgba(140,140,140,0.5) !important;
409 border-radius: 8px !important;
410 color: #FFFFFF !important;
411 position: absolute !important;
412 padding: 3px !important;
413 bottom: 3px !important;
414 left: 3px !important;
415 font-size: 10px !important;
416 line-height: 1.4 !important;
417 margin: 0 !important;
418 display: inline-block !important;
419 vertical-align: top !important;
420 font-family: Poppins !important;
421 text-decoration: none !important;
422 visibility: visible !important;
423 }
424 .mysticky-welcomebar-getbar:hover {
425 color: #000000 !important;
426 opacity: 0.5 !important;
427 }
428
429 @media only screen and (max-width: 1024px) {
430 .mysticky-welcomebar-fixed {
431 padding: 0 20px 0 10px;
432 }
433 .mysticky-welcomebar-fixed .mysticky-welcomebar-close {
434 width: 20px;
435 height: 20px;
436 line-height: 20px;
437 right: 0px;
438 }
439 }
440 </style>
441
442 <?php
443 }
444
445 function mysticky_welcomebar_pro_widget_default_fields() {
446 return array(
447 'mysticky_welcomebar_position' => 'top',
448 'mysticky_welcomebar_height' => '60',
449 'mysticky_welcomebar_bgcolor' => '#03ed96',
450 'mysticky_welcomebar_bgtxtcolor' => '#000000',
451 'mysticky_welcomebar_font' => 'Poppins',
452 'mysticky_welcomebar_fontsize' => '16',
453 'mysticky_welcomebar_bar_text' => 'Get 30% off your first purchase',
454 'mysticky_welcomebar_x_desktop' => 'desktop',
455 'mysticky_welcomebar_x_mobile' => 'mobile',
456 'mysticky_welcomebar_btn_desktop' => 'desktop',
457 'mysticky_welcomebar_btn_mobile' => 'mobile',
458 'mysticky_welcomebar_btncolor' => '#000000',
459 'mysticky_welcomebar_btntxtcolor' => '#ffffff',
460 'mysticky_welcomebar_btn_text' => 'Got it!',
461 'mysticky_welcomebar_actionselect' => 'close_bar',
462 'mysticky_welcomebar_redirect' => 'https://www.yourdomain.com',
463 'mysticky_welcomebar_redirect_newtab' => '',
464 'mysticky_welcomebar_device_desktop' => 'desktop',
465 'mysticky_welcomebar_device_mobile' => 'mobile',
466 'mysticky_welcomebar_trigger' => 'after_a_few_seconds',
467 'mysticky_welcomebar_triggersec' => '0',
468 'mysticky_welcomebar_expirydate' => '',
469 'mysticky_welcomebar_page_settings' => '',
470 );
471 }
472
473 function mysticky_welcome_bar_frontend(){
474 $welcomebar = get_option( 'mysticky_option_welcomebar' );
475
476 if ( ( isset($welcomebar['mysticky_welcomebar_expirydate']) && $welcomebar['mysticky_welcomebar_expirydate'] !='' && strtotime( date('m/d/Y')) > strtotime($welcomebar['mysticky_welcomebar_expirydate']) ) || !isset($welcomebar['mysticky_welcomebar_enable'] ) ) {
477 return;
478 }
479 $mysticky_welcomebar_showx_desktop = $mysticky_welcomebar_showx_mobile = '';
480 $mysticky_welcomebar_btn_desktop = $mysticky_welcomebar_btn_mobile = '';
481 $mysticky_welcomebar_display_desktop = $mysticky_welcomebar_display_mobile = '';
482 if( isset($welcomebar['mysticky_welcomebar_x_desktop']) ) {
483 $mysticky_welcomebar_showx_desktop = ' mysticky-welcomebar-showx-desktop';
484 }
485 if( isset($welcomebar['mysticky_welcomebar_x_mobile']) ) {
486 $mysticky_welcomebar_showx_mobile = ' mysticky-welcomebar-showx-mobile';
487 }
488 if( isset($welcomebar['mysticky_welcomebar_btn_desktop']) ) {
489 $mysticky_welcomebar_btn_desktop = ' mysticky-welcomebar-btn-desktop';
490 }
491 if( isset($welcomebar['mysticky_welcomebar_btn_mobile']) ) {
492 $mysticky_welcomebar_btn_mobile = ' mysticky-welcomebar-btn-mobile';
493 }
494
495 $mysticky_welcomebar_display_desktop = ' mysticky-welcomebar-display-desktop';
496 $mysticky_welcomebar_display_mobile = ' mysticky-welcomebar-display-mobile';
497
498 $display_main_class = "mysticky-welcomebar-position-" . $welcomebar['mysticky_welcomebar_position'] . $mysticky_welcomebar_showx_desktop . $mysticky_welcomebar_showx_mobile . $mysticky_welcomebar_btn_desktop . $mysticky_welcomebar_btn_mobile . $mysticky_welcomebar_display_desktop . $mysticky_welcomebar_display_mobile;
499
500 if( isset($welcomebar['mysticky_welcomebar_actionselect']) ) {
501 if( $welcomebar['mysticky_welcomebar_actionselect'] == 'redirect_to_url' ) {
502 $mysticky_welcomebar_actionselect_url = esc_url( $welcomebar['mysticky_welcomebar_redirect'] );
503 } else {
504 $mysticky_welcomebar_actionselect_url = 'javascript:void(0)';
505 }
506 }
507 if( !isset($welcomebar['mysticky_welcomebar_enable']) ) {
508 if ( $welcomebar['mysticky_welcomebar_position'] == 'top' ) {
509 $welcomebar_enable_block = "top: -60px";
510 } else {
511 $welcomebar_enable_block = "bottom: -60px";
512 }
513 }
514
515 ?>
516 <div class="mysticky-welcomebar-fixed <?php echo $display_main_class; ?>" style="<?php echo $welcomebar_enable_block; ?>" data-after-triger="after_a_few_seconds" data-triger-sec="0" data-position="<?php echo esc_attr($welcomebar['mysticky_welcomebar_position']);?>" data-height="<?php echo esc_attr($welcomebar['mysticky_welcomebar_height']);?>" data-rediect="<?php echo esc_attr($welcomebar['mysticky_welcomebar_actionselect']);?>">
517 <div class="mysticky-welcomebar-content">
518 <p><?php echo isset($welcomebar['mysticky_welcomebar_bar_text'])? stripslashes($welcomebar['mysticky_welcomebar_bar_text']) :"Get 30% off your first purchase";?></p>
519 </div>
520 <div class="mysticky-welcomebar-btn">
521 <a href="<?php echo $mysticky_welcomebar_actionselect_url; ?>" <?php if( isset($welcomebar['mysticky_welcomebar_redirect_newtab']) && $welcomebar['mysticky_welcomebar_actionselect'] == 'redirect_to_url' && $welcomebar['mysticky_welcomebar_redirect_newtab']== 1):?> target="_blank" <?php endif;?>><?php echo isset($welcomebar['mysticky_welcomebar_btn_text'])?$welcomebar['mysticky_welcomebar_btn_text']:"Got it!";?></a>
522 </div>
523 <a href="javascript:void(0)" class="mysticky-welcomebar-close">X</a>
524 <a href="https://premio.io/downloads/mystickymenu/?utm_source=credit&domain=<?php echo $_SERVER['HTTP_HOST']; ?>" class="mysticky-welcomebar-getbar" target="_blank" rel="noopener"><?php _e( 'Get Bar', 'mystickymenu' );?></a>
525 </div>
526 <script>
527
528 jQuery(document).ready(function($){
529 var mysticky_welcomebar_height = jQuery( '.mysticky-welcomebar-fixed' ).innerHeight();
530 if( jQuery( '.mysticky-welcomebar-fixed' ).data('position') == 'top' ) {
531 jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '-' + mysticky_welcomebar_height + 'px' );
532 } else {
533 jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '-' + mysticky_welcomebar_height + 'px' );
534 }
535 if ( sessionStorage.getItem("welcomebar_close") === null ){
536
537 var after_trigger = jQuery( '.mysticky-welcomebar-fixed' ).data('after-triger');
538
539 if ( after_trigger == 'after_a_few_seconds' ) {
540 if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-desktop' ) ) {
541 if ( $( window ).width() > 767 ) {
542 var trigger_sec = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec') * 1000;
543 var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
544 var welcombar_height = $( '.mysticky-welcomebar-fixed' ).data('height');
545 setTimeout(function(){
546 jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' );
547 if ( welcombar_position == 'top' ) {
548 jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' );
549 jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
550 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
551 $( 'html' ).css( 'margin-bottom', '' );
552 $( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' );
553 $( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
554 } else {
555 jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
556 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
557 $( 'html' ).css( 'margin-top', '' );
558 $( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' );
559 }
560 }, trigger_sec );
561 }
562 }
563 }
564 if ( $( window ).width() < 767 ) {
565 if ( after_trigger == 'after_a_few_seconds' ) {
566 if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) {
567 var trigger_sec = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec') * 1000;
568 var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
569 var welcombar_height = $( '.mysticky-welcomebar-fixed' ).data('height');
570 setTimeout(function(){
571 jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' );
572 if ( welcombar_position == 'top' ) {
573 jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
574 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
575 $( 'html' ).css( 'margin-bottom', '' );
576 $( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' );
577 $( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
578 } else {
579 jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
580 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
581 $( 'html' ).css( 'margin-top', '' );
582 $( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' );
583 }
584 }, trigger_sec );
585 }
586 }
587 }
588 mystickyelements_present();
589 }
590 $( window ).resize( function(){
591 if ( sessionStorage.getItem("welcomebar_close") === null ){
592 var after_trigger = jQuery( '.mysticky-welcomebar-fixed' ).data('after-triger');
593 if ( after_trigger == 'after_a_few_seconds' ) {
594 var trigger_sec = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec') * 1000;
595 var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
596 var welcombar_height = $( '.mysticky-welcomebar-fixed' ).data('height');
597 if ( $( window ).width() < 767 ) {
598 if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) {
599 setTimeout(function(){
600 jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' );
601 if ( welcombar_position == 'top' ) {
602 jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
603 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
604 $( 'html' ).css( 'margin-bottom', '' );
605 $( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' );
606 $( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
607 } else {
608 jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
609 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
610 $( 'html' ).css( 'margin-top', '' );
611 $( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' );
612 }
613 }, trigger_sec );
614 }
615 } else {
616 if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-desktop' ) ) {
617 setTimeout(function(){
618 jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' );
619 if ( welcombar_position == 'top' ) {
620 jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
621 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
622 $( 'html' ).css( 'margin-bottom', '' );
623 $( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' );
624 $( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
625 } else {
626 jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
627 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
628 $( 'html' ).css( 'margin-top', '' );
629 $( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' );
630 }
631 }, trigger_sec );
632 }
633 }
634 }
635 mystickyelements_present();
636 }
637 } );
638
639 jQuery(window).scroll(function(){
640 if ( sessionStorage.getItem("welcomebar_close") === null ){
641 var welcombar_height = $( '.mysticky-welcomebar-fixed' ).data('height');
642 var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
643 if ( welcombar_position == 'top' ) {
644 $( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
645 }
646 if ( after_trigger === 'after_scroll' ) {
647 var scroll = 100 * $(window).scrollTop() / ($(document).height() - $(window).height());
648 var after_scroll_val = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec');
649 var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
650 var welcombar_height = $( '.mysticky-welcomebar-fixed' ).data('height');
651 if( scroll > after_scroll_val ) {
652 if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-desktop' ) ) {
653 if ( $( window ).width() > 767 ) {
654 jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' );
655 if ( welcombar_position == 'top' ) {
656 jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
657 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
658 $( 'html' ).css( 'margin-bottom', '' );
659 $( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' );
660 $( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
661 } else {
662 jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
663 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
664 $( 'html' ).css( 'margin-top', '' );
665 $( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' );
666 }
667 }
668 }
669 if ( $( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) {
670 if ( $( window ).width() < 767 ) {
671 jQuery( '.mysticky-welcomebar-fixed' ).addClass( 'mysticky-welcomebar-animation' );
672 if ( welcombar_position == 'top' ) {
673 jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '0' );
674 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
675 $( 'html' ).css( 'margin-bottom', '' );
676 $( 'html' ).attr( 'style', 'margin-top: ' + mysticky_welcomebar_height + 'px !important' );
677 $( '#mysticky-nav' ).css( 'top', mysticky_welcomebar_height + 'px' );
678 } else {
679 jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '0' );
680 jQuery( '.mysticky-welcomebar-fixed' ).css( 'opacity', '1' );
681 $( 'html' ).css( 'margin-top', '' );
682 $( 'html' ).attr( 'style', 'margin-bottom: ' + mysticky_welcomebar_height + 'px !important' );
683 }
684 }
685 }
686 }
687 }
688 mystickyelements_present();
689 }
690
691 });
692 jQuery( '.mysticky-welcomebar-close, .mysticky-welcomebar-btn a' ).on( 'click', function(){
693 console.log("mysticky_welcomebar_height = " + mysticky_welcomebar_height);
694 sessionStorage.setItem('welcomebar_close', 'close');
695 var welcombar_position = $( '.mysticky-welcomebar-fixed' ).data('position');
696 var welcombar_height = $( '.mysticky-welcomebar-fixed' ).data('height');
697 jQuery( '.mysticky-welcomebar-fixed' ).slideUp( 'slow' );
698 if ( welcombar_position == 'top' ) {
699 jQuery( '.mysticky-welcomebar-fixed' ).css( 'top', '-' + mysticky_welcomebar_height + 'px' );
700 } else {
701 jQuery( '.mysticky-welcomebar-fixed' ).css( 'bottom', '-' + mysticky_welcomebar_height + 'px' );
702 }
703 jQuery( 'html' ).css( 'margin-top', '' );
704 jQuery( 'html' ).css( 'margin-bottom', '' );
705 $( '#mysticky-nav' ).css( 'top', '0px' );
706 /*if mystickyelements show*/
707 var mystickyelements_show = $( '.mystickyelements-fixed' ).length;
708 if( mystickyelements_show && $( window ).width() <= 1024 && $( '.mystickyelements-fixed' ).hasClass( 'mystickyelements-position-mobile-top' ) && welcombar_position == 'top' ) {
709 var mystickyelements_height = $( '.mystickyelements-fixed' ).height();
710 $( '.mystickyelements-fixed' ).css( 'top', '' );
711 $( 'html' ).attr( 'style', 'margin-top: ' + mystickyelements_height + 'px !important' );
712 }
713 } );
714 });
715 function mystickyelements_present() {
716 var after_trigger = jQuery( '.mysticky-welcomebar-fixed' ).data('after-triger');
717 var mystickyelements_show = jQuery( '.mystickyelements-fixed' ).length;
718 if( mystickyelements_show ) {
719 var welcombar_position = jQuery( '.mysticky-welcomebar-fixed' ).data('position');
720 var welcombar_height = jQuery( '.mysticky-welcomebar-fixed' ).innerHeight();
721 var mystickyelements_height = jQuery( '.mystickyelements-fixed' ).height();
722 var mystickyelements_total_height = welcombar_height + mystickyelements_height;
723 if ( jQuery( window ).width() <= 1024 && jQuery( '.mystickyelements-fixed' ).hasClass( 'mystickyelements-position-mobile-top' ) ) {
724 if ( after_trigger == 'after_a_few_seconds' ) {
725 if ( jQuery( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) {
726 var trigger_sec = jQuery( '.mysticky-welcomebar-fixed' ).data('triger-sec') * 1000;
727 setTimeout(function(){
728 if ( welcombar_position == 'top' ) {
729 jQuery( '.mystickyelements-fixed' ).css( 'top', welcombar_height );
730 jQuery( 'html' ).attr( 'style', 'margin-top: ' + mystickyelements_total_height + 'px !important' );
731 } else {
732 jQuery( '.mystickyelements-fixed' ).css( 'top', '' );
733 jQuery( 'html' ).attr( 'style', 'margin-bottom: ' + welcombar_height + 'px !important' );
734 }
735 }, trigger_sec );
736 }
737 } else if ( after_trigger === 'after_scroll' ) {
738 var scroll = 100 * $(window).scrollTop() / ($(document).height() - $(window).height());
739 var after_scroll_val = $( '.mysticky-welcomebar-fixed' ).data('triger-sec');
740 if( scroll > after_scroll_val ) {
741 if ( jQuery( '.mysticky-welcomebar-fixed' ).hasClass( 'mysticky-welcomebar-display-mobile' ) ) {
742 if ( welcombar_position == 'top' ) {
743 jQuery( '.mystickyelements-fixed' ).css( 'top', welcombar_height );
744 jQuery( 'html' ).attr( 'style', 'margin-top: ' + mystickyelements_total_height + 'px !important' );
745 } else {
746 jQuery( '.mystickyelements-fixed' ).css( 'top', '' );
747 jQuery( 'html' ).attr( 'style', 'margin-bottom: ' + welcombar_height + 'px !important' );
748 }
749 }
750 }
751 }
752 }
753 }
754 }
755 </script>
756 <style>
757 .mysticky-welcomebar-fixed {
758 height: 60px;
759 background-color: <?php echo $welcomebar['mysticky_welcomebar_bgcolor'] ?>;
760 font-family: <?php echo $welcomebar['mysticky_welcomebar_font'] ?>;
761 position: fixed;
762 left: 0;
763 right: 0;
764 display: flex;
765 align-items: center;
766 justify-content: center;
767 padding: 20px 50px;
768 z-index: 9999999;
769 opacity: 0;
770 }
771 .mysticky-welcomebar-animation {
772 -webkit-transition: all 0.5s ease 0s;
773 -moz-transition: all 0.5s ease 0s;
774 transition: all 0.5s ease 0s;
775 }
776 .mysticky-welcomebar-position-top {
777 top: -60px;
778 }
779 .mysticky-welcomebar-position-bottom {
780 bottom: -60px;
781 }
782 .mysticky-welcomebar-display-desktop.mysticky-welcomebar-position-top.mysticky-welcomebar-fixed {
783 top: 0;
784 }
785 .mysticky-welcomebar-display-desktop.mysticky-welcomebar-position-bottom.mysticky-welcomebar-fixed {
786 bottom: 0;
787 }
788 .mysticky-welcomebar-fixed .mysticky-welcomebar-content p {
789 color: <?php echo $welcomebar['mysticky_welcomebar_bgtxtcolor'] ?>;
790 font-size: <?php echo $welcomebar['mysticky_welcomebar_fontsize'] ?>px;
791 margin: 0;
792 padding: 0;
793 line-height: 1.2;
794 font-family: inherit;
795 font-weight: 400;
796 }
797 .mysticky-welcomebar-fixed .mysticky-welcomebar-btn {
798 padding-left: 30px;
799 display: none;
800 line-height: 1;
801 }
802 .mysticky-welcomebar-fixed.mysticky-welcomebar-btn-desktop .mysticky-welcomebar-btn {
803 display: block;
804 }
805 .mysticky-welcomebar-fixed .mysticky-welcomebar-btn a {
806 background-color: <?php echo $welcomebar['mysticky_welcomebar_btncolor'] ?>;
807 font-family: inherit;
808 color: <?php echo $welcomebar['mysticky_welcomebar_btntxtcolor'] ?>;
809 border-radius: 4px;
810 text-decoration: none;
811 display: inline-block;
812 vertical-align: top;
813 line-height: 1.2;
814 font-size: <?php echo $welcomebar['mysticky_welcomebar_fontsize'] ?>px;
815 font-weight: 400;
816 padding: 5px 20px;
817 white-space: nowrap;
818 }
819 .mysticky-welcomebar-fixed .mysticky-welcomebar-btn a:hover {
820 /*opacity: 0.7;*/
821 -moz-box-shadow: 1px 2px 4px rgba(0, 0, 0,0.5);
822 -webkit-box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.5);
823 box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.5);
824 }
825 .mysticky-welcomebar-fixed .mysticky-welcomebar-close {
826 display: none;
827 vertical-align: top;
828 width: 30px;
829 height: 30px;
830 text-align: center;
831 line-height: 30px;
832 border-radius: 5px;
833 color: #000;
834 position: absolute;
835 top: 5px;
836 right: 10px;
837 outline: none;
838 font-family: Lato;
839 text-decoration: none;
840 -webkit-transition: all 0.5s ease 0s;
841 -moz-transition: all 0.5s ease 0s;
842 transition: all 0.5s ease 0s;
843 -webkit-transform-origin: 50% 50%;
844 -moz-transform-origin: 50% 50%;
845 transform-origin: 50% 50%;
846 }
847 .mysticky-welcomebar-fixed .mysticky-welcomebar-close:hover {
848 opacity: 0.5;
849 -webkit-transform: rotate(180deg);
850 -moz-transform: rotate(180deg);
851 transform: rotate(180deg);
852 }
853 .mysticky-welcomebar-fixed .mysticky-welcomebar-close span.dashicons {
854 font-size: 27px;
855 }
856 .mysticky-welcomebar-fixed.mysticky-welcomebar-showx-desktop .mysticky-welcomebar-close {
857 display: inline-block;
858 }
859 .mysticky-welcomebar-getbar:focus,
860 .mysticky-welcomebar-getbar:active,
861 .mysticky-welcomebar-getbar {
862 background-color: rgba(140,140,140,0.5) !important;
863 border-radius: 8px !important;
864 color: #FFFFFF !important;
865 position: absolute !important;
866 padding: 3px !important;
867 bottom: 5px !important;
868 left: 10px !important;
869 font-size: 12px !important;
870 line-height: 1.4 !important;
871 margin: 0 !important;
872 display: inline-block !important;
873 vertical-align: top !important;
874 font-family: Poppins !important;
875 text-decoration: none !important;
876 visibility: visible !important;
877 outline: 0 !important;
878 }
879 .mysticky-welcomebar-getbar:hover {
880 color: #000000 !important;
881 opacity: 0.5 !important;
882 }
883 @media only screen and (max-width: 767px) {
884 .mysticky-welcomebar-display-desktop.mysticky-welcomebar-position-top.mysticky-welcomebar-fixed {
885 top: -60px;
886 }
887 .mysticky-welcomebar-display-desktop.mysticky-welcomebar-position-bottom.mysticky-welcomebar-fixed {
888 bottom: -60px;
889 }
890 .mysticky-welcomebar-display-mobile.mysticky-welcomebar-position-top.mysticky-welcomebar-fixed {
891 top: 0;
892 }
893 .mysticky-welcomebar-display-mobile.mysticky-welcomebar-position-bottom.mysticky-welcomebar-fixed {
894 bottom: 0;
895 }
896 .mysticky-welcomebar-fixed.mysticky-welcomebar-showx-desktop .mysticky-welcomebar-close {
897 display: none;
898 }
899 .mysticky-welcomebar-fixed.mysticky-welcomebar-showx-mobile .mysticky-welcomebar-close {
900 display: inline-block;
901 }
902 .mysticky-welcomebar-fixed.mysticky-welcomebar-btn-desktop .mysticky-welcomebar-btn {
903 display: none;
904 }
905 .mysticky-welcomebar-fixed.mysticky-welcomebar-btn-mobile .mysticky-welcomebar-btn {
906 display: block;
907 }
908 }
909 @media only screen and (max-width: 480px) {
910 .mysticky-welcomebar-fixed {
911 height: auto;
912 min-height: 60px;
913 padding: 15px 36px 35px 10px;
914 }
915 .mysticky-welcomebar-fixed .mysticky-welcomebar-btn {
916 padding-left: 10px;
917 }
918 .mysticky-welcomebar-fixed .mysticky-welcomebar-close {
919 right: 7px;
920 }
921 }
922 </style>
923 <?php
924 }
925 add_action( 'wp_footer', 'mysticky_welcome_bar_frontend' );