Global Elements
2
Footer Header Services Strip Services Tabs
Components
36
Card Carousel Cards Grid Content Overlap Content Strip Cta Bar Featured Article Featured Blocks Featured Expert Featured Pods Featured Tabs Form Block Full Screen Carousel Full Width Content Heading Strip Hero Hero Featured Links List Location Tabs Logo Carousel Map Block People Grid Quote Block Reviews Carousel Reviews Tabs Service Tiles Services Strip Services Tabs Staggered Content Sticky Accordion Sticky List Sub Navigation Team Carousel Team Filters Team Strip Tile Carousel Tile Grid

Team Filters

Your Team

Our effectiveness is down to the considerable expertise of our people and the way we work with clients. We are here to help you.

and/or
Field
Field Type
Field Name
Instructions
Block Data
tab
Heading Type
select
heading_type
Heading Text
text
heading_text
Copy
wysiwyg
copy
Buttons
repeater
buttons_list
-- Button
link
button
Service Filter Source
select
service_filter_source
Service Filter Options
taxonomy
service_filter_options
Block Meta
tab
ID
text
block_id
Block Classes
text
block_classes
Block Theme
select
block_theme
Background Colors
select
background_colors
Padding Top
select
padding_top
Padding Bottom
select
padding_bottom
Margin Top
select
margin_top
Margin Bottom
select
margin_bottom

				
@import "../../resources/scss/util/colours";
@import "../../resources/scss/util/variables";
@import "../../resources/scss/util/mixins";

.block-team-filters {
	background-color: $veryLightBlue;
	padding-top: rem-calc(80);
	padding-bottom: rem-calc(80);
	position: relative;
	z-index: 99;

	.heading {
		@include fluid-type(28, 34);
	}

	&__buttons {
		margin-top: rem-calc(40);
	}

	&__grid {
		margin-top: rem-calc(20);
		width: 100%;

		&:hover {
			.block-team-filters__grid-block {
				opacity: 0.7;

				&:hover {
					opacity: 1;
				}
			}
		}

		@include bp($lg) {
			margin-top: 0;
		}
	}

	&__grid-row {
		display: flex;

		&:last-of-type {
			align-items: flex-end;
			margin-top: -12%;
		}
	}

	&__grid-column {
		width: 30%;
		padding-left: 1%;
		padding-right: 1%;

		&--large {
			width: 45%;
		}
	}

	&__grid-block {
		background-color: $darkBlue;
		width: 100%;
		padding-bottom: 100%;
		position: relative;
		display: block;
		transition: all 0.3s ease-out;

		&:hover {
			img {
				transform: scale(1.1);
			}
		}

		&--small {
			width: 46%;
			padding-bottom: 46%;
			margin-top: 7%;
		}

		&--large {
			width: 100%;
			padding-bottom: 100%;
		}

		picture {
			overflow: hidden;
		}

		img {
			transition: all 2s ease-in-out;
		}
	}

	.nice-select {
		width: 100%;
		border: none;
		padding-left: 0;
		margin-top: rem-calc(15);
		margin-bottom: rem-calc(30);
		border-bottom: 1px solid $darkBlue;
		border-radius: 0;
		background-color: transparent;

		&:after {
			border-bottom: 2px solid $darkBlue;
			border-right: 2px solid $darkBlue;
			height: rem-calc(14);
			width: rem-calc(14);
			margin-top: rem-calc(-10);
		}

		.option {
			font-size: rem-calc(16);
		}

		.current {
			@include fluid-type(18, 20);
			color: $darkBlue;
			background-color: transparent;
		}
	}

	.nice-select-dropdown {
		width: 100%;
	}
}
class TeamFilters {
	/**
	 * Create and initialise objects of this class
	 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/constructor
	 * @param {object} block
	 */
	constructor() {
		this.blocks = document.querySelectorAll('.block-team-filters');
		this.init();
	}

	/**
	 * Example function to run class logic
	 * Can access `this.block`
	 */
	init() {
		this.blocks.forEach((block) => {

			var options = {
				searchable: true,
				placeholder: 'Search by Name'
			};

			var options02 = {
				searchable: true,
				placeholder: 'Search by Service'
			};

			const originalSelect = block.querySelector('#block-team-filters-service-search');
			if(originalSelect) {
				NiceSelect.bind(block.querySelector("#block-team-filters-service-search"), options02);
			}
			NiceSelect.bind(block.querySelector("#block-team-filters-name-search"), options);

			const formSubmitButton = block.querySelector('[type=submit]');

			if(originalSelect) {
				originalSelect.addEventListener("change", function() {
					if (originalSelect.value) {
						formSubmitButton.removeAttribute("disabled");
						formSubmitButton.removeAttribute("title");
					}
				});
			}

			const teamProfiles = block.querySelectorAll(".block-team-filters__grid-block");

			if (teamProfiles !== null)  {
				gsap.set(".block-team-filters__grid-block", {y: 50, opacity: 0});

				ScrollTrigger.batch(".block-team-filters__grid-block", {
					start: "top 100%",
					onEnter: batch => gsap.to(batch, {opacity: 1, y: 0, stagger:  0.15, overwrite: true}),
					onLeave: batch => gsap.set(batch, {opacity: 0, y: -50, overwrite: true}),
					onEnterBack: batch => gsap.to(batch, {opacity: 1, y: 0, stagger: 0.15, overwrite: true}),
					onLeaveBack: batch => gsap.set(batch, {opacity: 0, y: 50, overwrite: true})
				});

				ScrollTrigger.addEventListener("refreshInit", () => gsap.set(".block-team-filters__grid-block", {y: 0}));
			}

			block.querySelector("#block-team-filters-name-search").addEventListener('change', function() {
				window.location.href = this.value;
			});


		});
	}
}

new TeamFilters();
Page Title
Page Type
Page URL

Animation / States

  • As the user scrolls to this component the copy and each profile image will be lazyloaded fade in one by one
  • On page load the profile images will be randomised, unless specified within the component
  • When searching for a specialist, the options selected will be passed as a query parameter and redirected to the main people page to display the corresponding results

External Libraries

  • Swiper
  • ScrollTrigger (GSAP)

Notes (Design / Dev / SEO)

No notes.