diff --git a/src/components/common/Layout.js b/src/components/common/Layout.js index 01d08c7..464ab82 100644 --- a/src/components/common/Layout.js +++ b/src/components/common/Layout.js @@ -71,6 +71,7 @@ const DefaultLayout = ({ data, children, bodyClass, isHome, hasFeatureImage }) =
{/* All the main content gets inserted here, index.js, post.js */} diff --git a/src/components/common/PostCard.js b/src/components/common/PostCard.js index 476ebf6..4cb9c61 100644 --- a/src/components/common/PostCard.js +++ b/src/components/common/PostCard.js @@ -4,36 +4,39 @@ import { Link } from 'gatsby' import { Tags } from '@tryghost/helpers-gatsby' import { readingTime as readingTimeHelper } from '@tryghost/helpers' -const PostCard = ({ post }) => { +const PostCard = ({ post, isLarge }) => { const url = `/${post.slug}/` const readingTime = readingTimeHelper(post) return ( - +
{post.feature_image &&
} - {post.tags &&
} +
+
+ {/*post.tags &&
*/} + {post.tags &&
{post.tags[0].name}
} {post.featured && Featured}

{post.title}

- -
{post.excerpt}
-
-
-
- {post.primary_author.profile_image ? - {post.primary_author.name}/ : - {post.primary_author.name}/ - } +
{post.subtitle}
+
+
+
+ {post.primary_author.profile_image ? + {post.primary_author.name}/ : + {post.primary_author.name}/ + } +
+ { post.primary_author.name }
- { post.primary_author.name } -
-
-
{readingTime}
-
-
+
+
{readingTime}
+
+ +
) } @@ -55,6 +58,7 @@ PostCard.propTypes = { profile_image: PropTypes.string, }).isRequired, }).isRequired, + isLarge: PropTypes.bool, } export default PostCard diff --git a/src/styles/app.css b/src/styles/app.css index 84bc47c..27eae5c 100644 --- a/src/styles/app.css +++ b/src/styles/app.css @@ -769,6 +769,10 @@ h6 { padding: 4vw 0; } +.site-main.grey-background { + background: #f4f8fb; +} + .site-main.has-feature-image { padding: 0 0 4vw 0; /* Leave space for pic */ } @@ -777,10 +781,8 @@ h6 { /* ---------------------------------------------------------- */ .post-feed { - display: grid; - justify-content: space-between; - grid-gap: 30px; - grid-template-columns: 1fr 1fr 1fr; + display:flex; + flex-wrap: wrap; } @media (max-width: 980px) { @@ -797,17 +799,28 @@ h6 { .post-card { color: inherit; text-decoration: none; + flex: 1 1 300px; + margin: 1rem; + background: #fff; + border-radius: 5px; + box-shadow: 8px 14px 38px rgba(39,44,49,.06),1px 3px 8px rgba(39,44,49,.03); + display: flex; + flex-direction: column; } .post-card:hover { text-decoration: none; + box-shadow: rgba(39,44,49,0.07) 8px 28px 50px, rgba(39, 44, 49, 0.04) 1px 6px 12px; + transition: all 0.4s ease; + transform: translate3D(0, -1px, 0) scale(1.02); } .post-card-tags { margin: 0 0 5px 0; - font-size: 1.4rem; + font-size: 1.2rem; line-height: 1.15em; color: var(--color-secondary); + text-transform: uppercase; } @@ -816,6 +829,18 @@ h6 { padding: 0; } +.post-card-content { + padding: 1rem; + display: flex; + flex-direction: column; + height: 100%; +} + +.post-card-content::before { + margin-top: auto; + content: ""; +} + .post-card-excerpt { font-size: 1.6rem; line-height: 1.55em; @@ -827,13 +852,14 @@ h6 { height: 200px; background: var(--color-secondary) no-repeat center center; background-size: cover; + border-radius: 5px 5px 0 0; } .post-card-footer { display: flex; align-items: center; justify-content: space-between; - margin: 10px 0 0 0; + margin: auto 0 0 0; color: var(--color-secondary); } @@ -869,6 +895,31 @@ h6 { width: 26px; } +@media (min-width: 980px) { + .post-card-large { + flex: 1 1 100%; + flex-direction: row; + border-radius: 1rem; + } + + .post-card-large h2 { + font-size: 2.6rem; + } + + .post-card-large .post-card-header { + flex: 1 1 auto; + } + .post-card-large .post-card-image { + height: 400px; + margin-bottom: 0; + border-radius: 1rem 0 0 1rem; + } + .post-card-large .post-card-content { + flex: 0 1 357px; + padding: 3rem; + } +} + /* Tag Archives /* ---------------------------------------------------------- */ diff --git a/src/templates/index.js b/src/templates/index.js index af6b09c..25885ba 100755 --- a/src/templates/index.js +++ b/src/templates/index.js @@ -22,9 +22,9 @@ const Index = ({ data, location, pageContext }) => {
- {posts.map(({ node }) => ( + {posts.map(( {node}, count ) => ( // The tag below includes the markup for each post - components/common/PostCard.js - + ))}