Skip to content

Commit eb64434

Browse files
authored
Refactor/change ads (#2245)
* Refactor(ads): Change codefund with carbon ads * Refactor(carbon ads): Add style for home page * Refactor(docs): Add style for carbon ads
1 parent 79e49b6 commit eb64434

File tree

3 files changed

+153
-46
lines changed

3 files changed

+153
-46
lines changed

docs/app/components/AdManager.vue

+8-27
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<md-content class="ad-manager" id="ad-manager" md-theme="docs-dark">
3-
<div id="code-fund" class="code-fund"></div>
3+
<div id="carbon-ads" class="carbon-ads"></div>
44
</md-content>
55
</template>
66

@@ -9,15 +9,15 @@
99
name: 'AdManager',
1010
methods: {
1111
getSponsor () {
12-
let sponsorUrl = 'https://api.codefund.app/properties/60/funder.html'
1312
14-
if (this.$route.name !== 'home') {
15-
sponsorUrl += '?theme=light'
16-
}
13+
let carbonScript = document.createElement('script');
1714
18-
this.$http.get(sponsorUrl).then(({ data }) => {
19-
document.getElementById('code-fund').innerHTML = data;
20-
})
15+
carbonScript.setAttribute('async', '');
16+
carbonScript.setAttribute('type', 'text/javascript');
17+
carbonScript.setAttribute('src', '//cdn.carbonads.com/carbon.js?serve=CKYIL2QW&placement=vuematerialio');
18+
carbonScript.setAttribute('id', '_carbonads_js');
19+
20+
document.getElementById('carbon-ads').appendChild(carbonScript);
2121
}
2222
},
2323
mounted () {
@@ -51,23 +51,4 @@
5151
background: #303030;
5252
}
5353
54-
.code-fund {
55-
max-width: 175px;
56-
padding: 8px;
57-
display: flex;
58-
flex-direction: column;
59-
float: right;
60-
position: relative;
61-
z-index: 10;
62-
font-size: 12px;
63-
line-height: 1.5em;
64-
65-
.splash-container & {
66-
max-width: 530px;
67-
min-height: 100px;
68-
margin: 0px auto 8px;
69-
float: none;
70-
background: none !important;
71-
}
72-
}
7354
</style>

docs/app/components/PageContainer.vue

+72-2
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,12 @@
115115
position: fixed;
116116
}
117117
118+
.ad-manager .carbon-ads{
119+
background: red;
120+
}
121+
118122
@media (min-width: $ad-responsive-big) {
119-
.ad-manager >>> .code-fund {
123+
.ad-manager >>> .carbon-ads {
120124
margin: 0;
121125
position: fixed;
122126
bottom: 0;
@@ -128,7 +132,7 @@
128132
@media(max-width: 960px){
129133
.ad-manager{
130134
position: relative;
131-
>>>.code-fund{
135+
>>>.carbon-ads{
132136
float: none;
133137
margin: 0;
134138
display: flex;
@@ -144,3 +148,69 @@
144148
}
145149
}
146150
</style>
151+
152+
<style lang="scss">
153+
154+
@media (min-width: 960px){
155+
#carbonads{
156+
margin-right: 30px;
157+
}
158+
}
159+
160+
#carbonads {
161+
display: block;
162+
overflow: hidden;
163+
padding: 1em;
164+
max-width: 170px;
165+
background: #fff;
166+
text-align: center;
167+
font-size: 14px;
168+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
169+
line-height: 1.5;
170+
}
171+
172+
#carbonads a {
173+
color: inherit;
174+
text-decoration: none;
175+
}
176+
177+
#carbonads a:hover {
178+
color: inherit;
179+
}
180+
181+
#carbonads span {
182+
display: block;
183+
overflow: hidden;
184+
}
185+
186+
.carbon-img {
187+
display: block;
188+
margin: 0 auto 8px;
189+
line-height: 1;
190+
}
191+
192+
.carbon-text {
193+
display: block;
194+
margin-bottom: 8px;
195+
}
196+
197+
.carbon-poweredby {
198+
display: block;
199+
text-transform: uppercase;
200+
letter-spacing: 1px;
201+
font-size: 10px;
202+
line-height: 1;
203+
}
204+
205+
@media (max-width: 576px){
206+
#carbonads{
207+
margin: auto;
208+
margin-top: 30px;
209+
}
210+
211+
#carbonads .carbon-poweredby{
212+
left: 143px;
213+
}
214+
215+
}
216+
</style>

docs/app/pages/Home/Home.vue

+73-17
Original file line numberDiff line numberDiff line change
@@ -128,30 +128,14 @@
128128
@media (max-width: 1690px) {
129129
margin: 32px 0 0 0 !important;
130130
131-
.code-fund {
131+
.carbon-ads {
132132
display: flex !important;
133133
align-items: center;
134134
flex-direction: row;
135135
max-width: none;
136136
margin: 8px auto 16px;
137137
float: none;
138138
139-
.code-fund-image {
140-
max-width: 175px;
141-
}
142-
143-
.code-fund-data {
144-
margin-left: 8px;
145-
}
146-
147-
#cf{
148-
width: 300px !important;
149-
img{
150-
float: left;
151-
margin-right: 10px;
152-
border-radius: 2px;
153-
}
154-
}
155139
a {
156140
color: #fff !important;
157141
}
@@ -166,4 +150,76 @@
166150
color: #3a3a3a
167151
}
168152
}
153+
154+
#carbonads {
155+
max-width: 300px;
156+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
157+
}
158+
159+
#carbonads > span {
160+
position: relative;
161+
display: block;
162+
border-radius: 4px;
163+
background-color: rgba(255,255,255,.1);
164+
}
165+
166+
#carbonads > span {
167+
margin-left: 0px;
168+
margin-bottom: 35px;
169+
}
170+
171+
#carbonads .carbon-wrap {
172+
display: flex;
173+
position: relative;
174+
}
175+
176+
#carbonads .carbon-img {
177+
margin-right: 10px;
178+
line-height: 1;
179+
}
180+
181+
#carbonads .carbon-text {
182+
margin-bottom: 12px;
183+
text-decoration: none;
184+
font-size: 12px;
185+
line-height: 1.45;
186+
text-align: left;
187+
}
188+
189+
#carbonads .carbon-text {
190+
color: #2d3748;
191+
margin-top: 8px;
192+
}
193+
194+
#carbonads .carbon-poweredby {
195+
position: absolute;
196+
bottom: 10px;
197+
left: 142px;
198+
text-decoration: none;
199+
text-transform: uppercase;
200+
letter-spacing: .5px;
201+
font-weight: 500;
202+
font-size: 8px;
203+
line-height: 1;
204+
}
205+
206+
#carbonads .carbon-poweredby {
207+
color: #2d3748;
208+
}
209+
210+
#carbonads{
211+
margin: auto;
212+
margin-top: 15px;
213+
}
214+
215+
@media (max-width: 576px){
216+
#carbonads{
217+
margin: auto;
218+
margin-top: 30px;
219+
}
220+
221+
#carbonads .carbon-poweredby{
222+
left: 143px;
223+
}
224+
}
169225
</style>

0 commit comments

Comments
 (0)