Components
48
Background Gradients Breadcrumb Content Card Carousel Content Card Grid Content Cards Two Column Content Contact Form Content Contact Form Reveal Content Courses Map Content Courses Search Content Event Details Content Events Carousel Content Faqs Content Featured Cards Content Featured Products Content Featured Products Carousel Content Form Over Image Content Game Elements Content Hall Of Fame Carousel Content Horizontal Accordion Content Horizontal Scrolling Content How To Find Us Content Job Roles Grid Content Map Embed Content Marquee Text Content Media Carousel Content Players Content Quick Links Content Quote Over Image Content Simple Text And Image Variations Content Specification Content Stat Row Content Stat With Images And Content Content Text And Cards Grid Content Text And Image Variations Content Text Columns Content Text Image Carousel Content Text Over Image Content Title Content Useful Links Content Vacancies Grid Cookie Table Example Hero Basic Hero Featured Card Hero Game Hero Video And Carousel Hero Video Cards Playlist Hero Video Player

Hero Featured Card

Field
Field Type
Field Name
Instructions
Block Data
tab
Heading Type
select
heading_type
Heading Text
text
heading_text
Add <span></span> around gradient text. E.g. "British <span>Esports</span>"
Content
wysiwyg
content
CTA Select
post_object
cta_select
Button Type
select
button_button_type
Button Color
select
button_button_color
Button Link
link
button_button_link
Featured card type
button_group
featured_card_type
Featured card
relationship
featured_card
Background Image
image
background_image
Overwrite the featured card image if required
Block Meta
tab
Show heading arrow
true_false
show_heading_arrow
Show search
true_false
show_search
Image size
button_group
image_size
Show down arrow
true_false
show_down_arrow
Show overlay
true_false
show_overlay
Controls the gradient overlay over the main image and background.
ID
text
block_id
Block Classes
text
block_classes
Block theme
button_group
block_theme
Search options
tab
Search placeholder
text
search_placeholder
Post type
select
post_type
Choose which post type to search within.

				
@import "../../resources/scss/util/variables";
@import "../../resources/scss/util/mixins";
@import "../../resources/scss/vendor/bootstrap/vendor/rfs";

.block-hero-featured-card {
	min-height: rem-calc(300);
	position: relative;
	z-index: 6;
	background-color: $primary;
	@include padding-bottom( rem-calc(100) );

	@include bp($xxl) {
		min-height: rem-calc(600);
	}

	&:before {
		width: 100%;
		height: 100%;
		content: '';
		background: linear-gradient(to top, rgba($primary, 0) 0%, $primary 100%);
		position: absolute;
		top: 0;
		left: 0;
		z-index: 2;
		pointer-events: none;

		@include bp($lg) {
			height: 30%;
		}
	}

	&.large {
		&:after {
			width: 100%;
			height: 50%;
			content: '';
			background: linear-gradient(180deg, rgba($primary, 0) 0%, $primary 100%);
			position: absolute;
			bottom: 0;
			left: 0;
			z-index: 2;
			pointer-events: none;
		}
	}

	.block-breadcrumb {
		@include margin-bottom( rem-calc(82) );
		position: relative;
	}

	.container {

	}

	.heading,
	.content-container {
		color: var( --text-color );
	}

	.overlay {
		width: 100%;
		height: 100%;
		position: absolute;
		inset: 0;
		z-index: 2;
		pointer-events: none;
		background-image: url( '/wp-content/themes/british-esports/assets/images/gradients/gradient.svg' );
		background-position: center;
		background-size: cover;
		background-repeat: no-repeat;

		@-moz-document url-prefix() {
			opacity: 0.5;
		}
	}

	&__content-col {
		position: relative;
		z-index: 6;
	}

	&__card-col {
		max-width: rem-calc(450);
		position: relative;
		z-index: 5;
		margin-top: rem-calc(48);

		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;

		@include bp($lg) {
			position: absolute;
			right: 0;
			bottom: 0;
			padding: 0;
		}

		.post-card {
			background-color: #fff;
			flex-grow: 0;

			p {
				color: $primary;
			}
		}
	}

	&__wrapper {
		position: relative;
		z-index: 5;

		.heading {
			&.has-arrow {
				position: relative;

				&:before {
					width: 12vw;
					max-width: 300px;
					height: 1ch;
					content: '';
					display: inline-block;
					margin-right: rem-calc(16);
					background-image: url('/wp-content/themes/british-esports/assets/icons/arrow-right--white.svg');
					background-repeat: no-repeat;
					background-position: calc(80%) center;

					@include bp($md) {
						width: 18vw;
						max-width: 160px;
						height: 1ch;
						margin-right: rem-calc(32);
					}
				}
			}
		}
		.content-container {
			max-width: rem-calc(590);

			&:last-child {
				margin-bottom: 0;
			}
		}
	}

	&__meta-container {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		gap: rem-calc(16 30);
		@include margin-top( rem-calc(100) );

		form {
			width: 100%;
			max-width: rem-calc(300);
			height: rem-calc(60);
			background-color: $white;
			display: flex;
			flex-direction: row;
			padding: 0;
			position: relative;

			@include bp($lg) {
				width: auto;
				max-width: 100%;
			}

			input {
				width: 100%;
				border: none;
				padding: rem-calc(16 40 16 18);
				text-overflow: ellipsis;

				@include bp($lg) {
					width: rfs-fluid-value( rem-calc(408) );
				}
			}

			button {
				width: rem-calc(20);
				height: rem-calc(20);
				flex-shrink: 0;
				margin: 0;
				padding: 0;
				border: none;
				background-color: transparent;

				position: absolute;
				top: 50%;
				right: rem-calc(16);
				transform: translate3d(0,-50%,0);

				background-image: url("data:image/svg+xml,%3Csvg width='23' height='23' viewBox='0 0 23 23' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1.10938 10.398C1.10871 6.00124 4.214 2.2163 8.52616 1.35793C12.8383 0.499566 17.1563 2.80684 18.8394 6.86869C20.5225 10.9305 19.1019 15.6157 15.4464 18.0588C11.7909 20.502 6.91868 20.0226 3.80937 16.914C2.08082 15.186 1.10958 12.8421 1.10938 10.398Z' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M16.8438 16.9141L22.1103 22.1806' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A");
				background-position: center;
				background-repeat: no-repeat;
				background-size: contain;

				&:hover {
					margin: 0;
					padding: 0;
					border: none;
					background-color: transparent;
				}
			}
		}
	}

	&__image {
		display: flex;
		flex-direction: column;

		img {
			height: 100%;
			object-fit: cover;
		}

		&.small {
			@include bp($lg) {
				width: 50%;
				max-width: rem-calc(960);
				height: 100%;
				aspect-ratio: 960/540;
				right: 0;
				left: auto;
			}
		}

		&.medium {
			@include bp($lg) {
				width: rem-calc(1280);
				height: 100%;
				aspect-ratio: 1280/853;
				right: 0;
				left: auto;

				&:before {
					width: 50%;
					height: 100%;
					content: '';
					position: absolute;
					top: 0;
					left: 0;
					background: linear-gradient(to left, rgba($primary, 0) 0%, $primary 100%);
					z-index: 2;
				}
			}
		}
	}

	&__jump-to {
		display: none;

		@include bp($md) {
			width: rem-calc(14);
			height: rem-calc(14);
			position: absolute;
			bottom: 0;
			left: 50%;
			z-index: 5;
			margin-bottom: rem-calc(40);
			transform: translate3d(-50%,0,0);

			background-image: url('/wp-content/themes/british-esports/assets/icons/chevron-down--thin.svg');
			background-repeat: no-repeat;
			background-position: center;
			display: block;
			cursor: pointer;
			border: none;
			outline: none;
			background-color: transparent;
		}

		&:hover {
			transform: scale(2) !important;
			opacity: 0.5 !important;
		}
	}

	&__video {
		width: 100%;
		max-width: rem-calc(1920);
		height: 100%;
		display: block;
		position: absolute;
		top: 0;
		pointer-events: none;

		@include bp($lg) {
			pointer-events: all;
		}

		&.small {
			@include bp($lg) {
				width: rem-calc(960);
				height: rem-calc(540);
				aspect-ratio: 960/540;
				right: 0;
				left: auto;
			}
		}

		&.medium {
			@include bp($lg) {
				width: 75%;
				right: 0;
				left: auto;
			}

			&:before {
				top: 40%;
			}
		}

		&.large {
			&:before {
				@include bp($lg) {
					left: 60%;
				}
			}
		}

		&:hover {
			&:before {
				background-color: $primary;
				background-image: url(/wp-content/themes/british-esports/assets/icons/play--white.svg);
			}
		}

		&:before {
			width: rem-calc(60);
			height: rem-calc(60);
			content: none;
			background-color: $white;
			background-image: url(/wp-content/themes/british-esports/assets/icons/play.svg);
			background-repeat: no-repeat;
			background-position: center;
			background-size: rem-calc(20);
			position: absolute;
			top: 50%;
			left: 50%;
			z-index: 10;
			transform: translate3d(-50%,-50%,0);
			transition: 0.3s var(--ease);
			transition-property: background-color, background-image, opacity;
			animation-name: fade-in;
			animation-duration: 0.3s;
			animation-timing-function: var(--ease);
			animation-delay: 1.5s;
			animation-fill-mode: forwards;
			opacity: 0;

			@include bp($lg) {
				content: '';
			}
		}
	}
}

@keyframes fade-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}
class HeroFeaturedCard {
	/**
	 * Create and initialise objects of this class
	 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/constructor
	 * @param {object} block
	 */
	constructor( block ) {
		this.block = block;

		this.jumpTo = this.block.querySelector( '.js-jump-to' );
		if ( this.jumpTo ) {
			this.jumpTo.addEventListener( 'click', () => {
				let scrollPos = this.block.offsetTop;
				let offsetHeight = this.block.offsetHeight;

				window.scrollTo({
					top: scrollPos + offsetHeight,
					behavior: 'smooth'
				});
			});
		}

		this.init();
	}

	init() {
		//
	}
}

document.querySelectorAll('.block-hero-featured-card').forEach((block) => {
	new HeroFeaturedCard( block );
});
Page Title
Page Type
Page URL
  • Choose which post to output. If none chosen, the most recent one will display
  • Clicking the search input will launch the fullpage advanced search
  • Options for which background effect to show and/or gradient overlay

Animation: