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.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
3 changed files
with
94 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<template> | ||
<article class="cms-block-image-text"> | ||
<CmsGenericElement | ||
:content="getLeftContent" | ||
class="cms-block-image-text__image" | ||
/> | ||
<CmsGenericElement | ||
:content="getRightContent" | ||
class="cms-block-image-text__text" | ||
/> | ||
</article> | ||
</template> | ||
|
||
<script> | ||
import CmsGenericElement from "sw-cms/CmsGenericElement" | ||
export default { | ||
name: "CmsBlockImageText", | ||
components: { | ||
CmsGenericElement, | ||
}, | ||
props: { | ||
content: { | ||
type: Object, | ||
default: () => ({}), | ||
}, | ||
}, | ||
computed: { | ||
getSlots() { | ||
return this.content.slots || [] | ||
}, | ||
getLeftContent() { | ||
return this.getSlots.find(({ slot }) => slot === "left") | ||
}, | ||
getRightContent() { | ||
return this.getSlots.find(({ slot }) => slot === "right") | ||
}, | ||
}, | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
@import "@/assets/scss/variables"; | ||
.cms-block-image-text { | ||
display: flex; | ||
flex-direction: column; | ||
margin-right: 0; | ||
margin-left: 0; | ||
&__image, | ||
&__text { | ||
margin: var(--spacer-sm); | ||
flex: 1; | ||
& img { | ||
height: 340px; | ||
object-fit: cover; | ||
width: 100%; | ||
} | ||
} | ||
@include for-desktop { | ||
align-items: center; | ||
flex-direction: row; | ||
justify-content: space-around; | ||
.cms-block-image-text__image { | ||
margin-bottom: 0; | ||
margin-right: var(--spacer-sm); | ||
margin-top: 0; | ||
} | ||
.cms-block-image-text__text { | ||
margin-bottom: 0; | ||
margin-left: var(--spacer-sm); | ||
margin-top: 0; | ||
} | ||
} | ||
} | ||
</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
e296bea
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 the following URLs: