-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Showing
9 changed files
with
2,827 additions
and
2,373 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
Large diffs are not rendered by default.
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
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 @@ | ||
#carbonads * { | ||
margin: initial; | ||
padding: initial; | ||
} | ||
#carbonads { | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, | ||
Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', Helvetica, Arial, | ||
sans-serif; | ||
} | ||
#carbonads { | ||
display: flex; | ||
max-width: 330px; | ||
background-color: hsl(0, 0%, 98%); | ||
box-shadow: 0 1px 4px 1px hsla(0, 0%, 0%, 0.1); | ||
z-index: 100; | ||
margin-top: 20px; | ||
margin-bottom: 20px; | ||
min-height: 100px; | ||
} | ||
#carbonads a { | ||
color: #000000; | ||
text-decoration: none; | ||
} | ||
#carbonads a:hover { | ||
color: #000000; | ||
} | ||
#carbonads span { | ||
position: relative; | ||
display: block; | ||
overflow: hidden; | ||
} | ||
#carbonads .carbon-wrap { | ||
display: flex; | ||
} | ||
#carbonads .carbon-img { | ||
display: block; | ||
margin: 0; | ||
line-height: 1; | ||
} | ||
#carbonads .carbon-img img { | ||
display: block; | ||
} | ||
#carbonads .carbon-text { | ||
font-size: 13px; | ||
padding: 10px; | ||
margin-bottom: 16px; | ||
line-height: 1.5; | ||
text-align: left; | ||
} | ||
#carbonads .carbon-poweredby { | ||
display: block; | ||
padding: 6px 8px; | ||
background: #f1f1f2; | ||
text-align: center; | ||
text-transform: uppercase; | ||
letter-spacing: 0.5px; | ||
font-weight: 600; | ||
font-size: 8px; | ||
line-height: 1; | ||
border-top-left-radius: 3px; | ||
position: absolute; | ||
bottom: 0; | ||
right: 0; | ||
} |
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,31 @@ | ||
import { useEffect } from 'react'; | ||
import './index.css'; | ||
|
||
function insertAfter(referenceNode, newNode) { | ||
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); | ||
} | ||
|
||
export default function Carbon({ | ||
code = 'CEAIV23U', | ||
placement = 'wwwjest-previewcom', | ||
querySelector = 'h1', | ||
customStyle = 'min-height: 100px; margin: 20px 0;', | ||
}) { | ||
useEffect(() => { | ||
try { | ||
var targetElement = document.querySelector(querySelector); | ||
const s = document.createElement('script'); | ||
s.id = '_carbonads_js'; | ||
s.src = `//cdn.carbonads.com/carbon.js?serve=${code}&placement=${placement}`; | ||
// Add a container bellow h1 to avoid layout shift | ||
const mountContainer = document.createElement('div'); | ||
mountContainer.setAttribute('style', customStyle); | ||
insertAfter(targetElement, mountContainer); | ||
// Mount carbon as a child of mountContainer | ||
mountContainer.appendChild(s); | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
}, []); | ||
return null; | ||
} |
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,12 @@ | ||
import React from 'react'; | ||
import BlogListPage from '@theme-original/BlogListPage'; | ||
import Carbon from '@site/src/components/Carbon'; | ||
|
||
export default function BlogListPageWrapper(props) { | ||
return ( | ||
<> | ||
<Carbon querySelector="ul.clean-list" /> | ||
<BlogListPage {...props} /> | ||
</> | ||
); | ||
} |
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 React from 'react'; | ||
import BlogPostPage from '@theme-original/BlogPostPage'; | ||
import Carbon from '@site/src/components/Carbon'; | ||
|
||
export default function BlogPostPageWrapper(props) { | ||
return ( | ||
<> | ||
<Carbon querySelector="header" /> | ||
<BlogPostPage {...props} /> | ||
</> | ||
); | ||
} |
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 React, { useEffect } from 'react'; | ||
import DocItem from '@theme-original/DocItem'; | ||
import Carbon from '@site/src/components/Carbon'; | ||
|
||
export default function DocItemWrapper(props) { | ||
return ( | ||
<> | ||
<Carbon /> | ||
<DocItem {...props} /> | ||
</> | ||
); | ||
} |