PluginProbe ʕ •ᴥ•ʔ
Hustle – Email Marketing, Lead Generation, Optins, Popups / trunk
Hustle – Email Marketing, Lead Generation, Optins, Popups vtrunk
7.8.14 7.8.14.1 7.8.13 7.8.13.1 trunk 3.0 3.1 3.1.1 3.1.2 3.1.3 3.1.4 4.3.2 4.4.4 4.4.5 4.4.5.1 4.4.5.4 4.6 4.6.1.1 4.6.1.4 4.7.0.2 4.7.0.3 4.7.0.7 4.7.0.9 4.7.1.0 4.7.1.1 4.8.0.0 5.0.0 5.0.1 5.0.1.1 5.0.1.2 5.1 5.1.1 5.1.2 5.1.3 5.1.3.1 5.1.3.2 5.1.4 5.1.5 6.0 6.0.1 6.0.2 6.0.3 6.0.4.2 6.0.5 6.0.6.1 6.0.7 6.0.8.1 6.0.9 7.0.0.1 7.0.2 7.0.3 7.0.4 7.1.0 7.1.1 7.2.0 7.2.1 7.3.0 7.3.1 7.3.3 7.3.5 7.3.6 7.3.7 7.4.0 7.4.1 7.4.11 7.4.13 7.4.13.1 7.4.2 7.4.3 7.4.4 7.4.5 7.4.5.1 7.4.5.2 7.4.6 7.4.7 7.5.0 7.6.0 7.6.1 7.6.3 7.6.4 7.6.6 7.7.0 7.7.1 7.8.0 7.8.1 7.8.10 7.8.10.1 7.8.10.2 7.8.11 7.8.12 7.8.12.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.8.9.1 7.8.9.2 7.8.9.3
wordpress-popup / inc / front / non-sshare-styles / general-14--cta-button.php
wordpress-popup / inc / front / non-sshare-styles Last commit date
form-01--form-container.php 3 years ago form-02--form-fields.php 3 years ago form-03--input.php 5 months ago form-04--select2.php 5 months ago form-05--select2-dropdown.php 3 years ago form-06--timepicker-dropdown.php 3 years ago form-07--radio.php 5 months ago form-08--checkbox.php 5 months ago form-09--calendar.php 3 years ago form-10--submit.php 5 months ago form-11--options-container.php 3 years ago form-12--options-title.php 5 months ago form-13--gdpr.php 5 months ago form-14--error-message.php 5 months ago form-15--success-message.php 2 years ago form-16--recaptcha.php 5 months ago general-01--module-container.php 3 years ago general-02--main-layout.php 1 month ago general-03--layout-header.php 3 years ago general-04--layout-content.php 3 years ago general-05--layout-footer.php 3 years ago general-06--image-size.php 5 months ago general-07--image-fitting.php 3 years ago general-08--image-position.php 5 months ago general-09--content-wrapper.php 3 years ago general-10--title.php 5 months ago general-11--subtitle.php 5 months ago general-12--content.php 5 months ago general-13--cta-container.php 3 years ago general-14--cta-button.php 5 months ago general-15--cta-alignment.php 3 years ago general-16--nsa-link.php 5 months ago general-17--close-button.php 3 years ago general-18--popup-mask.php 3 years ago general-19--cta-helper-text.php 5 months ago module-size-embed.php 5 months ago module-size-popup.php 5 months ago module-size-slidein.php 3 years ago
general-14--cta-button.php
224 lines
1 <?php
2 /**
3 * CTA Button.
4 *
5 * @package Hustle
6 * @since 4.3.0
7 */
8
9 $component = '.hustle-layout a.hustle-button-cta';
10
11 // Component States.
12 $state_default = $component;
13 $state_hover = $component . ':hover';
14 $state_focus = $component . ':focus';
15
16 // SETTINGS: Background.
17 $background_default = $colors['cta_button_static_bg'];
18 $background_hover = $colors['cta_button_hover_bg'];
19 $background_focus = $colors['cta_button_active_bg'];
20
21 // SETTINGS: Padding.
22 $padding_top = ( '' !== $advanced['cta_padding_top'] ) ? $advanced['cta_padding_top'] . $advanced['cta_padding_unit'] : '0';
23 $padding_right = ( '' !== $advanced['cta_padding_right'] ) ? $advanced['cta_padding_right'] . $advanced['cta_padding_unit'] : '0';
24 $padding_bottom = ( '' !== $advanced['cta_padding_bottom'] ) ? $advanced['cta_padding_bottom'] . $advanced['cta_padding_unit'] : '0';
25 $padding_left = ( '' !== $advanced['cta_padding_left'] ) ? $advanced['cta_padding_left'] . $advanced['cta_padding_unit'] : '0';
26
27 $padding = $padding_top . ' ' . $padding_right . ' ' . $padding_bottom . ' ' . $padding_left;
28
29 $mobile_padding_top = ( '' !== $advanced['cta_padding_top_mobile'] ) ? $advanced['cta_padding_top_mobile'] . $advanced['cta_padding_unit_mobile'] : $padding_top;
30 $mobile_padding_right = ( '' !== $advanced['cta_padding_right_mobile'] ) ? $advanced['cta_padding_right_mobile'] . $advanced['cta_padding_unit_mobile'] : $padding_right;
31 $mobile_padding_bottom = ( '' !== $advanced['cta_padding_bottom_mobile'] ) ? $advanced['cta_padding_bottom_mobile'] . $advanced['cta_padding_unit_mobile'] : $padding_bottom;
32 $mobile_padding_left = ( '' !== $advanced['cta_padding_left_mobile'] ) ? $advanced['cta_padding_left_mobile'] . $advanced['cta_padding_unit_mobile'] : $padding_left;
33
34 $mobile_padding = ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_advanced ) ) ? $padding : $mobile_padding_top . ' ' . $mobile_padding_right . ' ' . $mobile_padding_bottom . ' ' . $mobile_padding_left;
35
36 // SETTINGS: Border.
37 $border_color_default = $colors['cta_button_static_bo'];
38 $border_color_hover = $colors['cta_button_hover_bo'];
39 $border_color_focus = $colors['cta_button_active_bo'];
40
41 $border_top = ( '' !== $advanced['cta_border_top'] ) ? $advanced['cta_border_top'] . $advanced['cta_border_unit'] : '0';
42 $border_right = ( '' !== $advanced['cta_border_right'] ) ? $advanced['cta_border_right'] . $advanced['cta_border_unit'] : '0';
43 $border_bottom = ( '' !== $advanced['cta_border_bottom'] ) ? $advanced['cta_border_bottom'] . $advanced['cta_border_unit'] : '0';
44 $border_left = ( '' !== $advanced['cta_border_left'] ) ? $advanced['cta_border_left'] . $advanced['cta_border_unit'] : '0';
45
46 $border_width = $border_top . ' ' . $border_right . ' ' . $border_bottom . ' ' . $border_left;
47 $border_style = ( '' !== $advanced['cta_border_type'] ) ? $advanced['cta_border_type'] : 'solid';
48
49 $mobile_border_top = ( '' !== $advanced['cta_border_top_mobile'] ) ? $advanced['cta_border_top_mobile'] . $advanced['cta_border_unit_mobile'] : $border_top;
50 $mobile_border_right = ( '' !== $advanced['cta_border_right_mobile'] ) ? $advanced['cta_border_right_mobile'] . $advanced['cta_border_unit_mobile'] : $border_right;
51 $mobile_border_bottom = ( '' !== $advanced['cta_border_bottom_mobile'] ) ? $advanced['cta_border_bottom_mobile'] . $advanced['cta_border_unit_mobile'] : $border_bottom;
52 $mobile_border_left = ( '' !== $advanced['cta_border_left_mobile'] ) ? $advanced['cta_border_left_mobile'] . $advanced['cta_border_unit_mobile'] : $border_left;
53
54 $mobile_border_width = ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_advanced ) ) ? $border_width : $mobile_border_top . ' ' . $mobile_border_right . ' ' . $mobile_border_bottom . ' ' . $mobile_border_left;
55 $mobile_border_style = ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_advanced ) ) ? $border_style : $advanced['cta_border_type_mobile'];
56
57 // SETTINGS: Border Radius.
58 $radius_topleft = ( '' !== $advanced['cta_radius_top_left'] ) ? $advanced['cta_radius_top_left'] . $advanced['cta_radius_unit'] : '0';
59 $radius_topright = ( '' !== $advanced['cta_radius_top_right'] ) ? $advanced['cta_radius_top_right'] . $advanced['cta_radius_unit'] : '0';
60 $radius_bottomright = ( '' !== $advanced['cta_radius_bottom_right'] ) ? $advanced['cta_radius_bottom_right'] . $advanced['cta_radius_unit'] : '0';
61 $radius_bottomleft = ( '' !== $advanced['cta_radius_bottom_left'] ) ? $advanced['cta_radius_bottom_left'] . $advanced['cta_radius_unit'] : '0';
62
63 $border_radius = $radius_topleft . ' ' . $radius_topright . ' ' . $radius_bottomright . ' ' . $radius_bottomleft;
64
65 $mobile_radius_topleft = ( '' !== $advanced['cta_radius_top_left_mobile'] ) ? $advanced['cta_radius_top_left_mobile'] . $advanced['cta_radius_unit_mobile'] : $radius_topleft;
66 $mobile_radius_topright = ( '' !== $advanced['cta_radius_top_right_mobile'] ) ? $advanced['cta_radius_top_right_mobile'] . $advanced['cta_radius_unit_mobile'] : $radius_topright;
67 $mobile_radius_bottomright = ( '' !== $advanced['cta_radius_bottom_right_mobile'] ) ? $advanced['cta_radius_bottom_right_mobile'] . $advanced['cta_radius_unit_mobile'] : $radius_bottomright;
68 $mobile_radius_bottomleft = ( '' !== $advanced['cta_radius_bottom_left_mobile'] ) ? $advanced['cta_radius_bottom_left_mobile'] . $advanced['cta_radius_unit_mobile'] : $radius_bottomleft;
69
70 $mobile_border_radius = ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_advanced ) ) ? $border_radius : $mobile_radius_topleft . ' ' . $mobile_radius_topright . ' ' . $mobile_radius_bottomright . ' ' . $mobile_radius_bottomleft;
71
72 // SETTINGS: Box Shadow.
73 $shadow_offset_x = ( '' !== $advanced['cta_drop_shadow_x'] ) ? $advanced['cta_drop_shadow_x'] . $advanced['cta_drop_shadow_unit'] : '0';
74 $shadow_offset_y = ( '' !== $advanced['cta_drop_shadow_y'] ) ? $advanced['cta_drop_shadow_y'] . $advanced['cta_drop_shadow_unit'] : '0';
75 $shadow_blur = ( '' !== $advanced['cta_drop_shadow_blur'] ) ? $advanced['cta_drop_shadow_blur'] . $advanced['cta_drop_shadow_unit'] : '0';
76 $shadow_spread = ( '' !== $advanced['cta_drop_shadow_spread'] ) ? $advanced['cta_drop_shadow_spread'] . $advanced['cta_drop_shadow_unit'] : '0';
77 $shadow_color = $colors['cta_button_static_drop_shadow'];
78
79 $box_shadow = $shadow_offset_x . ' ' . $shadow_offset_y . ' ' . $shadow_blur . ' ' . $shadow_spread . ' ' . $shadow_color;
80
81 $mobile_shadow_offset_x = ( '' !== $advanced['cta_drop_shadow_x'] ) ? $advanced['cta_drop_shadow_x'] . $advanced['cta_drop_shadow_unit'] : $shadow_offset_x;
82 $mobile_shadow_offset_y = ( '' !== $advanced['cta_drop_shadow_y'] ) ? $advanced['cta_drop_shadow_y'] . $advanced['cta_drop_shadow_unit'] : $shadow_offset_y;
83 $mobile_shadow_blur = ( '' !== $advanced['cta_drop_shadow_blur'] ) ? $advanced['cta_drop_shadow_blur'] . $advanced['cta_drop_shadow_unit'] : $shadow_blur;
84 $mobile_shadow_spread = ( '' !== $advanced['cta_drop_shadow_spread'] ) ? $advanced['cta_drop_shadow_spread'] . $advanced['cta_drop_shadow_unit'] : $shadow_spread;
85
86 $mobile_box_shadow = ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_advanced ) ) ? $box_shadow : $mobile_shadow_offset_x . ' ' . $mobile_shadow_offset_y . ' ' . $mobile_shadow_blur . ' ' . $mobile_shadow_spread . ' ' . $shadow_color;
87
88 // SETTINGS: Font settings.
89 $color_default = $colors['cta_button_static_color'];
90 $color_hover = $colors['cta_button_hover_color'];
91 $color_focus = $colors['cta_button_active_color'];
92
93 $font_family = $typography['cta_font_family'];
94 $font_size = $typography['cta_font_size'];
95 $font_size = ( '' !== $font_size ) ? $font_size . $typography['cta_font_size_unit'] : '0';
96 $font_weight = $typography['cta_font_weight'];
97 $font_style = 'normal';
98 $alignment = $typography['cta_alignment'];
99 $line_height = $typography['cta_line_height'];
100 $line_height = ( '' !== $line_height ) ? $line_height . $typography['cta_line_height_unit'] : '0';
101 $letter_spacing = $typography['cta_letter_spacing'];
102 $letter_spacing = ( '' !== $letter_spacing ) ? $letter_spacing . $typography['cta_letter_spacing_unit'] : '0';
103 $text_transform = $typography['cta_text_transform'];
104 $text_decoration = $typography['cta_text_decoration'];
105
106 if ( 'custom' === $font_family ) {
107 $font_family = ( '' !== $typography['cta_custom_font_family'] ) ? $typography['cta_custom_font_family'] : 'inherit';
108 }
109
110 if ( 'regular' === $font_weight ) {
111 $font_weight = 'normal';
112 } elseif ( 'italic' === $font_weight ) {
113 $font_weight = 'normal';
114 $font_style = 'italic';
115 } elseif ( preg_match( '/(italic)/', $font_weight ) ) { // Check if font weight is italic.
116 $font_weight = str_replace( 'italic', '', $font_weight );
117 $font_style = 'italic';
118 }
119
120 $mobile_font_size = $typography['cta_font_size_mobile'];
121 $mobile_font_size = ( '' !== $mobile_font_size ) ? $mobile_font_size . $typography['cta_font_size_unit_mobile'] : $font_size;
122 $mobile_font_weight = $typography['cta_font_weight_mobile'];
123 $mobile_font_style = 'normal';
124 $mobile_alignment = $typography['cta_alignment_mobile'];
125 $mobile_line_height = $typography['cta_line_height_mobile'];
126 $mobile_line_height = ( '' !== $mobile_line_height ) ? $mobile_line_height . $typography['cta_line_height_unit_mobile'] : $line_height;
127 $mobile_letter_spacing = $typography['cta_letter_spacing_mobile'];
128 $mobile_letter_spacing = ( '' !== $mobile_letter_spacing ) ? $mobile_letter_spacing . $typography['cta_letter_spacing_unit_mobile'] : $letter_spacing;
129 $mobile_text_transform = $typography['cta_text_transform'];
130 $mobile_text_decoration = $typography['cta_text_decoration_mobile'];
131
132 if ( 'regular' === $mobile_font_weight ) {
133 $mobile_font_weight = 'normal';
134 } elseif ( 'italic' === $font_weight ) {
135 $font_weight = 'normal';
136 $font_style = 'italic';
137 } elseif ( preg_match( '/(italic)/', $mobile_font_weight ) ) { // Check if font weight is italic.
138 $mobile_font_weight = str_replace( 'italic', '', $mobile_font_weight );
139 $mobile_font_style = 'italic';
140 }
141
142 if ( ! $is_mobile_enabled || ( $is_mobile_enabled && $default_typography ) ) {
143 $mobile_font_size = $font_size;
144 $mobile_font_weight = $font_weight;
145 $mobile_alignment = $alignment;
146 $mobile_line_height = $line_height;
147 $mobile_letter_spacing = $letter_spacing;
148 $mobile_text_transform = $text_transform;
149 $mobile_text_decoration = $text_decoration;
150 }
151
152 // ==================================================
153 // Check if "Call to Action" button is enabled.
154 if ( '0' !== $content['show_cta'] ) {
155
156 $style .= ' ';
157
158 // Mobile styles.
159 $style .= $prefix_mobile . $state_default . ' {';
160 $style .= 'margin: 0;';
161 $style .= 'padding: ' . $mobile_padding . ';';
162 $style .= 'border-width: ' . $mobile_border_width . ';';
163 $style .= 'border-style: ' . $mobile_border_style . ';';
164 $style .= ( ! $is_vanilla ) ? 'border-color: ' . $border_color_default . ';' : '';
165 $style .= 'border-radius: ' . $mobile_border_radius . ';';
166 $style .= ( ! $is_vanilla ) ? 'background-color: ' . $background_default . ';' : '';
167 $style .= ( ! $is_vanilla ) ? '-moz-box-shadow: ' . $mobile_box_shadow . ';' : '';
168 $style .= ( ! $is_vanilla ) ? '-webkit-box-shadow: ' . $mobile_box_shadow . ';' : '';
169 $style .= ( ! $is_vanilla ) ? 'box-shadow: ' . $mobile_box_shadow . ';' : '';
170 $style .= ( ! $is_vanilla ) ? 'color: ' . $color_default . ';' : '';
171 $style .= ( 'inherit' !== $font_family ) ? 'font: ' . $mobile_font_weight . ' ' . $mobile_font_size . '/' . $mobile_line_height . ' ' . $font_family . ';' : '';
172 $style .= ( 'inherit' === $font_family ) ? 'font-size: ' . $mobile_font_size . ';' : '';
173 $style .= ( 'inherit' === $font_family ) ? 'line-height: ' . $mobile_line_height . ';' : '';
174 $style .= ( 'inherit' === $font_family ) ? 'font-weight: ' . $mobile_font_weight . ';' : '';
175 $style .= 'font-style: ' . $mobile_font_style . ';';
176 $style .= 'letter-spacing: ' . $mobile_letter_spacing . ';';
177 $style .= 'text-transform: ' . $mobile_text_transform . ';';
178 $style .= 'text-decoration: ' . $mobile_text_decoration . ';';
179 $style .= 'text-align: ' . $mobile_alignment . ';';
180 $style .= '}';
181
182 if ( ! $is_vanilla ) {
183
184 $style .= $prefix_mobile . $state_hover . ' {';
185 $style .= 'border-color: ' . $border_color_hover . ';';
186 $style .= 'background-color: ' . $background_hover . ';';
187 $style .= 'color: ' . $color_hover . ';';
188 $style .= '}';
189
190 $style .= $prefix_mobile . $state_focus . ' {';
191 $style .= 'border-color: ' . $border_color_focus . ';';
192 $style .= 'background-color: ' . $background_focus . ';';
193 $style .= 'color: ' . $color_focus . ';';
194 $style .= '}';
195
196 }
197
198 // Desktop styles.
199 if ( $is_mobile_enabled ) {
200
201 $style .= $breakpoint . ' {';
202 $style .= $prefix_desktop . $state_default . ' {';
203 $style .= 'padding: ' . $padding . ';';
204 $style .= 'border-width: ' . $border_width . ';';
205 $style .= 'border-style: ' . $border_style . ';';
206 $style .= 'border-radius: ' . $border_radius . ';';
207 $style .= ( ! $is_vanilla ) ? 'box-shadow: ' . $box_shadow . ';' : '';
208 $style .= ( ! $is_vanilla ) ? '-moz-box-shadow: ' . $box_shadow . ';' : '';
209 $style .= ( ! $is_vanilla ) ? '-webkit-box-shadow: ' . $box_shadow . ';' : '';
210 $style .= ( 'inherit' !== $font_family ) ? 'font: ' . $font_weight . ' ' . $font_size . '/' . $line_height . ' ' . $font_family . ';' : '';
211 $style .= ( 'inherit' === $font_family ) ? 'font-size: ' . $font_size . ';' : '';
212 $style .= ( 'inherit' === $font_family ) ? 'line-height: ' . $line_height . ';' : '';
213 $style .= ( 'inherit' === $font_family ) ? 'font-weight: ' . $font_weight . ';' : '';
214 $style .= 'font-style: ' . $font_style . ';';
215 $style .= 'letter-spacing: ' . $letter_spacing . ';';
216 $style .= 'text-transform: ' . $text_transform . ';';
217 $style .= 'text-decoration: ' . $text_decoration . ';';
218 $style .= 'text-align: ' . $alignment . ';';
219 $style .= '}';
220 $style .= '}';
221
222 }
223 }
224