Skip to content

Commit 0143f9d

Browse files
docs: remove code sponsor :(
1 parent ded23b8 commit 0143f9d

File tree

5 files changed

+425
-447
lines changed

5 files changed

+425
-447
lines changed

build/docs/index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import webpack from 'webpack'
2-
import ora from 'ora'
2+
import Ora from 'ora'
33
import webpackConfig from './webpack'
44

5-
const spinner = ora({
6-
text: 'Building documentation...',
7-
color: 'green'
5+
const spinner = new Ora({
6+
text: 'Building documentation',
7+
color: 'green',
8+
spinner: 'simpleDots'
89
})
910

1011
spinner.start()
1112

1213
webpack(webpackConfig, (error, stats) => {
1314
if (error) {
15+
spinner.fail('ERRORED! Too bad! :(')
1416
throw error
1517
}
1618

@@ -22,5 +24,5 @@ webpack(webpackConfig, (error, stats) => {
2224
chunkModules: false
2325
}) + '\n\n')
2426

25-
spinner.stop()
27+
spinner.succeed('Vue Material documentation generated with success! \\o/')
2628
})

build/lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ webpack(entries, (error, stats) => {
3939
throw error
4040
}
4141

42-
spinner.color = 'yellow';
43-
spinner.text = 'Generating themes';
42+
spinner.color = 'yellow'
43+
spinner.text = 'Generating themes'
4444

4545
generateThemes()
4646

docs/ads.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
<!-- Carbon Ads -->
22
<script async src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=vuematerialio" id="_carbonads_js"></script>
33

4-
<!-- Code Sponsor -->
5-
<div class="code-sponsor-widget">
6-
<div id="code-sponsor-widget" class="code-sponsor-widget-frame"></div>
7-
</div>
8-
<script src="https://app.codesponsor.io/scripts/Tuxp4vQN_tThtWBhF8yOtA?theme=light&amp;width=330"></script>
9-
104
<!-- Amazon Pixel -->
115
<img src="//ir-na.amazon-adsystem.com/e/ir?t=vuematerial-20&l=ur2&o=1" class="amazon-pixel" />

docs/app/components/AdManager.vue

Lines changed: 55 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,135 +1,128 @@
1+
<template>
2+
<md-content id="ad-manager" md-theme="default"></md-content>
3+
</template>
14

25
<script>
36
export default {
47
name: 'AdManager',
5-
abstract: true,
68
data: () => ({
7-
carbonEl: null,
8-
codeSponsorEl: null
9+
carbonEl: null
910
}),
1011
render () {
1112
return null
1213
},
1314
methods: {
1415
saveAdsElements () {
1516
this.carbonEl = document.getElementById('carbonads')
16-
this.codeSponsorEl = document.querySelector('.code-sponsor-widget')
17-
if (!this.carbonEl || !this.codeSponsorEl) {
17+
18+
if (!this.carbonEl) {
1819
this.$destroy()
1920
}
2021
},
21-
appendCarbonAds() {
22+
appendCarbonAds () {
2223
const interval = window.setInterval(() => {
2324
const carbonAds = document.getElementById('carbonads')
2425
const container = document.querySelector('.container')
25-
const mainContainer = document.querySelector('.main-container')
26+
const pageContainer = document.querySelector('.page-container')
2627
const splashContainer = document.querySelector('.splash-container')
27-
const carbonAdsContainer = document.querySelector('.code-sponsor-widget')
28+
const adManager = this.$el
29+
2830
if (carbonAds && container) {
29-
if (splashContainer) {
30-
carbonAdsContainer.appendChild(carbonAds)
31-
} else if (mainContainer) {
32-
mainContainer.insertBefore(carbonAds, mainContainer.firstChild)
31+
if (pageContainer) {
32+
pageContainer.insertBefore(carbonAds, pageContainer.firstChild)
33+
} else if (splashContainer && adManager) {
34+
adManager.appendChild(carbonAds)
3335
} else {
3436
container.insertBefore(carbonAds, container.firstChild)
3537
}
38+
3639
window.clearInterval(interval)
3740
}
3841
}, 50)
3942
},
40-
appendCodeSponsor() {
41-
const interval = window.setInterval(() => {
42-
const carbonAds = document.querySelector('.code-sponsor-widget')
43-
const container = document.querySelector('.container')
44-
const mainContainer = document.querySelector('.main-container')
45-
if (carbonAds && mainContainer) {
46-
if (mainContainer) {
47-
mainContainer.appendChild(carbonAds)
48-
} else {
49-
container.appendChild(carbonAds)
50-
}
51-
window.clearInterval(interval)
52-
}
53-
}, 50)
54-
},
55-
moveCarbonAdsToBody() {
43+
moveCarbonAdsToBody () {
5644
if (this.carbonEl) {
5745
document.body.appendChild(this.carbonEl)
5846
}
59-
},
60-
moveCodeSponsorToBody() {
61-
if (this.codeSponsorEl) {
62-
document.body.appendChild(this.codeSponsorEl)
63-
}
6447
}
6548
},
6649
mounted () {
6750
this.saveAdsElements()
6851
this.appendCarbonAds()
69-
this.appendCodeSponsor()
7052
},
71-
beforeDestroy() {
53+
beforeDestroy () {
7254
this.moveCarbonAdsToBody()
73-
this.moveCodeSponsorToBody()
7455
}
7556
}
7657
</script>
7758

7859
<style lang="scss">
7960
@import "~vue-material/theme/engine";
61+
8062
$ad-responsive-big: 1670px;
8163
$ad-responsive-small: 600px;
64+
8265
@mixin ad-theme ($hue, $color) {
83-
#carbonads,
84-
.code-sponsor-widget {
66+
#carbonads {
8567
background: md-get-palette-color(grey, $hue);
68+
69+
.carbon-poweredby {
70+
color: rgba($color, .54);
71+
72+
&:hover {
73+
color: rgba($color, .87);
74+
}
75+
}
8676
}
77+
8778
.carbon-wrap a {
8879
color: rgba($color, .7);
80+
8981
&:hover {
9082
color: $color;
9183
}
9284
}
93-
#carbonads .carbon-poweredby {
94-
color: rgba($color, .54);
95-
&:hover {
96-
color: rgba($color, .87);
97-
}
98-
}
9985
}
86+
10087
.main-container {
10188
@include ad-theme(200, #000);
10289
}
90+
10391
.splash-container {
10492
@media (min-width: $ad-responsive-big) {
10593
@include ad-theme(800, #fff);
10694
}
10795
}
96+
10897
#carbonads {
10998
max-width: 162px;
11099
margin: 1em 0 24px 16px;
111100
padding: 16px;
112101
float: right;
113102
position: relative;
114103
z-index: 10;
104+
115105
.splash-container & {
116106
@media (max-width: $ad-responsive-big) {
117107
background: #fff;
118108
}
119109
}
110+
120111
@media (min-width: $ad-responsive-big) {
121112
margin: 0;
122113
position: fixed;
123114
right: 16px;
124115
bottom: 16px;
125116
}
117+
126118
@media (max-width: $ad-responsive-small) {
127119
max-width: none;
128120
min-height: 100px;
129121
margin-left: 0;
130122
padding: 0;
131123
float: none;
132124
}
125+
133126
.splash-container & {
134127
@media (max-width: $ad-responsive-big) {
135128
max-width: none;
@@ -139,70 +132,70 @@
139132
float: none;
140133
}
141134
}
135+
142136
.carbon-wrap {
143137
display: flex;
144138
flex-direction: column;
145139
font-size: 12px;
140+
146141
@media (max-width: $ad-responsive-small) {
147142
display: block;
148143
}
144+
149145
.splash-container & {
150146
@media (max-width: $ad-responsive-big) {
151147
display: block;
152148
}
153149
}
150+
154151
.carbon-img {
155152
@media (max-width: $ad-responsive-small) {
156153
margin-right: 16px;
157154
float: left;
158155
}
156+
159157
.splash-container & {
160158
@media (max-width: $ad-responsive-big) {
161159
margin-right: 16px;
162160
float: left;
163161
}
164162
}
165163
}
164+
166165
.carbon-text {
167166
line-height: 1.5em;
167+
168168
@media (max-width: $ad-responsive-big) {
169169
padding-top: 1em;
170170
padding-right: 16px;
171171
display: block;
172172
}
173+
173174
@media (min-width: $ad-responsive-big) {
174175
margin: 12px 0 8px;
175176
}
176177
}
178+
177179
a {
178180
&:hover {
179181
text-decoration: none;
180182
}
181183
}
182184
}
185+
183186
.carbon-poweredby {
184187
font-size: 11px;
185188
}
186189
}
187-
.code-sponsor-widget {
188-
margin-top: 64px;
189-
padding: 10px;
190-
display: flex;
191-
justify-content: center;
192-
@media (max-width: $ad-responsive-small) {
193-
align-items: center;
194-
flex-direction: column;
195-
}
196-
.splash-container & {
197-
width: calc(100% + 32px);
198-
margin: 0 -16px -16px;
199-
background: #fff;
200-
}
190+
191+
#ad-manager {
192+
width: calc(100% + 32px);
193+
margin: 0 -16px -16px;
194+
201195
#carbonads {
202-
margin-left: 16px;
203-
@media (max-width: $ad-responsive-small) {
204-
margin-top: 16px;
205-
margin-left: 0;
196+
@media (max-width: $ad-responsive-big) {
197+
max-width: 530px;
198+
margin: 24px auto;
206199
}
207200
}
208201
}

0 commit comments

Comments
 (0)