Skip to content

Commit 06b967b

Browse files
committed
feat: add sponsor banner
1 parent b17551b commit 06b967b

File tree

3 files changed

+11
-79
lines changed

3 files changed

+11
-79
lines changed

docusaurus.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ module.exports = {
77
organizationName: "electron-react-boilerplate",
88
projectName: "site",
99
themeConfig: {
10+
announcementBar: {
11+
id: "palette_banner",
12+
content:
13+
'<a target="_blank" rel="noopener noreferrer" href="https://palette.dev">Try Palette - Electron Performance, made easy</a>',
14+
isCloseable: false,
15+
},
1016
colorMode: {
1117
defaultMode: "light",
1218
disableSwitch: true,
@@ -98,7 +104,6 @@ module.exports = {
98104
src: "https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js",
99105
async: true,
100106
},
101-
"/js/ads.js",
102107
],
103108
presets: [
104109
[

src/css/custom.css

Lines changed: 5 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -13,74 +13,10 @@
1313
--ifm-color-primary-lightest: #cc7bb2;
1414
}
1515

16-
#carbonads {
17-
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
18-
Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial,
19-
sans-serif;
20-
}
21-
22-
#carbonads {
23-
display: flex;
24-
position: fixed;
25-
bottom: 30px;
26-
right: 30px;
27-
max-width: 330px;
28-
background-color: hsl(0, 0%, 98%);
29-
box-shadow: 0 1px 4px 1px hsla(0, 0%, 0%, 0.1);
30-
z-index: 100;
31-
}
32-
33-
#carbonads a {
34-
color: inherit;
16+
.announcementBarContent_node_modules-\@docusaurus-theme-classic-lib-theme-AnnouncementBar-styles-module {
17+
background-color: var(--ifm-color-primary);
18+
color: white;
19+
padding: 2rem;
20+
font-weight: bold;
3521
text-decoration: none;
3622
}
37-
38-
#carbonads a:hover {
39-
color: inherit;
40-
}
41-
42-
#carbonads span {
43-
position: relative;
44-
display: block;
45-
overflow: hidden;
46-
}
47-
48-
#carbonads .carbon-wrap {
49-
display: flex;
50-
}
51-
52-
.carbon-img {
53-
display: block;
54-
margin: 0;
55-
line-height: 1;
56-
}
57-
58-
.carbon-img img {
59-
display: block;
60-
}
61-
62-
.carbon-text {
63-
font-size: 13px;
64-
padding: 10px;
65-
line-height: 1.5;
66-
text-align: left;
67-
}
68-
69-
.carbon-poweredby {
70-
display: block;
71-
padding: 8px 10px;
72-
background: repeating-linear-gradient(
73-
-45deg,
74-
transparent,
75-
transparent 5px,
76-
hsla(0, 0%, 0%, 0.025) 5px,
77-
hsla(0, 0%, 0%, 0.025) 10px
78-
)
79-
hsla(203, 11%, 95%, 0.4);
80-
text-align: center;
81-
text-transform: uppercase;
82-
letter-spacing: 0.5px;
83-
font-weight: 600;
84-
font-size: 9px;
85-
line-height: 1;
86-
}

static/js/ads.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +0,0 @@
1-
document.addEventListener('DOMContentLoaded', () => {
2-
const item = document.createElement('script')
3-
item.src = 'https://cdn.carbonads.com/carbon.js?serve=CE7IC277&placement=electron-react-boilerplatejsorg'
4-
item.async = true;
5-
item.id = '_carbonads_js';
6-
setTimeout(() => {
7-
document.querySelector('body').appendChild(item);
8-
}, 1000)
9-
});

0 commit comments

Comments
 (0)