This repository has been archived by the owner on Oct 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cms): add picture blocks and elements (#573)
- Loading branch information
1 parent
6143f04
commit 9382384
Showing
21 changed files
with
572 additions
and
30 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
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,64 @@ | ||
<template> | ||
<article class="cms-block-center-text"> | ||
<CmsGenericElement :content="getLeftContent" class="cms-block-center-text__image"/> | ||
<CmsGenericElement :content="getCenterContent" class="cms-block-center-text__text"/> | ||
<CmsGenericElement :content="getRightContent" class="cms-block-center-text__image"/> | ||
</article> | ||
</template> | ||
|
||
<script> | ||
import CmsGenericElement from 'sw-cms/CmsGenericElement' | ||
export default { | ||
name: 'CmsBlockCenterText', | ||
components: { | ||
CmsGenericElement | ||
}, | ||
props: { | ||
content: { | ||
type: Object, | ||
default: () => ({}) | ||
} | ||
}, | ||
computed: { | ||
getSlots() { | ||
return this.content.slots || [] | ||
}, | ||
getLeftContent() { | ||
return this.getSlots.find(({slot}) => slot === 'left') | ||
}, | ||
getCenterContent() { | ||
return this.getSlots.find(({slot}) => slot === 'center') | ||
}, | ||
getRightContent() { | ||
return this.getSlots.find(({slot}) => slot === 'right') | ||
}, | ||
} | ||
}; | ||
</script> | ||
|
||
<style lang="scss"> | ||
@import '~@storefront-ui/vue/styles.scss'; | ||
.cms-block-center-text { | ||
display: flex; | ||
flex-direction: column; | ||
&__image, &__text { | ||
margin: var(--spacer-sm); | ||
flex: 1; | ||
& img { | ||
height: 340px; | ||
object-fit: cover; | ||
width: 100%; | ||
} | ||
} | ||
@include for-desktop { | ||
flex-direction: row; | ||
justify-content: space-around; | ||
align-items: center; | ||
} | ||
} | ||
</style> |
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
68 changes: 68 additions & 0 deletions
68
packages/default-theme/cms/blocks/CmsBlockImageFourColumn.vue
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,68 @@ | ||
<template> | ||
<article class="cms-block-image-four-column"> | ||
<CmsGenericElement :content="getLeftContent" class="cms-block-image-four-column__image"/> | ||
<CmsGenericElement :content="getCenterLeftContent" class="cms-block-image-four-column__image"/> | ||
<CmsGenericElement :content="getCenterRightContent" class="cms-block-image-four-column__image"/> | ||
<CmsGenericElement :content="getRightContent" class="cms-block-image-four-column__image"/> | ||
</article> | ||
</template> | ||
|
||
<script> | ||
import CmsGenericElement from 'sw-cms/CmsGenericElement' | ||
export default { | ||
name: 'CmsBlockImageFourColumn', | ||
components: { | ||
CmsGenericElement, | ||
}, | ||
props: { | ||
content: { | ||
type: Object, | ||
default: () => ({}) | ||
} | ||
}, | ||
computed: { | ||
getSlots() { | ||
return this.content.slots || [] | ||
}, | ||
getLeftContent() { | ||
return this.getSlots.find(({slot}) => slot === 'left') | ||
}, | ||
getCenterLeftContent() { | ||
return this.getSlots.find(({slot}) => slot === 'center-left') | ||
}, | ||
getCenterRightContent() { | ||
return this.getSlots.find(({slot}) => slot === 'center-right') | ||
}, | ||
getRightContent() { | ||
return this.getSlots.find(({slot}) => slot === 'right') | ||
}, | ||
} | ||
}; | ||
</script> | ||
|
||
<style lang="scss"> | ||
@import '~@storefront-ui/vue/styles.scss'; | ||
.cms-block-image-four-column { | ||
display: flex; | ||
flex-direction: column; | ||
&__image { | ||
margin: var(--spacer-sm); | ||
flex: 1; | ||
& img { | ||
height: 340px; | ||
object-fit: cover; | ||
width: 100%; | ||
} | ||
} | ||
@include for-desktop { | ||
flex-direction: row; | ||
justify-content: space-around; | ||
align-items: center; | ||
} | ||
} | ||
</style> |
65 changes: 65 additions & 0 deletions
65
packages/default-theme/cms/blocks/CmsBlockImageHighlightRow.vue
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,65 @@ | ||
<template> | ||
<article class="cms-block-image-highlight-row"> | ||
<CmsGenericElement :content="getLeftContent" class="cms-block-image-highlight-row__image"/> | ||
<CmsGenericElement :content="getCenterContent" class="cms-block-image-highlight-row__image"/> | ||
<CmsGenericElement :content="getRightContent" class="cms-block-image-highlight-row__image"/> | ||
</article> | ||
</template> | ||
|
||
<script> | ||
import CmsGenericElement from 'sw-cms/CmsGenericElement' | ||
export default { | ||
name: 'CmsBlockImageHighlightRow', | ||
components: { | ||
CmsGenericElement, | ||
}, | ||
props: { | ||
content: { | ||
type: Object, | ||
default: () => ({}) | ||
} | ||
}, | ||
computed: { | ||
getSlots() { | ||
return this.content.slots || [] | ||
}, | ||
getLeftContent() { | ||
return this.getSlots.find(({slot}) => slot === 'left') | ||
}, | ||
getCenterContent() { | ||
return this.getSlots.find(({slot}) => slot === 'center') | ||
}, | ||
getRightContent() { | ||
return this.getSlots.find(({slot}) => slot === 'right') | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="scss"> | ||
@import '~@storefront-ui/vue/styles.scss'; | ||
.cms-block-image-highlight-row { | ||
display: flex; | ||
flex-direction: column; | ||
&__image { | ||
margin: var(--spacer-sm); | ||
flex: 1; | ||
border: 12px solid #fff; | ||
& img { | ||
height: 340px; | ||
object-fit: cover; | ||
width: 100%; | ||
} | ||
} | ||
@include for-desktop { | ||
flex-direction: row; | ||
justify-content: space-around; | ||
align-items: center; | ||
} | ||
} | ||
</style> |
Oops, something went wrong.
9382384
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to following URLs: