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 Carousel

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
Featured Team Members
relationship
featured_team_members
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-carousel {
	background-color: $veryLightBlue;
	padding-top: rem-calc(80);
	padding-bottom: rem-calc(80);
	position: relative;

	&__intro {
		margin-bottom: rem-calc(48);
	}

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

	.swiper {
		position: relative;
	}

	.swiper-slide {
		background-color: $veryLightBlue;
		height: auto;
	}

	.e-carousel__navigation {
		position: relative;
		left: auto;
		bottom: auto;
		margin-left: 0;
		z-index: 99;

		@include bp($lg) {
			position: absolute;
			left: rem-calc(10);
			bottom: rem-calc(160);
		}
	}
}
class TeamCarousel {
	/**
	 * 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-carousel');
		this.init();
	}

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

			const blockCarousel = block.querySelector(".swiper");
			const navNext = block.querySelector(".test-next");
			const navPrev = block.querySelector(".test-prev");

			navPrev.style.border = "think solid #000000";

			// console.log(navPrev);

			const swiper = new Swiper(blockCarousel, {
				// loop: true,
				slidesPerView: 1,
				effect: 'fade',
				navigation: {
					nextEl: '.test-next',
					prevEl: '.test-prev',
				},
				breakpoints: {
					992: {
						slidesPerView: 1,
					},
					// 992: {
					// 	slidesPerView: 5,
					// }
				}
			});

		});
	}
}

new TeamCarousel();

Animation / States

  • As the user scrolls to this component the copy and each items will be lazyloaded and fade in one by one
  • On hover, the profile image will expand slowly
  • The user can navigate the carousel using the arrow indicators where the next/previous elements will fade in

External Libraries

  • Swiper
  • ScrollTrigger (GSAP)

Notes (Design / Dev / SEO)

  • By default this component will pull through the top 12 team members (in regards to menu order). Alternatively, the user can specify which team members to feature within the carousel (Max number being 12)