<?php

/**
 * Block Patterns
 *
 * @link https://developer.wordpress.org/reference/functions/register_block_pattern/
 * @link https://developer.wordpress.org/reference/functions/register_block_pattern_category/
 *
 * @package WordPress
 * @subpackage Twenty_Twenty_One
 * @since Twenty Twenty-One 1.0
 */

if (function_exists('register_block_pattern_category')) {
	/**
	 * Register Block Pattern Category.
	 * @since 1.0.0
	 * @return void
	 */
	function glaciers_register_block_pattern_category()
	{
		register_block_pattern_category(
			'glaciers',
			array('label' => esc_html__('Glaciers', 'glaciers'))
		);
	}
	add_action('init', 'glaciers_register_block_pattern_category');
}

/**
 * Register Block Patterns.
 */
if (function_exists('register_block_pattern')) {
	/**
	 * Register Block Pattern.
	 * @since 1.0.0
	 * @return void
	 */
	function glaciers_register_block_pattern()
	{

		// Section Heading.
		register_block_pattern(
			'glaciers/section-heading',
			array(
				'title'         => esc_html__('Section Heading', 'glaciers'),
				'categories'    => array('glaciers'),
				'viewportWidth' => 1170,
				'description'   => esc_html_x('A section heading with a subheading to add sections within your page content.', 'Block pattern description', 'glaciers'),
				'content'       => '<!-- wp:group {"className":"section-heading","layout":{"type":"constrained"}} --><div class="wp-block-group section-heading"><!-- wp:heading {"className":"section-title"} --><h2 class="wp-block-heading section-title">' . esc_html__('This is a Section Page Heading', 'glaciers') . '</h2><!-- /wp:heading --><!-- wp:paragraph {"className":"lead page-excerpt"} --><p class="lead page-excerpt">' . esc_html__('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus porttitor eu eros sit amet facilisis. Etiam pharetra elit pretium.', 'glaciers') . '</p><!-- /wp:paragraph --></div><!-- /wp:group -->',
			)
		);

		// Glaciers Cards v1
		register_block_pattern(
			'glaciers/glaciers-cards',
			array(
				'title'         => esc_html__('Glaciers Cards', 'glaciers'),
				'categories'    => array('glaciers'),
				'viewportWidth' => 1170,
				'description'   => esc_html_x('Three column layout with images, title, intro, and a button.', 'Block pattern description', 'glaciers'),
				'content'       => '<!-- wp:group {"className":"glaciers-cards","layout":{"type":"constrained"}} -->
						<div class="wp-block-group glaciers-cards"><!-- wp:columns -->
						<div class="wp-block-columns"><!-- wp:column -->
						<div class="wp-block-column"><!-- wp:image {"id":465,"sizeSlug":"full","linkDestination":"none","className":"glaciers-cards-image"} -->
						<figure class="wp-block-image size-full glaciers-cards-image"><img src="' . esc_url(get_template_directory_uri()) . '/assets/images/glaciers-card-image1.jpg" alt="' . esc_attr__('Glaciers card image 1', 'glaciers') . '" class="wp-image-465"/></figure>
						<!-- /wp:image -->

						<!-- wp:heading {"level":3,"className":"glaciers-cards-title"} -->
						<h3 class="wp-block-heading glaciers-cards-title">' . esc_html__('Column One', 'glaciers') . '</h3>
						<!-- /wp:heading -->

						<!-- wp:paragraph {"className":"glaciers-cards-intro"} -->
						<p class="glaciers-cards-intro">' . wp_kses_post(__('Tortor posuere ac ut consequat semper viverra nam. Elit eget gravida cum sociis natoque. Turpis massa sed elementum tempus egestas sed risus.', 'glaciers')) . '</p>
						<!-- /wp:paragraph -->

						<!-- wp:buttons -->
						<div class="wp-block-buttons"><!-- wp:button {"style":{"spacing":{"padding":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|30","left":"var:preset|spacing|50","right":"var:preset|spacing|50"}}},"className":"glaciers-card-button"} -->
						<div class="wp-block-button glaciers-card-button"><a class="wp-block-button__link wp-element-button" href="#" style="padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--50)">' . esc_html__('Button', 'glaciers') . '</a></div>
						<!-- /wp:button --></div>
						<!-- /wp:buttons --></div>
						<!-- /wp:column -->

						<!-- wp:column -->
						<div class="wp-block-column"><!-- wp:image {"id":466,"sizeSlug":"full","linkDestination":"none","className":"glaciers-cards-image"} -->
						<figure class="wp-block-image size-full glaciers-cards-image"><img src="' . esc_url(get_template_directory_uri()) . '/assets/images/glaciers-card-image2.jpg" alt="' . esc_attr__('Glaciers card image 2', 'glaciers') . '" class="wp-image-466"/></figure>
						<!-- /wp:image -->

						<!-- wp:heading {"level":3,"className":"glaciers-cards-title"} -->
						<h3 class="wp-block-heading glaciers-cards-title">' . esc_html__('Column Two', 'glaciers') . '</h3>
						<!-- /wp:heading -->

						<!-- wp:paragraph {"className":"glaciers-cards-intro"} -->
						<p class="glaciers-cards-intro">' . wp_kses_post(__('Tortor posuere ac ut consequat semper viverra nam. Elit eget gravida cum sociis natoque. Turpis massa sed elementum tempus egestas sed risus.', 'glaciers')) . '</p>
						<!-- /wp:paragraph -->

						<!-- wp:buttons -->
						<div class="wp-block-buttons"><!-- wp:button {"style":{"spacing":{"padding":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|30","left":"var:preset|spacing|50","right":"var:preset|spacing|50"}}},"className":"glaciers-card-button"} -->
						<div class="wp-block-button glaciers-card-button"><a class="wp-block-button__link wp-element-button" href="#" style="padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--50)">' . esc_html__('Button', 'glaciers') . '</a></div>
						<!-- /wp:button --></div>
						<!-- /wp:buttons --></div>
						<!-- /wp:column -->

						<!-- wp:column -->
						<div class="wp-block-column"><!-- wp:image {"id":467,"sizeSlug":"full","linkDestination":"none","className":"glaciers-cards-image"} -->
						<figure class="wp-block-image size-full glaciers-cards-image"><img src="' . esc_url(get_template_directory_uri()) . '/assets/images/glaciers-card-image3.jpg" alt="' . esc_attr__('Glaciers card image 3', 'glaciers') . '" class="wp-image-467"/></figure>
						<!-- /wp:image -->

						<!-- wp:heading {"level":3,"className":"glaciers-cards-title"} -->
						<h3 class="wp-block-heading glaciers-cards-title">' . esc_html__('Column Three', 'glaciers') . '</h3>
						<!-- /wp:heading -->

						<!-- wp:paragraph {"className":"glaciers-cards-intro"} -->
						<p class="glaciers-cards-intro">' . wp_kses_post(__('Tortor posuere ac ut consequat semper viverra nam. Elit eget gravida cum sociis natoque. Turpis massa sed elementum tempus egestas sed risus.', 'glaciers')) . '</p>
						<!-- /wp:paragraph -->

						<!-- wp:buttons -->
						<div class="wp-block-buttons"><!-- wp:button {"style":{"spacing":{"padding":{"top":"var:preset|spacing|30","bottom":"var:preset|spacing|30","left":"var:preset|spacing|50","right":"var:preset|spacing|50"}}},"className":"glaciers-card-button"} -->
						<div class="wp-block-button glaciers-card-button"><a class="wp-block-button__link wp-element-button" href="#" style="padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--50);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--50)">' . esc_html__('Button', 'glaciers') . '</a></div>
						<!-- /wp:button --></div>
						<!-- /wp:buttons --></div>
						<!-- /wp:column --></div>
						<!-- /wp:columns --></div>
						<!-- /wp:group -->',

			)
		);

		// Glaciers About v1.
		register_block_pattern(
			'glaciers/glaciers-about1',
			array(
				'title'         => esc_html__('Glaciers About 1', 'glaciers'),
				'categories'    => array('glaciers'),
				'viewportWidth' => 1170,
				'description'   => esc_html_x('An about layout with the author image on the left and additional content on the right. This includes social buttons.', 'Block pattern description', 'glaciers'),
				'content'       => '<!-- wp:group {"className":"glaciers-about1","layout":{"type":"constrained"}} -->
					<div class="wp-block-group glaciers-about1"><!-- wp:media-text {"mediaId":504,"mediaLink":"' . esc_url(get_template_directory_uri()) . '/assets/images/glaciers-about1-portrait.jpg","mediaType":"image","mediaWidth":45,"className":"about1-image"} -->
					<div class="wp-block-media-text alignwide is-stacked-on-mobile about1-image" style="grid-template-columns:45% auto"><figure class="wp-block-media-text__media"><img src="' . esc_url(get_template_directory_uri()) . '/assets/images/glaciers-about1-portrait.jpg" alt="' . esc_attr__('Glaciers About1 Portrait image', 'glaciers') . '" class="wp-image-504 size-full"/></figure><div class="wp-block-media-text__content"><!-- wp:heading {"className":"about1-title"} -->
					<h2 class="wp-block-heading about1-title">' . esc_html__('Joseph Lorem is a Dedicated Foodie Creator', 'glaciers') . '</h2>
					<!-- /wp:heading -->

					<!-- wp:paragraph {"className":"about1-intro"} -->
					<p class="about1-intro">' . wp_kses_post(__('Dolor morbi non arcu risus quis. Fringilla urna porttitor rhoncus dolor purus non enim praesent elementum. Enim diam vulputate ut pharetra. Integer feugiat scelerisque varius morbi enim nunc faucibus.', 'glaciers')) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:social-links {"iconColor":"white","iconColorValue":"#fff","iconBackgroundColor":"primary","iconBackgroundColorValue":"#35a0a7","className":"about1-social"} -->
					<ul class="wp-block-social-links has-icon-color has-icon-background-color about1-social"><!-- wp:social-link {"url":"https://twitter.com","service":"twitter"} /-->

					<!-- wp:social-link {"url":"https://instagram.com","service":"instagram"} /-->

					<!-- wp:social-link {"url":"https://pinterest.com","service":"pinterest"} /-->

					<!-- wp:social-link {"url":"https://youtube.com","service":"youtube"} /--></ul>
					<!-- /wp:social-links -->

					<!-- wp:buttons -->
					<div class="wp-block-buttons"><!-- wp:button {"className":"about1-button"} -->
					<div class="wp-block-button about1-button"><a class="wp-block-button__link wp-element-button" href="#">' . esc_html__('Contact Joseph', 'glaciers') . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons --></div></div>
					<!-- /wp:media-text --></div>
					<!-- /wp:group -->',
			)
		);


		// Glaciers About v2.
		register_block_pattern(
			'glaciers/glaciers-about2',
			array(
				'title'         => esc_html__('Glaciers About 2', 'glaciers'),
				'categories'    => array('glaciers'),
				'viewportWidth' => 1170,
				'description'   => esc_html_x('An about layout with the author image on the and the author title and intro below the image. This includes social buttons.', 'Block pattern description', 'glaciers'),
				'content'       => '<!-- wp:group {"className":"glaciers-about2","layout":{"type":"constrained"}} -->
					<div class="wp-block-group glaciers-about2"><!-- wp:image {"id":540,"sizeSlug":"full","linkDestination":"none","className":"glaciers-about2-image"} -->
					<figure class="wp-block-image size-full glaciers-about2-image"><img src="' . esc_url(get_template_directory_uri()) . '/assets/images/glaciers-about2-portrait.jpg" alt="' . esc_attr__('Glaciers About2 Portrait image', 'glaciers') . '" class="wp-image-540"/></figure>
					<!-- /wp:image -->

					<!-- wp:heading {"textAlign":"center","className":"glaciers-about2-title"} -->
					<h2 class="wp-block-heading has-text-align-center glaciers-about2-title">' . esc_html__('Joseph Lorem is a Dedicated Foodie Creator', 'glaciers') . '</h2>
					<!-- /wp:heading -->

					<!-- wp:paragraph {"align":"center","className":"glaciers-about2-intro"} -->
					<p class="has-text-align-center glaciers-about2-intro">' . wp_kses_post(__('Dolor morbi non arcu risus quis. Fringilla urna porttitor rhoncus dolor purus non enim praesent elementum. Enim diam vulputate ut pharetra. Integer feugiat scelerisque varius morbi enim nunc faucibus.', 'glaciers')) . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:social-links {"iconColor":"white","iconColorValue":"#fff","iconBackgroundColor":"primary","iconBackgroundColorValue":"#35a0a7","align":"center","className":"glaciers-about2-social"} -->
					<ul class="wp-block-social-links aligncenter has-icon-color has-icon-background-color glaciers-about2-social"><!-- wp:social-link {"url":"#","service":"twitter"} /-->

					<!-- wp:social-link {"url":"#","service":"instagram"} /-->

					<!-- wp:social-link {"url":"#","service":"pinterest"} /-->

					<!-- wp:social-link {"url":"#","service":"youtube"} /--></ul>
					<!-- /wp:social-links -->

					<!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center"}} -->
					<div class="wp-block-buttons"><!-- wp:button {"textAlign":"center","className":"glaciers-about2-button"} -->
					<div class="wp-block-button glaciers-about2-button"><a class="wp-block-button__link has-text-align-center wp-element-button" href="#">' . esc_html__('Contact Joseph', 'glaciers') . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons --></div>
					<!-- /wp:group -->',
			)
		);



		// Glaciers CTA v1
		register_block_pattern(
			'glaciers/glaciers-cta1',
			array(
				'title'         => esc_html__('Call to Action v1', 'glaciers'),
				'categories'    => array('glaciers'),
				'viewportWidth' => 1024,
				'description'   => esc_html_x('A simple CTA (Call to action) with a horizontal layout.', 'Block pattern description', 'glaciers'),
				'content'       => '<!-- wp:group {"className":"glaciers-cta1","layout":{"type":"constrained"}} -->
					<div class="wp-block-group glaciers-cta1"><!-- wp:columns {"verticalAlignment":null,"className":"glaciers-cta-columns"} -->
					<div class="wp-block-columns glaciers-cta-columns"><!-- wp:column {"verticalAlignment":"center","width":"66.66%"} -->
					<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:66.66%"><!-- wp:heading {"className":"glaciers-cta1-title"} -->
					<h2 class="wp-block-heading glaciers-cta1-title">' . esc_html__('Call to Action Version 1', 'glaciers') . '</h2>
					<!-- /wp:heading -->

					<!-- wp:paragraph {"className":"glaciers-cta1-intro"} -->
					<p class="glaciers-cta1-intro">' . esc_html__('Risus nec feugiat in fermentum posuere urna. Eget aliquet nibh praesent tristique magna sit amet purus gravida. Consectetur adipiscing elit pellentesque habitant serbium.', 'glaciers') . '</p>
					<!-- /wp:paragraph --></div>
					<!-- /wp:column -->

					<!-- wp:column {"verticalAlignment":"center","width":"33.33%"} -->
					<div class="wp-block-column is-vertically-aligned-center" style="flex-basis:33.33%"><!-- wp:buttons {"layout":{"type":"flex","justifyContent":"right"}} -->
					<div class="wp-block-buttons"><!-- wp:button {"className":"glaciers-cta1-button"} -->
					<div class="wp-block-button glaciers-cta1-button"><a class="wp-block-button__link wp-element-button" href="#">' . esc_html__('Take Action Here', 'glaciers') . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons --></div>
					<!-- /wp:column --></div>
					<!-- /wp:columns --></div>
					<!-- /wp:group -->',
			)
		);


		// Glaciers CTA v2
		register_block_pattern(
			'glaciers/glaciers-cta2',
			array(
				'title'         => esc_html__('Call to Action v2', 'glaciers'),
				'categories'    => array('glaciers'),
				'viewportWidth' => 1024,
				'description'   => esc_html_x('A simple CTA (Call to action) with a vertical layout.', 'Block pattern description', 'glaciers'),
				'content'       => '<!-- wp:group {"className":"glaciers-cta2","layout":{"type":"constrained"}} -->
					<div class="wp-block-group glaciers-cta2"><!-- wp:heading {"textAlign":"center","className":"glaciers-cta2-title"} -->
					<h2 class="wp-block-heading has-text-align-center glaciers-cta2-title">' . esc_html__('Call to Action Version 2', 'glaciers') . '</h2>
					<!-- /wp:heading -->

					<!-- wp:paragraph {"align":"center","className":"glaciers-cta2-intro"} -->
					<p class="has-text-align-center glaciers-cta2-intro">' . esc_html__('Risus nec feugiat in fermentum posuere urna. Eget aliquet nibh praesent tristique magna sit amet purus gravida. Consectetur adipiscing elit pellentesque habitant serbium.', 'glaciers') . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center"}} -->
					<div class="wp-block-buttons"><!-- wp:button {"className":"glaciers-cta2-button"} -->
					<div class="wp-block-button glaciers-cta2-button"><a class="wp-block-button__link wp-element-button" href="#">' . esc_html__('Take Action Here', 'glaciers') . '</a></div>
					<!-- /wp:button --></div>
					<!-- /wp:buttons --></div>
					<!-- /wp:group -->',
			)
		);

		// Glaciers contact version 1
		register_block_pattern(
			'glaciers/glaciers-contact1',
			array(
				'title'         => esc_html__('Contact v2', 'glaciers'),
				'categories'    => array('glaciers'),
				'viewportWidth' => 1024,
				'description'   => esc_html_x('A simple contact layout with a blank shortcode block to enter your plugin shortcode.', 'Block pattern description', 'glaciers'),
				'content'       => '<!-- wp:group {"className":"glaciers-contact-v1","layout":{"type":"constrained"}} -->
					<div class="wp-block-group glaciers-contact-v1"><!-- wp:heading {"textAlign":"center","className":"glaciers-contact1-heading"} -->
					<h2 class="wp-block-heading has-text-align-center glaciers-contact1-heading">' . esc_html__('Contact Me', 'glaciers') . '</h2>
					<!-- /wp:heading -->

					<!-- wp:paragraph {"align":"center","className":"glaciers-contact1-intro lead"} -->
					<p class="has-text-align-center glaciers-contact1-intro lead">' . esc_html__('Enim nulla aliquet porttitor lacus luctus accumsan tortor posuere ac. Non quam lacus suspendisse faucibus interdum posuere lorem ipsum.', 'glaciers') . '</p>
					<!-- /wp:paragraph -->

					<!-- wp:spacer {"height":"32px"} -->
					<div style="height:32px" aria-hidden="true" class="wp-block-spacer"></div>
					<!-- /wp:spacer -->

					<!-- wp:shortcode /--></div>
					<!-- /wp:group -->',
			)
		);
	}
	add_action('init', 'glaciers_register_block_pattern');
}
