-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(static recipe section): featured recipes
* feat(lazy loading): added a lazy loading snippet using a supported library * feat(hero static): added lazyload support and static hero section * fix(name change): got rid of name change used for testing * fix(text orientation): had the text orientation backwards * fix(orientation default): changed orientation default * refactor(unused setting): got rid of unused setting * fix(added character): got rid of added character that shouldn't be there * feat(image text section): static image text section (#186) * feat(added image text section): added the image text section * feat(background image): added background image to image text section * feat(recipe cards): added the recipe cards section * feat(more settings): added more settings to the recipe cards
- Loading branch information
Showing
5 changed files
with
135 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
.recipe-cards { | ||
margin: 50px 0px; | ||
.grid { | ||
max-width:1200px; | ||
margin:auto; | ||
padding-right:30px; | ||
} | ||
.btn { | ||
width: 100% !important; | ||
font-size: 1.2em; | ||
font-family: 'CooperHewitt-Medium'; | ||
} | ||
.section-title { | ||
font-size: 2em; | ||
font-family: 'CooperHewitt-Bold'; | ||
} | ||
} | ||
|
||
.recipe-card { | ||
margin: 50px 0px; | ||
height: 500px; | ||
position:relative; | ||
width:100%; | ||
background-size:cover; | ||
background-repeat:no-repeat; | ||
background-position:center; | ||
.btn { | ||
position:absolute; | ||
bottom: 0px; | ||
} | ||
.card-title { | ||
color: white; | ||
font-size: 2em; | ||
padding: 20px; | ||
font-family: 'CooperHewitt-Medium'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
|
||
<div class="recipe-cards"> | ||
<div class="grid"> | ||
<div class="grid__item large--two-thirds medium--two-thirds section-title">{{section.settings.section_title}}</div> | ||
<div class="grid__item large--one-third medium--one-third"> | ||
{% assign text = section.settings.more_recipes %} | ||
{% assign url = section.settings.recipes_link %} | ||
{% include 'cta-button' %} | ||
</div> | ||
</div> | ||
<div class="grid"> | ||
{% assign viewRecipes = section.settings.view_recipe %} | ||
<div class="grid__item large--one-third medium--one-third"> | ||
{% assign art = articles[section.settings.featured_article] %} | ||
{% assign cardClass = 'recipe-card-1' %} | ||
{% include 'recipe-card' %} | ||
</div> | ||
<div class="grid__item large--one-third medium--one-third"> | ||
{% assign art = articles[section.settings.featured_article_2] %} | ||
{% assign cardClass = 'recipe-card-2' %} | ||
{% include 'recipe-card' %} | ||
</div> | ||
<div class="grid__item large--one-third medium--one-third"> | ||
{% assign art = articles[section.settings.featured_article_3] %} | ||
{% assign cardClass = 'recipe-card-3' %} | ||
{% include 'recipe-card' %} | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
{% schema %} | ||
{ | ||
"name": "Recipe Cards", | ||
"class": "recipe-cards-wrapper", | ||
"settings": [ | ||
{ | ||
"type": "article", | ||
"id": "featured_article", | ||
"label": "Choose a recipe you want to display." | ||
}, | ||
{ | ||
"type": "article", | ||
"id": "featured_article_2", | ||
"label": "Choose a recipe you want to display." | ||
}, | ||
{ | ||
"type": "article", | ||
"id": "featured_article_3", | ||
"label": "Choose a recipe you want to display." | ||
}, | ||
{ | ||
"type":"text", | ||
"id":"more_recipes", | ||
"label":"Top Button", | ||
"default":"View More Recipes" | ||
}, | ||
{ | ||
"type":"text", | ||
"id":"view_recipe", | ||
"label":"View Recipe Button", | ||
"default":"View Recipe" | ||
}, | ||
{ | ||
"type": "url", | ||
"id": "recipes_link", | ||
"label": "More Recipes Link" | ||
}, | ||
{ | ||
"type":"text", | ||
"id":"section_title", | ||
"label":"Section title", | ||
"default":"RECIPES" | ||
} | ||
], | ||
"presets": [{ | ||
"name": "Recipe Cards", | ||
"category": "Text" | ||
}] | ||
} | ||
{% endschema %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div class="recipe-card {{ cardClass }}"> | ||
<div class="card-title"> | ||
{{art.title}} | ||
</div> | ||
{% assign text = viewRecipes %} | ||
{% assign url = art.url %} | ||
{% include 'cta-button' %} | ||
</div> | ||
{% if art.image %} | ||
{% assign backgroundImageWidths = "1100 1300 1500" %} | ||
{% assign backgroundClass = "." | append: cardClass %} | ||
{% assign imageObject = art.image %} | ||
{% include 'lazy-load-background' %} | ||
{% endif %} |