Skip to content

Commit 6064b97

Browse files
committed
doc: add geektime ad
1 parent 71b7c9d commit 6064b97

File tree

5 files changed

+80
-15
lines changed

5 files changed

+80
-15
lines changed

site/components/CarbonAds.vue

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,14 @@ export default {
5959
</script>
6060
<style lang="less">
6161
#carbon-ads {
62-
width: 280px;
63-
float: right;
64-
position: relative;
65-
right: 0;
66-
bottom: 0;
62+
width: 266px;
63+
position: fixed;
64+
left: 0;
65+
bottom: 0px;
6766
padding: 0;
6867
overflow: hidden;
6968
z-index: 9;
7069
background-color: #fff;
71-
border-radius: 3px;
7270
font-size: 13px;
7371
background: #f5f5f5;
7472
font-family: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
@@ -86,7 +84,7 @@ export default {
8684
}
8785
#carbon-ads img {
8886
float: left;
89-
margin-right: 10px;
87+
padding-right: 10px;
9088
}
9189
#carbon-ads .carbon-img,
9290
#carbon-ads .carbon-text {
@@ -113,6 +111,7 @@ export default {
113111
right: 0;
114112
bottom: 0;
115113
padding: 0;
114+
margin-bottom: 15px;
116115
.carbon-img {
117116
float: left;
118117
margin-right: 10px;

site/components/geektime.vue

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<template>
2-
<div id="geektime" v-show="visible">
2+
<div
3+
v-show="visible"
4+
id="geektime"
5+
>
36
<a
47
href="https://time.geekbang.org/course/intro/163?code=KHKYcoBU6vZa8nMglg7AWfDxxi3BWrz9INAzAY3umPk%3D"
58
target="_blank"
@@ -10,8 +13,12 @@
1013
src="https://cdn.nlark.com/yuque/0/2019/jpeg/87084/1562230861353-assets/web-upload/2fab2df7-5cc9-4791-b344-a97da29eb400.jpeg"
1114
>
1215
</a>
13-
<div v-if="isMobile" class="close" @click="visible=false">
14-
<a-icon type="close"></a-icon>
16+
<div
17+
v-if="isMobile"
18+
class="close"
19+
@click="visible=false"
20+
>
21+
<a-icon type="close" />
1522
</div>
1623
</div>
1724
</template>
@@ -21,9 +28,9 @@ export default {
2128
props: ['isMobile'],
2229
data() {
2330
return {
24-
visible: true
25-
}
26-
}
31+
visible: true,
32+
};
33+
},
2734
};
2835
</script>
2936

site/components/geektime_ads.vue

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<template>
2+
<div
3+
v-show="visible"
4+
id="geektime-ads"
5+
:class="isMobile ? 'geektime-ads-mobile':''"
6+
>
7+
<a
8+
href="https://time.geekbang.org/course/intro/163?code=KHKYcoBU6vZa8nMglg7AWfDxxi3BWrz9INAzAY3umPk%3D"
9+
target="_blank"
10+
>
11+
<img
12+
height="100"
13+
alt="Vue 实战教程"
14+
src="https://cdn.nlark.com/yuque/0/2019/jpeg/87084/1562230861353-assets/web-upload/2fab2df7-5cc9-4791-b344-a97da29eb400.jpeg"
15+
>
16+
</a>
17+
</div>
18+
</template>
19+
20+
<script>
21+
export default {
22+
props: ['isMobile'],
23+
data() {
24+
return {
25+
visible: true,
26+
};
27+
},
28+
};
29+
</script>
30+
31+
<style lang="less" scoped>
32+
#geektime-ads {
33+
max-width: 280px;
34+
height: 100px;
35+
float: right;
36+
position: relative;
37+
right: 0;
38+
bottom: 0;
39+
padding: 0;
40+
overflow: hidden;
41+
z-index: 9;
42+
background-color: #fff;
43+
border-radius: 3px;
44+
font-size: 13px;
45+
background: #f5f5f5;
46+
font-family: "Source Sans Pro", "Helvetica Neue", Arial, sans-serif;
47+
}
48+
#geektime-ads.geektime-ads-mobile {
49+
width: 100%;
50+
position: relative;
51+
right: 0;
52+
bottom: 0;
53+
padding: 0;
54+
margin-bottom: 15px;
55+
}
56+
</style>
57+

site/components/layout.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import Header from './header';
55
import Footer from './footer';
66
import CarbonAds from './CarbonAds';
77
import Geektime from './geektime';
8+
import GeektimeAds from './geektime_ads';
89
import Sponsors from './sponsors';
910
import zhCN from 'antd/locale-provider/zh_CN';
1011
import enUS from 'antd/locale-provider/default';
@@ -268,7 +269,8 @@ export default {
268269
}
269270
<a-col xxl={20} xl={19} lg={19} md={18} sm={24} xs={24}>
270271
<section class='main-container main-container-component'>
271-
<CarbonAds isMobile={isMobile}/>
272+
<CarbonAds isMobile={isMobile} />
273+
<GeektimeAds isMobile={isMobile} />
272274
{!isMobile ? <div class='toc-affix' style='width: 150px;'>
273275
{this.getSubMenu(isCN)}
274276
</div> : null}

site/theme/static/common.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ a {
5151
}
5252

5353
.aside-container {
54-
padding-bottom: 48px;
54+
padding-bottom: 120px;
5555
font-family: Avenir, @font-family;
5656

5757
&.ant-menu-inline .ant-menu-submenu-title h4,

0 commit comments

Comments
 (0)