-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
5 changed files
with
218 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<template> | ||
<ParentLayout> | ||
<template #sidebar-top> | ||
<CarbonAds | ||
v-if="$site.themeConfig.carbonAds" | ||
:key="$page.path" | ||
:serve="$site.themeConfig.carbonAds.serve" | ||
:placement="$site.themeConfig.carbonAds.placement" | ||
/> | ||
</template> | ||
<template #page-bottom> | ||
<BuySellAds | ||
v-if="$site.themeConfig.carbonAds" | ||
:key="$page.path" | ||
:serve="$site.themeConfig.carbonAds.serve" | ||
:placement="$site.themeConfig.carbonAds.placement" | ||
/> | ||
</template> | ||
</ParentLayout> | ||
</template> | ||
|
||
<script> | ||
import ParentLayout from '@parent-theme/layouts/Layout.vue' | ||
import CarbonAds from './components/CarbonAds.vue' | ||
import BuySellAds from './components/BuySellAds.vue' | ||
export default { | ||
name: 'Layout', | ||
components: { | ||
ParentLayout, | ||
CarbonAds, | ||
BuySellAds | ||
} | ||
} | ||
</script> |
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,110 @@ | ||
<template> | ||
<div class="bsa-cpc-wrapper"> | ||
<div class="bsa-cpc"></div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
/* global _bsa */ | ||
const ID = 'bsa-cpc-script' | ||
export default { | ||
name: 'BuySellAds', | ||
props: { | ||
serve: { | ||
type: String, | ||
required: true | ||
}, | ||
placement: { | ||
type: String, | ||
required: true | ||
} | ||
}, | ||
methods: { | ||
load() { | ||
if (typeof _bsa !== 'undefined' && _bsa) { | ||
_bsa.init('default', this.serve, `placement:${this.placement}`, { | ||
target: '.bsa-cpc', | ||
align: 'horizontal', | ||
disable_css: 'true' | ||
}) | ||
} | ||
} | ||
}, | ||
mounted() { | ||
if (!document.getElementById(ID)) { | ||
const s = document.createElement('script') | ||
s.id = ID | ||
s.src = `//m.servedby-buysellads.com/monetization.js` | ||
document.head.appendChild(s) | ||
s.onload = () => { | ||
this.load() | ||
} | ||
} else { | ||
this.load() | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
.bsa-cpc-wrapper { | ||
font-size: 0.95rem; | ||
/* from Page.vue */ | ||
max-width: 50rem; | ||
margin: 0px auto; | ||
padding: 1rem 2rem 0; | ||
margin-bottom: -1rem; | ||
} | ||
@media (max-width: 419px) { | ||
.bsa-cpc-wrapper { | ||
padding: 0 1.5rem; | ||
} | ||
} | ||
.bsa-cpc { | ||
font-size: 0.9em; | ||
background-color: #f8f8f8; | ||
border-radius: 6px; | ||
} | ||
.bsa-cpc a._default_ { | ||
text-align: left; | ||
display: block; | ||
text-decoration: none; | ||
padding: 10px 15px 12px; | ||
margin-bottom: 20px; | ||
color: #666; | ||
font-weight: 400; | ||
line-height: 18px; | ||
} | ||
.bsa-cpc a._default_ .default-image img { | ||
height: 20px; | ||
border-radius: 3px; | ||
vertical-align: middle; | ||
position: relative; | ||
top: -1px; | ||
} | ||
.bsa-cpc a._default_ .default-title { | ||
font-weight: 600; | ||
} | ||
.bsa-cpc a._default_ .default-description:after { | ||
font-size: 0.85em; | ||
content: 'Sponsored'; | ||
color: #1c90f3; | ||
border: 1px solid #1c90f3; | ||
border-radius: 3px; | ||
padding: 0 4px 1px; | ||
margin-left: 6px; | ||
} | ||
.bsa-cpc .default-ad { | ||
display: none; | ||
} | ||
.bsa-cpc a._default_ .default-image, | ||
.bsa-cpc a._default_ .default-title, | ||
.bsa-cpc a._default_ .default-description { | ||
display: inline; | ||
vertical-align: middle; | ||
margin-right: 6px; | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<template> | ||
<div class="carbon-ads"></div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'CarbonAds', | ||
props: { | ||
serve: { | ||
type: String, | ||
required: true | ||
}, | ||
placement: { | ||
type: String, | ||
required: true | ||
} | ||
}, | ||
mounted() { | ||
const s = document.createElement('script') | ||
s.id = '_carbonads_js' | ||
s.src = `//cdn.carbonads.com/carbon.js?serve=${this.serve}&placement=${this.placement}` | ||
this.$el.appendChild(s) | ||
} | ||
} | ||
</script> | ||
|
||
<style> | ||
.carbon-ads { | ||
min-height: 102px; | ||
padding: 1.5rem 1.5rem 0; | ||
margin-bottom: -0.5rem; | ||
font-size: 0.75rem; | ||
} | ||
.carbon-ads a { | ||
color: #444; | ||
font-weight: normal; | ||
display: inline; | ||
} | ||
.carbon-ads .carbon-img { | ||
float: left; | ||
margin-right: 1rem; | ||
border: 1px solid var(--border-color); | ||
} | ||
.carbon-ads .carbon-img img { | ||
display: block; | ||
} | ||
.carbon-ads .carbon-poweredby { | ||
color: #999; | ||
display: block; | ||
margin-top: 0.5em; | ||
} | ||
@media (max-width: 719px) { | ||
.carbon-ads .carbon-img img { | ||
width: 100px; | ||
height: 77px; | ||
} | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extend: '@vuepress/theme-default' | ||
} |