PluginProbe
LoginPress | wp-login Custom Login Page Customizer / 1.0.22
LoginPress | wp-login Custom Login Page Customizer v1.0.22
6.2.5 6.2.4 6.2.3 6.2.2 6.2.1 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.3 1.0.4 All 118 releases
loginpress / classes / control-presets.php

control-presets.php in LoginPress | wp-login Custom Login Page Customizer 1.0.22, at classes/control-presets.php

372 lines 9.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Class for Presets.
5 *
6 * @since 1.0.9
7 * @access public
8 */
9 class LoginPress_Presets extends WP_Customize_Control {
10
11 /**
12 * The type of customize control being rendered.
13 *
14 * @since 1.0.9
15 * @access public
16 * @var string
17 */
18 public $type = 'checkbox-multiple';
19
20 /**
21 * Enqueue scripts/styles.
22 *
23 * @since 1.0.9
24 * @access public
25 * @return void
26 */
27 public function enqueue() {
28 // wp_enqueue_script( 'jt-customize-controls', plugins_url( '/customize-controls.js' , __FILE__ ), array( 'jquery' ) );
29 // wp_enqueue_script( 'jquery-ui-button' );
30
31 }
32
33 /**
34 * Displays the control content.
35 *
36 * @since 1.0.9
37 * @access public
38 * @return void
39 */
40 public function render_content() {
41
42
43 if ( empty( $this->choices ) )
44 return;
45 $name = 'loginpress_preset-' . $this->id; ?>
46
47 <span class="customize-control-title">
48 <?php echo esc_attr( $this->label ); ?>
49 <?php if ( ! empty( $this->description ) ) : ?>
50 <span class="description customize-control-description"><?php echo esc_html( $this->description ); ?></span>
51 <?php endif; ?>
52 </span>
53
54 <?php // $multi_values = !is_array( $this->value() ) ? explode( ',', $this->value() ) : $this->value(); ?>
55
56
57 <div id="input_<?php echo $this->id; ?>" class="image">
58
59 <?php foreach ( $this->choices as $val ) : ?>
60
61 <?php $_disbaled = isset( $val['pro'] ) ? 'disabled' : ''; ?>
62 <?php $_disbaled_link = isset( $val['link'] ) ? 'disabled' : ''; ?>
63 <?php $disable_for_pro = $_disbaled == 'disabled' ? $_disbaled : $_disbaled_link; ?>
64 <div class="loginpress_thumbnail">
65 <input <?php echo $disable_for_pro; ?> class="image-select" type="radio" value="<?php echo esc_attr( $val['id'] ); ?>" id="<?php echo $this->id . $val['id']; ?>" name="<?php echo esc_attr( $name ); ?>" <?php checked( $this->value(), $val['id'] ); ?> />
66 <label for="<?php echo $this->id . $val['id']; ?>">
67 <div class="loginpress_thumbnail_img">
68 <img src="<?php echo $val['thumbnail']; ?>" alt="<?php echo esc_attr( $val['id'] ); ?>" title="<?php echo esc_attr( $val['id'] ); ?>">
69 </div> <!-- .img -->
70 <h3><?php echo $val['name'] ?></h3>
71 </label>
72 <?php if ( isset( $val['pro'] ) ) : ?>
73 <a href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=loginpress-lite&utm_medium=themes&utm_campaign=pro-upgrade" target="_blank" class="no-available">
74 <span><?php _e( 'Unlock Premium Feature', 'loginpress' ); ?></span>
75 </a>
76 <?php elseif ( isset( $val['link'] ) ) : ?>
77 <a href="mailto:support@wpbrigade.com?subject=I want Custom Design for my login page." class="no-available">
78 <span><?php _e( 'Contact us for Custom Design', 'loginpress' ); ?></span>
79 </a>
80 <?php endif; ?>
81
82
83 <!-- </input> -->
84 </div> <!-- .loginpress_thumbnail -->
85
86 <?php endforeach; ?>
87 </div>
88
89 <input name='presets_hidden' type="hidden" <?php $this->link(); ?> value="<?php echo $this->value(); ?>" />
90 <?php }
91
92
93 }
94
95 function loginpress_presets_control_css() {
96 ?>
97 <style>
98 #customize-theme-controls #accordion-section-customize_presets .accordion-section-title{
99 background-color: #FFD700;
100 }
101 #customize-controls #accordion-section-customize_presets:hover>.accordion-section-title{
102 background-color: #FFD700;
103 }
104 .customize-control-checkbox-multiple .image.ui-buttonset input[type=radio] {
105 height: auto;
106 }
107 .customize-control-checkbox-multiple .image.ui-buttonset label {
108 display: inline-block;
109 margin-right: 5px;
110 margin-bottom: 5px;
111 }
112 .customize-control-checkbox-multiple .image.ui-buttonset label.ui-state-active {
113 background: none;
114 }
115 .customize-control-checkbox-multiple .customize-control-radio-buttonset label {
116 padding: 5px 10px;
117 background: #f7f7f7;
118 border-left: 1px solid #dedede;
119 line-height: 35px;
120 }
121 .customize-control-checkbox-multiple label img {
122 border: 1px solid #bbb;
123 opacity: 0.5;
124 }
125 #customize-controls .customize-control-checkbox-multiple label img {
126 max-width: 250px;
127 height: auto;
128 width: 100%;
129 margin-bottom: 0;
130 border: 0;
131 display: block;
132 }
133 .customize-control-checkbox-multiple label.ui-state-active img {
134 background: #dedede;
135 border-color: #000;
136 opacity: 1;
137 margin-bottom: 0;
138 }
139 .customize-control-checkbox-multiple label.ui-state-hover img {
140 opacity: 0.9;
141 border-color: #999;
142 }
143 .customize-control-radio-buttonset label.ui-corner-left {
144 border-radius: 3px 0 0 3px;
145 border-left: 0;
146 }
147 .customize-control-radio-buttonset label.ui-corner-right {
148 border-radius: 0 3px 3px 0;
149 }
150 #customize-control-customize_presets_settings input[type=radio]{
151 display: none;
152 }
153 #customize-control-customize_presets_settings label{
154 display: block;
155 position: relative;
156 width: 100%;
157 }
158 #customize-control-customize_presets_settings .loginpress_thumbnail{
159 width: calc(50% - 10px);
160 margin-bottom: 10px;
161 position: relative;
162 border: 5px solid transparent;
163 -webkit-transition:all 0.2s ease-in-out;
164 -moz-transition:all 0.2s ease-in-out;
165 -ms-transition:all 0.2s ease-in-out;
166 transition:all 0.2s ease-in-out;
167 }
168 #customize-control-customize_presets_settings .loginpress_thumbnail:nth-child(odd){
169 float: left;
170 }
171 #customize-control-customize_presets_settings .loginpress_thumbnail:nth-child(even){
172 float: right;
173 }
174 #customize-control-customize_presets_settings .image:after{
175 content: '';
176 display: table;
177 clear: both;
178 }
179 #customize-control-customize_presets_settings h3{
180 margin: 0;
181 font: 400 14px 'Open Sans', Arial, Helvetica, sans-serif;
182 line-height: 1.1;
183 padding: 3px;
184 text-align: center;
185 background: #eee;
186 color: #777777;
187 }
188 #customize-control-customize_presets_settings label .loginpress_thumbnail_img:after {
189 content: '';
190 width: 20px;
191 height: 20px;
192 border-radius: 50%;
193 background: #2EB150;
194 position: absolute;
195 top: -5px;
196 left: -5px;
197 border-radius: 50%;
198 visibility: hidden;
199 }
200 #customize-control-customize_presets_settings label .loginpress_thumbnail_img:before {
201 height: 6px;
202 width: 3px;
203 -webkit-transform-origin: left top;
204 -moz-transform-origin: left top;
205 -ms-transform-origin: left top;
206 -o-transform-origin: left top;
207 transform-origin: left top;
208 border-right: 3px solid white;
209 border-top: 3px solid white;
210 border-radius: 2.5px !important;
211 content: '';
212 position: absolute;
213 z-index: 2;
214 opacity: 0;
215 margin-top: 0px;
216 margin-left: -7px;
217 top: 5px;
218 left: 4px;
219 }
220 #customize-control-customize_presets_settings .loginpress_thumbnail_img{
221 display: block;
222 position: relative;
223 }
224 #customize-control-customize_presets_settings input[type="radio"]:checked + label .loginpress_thumbnail_img:before {
225 -webkit-animation-delay: 100ms;
226 -moz-animation-delay: 100ms;
227 animation-delay: 100ms;
228 -webkit-animation-duration: 1s;
229 -moz-animation-duration: 1s;
230 animation-duration: 1s;
231 -webkit-animation-timing-function: ease;
232 -moz-animation-timing-function: ease;
233 animation-timing-function: ease;
234 -webkit-animation-name: checkmark;
235 -moz-animation-name: checkmark;
236 animation-name: checkmark;
237 -webkit-transform: scaleX(-1) rotate(135deg);
238 -moz-transform: scaleX(-1) rotate(135deg);
239 -ms-transform: scaleX(-1) rotate(135deg);
240 -o-transform: scaleX(-1) rotate(135deg);
241 transform: scaleX(-1) rotate(135deg);
242 -webkit-animation-fill-mode: forwards;
243 -moz-animation-fill-mode: forwards;
244 animation-fill-mode: forwards;
245 z-index: 2;
246 }
247 #customize-control-customize_presets_settings input[type="radio"]:checked + label .loginpress_thumbnail_img:after{
248 visibility: visible;
249 }
250 /*#customize-control-customize_presets_settings input[type="radio"]:disabled + label .loginpress_thumbnail_img:before{
251 visibility: hidden;
252 }
253 #customize-control-customize_presets_settings input[type="radio"]:disabled + label .loginpress_thumbnail_img:after{
254 visibility: hidden;
255 }*/
256 #customize-control-customize_presets_settings img{
257 margin-bottom: 0;
258 }
259 #customize-control-customize_presets_settings input[type="radio"]:checked + label img{
260 opacity: 1;
261 }
262 .no-available{
263 top: 0;
264 left: 0;
265 background: rgba(204, 204, 204, 0.8);
266 content: '';
267 position: absolute;
268 bottom: 0;
269 right: 0;
270 z-index: 100;
271 padding: 20px;
272 text-align: center;
273 font-weight: bold;
274 color: #000;
275 -webkit-transition: all 0.2s ease-in-out;
276 -moz-transition: all 0.2s ease-in-out;
277 -ms-transition: all 0.2s ease-in-out;
278 transition: all 0.2s ease-in-out;
279 opacity: 0;
280 visibility: hidden;
281 -webkit-transform: scale(.5);
282 -moz-transform: scale(.5);
283 -ms-transform: scale(.5);
284 transform: scale(.5);
285 text-decoration: none !important;
286 }
287 #customize-control-customize_presets_settings .loginpress_thumbnail:hover input[type="radio"]:disabled ~ .no-available{
288 opacity: 1;
289 visibility: visible;
290 color: #000;
291 -webkit-transform: scale(1);
292 -moz-transform: scale(1);
293 -ms-transform: scale(1);
294 transform: scale(1);
295 }
296 #customize-control-customize_presets_settings .loginpress_thumbnail:hover{
297 border-color: #ccc;
298 }
299
300 @-webkit-keyframes checkmark {
301 0% {
302 height: 0;
303 width: 0;
304 opacity: 1;
305 }
306 20% {
307 height: 0;
308 width: 5px;
309 opacity: 1;
310 }
311 40% {
312 height: 10px;
313 width: 5px;
314 opacity: 1;
315 }
316 100% {
317 height: 10px;
318 width: 5px;
319 opacity: 1;
320 }
321 }
322 @-moz-keyframes checkmark {
323 0% {
324 height: 0;
325 width: 0;
326 opacity: 1;
327 }
328 20% {
329 height: 0;
330 width: 5px;
331 opacity: 1;
332 }
333 40% {
334 height: 10px;
335 width: 5px;
336 opacity: 1;
337 }
338 100% {
339 height: 10px;
340 width: 5px;
341 opacity: 1;
342 }
343 }
344 @keyframes checkmark {
345 0% {
346 height: 0;
347 width: 0;
348 opacity: 1;
349 }
350 20% {
351 height: 0;
352 width: 5px;
353 opacity: 1;
354 }
355 40% {
356 height: 10px;
357 width: 5px;
358 opacity: 1;
359 }
360 100% {
361 height: 10px;
362 width: 5px;
363 opacity: 1;
364 }
365 }
366
367 </style>
368 <?php
369 }
370 add_action( 'customize_controls_print_styles', 'loginpress_presets_control_css' );
371 ?>
372