Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Add About me patterns #110

Merged
merged 23 commits into from
Oct 14, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/img/patterns/hummingbird-black.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/patterns/hummingbird-flying.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/patterns/hummingbird.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/patterns/swallow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions inc/block-patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,19 @@ function twentytwentytwo_register_block_patterns() {
'twentytwentytwo-query',
array( 'label' => __( 'Twenty Twenty-Two Posts', 'twentytwentytwo' ) )
);
register_block_pattern_category(
'twentytwentytwo-about-me',
array( 'label' => __( 'Twenty Twenty-Two: About me', 'twentytwentytwo' ) )
);
}
if ( function_exists( 'register_block_pattern' ) ) {
$block_patterns = array(
'about-me-big-image-and-buttons',
'about-me-left-media-and-text-with-logo-header-paragraph-and-social',
'about-me-logo-header-description-and-social-on-left-menu-and-separator-on-right',
'about-me-right-media-and-text-with-logo-header-paragraph-and-social',
'about-me-link-in-bio',
'about-me-link-in-bio-dark',
'footer-default',
'footer-dark',
'footer-logo',
Expand Down
58 changes: 58 additions & 0 deletions inc/patterns/about-me-big-image-and-buttons.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php
/**
* About Me - Big Image and Buttons
*/
return array(
'title' => __( 'About Me - Big Image and Buttons', 'twentytwentytwo' ),
'categories' => array( 'twentytwentytwo-about-me' ),
'content' => '<!-- wp:group {"align":"full"} -->
<div class="wp-block-group alignfull">
<!-- wp:image {"align":"full","sizeSlug":"full","linkDestination":"none"} -->
<figure class="wp-block-image alignfull size-full"><img src="' . esc_url( get_stylesheet_directory_uri() ) . '/assets/img/patterns/hummingbird-flying.jpg" alt="" /></figure>
<!-- /wp:image -->

<!-- wp:group {"style":{"spacing":{"padding":{"top":"4rem","bottom":"4rem"}}},"layout":{"wideSize":"1000px"}} -->
<div class="wp-block-group" style="padding-top:4rem;padding-bottom:4rem"><!-- wp:buttons {"contentJustification":"space-between"} -->
<div class="wp-block-buttons is-content-justification-space-between"><!-- wp:button {"width":25} -->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you set a width on a button, they don't wrap nicely on smaller screens:

Screen Shot 2021-10-14 at 10 13 58 AM

It's because of this line:

Screen Shot 2021-10-14 at 10 15 20 AM

It seems like this needs better defaults in Gutenberg, whether that's through flex-basis, min-width or otherwise.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recreated this one using columns, and it works much better.... except at middle breakpoints. I'm not sure what else to try. 😕 Might end up needing to revise this design.
buttons

<div class="wp-block-button has-custom-width wp-block-button__width-25"><a class="wp-block-button__link">' . esc_html__( 'Purchase my work', 'twentytwentytwo' ) . '</a></div>
<!-- /wp:button -->

<!-- wp:button {"width":25} -->
<div class="wp-block-button has-custom-width wp-block-button__width-25"><a class="wp-block-button__link">' . esc_html__( 'Support my studio', 'twentytwentytwo' ) . '</a></div>
<!-- /wp:button -->

<!-- wp:button {"width":25} -->
<div class="wp-block-button has-custom-width wp-block-button__width-25"><a class="wp-block-button__link">' . esc_html__( 'Take a class', 'twentytwentytwo' ) . '</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->

<!-- wp:buttons {"contentJustification":"space-between"} -->
<div class="wp-block-buttons is-content-justification-space-between"><!-- wp:button {"width":25} -->
<div class="wp-block-button has-custom-width wp-block-button__width-25"><a class="wp-block-button__link">' . esc_html__( 'Read about me', 'twentytwentytwo' ) . '</a></div>
<!-- /wp:button -->

<!-- wp:button {"width":25} -->
<div class="wp-block-button has-custom-width wp-block-button__width-25"><a class="wp-block-button__link">' . esc_html__( 'See my process', 'twentytwentytwo' ) . '</a></div>
<!-- /wp:button -->

<!-- wp:button {"width":25} -->
<div class="wp-block-button has-custom-width wp-block-button__width-25"><a class="wp-block-button__link">' . esc_html__( 'Join my mailing list', 'twentytwentytwo' ) . '</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->

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

<!-- wp:social-links {"iconColor":"primary","iconColorValue":"#1a4548","className":"is-style-logos-only","layout":{"type":"flex","justifyContent":"center"}} -->
<ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"https://wordpress.org/","service":"wordpress"} /-->

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

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

<!-- wp:social-link {"url":"https://www.instagram.com/","service":"instagram"} /--></ul>
<!-- /wp:social-links --></div>
<!-- /wp:group --></div>
<!-- /wp:group -->',
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/**
* About Me - Left Media & Text with Logo, Header, Paragraph, and Social
*/
return array(
'title' => __( 'About Me - Left Media & Text with Logo, Header, Paragraph, and Social', 'twentytwentytwo' ),
'categories' => array( 'twentytwentytwo-about-me' ),
'content' => '<!-- wp:media-text {"align":"full","mediaLink":"' . esc_url( get_stylesheet_directory_uri() ) . '/assets/img/patterns/hummingbird.jpg","mediaType":"image","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}}},"backgroundColor":"foreground","textColor":"background"} -->
<div class="wp-block-media-text alignfull is-stacked-on-mobile has-background-color has-foreground-background-color has-text-color has-background has-link-color"><figure class="wp-block-media-text__media"><img src="' . esc_url( get_stylesheet_directory_uri() ) . '/assets/img/patterns/hummingbird.jpg" alt=""/></figure><div class="wp-block-media-text__content"><!-- wp:site-logo {"width":60} /-->

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

<!-- wp:group {"style":{"spacing":{"padding":{"right":"8rem"}}}} -->
<div class="wp-block-group" style="padding-right:8rem"><!-- wp:heading {"style":{"typography":{"fontWeight":"300","lineHeight":"1.115","fontSize":"72px"}}} -->
<h2 style="font-size:72px;font-weight:300;line-height:1.115"><em>' . __( 'Doug<br>Stilton', 'twentytwentytwo' ) . '</em></h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.6"}}} -->
<p style="line-height:1.6">' . esc_html__( "Oh hello. My name’s Doug, and you’ve found your way to my website. I’m an avid bird watcher, and I also broadcast my own radio show on Tuesday evenings at 11PM EDT." ) . '</p>
<!-- /wp:paragraph -->

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

<!-- wp:social-links {"iconColor":"background","iconColorValue":"#ffffff","iconBackgroundColor":"foreground","iconBackgroundColorValue":"#000000"} -->
<ul class="wp-block-social-links has-icon-color has-icon-background-color"><!-- wp:social-link {"url":"https://wordpress.org/","service":"wordpress"} /-->

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

<!-- wp:social-link {"url":"https://www.instagram.com/","service":"instagram"} /--></ul>
<!-- /wp:social-links --></div>
<!-- /wp:group --></div></div>
<!-- /wp:media-text -->',
);
47 changes: 47 additions & 0 deletions inc/patterns/about-me-link-in-bio-dark.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php
/**
* About Me - Link in Bio - Dark
*/
return array(
'title' => __( 'About Me - Link in Bio - Dark', 'twentytwentytwo' ),
'categories' => array( 'twentytwentytwo-about-me' ),
'content' => '<!-- wp:group {"align":"full","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}},"spacing":{"padding":{"top":"10rem","right":"0rem","bottom":"10rem","left":"0rem"}}},"backgroundColor":"primary","textColor":"background","layout":{"wideSize":"1000px","contentSize":"480px"}} -->
<div class="wp-block-group alignfull has-background-color has-primary-background-color has-text-color has-background has-link-color" style="padding-top:10rem;padding-right:0rem;padding-bottom:10rem;padding-left:0rem"><!-- wp:group -->
<div class="wp-block-group">

<!-- wp:image {"width":100,"height":100,"sizeSlug":"full","linkDestination":"none","className":"is-style-rounded"} -->
<figure class="wp-block-image size-full is-resized is-style-rounded"><img src="' . esc_url( get_stylesheet_directory_uri() ) . '/assets/img/patterns/swallow.png" alt="" width="100" height="100"/></figure>
<!-- /wp:image -->

<!-- wp:heading {"textAlign":"left","style":{"typography":{"fontSize":"48px"}}} -->
<h2 class="has-text-align-left" style="font-size:48px">' . esc_html__( 'A trouble of hummingbirds', 'twentytwentytwo' ) . '</h2>
<!-- /wp:heading -->

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

<!-- wp:buttons {"contentJustification":"left"} -->
<div class="wp-block-buttons is-content-justification-left"><!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-outline"} -->
<div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-outline"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Watch our videos', 'twentytwentytwo' ) . '</a></div>
<!-- /wp:button -->

<!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-outline"} -->
<div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-outline"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Listen on iTunes Podcasts', 'twentytwentytwo' ) . '</a></div>
<!-- /wp:button -->

<!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-outline"} -->
<div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-outline"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Listen on Spotify', 'twentytwentytwo' ) . '</a></div>
<!-- /wp:button -->

<!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-outline"} -->
<div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-outline"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Support the show', 'twentytwentytwo' ) . '</a></div>
<!-- /wp:button -->

<!-- wp:button {"width":100,"style":{"border":{"radius":"6px"}},"className":"is-style-outline"} -->
<div class="wp-block-button has-custom-width wp-block-button__width-100 is-style-outline"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'About the hosts', 'twentytwentytwo' ) . '</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons --></div>
<!-- /wp:group --></div>
<!-- /wp:group -->',
);
61 changes: 61 additions & 0 deletions inc/patterns/about-me-link-in-bio.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?php
/**
* About Me - Link in Bio
*/
return array(
'title' => __( 'About Me - Link in Bio', 'twentytwentytwo' ),
'categories' => array( 'twentytwentytwo-about-me' ),
'content' => '<!-- wp:group -->
<div class="wp-block-group"><!-- wp:image {"align":"center","width":100,"height":100,"sizeSlug":"full","linkDestination":"none","className":"is-style-rounded"} -->
<div class="wp-block-image is-style-rounded"><figure class="aligncenter size-full is-resized"><img src="' . esc_url( get_stylesheet_directory_uri() ) . '/assets/img/patterns/swallow.png" alt="" width="100" height="100"/></figure></div>
<!-- /wp:image -->

<!-- wp:heading {"textAlign":"center","style":{"typography":{"fontSize":"48px"}}} -->
<h2 class="has-text-align-center" style="font-size:48px">' . esc_html__( 'Swoop', 'twentytwentytwo' ) . '</h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"align":"center"} -->
<p class="has-text-align-center">' . esc_html__( 'A podcast about birds', 'twentytwentytwo' ) . '</p>
<!-- /wp:paragraph -->

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

<!-- wp:buttons {"contentJustification":"center"} -->
<div class="wp-block-buttons is-content-justification-center"><!-- wp:button {"width":75,"style":{"border":{"radius":"6px"}}} -->
<div class="wp-block-button has-custom-width wp-block-button__width-75"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Watch our videos', 'twentytwentytwo' ) . '</a></div>
<!-- /wp:button -->

<!-- wp:button {"width":75,"style":{"border":{"radius":"6px"}}} -->
<div class="wp-block-button has-custom-width wp-block-button__width-75"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Listen on iTunes Podcasts', 'twentytwentytwo' ) . '</a></div>
<!-- /wp:button -->

<!-- wp:button {"width":75,"style":{"border":{"radius":"6px"}}} -->
<div class="wp-block-button has-custom-width wp-block-button__width-75"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Listen on Spotify', 'twentytwentytwo' ) . '</a></div>
<!-- /wp:button -->

<!-- wp:button {"width":75,"style":{"border":{"radius":"6px"}}} -->
<div class="wp-block-button has-custom-width wp-block-button__width-75"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'Support the show', 'twentytwentytwo' ) . '</a></div>
<!-- /wp:button -->

<!-- wp:button {"width":75,"style":{"border":{"radius":"6px"}}} -->
<div class="wp-block-button has-custom-width wp-block-button__width-75"><a class="wp-block-button__link" style="border-radius:6px">' . esc_html__( 'About the hosts', 'twentytwentytwo' ) . '</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons -->

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

<!-- wp:social-links {"iconColor":"primary","iconColorValue":"#1a4548","className":"is-style-logos-only","layout":{"type":"flex","justifyContent":"center"}} -->
<ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"https://wordpress.org/","service":"wordpress"} /-->

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

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

<!-- wp:social-link {"url":"https://www.instagram.com/","service":"instagram"} /--></ul>
<!-- /wp:social-links --></div>
<!-- /wp:group -->',
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php
/**
* About Me - Logo, header, description, and social on left, menu and separator on right
*/
return array(
'title' => __( 'About Me - Logo, header, description, and social on left, menu and separator on right', 'twentytwentytwo' ),
'categories' => array( 'twentytwentytwo-about-me' ),
'content' => '<!-- wp:cover {"overlayColor":"foreground","minHeight":100,"minHeightUnit":"vh","contentPosition":"center center","align":"full","style":{"spacing":{"padding":{"top":"4rem","right":"4rem","bottom":"4rem","left":"4rem"}}}} -->
<div class="wp-block-cover alignfull has-foreground-background-color has-background-dim" style="padding-top:4rem;padding-right:4rem;padding-bottom:4rem;padding-left:4rem;min-height:100vh"><div class="wp-block-cover__inner-container"><!-- wp:navigation {"itemsJustification":"right"} -->
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
<!-- /wp:navigation -->

<!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column {"verticalAlignment":"bottom","width":"45%","style":{"spacing":{"padding":{"top":"12rem","right":"2rem","bottom":"2rem","left":"2rem"}}}} -->
<div class="wp-block-column is-vertically-aligned-bottom" style="padding-top:12rem;padding-right:2rem;padding-bottom:2rem;padding-left:2rem;flex-basis:45%"><!-- wp:site-logo {"width":60} /-->

<!-- wp:heading {"style":{"typography":{"fontWeight":"300","lineHeight":"1.115","fontSize":"72px"}}} -->
<h2 style="font-size:72px;font-weight:300;line-height:1.115"><em>' . __( 'Jesús<br>Rodriguez', 'twentytwentytwo' ) . '</em></h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.6"}}} -->
<p style="line-height:1.6">' . esc_html__( 'Oh hello. My name’s Jesús, and you’ve found your way to my website. I’m an avid bird watcher, and I also broadcast my own radio show on Tuesday evenings at 11PM EDT.', 'twentytwentytwo' ) . '</p>
<!-- /wp:paragraph -->

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

<!-- wp:social-links {"iconColor":"background","iconColorValue":"#ffffff","iconBackgroundColor":"foreground","iconBackgroundColorValue":"#000000"} -->
<ul class="wp-block-social-links has-icon-color has-icon-background-color"><!-- wp:social-link {"url":"https://wordpress.org/","service":"wordpress"} /-->

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

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

<!-- wp:column {"verticalAlignment":"center","style":{"spacing":{"padding":{"top":"0rem","right":"0rem","bottom":"4rem","left":"4rem"}}}} -->
<div class="wp-block-column is-vertically-aligned-center" style="padding-top:0rem;padding-right:0rem;padding-bottom:4rem;padding-left:4rem"><!-- wp:separator {"color":"background","className":"is-style-wide"} -->
<hr class="wp-block-separator has-text-color has-background has-background-background-color has-background-color is-style-wide"/>
<!-- /wp:separator --></div>
<!-- /wp:column --></div>
<!-- /wp:columns --></div></div>
<!-- /wp:cover -->',
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/**
* About Me - Right Media & Text with Logo, Header, Paragraph, and Social
*/
return array(
'title' => __( 'About Me - Right Media & Text with Logo, Header, Paragraph, and Social', 'twentytwentytwo' ),
'categories' => array( 'twentytwentytwo-about-me' ),
'content' => '<!-- wp:media-text {"align":"full","mediaLink":"' . esc_url( get_stylesheet_directory_uri() ) . '/assets/img/patterns/hummingbird-black.jpg","mediaType":"image","style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}}},"backgroundColor":"foreground","textColor":"background"} -->
<div class="wp-block-media-text alignfull is-stacked-on-mobile has-background-color has-foreground-background-color has-text-color has-background has-link-color"><figure class="wp-block-media-text__media"><img src="' . esc_url( get_stylesheet_directory_uri() ) . '/assets/img/patterns/hummingbird-black.jpg" alt=""/></figure><div class="wp-block-media-text__content"><!-- wp:site-logo {"width":60} /-->

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

<!-- wp:group {"style":{"spacing":{"padding":{"right":"8rem"}}}} -->
<div class="wp-block-group" style="padding-right:8rem"><!-- wp:heading {"style":{"typography":{"fontWeight":"300","lineHeight":"1.115","fontSize":"72px"}}} -->
<h2 style="font-size:72px;font-weight:300;line-height:1.115"><em>Emery<br>Driscoll</em></h2>
<!-- /wp:heading -->

<!-- wp:paragraph {"style":{"typography":{"lineHeight":"1.6"}}} -->
<p style="line-height:1.6">' . esc_html__( 'Oh hello. My name’s Emery, and you’ve found your way to my website. I’m an avid bird watcher, and I also broadcast my own radio show on Tuesday evenings at 11PM EDT.', 'twentytwentytwo' ) . '</p>
<!-- /wp:paragraph -->

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

<!-- wp:social-links {"iconColor":"background","iconColorValue":"#ffffff","iconBackgroundColor":"foreground","iconBackgroundColorValue":"#000000"} -->
<ul class="wp-block-social-links has-icon-color has-icon-background-color"><!-- wp:social-link {"url":"https://wordpress.org/","service":"wordpress"} /-->

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

<!-- wp:social-link {"url":"https://www.instagram.com/","service":"instagram"} /--></ul>
<!-- /wp:social-links --></div>
<!-- /wp:group --></div></div>
<!-- /wp:media-text -->',
);