-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de752a8
commit fefabb0
Showing
4 changed files
with
309 additions
and
6 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,96 @@ | ||
import React from 'react' | ||
import { Card, Button } from '@oacore/design/lib/elements' | ||
|
||
import styles from './labs.module.scss' | ||
|
||
import { Page } from 'components' | ||
import { Layout, Hero } from 'design-v2/components' | ||
import retrieveContent from 'content' | ||
|
||
const ASSETS_BASE_URL = 'https://oacore.github.io/content/' | ||
|
||
const setAssetsUrl = (object) => { | ||
Object.entries(object).forEach(([key, value]) => { | ||
if (typeof value === 'string' && value.includes('/images')) | ||
object[key] = ASSETS_BASE_URL + value | ||
else if (typeof value === 'object') setAssetsUrl(value) // Recursively process nested objects | ||
}) | ||
} | ||
|
||
const getSections = async ({ ref } = {}) => { | ||
const page = await retrieveContent('coreLabs', { | ||
ref, | ||
transform: 'object', | ||
}) | ||
|
||
setAssetsUrl(page) | ||
|
||
return page | ||
} | ||
|
||
export async function getStaticProps({ previewData }) { | ||
const ref = previewData?.ref | ||
const page = await getSections({ ref }) | ||
|
||
return { | ||
props: { | ||
page, | ||
}, | ||
} | ||
} | ||
|
||
const FeatureBox = ({ iconSrc, title, description, tag, action }) => ( | ||
<Card variant="pure" className={styles.card}> | ||
<img src={iconSrc} alt={title} className={styles.cardLogo} /> | ||
<Card.Title className={styles.headerWrapper} tag="h5"> | ||
<span>{title}</span> | ||
<div className={styles.tag}>{tag}</div> | ||
</Card.Title> | ||
<Card.Description className={styles.description}> | ||
{description} | ||
</Card.Description> | ||
<Card.Footer className={styles.cardFooter}> | ||
<Button | ||
className={styles.button} | ||
variant="contained" | ||
href={action.url} | ||
tag="a" | ||
> | ||
{action.caption} | ||
</Button> | ||
</Card.Footer> | ||
</Card> | ||
) | ||
|
||
const LabsPage = ({ page }) => ( | ||
<Page | ||
title={page.header.header.title} | ||
description={page.header.header.description} | ||
// keywords={servicesData.keywords} | ||
nav | ||
> | ||
<Layout> | ||
<Hero | ||
image={page.header.header.hero} | ||
title={page.header.header.title} | ||
description={page.header.header.description} | ||
/> | ||
<div className={styles.features}> | ||
{page.services.features && | ||
page.services.features.map((feature) => ( | ||
<FeatureBox | ||
key={feature.id} | ||
iconSrc={feature.logo} | ||
title={feature.title} | ||
description={feature.description} | ||
recommender={feature.recommender} | ||
action={feature.action} | ||
tag={feature.tag} | ||
/> | ||
))} | ||
</div> | ||
</Layout> | ||
</Page> | ||
) | ||
|
||
export default LabsPage |
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,128 @@ | ||
.wrapper { | ||
padding-bottom: 4rem; | ||
} | ||
|
||
.section { | ||
&-container { | ||
padding: 1rem 0 !important; | ||
&-inline { | ||
display: inline-flex; | ||
flex-direction: column; | ||
justify-content: stretch; | ||
max-width: 25.35rem; | ||
|
||
&:not(:last-child) { | ||
margin-right: 1rem; | ||
} | ||
} | ||
} | ||
&-header { | ||
display: flex; | ||
align-items: center; | ||
margin-bottom: 2rem; | ||
&:after { | ||
border-bottom: 3px dashed var(--gray-300); | ||
content: ''; | ||
flex: 1; | ||
} | ||
} | ||
&-video-img { | ||
margin-right: 1rem; | ||
position: relative; | ||
&:hover, | ||
&:focus { | ||
--button-overlay: none; | ||
--button-focus-ring: none; | ||
} | ||
img { | ||
width: 100%; | ||
height: auto; | ||
} | ||
.pulse { | ||
position: absolute; | ||
top: 18%; | ||
left: 22%; | ||
width: 100px; | ||
height: 100px; | ||
border-radius: 50%; | ||
background-color: rgba(255, 0, 0, 0.5); | ||
animation: pulse 2s infinite; | ||
z-index: -1; | ||
} | ||
|
||
@keyframes pulse { | ||
0% { | ||
transform: scale(0); | ||
opacity: 1; | ||
} | ||
100% { | ||
transform: scale(2); | ||
opacity: 0; | ||
} | ||
} | ||
} | ||
&-title { | ||
display: block; | ||
margin-right: 1rem; | ||
font-weight: 600; | ||
} | ||
} | ||
.features { | ||
display: grid; | ||
grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); | ||
grid-gap: 1rem; | ||
|
||
.card { | ||
padding: 2rem; | ||
background-color: var(--gray-100); | ||
display: flex; | ||
flex-direction: column; | ||
min-height: 29rem; | ||
.header-wrapper { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
} | ||
.tag { | ||
padding: 3px 7px; | ||
border-radius: 2px; | ||
background: #8bc34a; | ||
color: #fff; | ||
font-size: 16px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 24px; | ||
letter-spacing: 0.026px; | ||
} | ||
.description { | ||
color: #000; | ||
font-size: 16px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 24px; | ||
letter-spacing: 0.026px; | ||
} | ||
.button { | ||
text-transform: initial; | ||
} | ||
&-logo { | ||
width: 96px; | ||
height: 63px; | ||
margin-bottom: 1rem; | ||
} | ||
&-title { | ||
font-weight: 500; | ||
} | ||
&-footer { | ||
height: 100%; | ||
align-items: flex-start; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: flex-end; | ||
&-caption { | ||
margin-bottom: 1rem; | ||
color: var(--gray-500); | ||
} | ||
} | ||
} | ||
} |