frontblocks-advanced-option.js
1 week ago
frontblocks-advanced-option.jsx
1 week ago
frontblocks-carousel-editor.css
4 months ago
frontblocks-carousel.css
1 week ago
frontblocks-carousel.js
1 week ago
glide.min.js
8 months ago
frontblocks-carousel.css
370 lines
| 1 | /** |
| 2 | * Frontblocks Carousel – scoped under .frontblocks so other Glide instances are not affected. |
| 3 | */ |
| 4 | |
| 5 | .frontblocks.glide { |
| 6 | position: relative; |
| 7 | width: 100%; |
| 8 | max-width: 100%; |
| 9 | box-sizing: border-box; |
| 10 | overflow: visible; |
| 11 | margin: 0; |
| 12 | padding: 0; |
| 13 | } |
| 14 | |
| 15 | .frontblocks.glide * { |
| 16 | box-sizing: inherit; |
| 17 | } |
| 18 | |
| 19 | .frontblocks .glide__track { |
| 20 | overflow: hidden; |
| 21 | width: 100%; |
| 22 | position: relative; |
| 23 | left: 0; |
| 24 | margin: 0; |
| 25 | padding: 0; |
| 26 | } |
| 27 | |
| 28 | .frontblocks .glide__slides { |
| 29 | position: relative; |
| 30 | width: 100%; |
| 31 | list-style: none; |
| 32 | backface-visibility: hidden; |
| 33 | transform-style: preserve-3d; |
| 34 | touch-action: pan-Y; |
| 35 | overflow: hidden; |
| 36 | margin: 0; |
| 37 | padding: 0; |
| 38 | white-space: nowrap; |
| 39 | display: flex; |
| 40 | flex-wrap: nowrap; |
| 41 | will-change: transform; |
| 42 | } |
| 43 | |
| 44 | .frontblocks .glide__slides--dragging { |
| 45 | user-select: none; |
| 46 | } |
| 47 | |
| 48 | .frontblocks .glide__slide { |
| 49 | width: 100%; |
| 50 | height: 100%; |
| 51 | flex-shrink: 0; |
| 52 | white-space: normal; |
| 53 | user-select: none; |
| 54 | -webkit-touch-callout: none; |
| 55 | -webkit-tap-highlight-color: transparent; |
| 56 | min-width: 0; |
| 57 | overflow: hidden; |
| 58 | } |
| 59 | |
| 60 | /* Prevent inner content (cards, AWB, etc.) from overflowing the slide and being cut off. */ |
| 61 | .frontblocks .glide__slide > * { |
| 62 | max-width: 100%; |
| 63 | box-sizing: border-box; |
| 64 | } |
| 65 | |
| 66 | .frontblocks .glide__slide a { |
| 67 | user-select: none; |
| 68 | -webkit-user-drag: none; |
| 69 | -moz-user-select: none; |
| 70 | -ms-user-select: none; |
| 71 | } |
| 72 | |
| 73 | .frontblocks .glide__arrows { |
| 74 | -webkit-touch-callout: none; |
| 75 | user-select: none; |
| 76 | } |
| 77 | |
| 78 | .frontblocks .glide__bullets { |
| 79 | -webkit-touch-callout: none; |
| 80 | user-select: none; |
| 81 | } |
| 82 | |
| 83 | .frontblocks.glide--rtl { |
| 84 | direction: rtl; |
| 85 | } |
| 86 | |
| 87 | .frontblocks .glide__arrow { |
| 88 | position: absolute; |
| 89 | display: block; |
| 90 | top: 50%; |
| 91 | z-index: 2; |
| 92 | color: white; |
| 93 | text-transform: uppercase; |
| 94 | padding: 9px 12px; |
| 95 | background-color: transparent; |
| 96 | border: 2px solid rgba(255, 255, 255, 0.5); |
| 97 | border-radius: 4px; |
| 98 | opacity: 1; |
| 99 | cursor: pointer; |
| 100 | transition: opacity 150ms ease, border 300ms ease-in-out; |
| 101 | transform: translateY(-50%); |
| 102 | line-height: 1; |
| 103 | } |
| 104 | |
| 105 | .frontblocks .glide__arrow:focus { |
| 106 | outline: none; |
| 107 | } |
| 108 | |
| 109 | .frontblocks .glide__arrow:hover { |
| 110 | border-color: white; |
| 111 | } |
| 112 | |
| 113 | .frontblocks .glide__arrow--left { |
| 114 | left: 1em; |
| 115 | } |
| 116 | |
| 117 | .frontblocks .glide__arrow--right { |
| 118 | right: 1em; |
| 119 | } |
| 120 | |
| 121 | .frontblocks .glide__arrow--disabled { |
| 122 | opacity: 0.33; |
| 123 | } |
| 124 | |
| 125 | .frontblocks .glide__bullets { |
| 126 | display: flex; |
| 127 | justify-content: center; |
| 128 | list-style: none; |
| 129 | gap: 2px; |
| 130 | margin: 0.75em 0 0; |
| 131 | padding: 0; |
| 132 | } |
| 133 | |
| 134 | .frontblocks .glide__bullet { |
| 135 | box-sizing: content-box; |
| 136 | width: 10px; |
| 137 | height: 10px; |
| 138 | padding: 0; |
| 139 | border-radius: 50%; |
| 140 | border: none; |
| 141 | background-color: var(--frbl-bullet-bg, rgba(0, 0, 0, 0.25)); |
| 142 | cursor: pointer; |
| 143 | transition: background-color 300ms ease-in-out, transform 300ms ease-in-out; |
| 144 | margin: 0 2px; |
| 145 | flex-shrink: 0; |
| 146 | } |
| 147 | |
| 148 | .frontblocks .glide__bullet:focus { |
| 149 | outline: 2px solid var(--frbl-bullet-color, rgba(0, 0, 0, 0.8)); |
| 150 | outline-offset: 2px; |
| 151 | } |
| 152 | |
| 153 | .frontblocks .glide__bullet:hover { |
| 154 | background-color: var(--frbl-bullet-color, rgba(0, 0, 0, 0.8)); |
| 155 | transform: scale(1.2); |
| 156 | } |
| 157 | |
| 158 | .frontblocks .glide__bullet--active { |
| 159 | background-color: var(--frbl-bullet-color, rgba(0, 0, 0, 0.8)); |
| 160 | transform: scale(1.2); |
| 161 | } |
| 162 | |
| 163 | .frontblocks.glide--swipeable { |
| 164 | cursor: grab; |
| 165 | cursor: -moz-grab; |
| 166 | cursor: -webkit-grab; |
| 167 | } |
| 168 | |
| 169 | .frontblocks.glide--dragging { |
| 170 | cursor: grabbing; |
| 171 | cursor: -moz-grabbing; |
| 172 | cursor: -webkit-grabbing; |
| 173 | } |
| 174 | |
| 175 | /* Side: arrows on left and right sides, vertically centered (default) */ |
| 176 | .frontblocks .glide__arrows--side { |
| 177 | position: absolute; |
| 178 | top: 50%; |
| 179 | left: 0; |
| 180 | right: 0; |
| 181 | width: 100%; |
| 182 | z-index: 10; |
| 183 | pointer-events: none; |
| 184 | transform: translateY(-50%); |
| 185 | } |
| 186 | |
| 187 | .frontblocks .glide__arrows--side .glide__arrow { |
| 188 | pointer-events: all; |
| 189 | } |
| 190 | |
| 191 | .frontblocks .glide__arrows--side .glide__arrow--left { |
| 192 | left: 2em; |
| 193 | } |
| 194 | |
| 195 | .frontblocks .glide__arrows--side .glide__arrow--right { |
| 196 | right: 2em; |
| 197 | } |
| 198 | |
| 199 | /* Grouped positions: both arrows outside the carousel, below or above */ |
| 200 | .frontblocks .glide__arrows--bottom-left, |
| 201 | .frontblocks .glide__arrows--bottom-right, |
| 202 | .frontblocks .glide__arrows--top-left, |
| 203 | .frontblocks .glide__arrows--top-right { |
| 204 | position: absolute; |
| 205 | display: flex; |
| 206 | flex-direction: row; |
| 207 | gap: 8px; |
| 208 | z-index: 10; |
| 209 | } |
| 210 | |
| 211 | .frontblocks .glide__arrows--bottom-left .glide__arrow, |
| 212 | .frontblocks .glide__arrows--bottom-right .glide__arrow, |
| 213 | .frontblocks .glide__arrows--top-left .glide__arrow, |
| 214 | .frontblocks .glide__arrows--top-right .glide__arrow { |
| 215 | position: relative; |
| 216 | top: auto; |
| 217 | left: auto; |
| 218 | right: auto; |
| 219 | transform: none; |
| 220 | } |
| 221 | |
| 222 | /* Below the carousel */ |
| 223 | .frontblocks .glide__arrows--bottom-left { |
| 224 | top: calc(100% + 12px); |
| 225 | left: 0; |
| 226 | } |
| 227 | |
| 228 | .frontblocks .glide__arrows--bottom-right { |
| 229 | top: calc(100% + 12px); |
| 230 | right: 0; |
| 231 | } |
| 232 | |
| 233 | /* Above the carousel */ |
| 234 | .frontblocks .glide__arrows--top-left { |
| 235 | bottom: calc(100% + 12px); |
| 236 | left: 0; |
| 237 | } |
| 238 | |
| 239 | .frontblocks .glide__arrows--top-right { |
| 240 | bottom: calc(100% + 12px); |
| 241 | right: 0; |
| 242 | } |
| 243 | |
| 244 | |
| 245 | /* Backward compatibility aliases */ |
| 246 | .frontblocks .glide__arrows--top { |
| 247 | position: absolute; |
| 248 | top: 50%; |
| 249 | left: 0; |
| 250 | right: 0; |
| 251 | width: 100%; |
| 252 | z-index: 10; |
| 253 | pointer-events: none; |
| 254 | transform: translateY(-50%); |
| 255 | } |
| 256 | |
| 257 | .frontblocks .glide__arrows--top .glide__arrow { |
| 258 | pointer-events: all; |
| 259 | } |
| 260 | |
| 261 | .frontblocks .glide__arrows--top .glide__arrow--left { |
| 262 | left: 2em; |
| 263 | } |
| 264 | |
| 265 | .frontblocks .glide__arrows--top .glide__arrow--right { |
| 266 | right: 2em; |
| 267 | } |
| 268 | |
| 269 | .frontblocks .glide__arrows--bottom .glide__arrow { |
| 270 | top: calc(100% + 25px); |
| 271 | left: 0; |
| 272 | } |
| 273 | |
| 274 | .frontblocks .glide__arrows--bottom .glide__arrow--right { |
| 275 | left: 50px; |
| 276 | right: unset; |
| 277 | } |
| 278 | |
| 279 | @media only screen and (max-width: 768px) { |
| 280 | .frontblocks .glide__arrow--left { |
| 281 | left: 0.5em; |
| 282 | } |
| 283 | .frontblocks .glide__arrow--right { |
| 284 | right: 0.5em; |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | /** |
| 289 | * Override native Gutenberg Grid styles when carousel is active (scoped to frontblocks carousel). |
| 290 | */ |
| 291 | .wp-block-group.frontblocks-carousel, |
| 292 | .wp-block-group.frontblocks-carousel.is-layout-grid { |
| 293 | display: block; |
| 294 | grid-template-columns: none; |
| 295 | gap: 0; |
| 296 | } |
| 297 | |
| 298 | .wp-block-group.frontblocks-carousel .frontblocks.glide, |
| 299 | .wp-block-group.frontblocks-carousel .frontblocks .glide__track { |
| 300 | width: 100%; |
| 301 | max-width: 100%; |
| 302 | margin-left: 0; |
| 303 | margin-right: 0; |
| 304 | padding-left: 0; |
| 305 | padding-right: 0; |
| 306 | } |
| 307 | |
| 308 | .wp-block-group.frontblocks-carousel > * { |
| 309 | width: 100%; |
| 310 | } |
| 311 | |
| 312 | .wp-block-group.frontblocks-carousel > .wp-block-group__inner-container { |
| 313 | display: block; |
| 314 | grid-template-columns: none; |
| 315 | gap: 0; |
| 316 | width: 100%; |
| 317 | } |
| 318 | |
| 319 | .frontblocks .glide__slides.wp-block-group, |
| 320 | .frontblocks .glide__slides.wp-block-group.is-layout-grid { |
| 321 | display: flex; |
| 322 | grid-template-columns: none; |
| 323 | gap: 0; |
| 324 | column-gap: 0; |
| 325 | row-gap: 0; |
| 326 | } |
| 327 | |
| 328 | .frontblocks .glide__slides > .glide__slide { |
| 329 | min-width: 0; |
| 330 | flex-shrink: 0; |
| 331 | } |
| 332 | |
| 333 | /** |
| 334 | * GenerateBlocks (and any other plugin) may inject column-gap via generated |
| 335 | * utility classes on the carousel slides container. Glide manages its own |
| 336 | * spacing through margin-right on each slide, so any external column-gap |
| 337 | * breaks the width calculation and must be zeroed out. |
| 338 | */ |
| 339 | .frontblocks-carousel, |
| 340 | .frontblocks .glide__slides { |
| 341 | column-gap: 0 !important; |
| 342 | gap: 0 !important; |
| 343 | } |
| 344 | |
| 345 | /* core/query (wp-block-post-template) as carousel — override WP grid layout */ |
| 346 | .frontblocks ul.glide__slides.wp-block-post-template, |
| 347 | .frontblocks ul.glide__slides.wp-block-post-template.is-layout-grid, |
| 348 | .frontblocks ul.glide__slides.wp-block-post-template.is-layout-flex, |
| 349 | .frontblocks ul.glide__slides.wp-block-post-template.is-layout-flow { |
| 350 | display: flex; |
| 351 | flex-wrap: nowrap; |
| 352 | grid-template-columns: unset; |
| 353 | grid-auto-rows: unset; |
| 354 | max-width: none; |
| 355 | list-style: none; |
| 356 | padding-left: 0; |
| 357 | margin-left: 0; |
| 358 | margin-right: 0; |
| 359 | } |
| 360 | |
| 361 | .frontblocks ul.glide__slides.wp-block-post-template > li.glide__slide, |
| 362 | .frontblocks ul.glide__slides.wp-block-post-template > li.glide__slide.wp-block-post { |
| 363 | display: block; |
| 364 | height: auto; |
| 365 | grid-column: unset; |
| 366 | grid-row: unset; |
| 367 | float: none; |
| 368 | clear: none; |
| 369 | } |
| 370 |