frontblocks-gallery-option.jsx
11 months ago
frontblocks-gallery.css
11 months ago
frontblocks-gallery.js
11 months ago
frontblocks-gallery.php
11 months ago
frontblocks-gallery.css
282 lines
| 1 | /* FrontBlocks Gallery Styles */ |
| 2 | |
| 3 | /* Common column width calculations for both masonry and grid layouts */ |
| 4 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-1 figure.wp-block-image:not(#individual-image), |
| 5 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-1 figure.wp-block-image:not(#individual-image) { |
| 6 | width: calc(100% - var(--frontblocks-gutter, 20px) * 0) !important; |
| 7 | } |
| 8 | |
| 9 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-2 figure.wp-block-image:not(#individual-image), |
| 10 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-2 figure.wp-block-image:not(#individual-image) { |
| 11 | width: calc(50% - var(--frontblocks-gutter, 20px) * 0.5) !important; |
| 12 | } |
| 13 | |
| 14 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-3 figure.wp-block-image:not(#individual-image), |
| 15 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-3 figure.wp-block-image:not(#individual-image) { |
| 16 | width: calc(33.33333% - var(--frontblocks-gutter, 20px) * 0.66667) !important; |
| 17 | } |
| 18 | |
| 19 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-4 figure.wp-block-image:not(#individual-image), |
| 20 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-4 figure.wp-block-image:not(#individual-image) { |
| 21 | width: calc(25% - var(--frontblocks-gutter, 20px) * 0.75) !important; |
| 22 | } |
| 23 | |
| 24 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-5 figure.wp-block-image:not(#individual-image), |
| 25 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-5 figure.wp-block-image:not(#individual-image) { |
| 26 | width: calc(20% - var(--frontblocks-gutter, 20px) * 0.8) !important; |
| 27 | } |
| 28 | |
| 29 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-6 figure.wp-block-image:not(#individual-image), |
| 30 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-6 figure.wp-block-image:not(#individual-image) { |
| 31 | width: calc(16.66667% - var(--frontblocks-gutter, 20px) * 0.83333) !important; |
| 32 | } |
| 33 | |
| 34 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-7 figure.wp-block-image:not(#individual-image), |
| 35 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-7 figure.wp-block-image:not(#individual-image) { |
| 36 | width: calc(14.28571% - var(--frontblocks-gutter, 20px) * 0.85714) !important; |
| 37 | } |
| 38 | |
| 39 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-8 figure.wp-block-image:not(#individual-image), |
| 40 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-8 figure.wp-block-image:not(#individual-image) { |
| 41 | width: calc(12.5% - var(--frontblocks-gutter, 20px) * 0.875) !important; |
| 42 | } |
| 43 | |
| 44 | /* Grid layout specific styles */ |
| 45 | .wp-block-gallery.frontblocks-gallery-grid { |
| 46 | gap: var(--frontblocks-gutter, 20px) !important; |
| 47 | } |
| 48 | |
| 49 | /* Common image styles for both layouts */ |
| 50 | .wp-block-gallery.frontblocks-gallery-masonry figure.wp-block-image img, |
| 51 | .wp-block-gallery.frontblocks-gallery-grid figure.wp-block-image img { |
| 52 | width: 100% !important; |
| 53 | height: auto !important; |
| 54 | display: block !important; |
| 55 | transition: transform 0.3s ease; |
| 56 | max-width: 100% !important; |
| 57 | object-fit: cover !important; |
| 58 | } |
| 59 | |
| 60 | /* Common hover effects for both layouts */ |
| 61 | .wp-block-gallery.frontblocks-gallery-masonry figure.wp-block-image img:hover, |
| 62 | .wp-block-gallery.frontblocks-gallery-grid figure.wp-block-image img:hover { |
| 63 | transform: scale(1.01); |
| 64 | } |
| 65 | |
| 66 | /* Responsive breakpoints for gallery layouts */ |
| 67 | @media (max-width: 1024px) { |
| 68 | /* Small desktop: maximum 4 columns */ |
| 69 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-5 figure.wp-block-image:not(#individual-image), |
| 70 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-6 figure.wp-block-image:not(#individual-image), |
| 71 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-7 figure.wp-block-image:not(#individual-image), |
| 72 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-8 figure.wp-block-image:not(#individual-image), |
| 73 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-5 figure.wp-block-image:not(#individual-image), |
| 74 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-6 figure.wp-block-image:not(#individual-image), |
| 75 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-7 figure.wp-block-image:not(#individual-image), |
| 76 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-8 figure.wp-block-image:not(#individual-image) { |
| 77 | width: calc(25% - var(--frontblocks-gutter, 20px) * 0.75) !important; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | @media (max-width: 768px) { |
| 82 | /* Tablet: maximum 3 columns */ |
| 83 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-4 figure.wp-block-image:not(#individual-image), |
| 84 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-5 figure.wp-block-image:not(#individual-image), |
| 85 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-6 figure.wp-block-image:not(#individual-image), |
| 86 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-7 figure.wp-block-image:not(#individual-image), |
| 87 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-8 figure.wp-block-image:not(#individual-image), |
| 88 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-4 figure.wp-block-image:not(#individual-image), |
| 89 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-5 figure.wp-block-image:not(#individual-image), |
| 90 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-6 figure.wp-block-image:not(#individual-image), |
| 91 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-7 figure.wp-block-image:not(#individual-image), |
| 92 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-8 figure.wp-block-image:not(#individual-image) { |
| 93 | width: calc(33.33333% - var(--frontblocks-gutter, 20px) * 0.66667) !important; |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | @media (max-width: 480px) { |
| 98 | /* Mobile: maximum 2 columns */ |
| 99 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-3 figure.wp-block-image:not(#individual-image), |
| 100 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-4 figure.wp-block-image:not(#individual-image), |
| 101 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-5 figure.wp-block-image:not(#individual-image), |
| 102 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-6 figure.wp-block-image:not(#individual-image), |
| 103 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-7 figure.wp-block-image:not(#individual-image), |
| 104 | .wp-block-gallery.frontblocks-gallery-masonry.has-nested-images.columns-8 figure.wp-block-image:not(#individual-image), |
| 105 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-3 figure.wp-block-image:not(#individual-image), |
| 106 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-4 figure.wp-block-image:not(#individual-image), |
| 107 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-5 figure.wp-block-image:not(#individual-image), |
| 108 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-6 figure.wp-block-image:not(#individual-image), |
| 109 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-7 figure.wp-block-image:not(#individual-image), |
| 110 | .wp-block-gallery.frontblocks-gallery-grid.has-nested-images.columns-8 figure.wp-block-image:not(#individual-image) { |
| 111 | width: calc(50% - var(--frontblocks-gutter, 20px) * 0.5) !important; |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | /* Lightbox Styles */ |
| 116 | .frontblocks-lightbox { |
| 117 | position: fixed; |
| 118 | top: 0; |
| 119 | left: 0; |
| 120 | width: 100%; |
| 121 | height: 100%; |
| 122 | background: rgba(0, 0, 0, 0.9); |
| 123 | z-index: 9999; |
| 124 | display: none; |
| 125 | align-items: center; |
| 126 | justify-content: center; |
| 127 | opacity: 0; |
| 128 | transition: opacity 0.3s ease; |
| 129 | } |
| 130 | |
| 131 | .frontblocks-lightbox.active { |
| 132 | display: flex; |
| 133 | opacity: 1; |
| 134 | } |
| 135 | |
| 136 | .frontblocks-lightbox-content { |
| 137 | position: relative; |
| 138 | max-width: 90%; |
| 139 | max-height: 90%; |
| 140 | } |
| 141 | |
| 142 | .frontblocks-lightbox-content img { |
| 143 | max-width: 100%; |
| 144 | max-height: 100%; |
| 145 | object-fit: contain; |
| 146 | } |
| 147 | |
| 148 | .frontblocks-lightbox-caption { |
| 149 | position: absolute; |
| 150 | bottom: -30px; |
| 151 | left: 0; |
| 152 | text-align: left; |
| 153 | color: #fff; |
| 154 | max-width: 80%; |
| 155 | font-size: 16px; |
| 156 | line-height: 1.4; |
| 157 | padding: 5px; |
| 158 | border-radius: 5px; |
| 159 | margin: 0 auto; |
| 160 | display: none; |
| 161 | } |
| 162 | |
| 163 | .frontblocks-lightbox-counter { |
| 164 | position: absolute; |
| 165 | bottom: -30px; |
| 166 | right: 0; |
| 167 | color: #fff; |
| 168 | font-size: 14px; |
| 169 | padding: 5px; |
| 170 | border-radius: 5px; |
| 171 | display: none; |
| 172 | } |
| 173 | |
| 174 | .frontblocks-lightbox-close { |
| 175 | position: absolute; |
| 176 | top: -40px; |
| 177 | right: 0; |
| 178 | background: none; |
| 179 | border: none; |
| 180 | color: #fff; |
| 181 | font-size: 30px; |
| 182 | cursor: pointer; |
| 183 | padding: 0; |
| 184 | width: 40px; |
| 185 | height: 40px; |
| 186 | display: flex; |
| 187 | align-items: center; |
| 188 | justify-content: center; |
| 189 | } |
| 190 | |
| 191 | .frontblocks-lightbox-close:hover { |
| 192 | color: #ccc; |
| 193 | } |
| 194 | |
| 195 | .frontblocks-lightbox-nav { |
| 196 | position: absolute; |
| 197 | top: 50%; |
| 198 | transform: translateY(-50%); |
| 199 | background: rgba(255, 255, 255, 0.2); |
| 200 | border: none; |
| 201 | color: #fff; |
| 202 | font-size: 24px; |
| 203 | cursor: pointer; |
| 204 | padding: 10px 15px; |
| 205 | border-radius: 5px; |
| 206 | transition: background 0.3s ease; |
| 207 | } |
| 208 | |
| 209 | .frontblocks-lightbox-nav:hover { |
| 210 | background: rgba(255, 255, 255, 0.3); |
| 211 | } |
| 212 | |
| 213 | .frontblocks-lightbox-prev { |
| 214 | left: 20px; |
| 215 | } |
| 216 | |
| 217 | .frontblocks-lightbox-next { |
| 218 | right: 20px; |
| 219 | } |
| 220 | |
| 221 | /* Loading indicator */ |
| 222 | .frontblocks-gallery-loading { |
| 223 | display: flex; |
| 224 | justify-content: center; |
| 225 | align-items: center; |
| 226 | min-height: 200px; |
| 227 | } |
| 228 | |
| 229 | .frontblocks-gallery-loading::after { |
| 230 | content: ''; |
| 231 | width: 40px; |
| 232 | height: 40px; |
| 233 | border: 4px solid #f3f3f3; |
| 234 | border-top: 4px solid #3498db; |
| 235 | border-radius: 50%; |
| 236 | animation: spin 1s linear infinite; |
| 237 | } |
| 238 | |
| 239 | @keyframes spin { |
| 240 | 0% { transform: rotate(0deg); } |
| 241 | 100% { transform: rotate(360deg); } |
| 242 | } |
| 243 | |
| 244 | /* Responsive adjustments */ |
| 245 | @media (max-width: 768px) { |
| 246 | .frontblocks-lightbox-nav { |
| 247 | padding: 8px 12px; |
| 248 | font-size: 20px; |
| 249 | } |
| 250 | |
| 251 | .frontblocks-lightbox-prev { |
| 252 | left: 10px; |
| 253 | } |
| 254 | |
| 255 | .frontblocks-lightbox-next { |
| 256 | right: 10px; |
| 257 | } |
| 258 | |
| 259 | .frontblocks-lightbox-caption { |
| 260 | font-size: 14px; |
| 261 | padding: 8px; |
| 262 | max-width: 90%; |
| 263 | } |
| 264 | |
| 265 | .frontblocks-lightbox-counter { |
| 266 | font-size: 12px; |
| 267 | padding: 6px 10px; |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | @media (max-width: 480px) { |
| 272 | .frontblocks-lightbox-content { |
| 273 | max-width: 95%; |
| 274 | max-height: 95%; |
| 275 | } |
| 276 | |
| 277 | .frontblocks-lightbox-caption { |
| 278 | font-size: 12px; |
| 279 | padding: 6px; |
| 280 | max-width: 95%; |
| 281 | } |
| 282 | } |