PluginProbe
Float menu – awesome floating side menu / 4.1.1
Float menu – awesome floating side menu v4.1.1
7.2.5 trunk 2.1 2.2 3.0.1 3.1 3.2.2 3.3.1 3.5 3.5.1 3.5.2 3.5.3. 3.5.4 4.0 4.1 4.1.1 4.2 4.3 4.3.1 4.3.2 5.0 5.0.1 5.0.2 5.0.3 5.1 All 57 releases
float-menu / public / generator-style.php

generator-style.php in Float menu – awesome floating side menu 4.1.1, at public/generator-style.php

202 lines 4.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 $isize = ! empty( $param['iconSize'] ) ? $param['iconSize'] : 24;
17 $lsize = ! empty( $param['labelSize'] ) ? $param['labelSize'] : 15;
18 $iwidth = $isize * 2;
19 $iwidth1 = $iwidth - 1;
20 $iwidth2 = $iwidth + 2;
21 $iwidth3 = $iwidth + 8;
22 $misize = ! empty( $param['mobiliconSize'] ) ? $param['mobiliconSize'] : 24;
23 $mlsize = ! empty( $param['mobillabelSize'] ) ? $param['mobillabelSize'] : 15;
24 $miwidth = $misize * 2;
25 $miwidth1 = $miwidth - 1;
26 $miwidth2 = $miwidth + 2;
27 $miwidth3 = $miwidth + 8;
28 $mlsize = $misize - 9;
29
30 $idd = $id;
31 $zindex = ! empty( $param['zindex'] ) ? $param['zindex'] : 0;
32
33 $css = '.float-menu-' . $id . ' {
34 z-index: ' . $zindex . ';
35 }';
36
37 $count_i = ( ! empty( $param['menu_1']['item_type'] ) ) ? count( $param['menu_1']['item_type'] ) : '0';
38 if ( $count_i > 0 ) {
39 for ( $i = 0; $i < $count_i; $i ++ ) {
40 $css .= '.fm-item-' . $idd . '-' . $i . ' .fm-icon, .fm-item-' . $idd . '-' . $i
41 . ' a:hover .fm-icon, .fm-item-' . $idd . '-' . $i . ' .fm-label{';
42 $css .= 'color:' . $param['menu_1']['color'][ $i ] . ';';
43 $css .= 'background-color:' . $param['menu_1']['bcolor'][ $i ] . ';';
44 $css .= '}';
45 }
46 }
47 $css .= '
48 .fm-bar.fm-right li,
49 .fm-right .fm-mask,
50 .fm-hit,
51 .fm-icon {
52 height: ' . $iwidth . 'px;
53 }
54 .fm-bar a,
55 .fm-icon,
56 .fm-round .fm-hit,
57 .fm-sub > ul
58 {
59 width: ' . $iwidth . 'px;
60 }
61 .fm-icon,
62 .fm-label {
63 line-height:' . $iwidth . 'px;
64 }
65 .fm-icon {
66 font-size: ' . $isize . 'px;
67 }
68 .fm-label {
69 font-size: ' . $lsize . 'px;
70 }
71 .fm-icon .fa {
72 line-height: ' . $iwidth . 'px !important;
73 }
74
75 .fm-label,
76 .fm-label-space .fm-hit,
77 .fm-sub.fm-side > ul
78 {
79 left: ' . $iwidth . 'px;
80 }
81 .fm-right .fm-label,
82 .fm-right.fm-label-space .fm-hit,
83 .fm-right .fm-sub.fm-side > ul
84 {
85 right: ' . $iwidth . 'px;
86 }
87 .fm-round.fm-label-space .fm-hit
88 {
89 width: ' . $iwidth2 . 'px;
90 }
91 .fm-sub > ul {
92 top: ' . $iwidth . 'px;
93 }
94 .fm-round li,
95 .fm-round .fm-mask,
96 .fm-round .fm-icon,
97 .fm-round a,
98 .fm-round .fm-label {
99 border-radius: ' . $isize . 'px;
100 }
101 .fm-connected .fm-label {
102 padding: 0 11px 0 ' . $iwidth3 . 'px;
103 }
104 .fm-right.fm-connected .fm-label {
105 padding: 0 ' . $iwidth3 . 'px 0 11px;
106 }
107 .fm-connected.fm-round .fm-label {
108 padding: 0 12px 0 ' . $iwidth1 . 'px;
109 }
110 .fm-right.fm-connected.fm-round .fm-label {
111 padding: 0 ' . $iwidth1 . 'px 0 12px;
112 }
113 ';
114 $mobilieScreen = ! empty( $param['mobilieScreen'] ) ? $param['mobilieScreen'] : 480;
115 $css .= '
116 @media only screen and (max-width: ' . $mobilieScreen . 'px){
117 .fm-bar.fm-right li,
118 .fm-right .fm-mask,
119 .fm-hit,
120 .fm-icon {
121 height: ' . $miwidth . 'px;
122 }
123 .fm-bar a,
124 .fm-icon,
125 .fm-round .fm-hit,
126 .fm-sub > ul
127 {
128 width: ' . $miwidth . 'px;
129 }
130 .fm-icon,
131 .fm-label {
132 line-height:' . $miwidth . 'px;
133 }
134 .fm-icon {
135 font-size: ' . $misize . 'px;
136 }
137 .fm-label {
138 font-size: ' . $mlsize . 'px;
139 }
140 .fm-icon .fa {
141 line-height: ' . $miwidth . 'px !important;
142 }
143
144 .fm-label,
145 .fm-label-space .fm-hit,
146 .fm-sub.fm-side > ul
147 {
148 left: ' . $miwidth . 'px;
149 }
150 .fm-right .fm-label,
151 .fm-right.fm-label-space .fm-hit,
152 .fm-right .fm-sub.fm-side > ul
153 {
154 right: ' . $miwidth . 'px;
155 }
156 .fm-round.fm-label-space .fm-hit
157 {
158 width: ' . $miwidth2 . 'px;
159 }
160 .fm-sub > ul {
161 top: ' . $miwidth . 'px;
162 }
163 .fm-round li,
164 .fm-round .fm-mask,
165 .fm-round .fm-icon,
166 .fm-round a,
167 .fm-round .fm-label {
168 border-radius: ' . $misize . 'px;
169 }
170 .fm-connected .fm-label {
171 padding: 0 11px 0 ' . $miwidth3 . 'px;
172 }
173 .fm-right.fm-connected .fm-label {
174 padding: 0 ' . $miwidth3 . 'px 0 11px;
175 }
176 .fm-connected.fm-round .fm-label {
177 padding: 0 12px 0 ' . $miwidth1 . 'px;
178 }
179 .fm-right.fm-connected.fm-round .fm-label {
180 padding: 0 ' . $miwidth1 . 'px 0 12px;
181 }
182 }';
183 if ( ! empty( $param['include_mobile'] ) ) {
184 $screen = ! empty( $param['screen'] ) ? $param['screen'] : 480;
185 $css .= '
186 @media only screen and (max-width: ' . $screen . 'px){
187 .float-menu-' . $idd . ' {
188 display:none;
189 }
190 }';
191 }
192 if ( ! empty( $param['include_more_screen'] ) ) {
193 $screen_more = ! empty( $param['screen_more'] ) ? $param['screen_more'] : 1200;
194 $css .= '
195 @media only screen and (min-width: ' . $screen_more . 'px){
196 .float-menu-' . $idd . ' {
197 display:none;
198 }
199 }';
200 }
201
202 $css = trim( preg_replace( '~\s+~s', ' ', $css ) );