Animations.php
4 months ago
BackButton.php
7 months ago
BlockPatterns.php
4 months ago
Carousel.php
6 months ago
ContainerEdgeAlignment.php
7 months ago
Counter.php
4 months ago
Events.php
6 months ago
FluidTypography.php
4 months ago
Gallery.php
8 months ago
GravityFormsInline.php
7 months ago
Headline.php
4 months ago
InsertPost.php
8 months ago
ProductCategories.php
8 months ago
ReadingProgress.php
7 months ago
ReadingTime.php
8 months ago
ShapeAnimations.php
7 months ago
StackedImages.php
4 months ago
StickyColumn.php
8 months ago
Testimonials.php
8 months ago
BlockPatterns.php
135 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Block Patterns Registration |
| 4 | * |
| 5 | * Registers custom block patterns for FrontBlocks. |
| 6 | * |
| 7 | * @package FrontBlocks |
| 8 | */ |
| 9 | |
| 10 | namespace FrontBlocks\Frontend; |
| 11 | |
| 12 | /** |
| 13 | * Class BlockPatterns |
| 14 | * |
| 15 | * Handles registration of custom block patterns. |
| 16 | */ |
| 17 | class BlockPatterns { |
| 18 | |
| 19 | /** |
| 20 | * Constructor |
| 21 | */ |
| 22 | public function __construct() { |
| 23 | add_action( 'init', array( $this, 'register_pattern_categories' ) ); |
| 24 | add_action( 'init', array( $this, 'register_patterns' ) ); |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * Register custom pattern categories |
| 29 | * |
| 30 | * @return void |
| 31 | */ |
| 32 | public function register_pattern_categories() { |
| 33 | // Register FrontBlocks category. |
| 34 | if ( function_exists( 'register_block_pattern_category' ) ) { |
| 35 | register_block_pattern_category( |
| 36 | 'frontblocks', |
| 37 | array( |
| 38 | 'label' => __( 'FrontBlocks', 'frontblocks' ), |
| 39 | ) |
| 40 | ); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Register block patterns |
| 46 | * |
| 47 | * @return void |
| 48 | */ |
| 49 | public function register_patterns() { |
| 50 | if ( ! function_exists( 'register_block_pattern' ) ) { |
| 51 | return; |
| 52 | } |
| 53 | |
| 54 | // Register Carousel Hero Pattern. |
| 55 | $this->register_carousel_hero_pattern(); |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Register Carousel Hero Pattern |
| 60 | * |
| 61 | * Full-width hero carousel with gradient backgrounds, headings, text and CTA buttons. |
| 62 | * |
| 63 | * @return void |
| 64 | */ |
| 65 | private function register_carousel_hero_pattern() { |
| 66 | $pattern_content = '<!-- wp:group {"layout":{"type":"grid","columnCount":1,"minimumColumnWidth":null},"frblGridOption":"carousel","frblItemsToView":"1","frblLaptopToView":"1","frblTabletToView":"1","frblCarouselButtons":"arrows","frblCarouselButtonsPosition":"side"} --> |
| 67 | <div class="wp-block-group"><!-- wp:cover {"dimRatio":40,"isUserOverlayColor":true,"customGradient":"linear-gradient(135deg,rgb(224,15,15) 0%,rgb(225,15,15) 100%)","isDark":false,"sizeSlug":"large","align":"full","style":{"spacing":{"padding":{"top":"120px","bottom":"120px"}}}} --> |
| 68 | <div class="wp-block-cover alignfull is-light" style="padding-top:120px;padding-bottom:120px"><span aria-hidden="true" class="wp-block-cover__background has-background-dim-40 has-background-dim has-background-gradient" style="background:linear-gradient(135deg,rgb(224,15,15) 0%,rgb(225,15,15) 100%)"></span><div class="wp-block-cover__inner-container"><!-- wp:group {"align":"wide","layout":{"type":"constrained","contentSize":"800px"}} --> |
| 69 | <div class="wp-block-group alignwide"><!-- wp:heading {"textAlign":"left","level":1,"style":{"typography":{"fontSize":"52px","fontWeight":"700","lineHeight":"1.2"}},"textColor":"white"} --> |
| 70 | <h1 class="wp-block-heading has-text-align-left has-white-color has-text-color" style="font-size:52px;font-weight:700;line-height:1.2">Discover Amazing Content</h1> |
| 71 | <!-- /wp:heading --> |
| 72 | |
| 73 | <!-- wp:paragraph {"align":"left","style":{"typography":{"fontSize":"18px"},"spacing":{"margin":{"top":"20px"}}},"textColor":"white"} --> |
| 74 | <p class="has-text-align-left has-white-color has-text-color" style="margin-top:20px;font-size:18px">Experience the best features and benefits we have to offer. Join thousands of satisfied customers today.</p> |
| 75 | <!-- /wp:paragraph --> |
| 76 | |
| 77 | <!-- wp:buttons {"style":{"spacing":{"margin":{"top":"40px"}}}} --> |
| 78 | <div class="wp-block-buttons" style="margin-top:40px"><!-- wp:button {"backgroundColor":"primary","className":"is-style-fill","style":{"border":{"radius":"25px"},"spacing":{"padding":{"left":"35px","right":"35px","top":"15px","bottom":"15px"}}}} --> |
| 79 | <div class="wp-block-button is-style-fill"><a class="wp-block-button__link has-primary-background-color has-background wp-element-button" style="border-radius:25px;padding-top:15px;padding-right:35px;padding-bottom:15px;padding-left:35px">Get Started</a></div> |
| 80 | <!-- /wp:button --></div> |
| 81 | <!-- /wp:buttons --></div> |
| 82 | <!-- /wp:group --></div></div> |
| 83 | <!-- /wp:cover --> |
| 84 | |
| 85 | <!-- wp:cover {"dimRatio":40,"customOverlayColor":"#006f49","isUserOverlayColor":true,"isDark":false,"sizeSlug":"large","align":"full","style":{"spacing":{"padding":{"top":"120px","bottom":"120px"}}}} --> |
| 86 | <div class="wp-block-cover alignfull is-light" style="padding-top:120px;padding-bottom:120px"><span aria-hidden="true" class="wp-block-cover__background has-background-dim-40 has-background-dim" style="background-color:#006f49"></span><div class="wp-block-cover__inner-container"><!-- wp:group {"align":"wide","layout":{"type":"constrained","contentSize":"800px"}} --> |
| 87 | <div class="wp-block-group alignwide"><!-- wp:heading {"textAlign":"left","level":1,"style":{"typography":{"fontSize":"52px","fontWeight":"700","lineHeight":"1.2"}},"textColor":"white"} --> |
| 88 | <h1 class="wp-block-heading has-text-align-left has-white-color has-text-color" style="font-size:52px;font-weight:700;line-height:1.2">Transform Your Business</h1> |
| 89 | <!-- /wp:heading --> |
| 90 | |
| 91 | <!-- wp:paragraph {"align":"left","style":{"typography":{"fontSize":"18px"},"spacing":{"margin":{"top":"20px"}}},"textColor":"white"} --> |
| 92 | <p class="has-text-align-left has-white-color has-text-color" style="margin-top:20px;font-size:18px">Unlock powerful tools and resources designed to help you grow and succeed in your industry.</p> |
| 93 | <!-- /wp:paragraph --> |
| 94 | |
| 95 | <!-- wp:buttons {"style":{"spacing":{"margin":{"top":"40px"}}}} --> |
| 96 | <div class="wp-block-buttons" style="margin-top:40px"><!-- wp:button {"backgroundColor":"primary","className":"is-style-fill","style":{"border":{"radius":"25px"},"spacing":{"padding":{"left":"35px","right":"35px","top":"15px","bottom":"15px"}}}} --> |
| 97 | <div class="wp-block-button is-style-fill"><a class="wp-block-button__link has-primary-background-color has-background wp-element-button" style="border-radius:25px;padding-top:15px;padding-right:35px;padding-bottom:15px;padding-left:35px">Learn More</a></div> |
| 98 | <!-- /wp:button --></div> |
| 99 | <!-- /wp:buttons --></div> |
| 100 | <!-- /wp:group --></div></div> |
| 101 | <!-- /wp:cover --> |
| 102 | |
| 103 | <!-- wp:cover {"dimRatio":40,"customOverlayColor":"#1a237e","isUserOverlayColor":true,"isDark":false,"sizeSlug":"large","align":"full","style":{"spacing":{"padding":{"top":"120px","bottom":"120px"}}}} --> |
| 104 | <div class="wp-block-cover alignfull is-light" style="padding-top:120px;padding-bottom:120px"><span aria-hidden="true" class="wp-block-cover__background has-background-dim-40 has-background-dim" style="background-color:#1a237e"></span><div class="wp-block-cover__inner-container"><!-- wp:group {"align":"wide","layout":{"type":"constrained","contentSize":"800px"}} --> |
| 105 | <div class="wp-block-group alignwide"><!-- wp:heading {"textAlign":"left","level":1,"style":{"typography":{"fontSize":"52px","fontWeight":"700","lineHeight":"1.2"}},"textColor":"white"} --> |
| 106 | <h1 class="wp-block-heading has-text-align-left has-white-color has-text-color" style="font-size:52px;font-weight:700;line-height:1.2">Join Our Community</h1> |
| 107 | <!-- /wp:heading --> |
| 108 | |
| 109 | <!-- wp:paragraph {"align":"left","style":{"typography":{"fontSize":"18px"},"spacing":{"margin":{"top":"20px"}}},"textColor":"white"} --> |
| 110 | <p class="has-text-align-left has-white-color has-text-color" style="margin-top:20px;font-size:18px">Connect with like-minded professionals and access exclusive resources, events, and opportunities.</p> |
| 111 | <!-- /wp:paragraph --> |
| 112 | |
| 113 | <!-- wp:buttons {"style":{"spacing":{"margin":{"top":"40px"}}}} --> |
| 114 | <div class="wp-block-buttons" style="margin-top:40px"><!-- wp:button {"backgroundColor":"primary","className":"is-style-fill","style":{"border":{"radius":"25px"},"spacing":{"padding":{"left":"35px","right":"35px","top":"15px","bottom":"15px"}}}} --> |
| 115 | <div class="wp-block-button is-style-fill"><a class="wp-block-button__link has-primary-background-color has-background wp-element-button" style="border-radius:25px;padding-top:15px;padding-right:35px;padding-bottom:15px;padding-left:35px">Join Now</a></div> |
| 116 | <!-- /wp:button --></div> |
| 117 | <!-- /wp:buttons --></div> |
| 118 | <!-- /wp:group --></div></div> |
| 119 | <!-- /wp:cover --></div> |
| 120 | <!-- /wp:group -->'; |
| 121 | |
| 122 | register_block_pattern( |
| 123 | 'frontblocks/carousel-hero', |
| 124 | array( |
| 125 | 'title' => __( 'Hero Carousel', 'frontblocks' ), |
| 126 | 'description' => __( 'Full-width hero carousel with smooth transitions, featuring gradient backgrounds, headings, and call-to-action buttons. Perfect for landing pages and promotional content.', 'frontblocks' ), |
| 127 | 'content' => $pattern_content, |
| 128 | 'categories' => array( 'frontblocks', 'featured', 'header' ), |
| 129 | 'keywords' => array( 'carousel', 'hero', 'slider', 'cover', 'cta', 'gradient', 'header', 'banner' ), |
| 130 | 'viewportWidth' => 1440, |
| 131 | ) |
| 132 | ); |
| 133 | } |
| 134 | } |
| 135 |