PluginProbe
Meow Gallery / trunk
Meow Gallery vtrunk
5.5.4 5.5.3 5.5.2 5.5.1 5.5.0 5.4.9 5.4.8 5.4.7 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 All 156 releases
meow-gallery / classes / builders / square.css.php

square.css.php in Meow Gallery trunk, at classes/builders/square.css.php

81 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <style>
2
3 .mgl-square {
4 display: <?php echo ($isPreview ? 'block' : 'none') ?>;
5 }
6
7 <?php
8 $columns_in_percentage = "20%";
9
10 switch($columns) {
11 case 5:
12 $columns_in_percentage = "20%";
13 break;
14 case 4:
15 $columns_in_percentage = "25%";
16 break;
17 case 3:
18 $columns_in_percentage = "33.33%";
19 break;
20 case 2:
21 $columns_in_percentage = "50%";
22 break;
23 case 1:
24 $columns_in_percentage = "100%";
25 break;
26 }
27 ?>
28
29 <?php echo esc_attr( $class_id ) ?> {
30 margin: <?php echo -1 * ( (int)$gutter / 2 ) ?>px;
31 }
32
33 <?php echo esc_attr( $class_id ) ?> .mgl-item {
34 width: <?php echo (int)$columns_in_percentage ?>%;
35 padding-bottom: <?php echo (int)$columns_in_percentage ?>%;
36 }
37
38 <?php
39 if($columns > 2) {
40 ?>
41
42 @media screen and (max-width: 460px) {
43 <?php echo esc_attr( $class_id ) ?> .mgl-item {
44 width: 50%;
45 padding-bottom: 50%;
46 }
47 }
48
49 <?php
50 }
51 ?>
52
53 <?php
54 if($columns > 1) {
55 ?>
56
57 @media screen and (max-width: 360px) {
58 <?php echo esc_attr( $class_id ) ?> .mgl-item {
59 width: 100%;
60 padding-bottom: 100%;
61 }
62 }
63
64 <?php
65 }
66 ?>
67
68 <?php echo esc_attr( $class_id ) ?>.custom-gallery-class .mgl-item {
69 padding-bottom: <?php echo ( str_replace( '%', '', (int)$columns_in_percentage) / 1.5 ) ?>% !important;
70 }
71
72 <?php echo esc_attr( $class_id ) ?> .mgl-item .mgl-icon {
73 padding: <?php echo (int)$gutter / 2 ?>px;
74 }
75
76 <?php echo esc_attr( $class_id ) ?> .mgl-item figcaption {
77 padding: <?php echo (int)$gutter / 2 ?>px;
78 }
79
80 </style>
81