Skip to content

Commit

Permalink
feat(static recipe section): featured recipes
Browse files Browse the repository at this point in the history
* 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
reiddk authored and Stone Lasley committed Sep 20, 2018
1 parent c2a390a commit f64f972
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ after_success:
deploy:
- provider: script
skip_cleanup: true
script: npm run release && theme upload -d dist -p $PROD_PASSWORD -s $PROD_SHOP -t $PROD_THEME_ID --force --no-update-notifier --ignores './themekit_ignores'
script: npm run release && theme upload -d dist -p $PROD_PASSWORD -s $PROD_SHOP -t $PROD_THEME_ID --no-update-notifier --ignores './themekit_ignores'
on:
branch: master

- provider: script
skip_cleanup: true
script: theme upload -d dist -p $STAGE_PASSWORD -s $STAGE_SHOP -t $STAGE_THEME_ID --force --no-update-notifier --ignores './themekit_ignores'
script: theme upload -d dist -p $STAGE_PASSWORD -s $STAGE_SHOP -t $STAGE_THEME_ID --no-update-notifier --ignores './themekit_ignores'
on:
branch: develop
1 change: 1 addition & 0 deletions src/assets/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
@import './sections/cookie-notification';
@import './sections/static-hero';
@import './sections/image-text';
@import './sections/recipe-cards';

// Templates TODO - product entry point
@import './templates/password-page';
Expand Down
37 changes: 37 additions & 0 deletions src/assets/styles/sections/recipe-cards.scss
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';
}
}
81 changes: 81 additions & 0 deletions src/sections/recipe-cards.liquid
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 %}
14 changes: 14 additions & 0 deletions src/snippets/recipe-card.liquid
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 %}

0 comments on commit f64f972

Please sign in to comment.