| 1 |
<?php |
| 2 |
/** |
| 3 |
* Inline Style generator |
| 4 |
* |
| 5 |
* @package Wow_Plugin |
| 6 |
* @author Dmytro Lobov <d@dayes.dev> |
| 7 |
* @copyright 2019 Wow-Company |
| 8 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 9 |
* @since 1.0 |
| 10 |
*/ |
| 11 |
|
| 12 |
if ( ! defined( 'ABSPATH' ) ) { |
| 13 |
exit; |
| 14 |
} |
| 15 |
|
| 16 |
$css = ''; |
| 17 |
|
| 18 |
$count_i = count( $param['menu_1']['item_type'] ); |
| 19 |
for ( $i = 0; $i < $count_i; $i ++ ) { |
| 20 |
$item = $i + 1; |
| 21 |
$css .= ' |
| 22 |
#floatBtn-' . $id . ' .flBtn-first li:nth-child(' . $item . ') a { |
| 23 |
background-color: ' . $param['menu_1']['button_color'][ $i ] . '; |
| 24 |
color: ' . $param['menu_1']['icon_color'][ $i ] . '; |
| 25 |
} |
| 26 |
#floatBtn-' . $id . ' .flBtn-first li:nth-child(' . $item . ') a:hover { |
| 27 |
background-color: ' . $param['menu_1']['button_hcolor'][ $i ] . '; |
| 28 |
color: ' . $param['menu_1']['icon_color'][ $i ] . '; |
| 29 |
} |
| 30 |
'; |
| 31 |
} |
| 32 |
|
| 33 |
$count_i = count( $param['menu_2']['item_type'] ); |
| 34 |
for ( $i = 0; $i < $count_i; $i ++ ) { |
| 35 |
$item = $i + 1; |
| 36 |
$css .= ' |
| 37 |
#floatBtn-' . $id . ' .flBtn-second li:nth-child(' . $item . ') a { |
| 38 |
background-color: ' . $param['menu_2']['button_color'][ $i ] . '; |
| 39 |
color: ' . $param['menu_2']['icon_color'][ $i ] . '; |
| 40 |
} |
| 41 |
#floatBtn-' . $id . ' .flBtn-second li:nth-child(' . $item . ') a:hover { |
| 42 |
background-color: ' . $param['menu_2']['button_hcolor'][ $i ] . '; |
| 43 |
color: ' . $param['menu_2']['icon_color'][ $i ] . '; |
| 44 |
} |
| 45 |
'; |
| 46 |
} |
| 47 |
|
| 48 |
$css .= ' |
| 49 |
#floatBtn-' . $id . ' a { |
| 50 |
background-color: ' . $param['button_color'] . '; |
| 51 |
color: ' . $param['icon_color'] . '; |
| 52 |
} |
| 53 |
#floatBtn-' . $id . ' a:hover , |
| 54 |
#floatBtn-' . $id . ' input:hover + a{ |
| 55 |
background-color: ' . $param['button_hcolor'] . '; |
| 56 |
color: ' . $param['icon_color'] . '; |
| 57 |
} |
| 58 |
#floatBtn-' . $id . ' [tooltip]:before { |
| 59 |
background: ' . $param['tooltip_background'] . '; |
| 60 |
color: ' . $param['tooltip_color'] . '; |
| 61 |
} |
| 62 |
|
| 63 |
'; |
| 64 |
|
| 65 |
if ( ! empty( $param['include_mobile'] ) ) { |
| 66 |
$screen = ! empty( $param['screen'] ) ? $param['screen'] : 480; |
| 67 |
$css .= ' |
| 68 |
@media only screen and (max-width: ' . $screen . 'px){ |
| 69 |
#floatBtn-' . $id . ' { |
| 70 |
display:none; |
| 71 |
} |
| 72 |
}'; |
| 73 |
} |
| 74 |
if ( ! empty( $param['include_more_screen'] ) ) { |
| 75 |
$screen_more = ! empty( $param['screen_more'] ) ? $param['screen_more'] : 1200; |
| 76 |
$css .= ' |
| 77 |
@media only screen and (min-width: ' . $screen_more . 'px){ |
| 78 |
#floatBtn-' . $id . ' { |
| 79 |
display:none; |
| 80 |
} |
| 81 |
}'; |
| 82 |
} |
| 83 |
|
| 84 |
$css = trim( preg_replace( '~\s+~s', ' ', $css ) ); |
| 85 |
|