-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2866 from Nikhil-Ladha/rotational_cta
Added rotational CTA framework
- Loading branch information
Showing
10 changed files
with
380 additions
and
3 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
12 changes: 12 additions & 0 deletions
12
src/components/Call-To-Actions/CTA_Bottom/cta_bottom_categories.js
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,12 @@ | ||
import img_source from "../../../assets/images/callout/callout.png"; | ||
|
||
export const Categories = { | ||
"Community" : { | ||
"Image" : img_source, | ||
"Image_Alt" : "Image alt text", | ||
"Content" : "This callout is specific for community categorised blogs", | ||
"Button_Text" : "Join Us", | ||
"Link" : "https://slack.layer5.io", | ||
"Link_external" : true | ||
} | ||
}; |
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,113 @@ | ||
import React from "react"; | ||
import image_src from "../../../assets/images/callout/callout.png"; | ||
import styled from "styled-components"; | ||
import Button from "../../../reusecore/Button"; | ||
import { Categories } from "./cta_bottom_categories"; | ||
|
||
const CTA_BottomWrapper = styled.div` | ||
display: flex; | ||
flex: 0 0 100%; | ||
width: 98%; | ||
height: 16rem; | ||
margin: 2rem auto 1.5rem; | ||
box-shadow: 0px 0px 16px 4px rgba(0, 0, 0, 0.1); | ||
border-radius: 0.5rem; | ||
a { | ||
display: block; | ||
} | ||
img { | ||
width: 16rem; | ||
height: 16rem; | ||
object-fit: cover; | ||
pointer-events: none; | ||
border-radius: 0 0.5rem 0.5rem 0; | ||
} | ||
.cta-content { | ||
padding: 0.5rem; | ||
display: flex; | ||
flex: auto; | ||
background: rgba(201, 252, 246, 0.3); | ||
text-align: center; | ||
align-items: center; | ||
height: 100%; | ||
p { | ||
flex: 0 0 75%; | ||
} | ||
a { | ||
flex: 0 0 25%; | ||
} | ||
} | ||
@media screen and (max-width: 1200px) and (min-width: 700px) { | ||
button { | ||
min-width: 6.5rem; | ||
} | ||
} | ||
@media screen and (max-width: 699px) { | ||
button { | ||
min-width: auto; | ||
} | ||
} | ||
@media screen and (max-width: 550px) { | ||
display: block; | ||
width: 18rem; | ||
height: 18rem; | ||
margin: 1.5rem auto; | ||
border-radius: 0.25rem; | ||
img { | ||
width: 18rem; | ||
height: 18rem; | ||
position: absolute; | ||
filter: brightness(0.5); | ||
border-radius: 0.25rem; | ||
} | ||
.cta-content { | ||
position: absolute; | ||
height: 18rem; | ||
display: block; | ||
width: 18rem; | ||
background: none; | ||
padding: 4rem 1rem; | ||
z-index: 1; | ||
p { | ||
color: white; | ||
} | ||
} | ||
} | ||
`; | ||
|
||
const defaultContent = "Join the Layer5 community and explore the world of service meshes!"; | ||
const defaultURL = "https://slack.layer5.io"; | ||
|
||
export const CTA_Bottom = ({ alt, button_text, category, content, external_link, image, url }) => { | ||
return ( | ||
<CTA_BottomWrapper> | ||
{ category ? ( | ||
<> | ||
<div className="cta-content"> | ||
<p>{Categories[category]["Content"]}</p> | ||
<Button primary title={Categories[category]["Button_Text"]} url={Categories[category]["Link"]} external={Categories[category]["Link_external"]} /> | ||
</div> | ||
<img src={Categories[category]["Image"]} alt={Categories[category]["Image_Alt"]} /> | ||
</> | ||
) : ( | ||
<> | ||
<div className="cta-content"> | ||
<p>{content ? content : defaultContent}</p> | ||
<Button primary title={button_text ? button_text : "Join Us"} url={url ? url : defaultURL} external={external_link ? true : false} /> | ||
</div> | ||
<img src={image ? image : image_src} alt={alt ? alt : "Alt Text"} /> | ||
</> | ||
)} | ||
</CTA_BottomWrapper> | ||
); | ||
}; |
12 changes: 12 additions & 0 deletions
12
src/components/Call-To-Actions/CTA_FullWidth/cta_fullwidth_categories.js
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,12 @@ | ||
import img_source from "../../../assets/images/callout/callout.png"; | ||
|
||
export const Categories = { | ||
"Community" : { | ||
"Image" : img_source, | ||
"Image_Alt" : "Image alt text", | ||
"Content" : "This callout is specific for community categorised blogs", | ||
"Button_Text" : "Join Us", | ||
"Link" : "https://slack.layer5.io", | ||
"Link_external" : true | ||
} | ||
}; |
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,112 @@ | ||
import React from "react"; | ||
import image_src from "../../../assets/images/callout/callout.png"; | ||
import styled from "styled-components"; | ||
import Button from "../../../reusecore/Button"; | ||
import { Categories } from "./cta_fullwidth_categories"; | ||
|
||
const CTA_FullWidthWrapper = styled.div` | ||
display: flex; | ||
flex: 0 0 100%; | ||
width: 98%; | ||
height: 16rem; | ||
margin: 1.5rem auto; | ||
box-shadow: 0px 0px 16px 4px rgba(0, 0, 0, 0.1); | ||
border-radius: 0.5rem; | ||
a { | ||
display: block; | ||
} | ||
img { | ||
width: 16rem; | ||
height: 16rem; | ||
object-fit: cover; | ||
pointer-events: none; | ||
border-radius: 0.5rem 0 0 0.5rem; | ||
} | ||
.cta-content { | ||
padding: 0.5rem; | ||
display: flex; | ||
flex: auto; | ||
background: rgba(201, 252, 246, 0.3); | ||
text-align: center; | ||
align-items: center; | ||
height: 100%; | ||
p { | ||
flex: 0 0 75%; | ||
} | ||
a { | ||
flex: 0 0 25%; | ||
} | ||
} | ||
@media screen and (max-width: 1200px) and (min-width: 700px) { | ||
button { | ||
min-width: 6.5rem; | ||
} | ||
} | ||
@media screen and (max-width: 699px) { | ||
button { | ||
min-width: auto; | ||
} | ||
} | ||
@media screen and (max-width: 550px) { | ||
display: block; | ||
width: 18rem; | ||
height: 18rem; | ||
margin: 1.5rem auto; | ||
border-radius: 0.25rem; | ||
img { | ||
width: 18rem; | ||
height: 18rem; | ||
position: absolute; | ||
filter: brightness(0.5); | ||
border-radius: 0.25rem; | ||
} | ||
.cta-content { | ||
position: absolute; | ||
height: 18rem; | ||
display: block; | ||
width: 18rem; | ||
background: none; | ||
padding: 4rem 1rem; | ||
p { | ||
color: white; | ||
} | ||
} | ||
} | ||
`; | ||
|
||
const defaultContent = "Join the Layer5 community and explore the world of service meshes!"; | ||
const defaultURL = "https://slack.layer5.io"; | ||
|
||
export const CTA_FullWidth = ({ alt, button_text, category, content, external_link, image, url }) => { | ||
return ( | ||
<CTA_FullWidthWrapper> | ||
{ category ? ( | ||
<> | ||
<img src={Categories[category]["Image"]} alt={Categories[category]["Image_Alt"]} /> | ||
<div className="cta-content"> | ||
<p>{Categories[category]["Content"]}</p> | ||
<Button primary title={Categories[category]["Button_Text"]} url={Categories[category]["Link"]} external={Categories[category]["Link_external"]} /> | ||
</div> | ||
</> | ||
) : ( | ||
<> | ||
<img src={image ? image : image_src} alt={alt ? alt : "Alt Text"} /> | ||
<div className="cta-content"> | ||
<p>{content ? content : defaultContent}</p> | ||
<Button primary title={button_text ? button_text : "Join Us"} url={url ? url : defaultURL} external={external_link ? true : false} /> | ||
</div> | ||
</> | ||
)} | ||
</CTA_FullWidthWrapper> | ||
); | ||
}; |
9 changes: 9 additions & 0 deletions
9
src/components/Call-To-Actions/CTA_ImageOnly/cta_imageonly_categories.js
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,9 @@ | ||
import img_source from "../../../assets/images/callout/callout.png"; | ||
|
||
export const Categories = { | ||
"Community" : { | ||
"Image" : img_source, | ||
"Alt" : "Alt text", | ||
"Link" : "https://slack.layer5.io" | ||
} | ||
}; |
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,56 @@ | ||
import React from "react"; | ||
import { Link } from "gatsby"; | ||
import image_src from "../../../assets/images/callout/callout.png"; | ||
import styled from "styled-components"; | ||
import { Categories } from "./cta_imageonly_categories"; | ||
|
||
const CTA_ImageOnlyWrapper = styled.div` | ||
float: right; | ||
margin-left: 0.5rem; | ||
a { | ||
display: block; | ||
height: 15rem; | ||
background: rgb(201, 252, 246); | ||
border-radius: 0.5rem; | ||
} | ||
img { | ||
width: 20rem; | ||
height: 15rem; | ||
pointer-events: none; | ||
border-radius: 0.5rem; | ||
} | ||
@media screen and (max-width: 500px) { | ||
float: none; | ||
width: 20rem; | ||
margin: 1.5rem auto; | ||
} | ||
`; | ||
|
||
const defaultURL = "https://slack.layer5.io"; | ||
|
||
export const CTA_ImageOnly = ({ alt, category, image, url, blend }) => { | ||
return ( | ||
<CTA_ImageOnlyWrapper> | ||
{ category ? ( | ||
<Link to={Categories[category]["Link"]}> | ||
<img | ||
src={Categories[category]["Image"]} | ||
alt={Categories[category]["Alt"]} | ||
style={{ opacity: blend ? "0.7" : "1" }} | ||
/> | ||
</Link> | ||
) : ( | ||
<Link to={url ? url : defaultURL}> | ||
<img | ||
src={image ? image : image_src} | ||
alt={alt ? alt : "Alt Text"} | ||
style={{ opacity: blend ? "0.7" : "1" }} | ||
/> | ||
</Link> | ||
)} | ||
</CTA_ImageOnlyWrapper> | ||
); | ||
}; |
Oops, something went wrong.