Menu
All plugins

Colour Slideshow for Bricks

Colour Slideshow is a Bricks element that shows landscape images in a slideshow and changes the background of the section around it to the dominant colour of the image in view. The colour fades from one image to the next as visitors scroll, swipe or click through.

Version: 0.4.2 · Requires: Bricks Builder, WordPress 6.5+ and PHP 8.1+ · See the live demo

Please note: this is an early release. It has been run on this playground but not yet tested widely, so stage & back up before using it on a live site.

Using it

  1. Add the Colour Slideshow element (Media) inside a Section.
  2. Pick your landscape images under Images.
  3. Choose a layout, then set the background colour options. By default the nearest Section takes the colour.

Layouts

  • Scroll track — images sit in a horizontal scroll-snap track with the neighbouring images peeking in at the sides. Scroll, swipe, use the arrows or the arrow keys.
  • Single image — one full-width image at a time, with plain arrows out in the side gutters.

Either layout can show dots or a thumbnail strip underneath. The active thumbnail is outlined and underlined, and the strip follows the slideshow.

Background colour

  • Change the background of — the nearest section (default), the direct parent, or any CSS selector.
  • Colour picked from each image — dominant (the most common colour, weighted towards saturated ones, ignoring near-black and near-white) or the average of the whole image.
  • Lightness adjust and Saturation adjust — from -50 to 50, to darken, lighten or mute the picked colour.
  • Fallback colour — shown until an image has been read, or if it cannot be read.
  • Colour fade time — in milliseconds.
  • Set text colour for contrast — switches the coloured element’s text to white or near-black, whichever reads better.

Layout and navigation

  • Image shape — landscape only: 3 / 2, 4 / 3, 16 / 9, 21 / 9 or a custom ratio that is wider than tall.
  • Slide width on desktop and mobile (scroll track), max width of the image, the gap, and the opacity of images not in view.
  • Arrows, dots or thumbnails, with thumbnail width and gap, and arrow colours.
  • Looping — on by default. Tick Stop at the first and last image to turn it off.
  • Autoplay with the time on each image.

Behaviour

  • Looping wraps from the last image to the first and back from the arrows, arrow keys, thumbnails and autoplay. The wrap is an instant jump.
  • Max width caps the big image and keeps it centred. The arrows stay at its edges and the thumbnails stay centred under it.
  • On phones the arrows are hidden and swiping is used instead.
  • Reduced motion is respected: jumps are instant.

Styling

Variables on the element: --csb-ratio, --csb-w, --csb-w-m, --csb-gap, --csb-max, --csb-inactive, --csb-fade, --csb-thumb-w, --csb-thumb-gap, --csb-arrow-bg and --csb-arrow-ink.

On the section being coloured: --csb-bg is the current colour, and --csb-ink is white or near-black when Set text colour for contrast is on. Use var(--csb-ink) to colour your own headings and text to match. Classes use the plugin’s own csb- prefix.

Limitations

  • Built for landscape images. They are cropped to a landscape shape.
  • Colours are read in the browser from each image. The browser only allows this for images on the same domain, or on another domain that sends CORS headers. Any other image uses the fallback colour.
  • Looping is a jump back, not a seamless endless carousel.

Changelog

  • 0.4.2 — a long thumbnail strip now scrolls from its first thumbnail.
  • 0.4.1 — fixed the active thumbnail outline being clipped.
  • 0.4.0 — looping, and a max width for the big image.
  • 0.3.0 — single image layout with side-gutter arrows and underlined thumbnails.
  • 0.2.0 — thumbnail strip; landscape only.
  • 0.1.0 — first release.