Skip to content

Commit

Permalink
docs: add carbon ads
Browse files Browse the repository at this point in the history
  • Loading branch information
Atinux committed Jan 17, 2024
1 parent a77e45f commit 77163e4
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 2 deletions.
45 changes: 45 additions & 0 deletions docs/components/AdsCarbon.vue
@@ -0,0 +1,45 @@
<script setup lang="ts">
const carbonads = ref(null)
onMounted(() => {
if (carbonads.value) {
const script = document.createElement('script')
script.setAttribute('type', 'text/javascript')
script.setAttribute('src', 'https://cdn.carbonads.com/carbon.js?serve=CWYIPK7W&placement=contentnuxtcom')
script.setAttribute('id', '_carbonads_js')
carbonads.value.appendChild(script)
}
})
</script>

<template>
<div ref="carbonads" class="carbon" />
</template>

<style lang="postcss">
.carbon > #carbonads {
@apply relative border border-gray-200 dark:border-gray-800 rounded-lg bg-white dark:bg-gray-800/50 hover:border-gray-300 dark:hover:border-gray-700 w-full transition-colors min-h-[220px];
&:hover {
.carbon-text {
@apply text-gray-700 dark:text-gray-200;
}
}
.carbon-img {
@apply flex justify-center p-2 w-full;
& > img {
@apply !max-w-full w-full rounded;
}
}
.carbon-text {
@apply flex px-2 text-sm text-gray-500 dark:text-gray-400 transition-colors text-center w-full;
}
.carbon-poweredby {
@apply block text-xs text-center text-gray-400 dark:text-gray-500 hover:text-gray-500 dark:hover:text-gray-400 pt-1 pb-2 px-2 transition-colors;
}
}
</style>
6 changes: 4 additions & 2 deletions docs/pages/[...slug].vue
Expand Up @@ -91,10 +91,12 @@ const ecosystemLinks = [
<UDocsToc :links="page.body.toc.links">
<template #bottom>
<div class="hidden !mt-6 lg:block space-y-6">
<UDivider v-if="page.body?.toc?.links?.length" dashed />
<UDivider v-if="page.body?.toc?.links?.length" type="dashed" />
<UPageLinks title="Community" :links="communityLinks" />
<UDivider dashed />
<UDivider type="dashed" />
<UPageLinks title="Ecosystem" :links="ecosystemLinks" />
<UDivider type="dashed" />
<AdsCarbon />
</div>
</template>
</UDocsToc>
Expand Down

0 comments on commit 77163e4

Please sign in to comment.