Skip to content

Commit 155a7bd

Browse files
authored
feat: 增加视频公开课页面 (#1919)
修复顶部导航在移动设备不能折叠的问题 Closes #1712
1 parent 7bdc4eb commit 155a7bd

12 files changed

+642
-503
lines changed

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ grunt.registerMultiTask('docmeta', '增加 Title、文档修改日期、设置
327327
// 首页:内容分类导航 scrollspy
328328
if ( file.base.toLowerCase() === 'index.html' ){
329329
let $sectionNav = $('#section-nav').find('ul');
330-
$('.section-title').each(function(index, el) {
330+
$('#tab-docs').find('.section-title').each(function(index, el) {
331331
let $el = $(el);
332332
let id = $el.text().replace(/ /g,'-').replace(/[^a-zA-Z_0-9\u4e00-\u9fa5]/g,'-');
333333
$el.attr('id',id);

custom/less/section-dashboard-header.less

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
// dashboard-header.html
2+
@media (max-width: @screen-xs-max) {
3+
.navbar-right {
4+
margin-top: 0;
5+
margin-bottom: 0;
6+
}
7+
8+
.dashboard-subnav {
9+
box-shadow: 0 1px 2px rgba(0,0,0,0.2);
10+
}
11+
}
12+
213
.notification-trigger {
314
position: relative;
415
}
@@ -305,9 +316,9 @@
305316
.nav-logo {
306317
display: block;
307318
color: @link-color;
308-
background: #efefef;
319+
/*background: #efefef;*/
309320
text-align: center;
310-
font-size: 24px;
321+
font-size: 22px;
311322

312323
&:hover,
313324
&:focus,

custom/less/section-docs.less

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,59 @@ body {
6868
height: 48px;
6969
position: relative;
7070
}
71+
7172
.doc-content {
7273

74+
.section-title {
75+
margin: 36px 0;
76+
font-size: 28px;
77+
color: #666;
78+
position: relative;
79+
overflow: hidden;
80+
padding: 0;
81+
text-align: center;
82+
z-index: 1;
83+
84+
&:before,
85+
&:after {
86+
position: absolute;
87+
top: 51%;
88+
overflow: hidden;
89+
width: 50%;
90+
height: 1px;
91+
content: '\a0'!important;
92+
background-color: #ddd;
93+
}
94+
95+
&:after {
96+
margin-left: 2%;
97+
}
98+
&:before {
99+
margin-left: -52%;
100+
text-align: right;
101+
}
102+
}
103+
104+
.section-content {
105+
h3 {
106+
margin: 24px 0 0 0;
107+
font-size: 1em;
108+
padding: 0;
109+
color: #999;
110+
line-height: 1.8;
111+
112+
&:first-child{
113+
margin-top: 0;
114+
}
115+
}
116+
117+
.note {
118+
font-size: 13px;
119+
color: #aaa;
120+
max-width: 25em;
121+
}
122+
}
123+
73124
.link-block .dropdown-header {
74125
.dropdown_header;
75126
font-size: 12px;

custom/less/section-footer.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
border-bottom: none !important;
1111

1212
&.font-logo {
13-
font-size: 24px;
13+
font-size: 22px;
1414
line-height: 1;
1515
}
1616

custom/less/ui-navbar.less

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
}
55

66
.navbar-brand {
7-
padding-top: 19px;
8-
padding-bottom: 18px;
97
height: @navbar-height;
10-
font-size: 24px;
11-
color: @text-color;
8+
font-size: 20px;
9+
color: @brand-primary;
1210

1311
&:hover,
1412
&:focus {
@@ -27,6 +25,26 @@
2725
}
2826

2927
.navbar-toggle {
30-
margin-top: 13px;
31-
margin-bottom: 13px;
28+
/*margin-top: 13px;
29+
margin-bottom: 13px;*/
30+
border:0;
31+
}
32+
33+
.navbar-default {
34+
.navbar-toggle {
35+
&:hover,
36+
&:focus {
37+
background-color: transparent;
38+
border-color: @brand-primary;
39+
40+
.icon-bar {
41+
background-color: @brand-primary;
42+
}
43+
44+
}
45+
46+
.icon-bar {
47+
width: 18px;
48+
}
49+
}
3250
}

templates/include/common-footer.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@
3131

3232
<script src="https://download.leancloud.cn/sdk/latest.js"></script>
3333

34-
35-
36-
{% if basename!='index' and basename!='sdk_down' and basename !='demo' and basename !='start' and basename != 'weapp-domains' %}
34+
{% if basename !='index' and basename!='sdk_down' and basename !='demo' and basename !='start' and basename != 'weapp-domains' and basename != 'opencourse' %}
3735
<script src="custom/js/lib/contents.js"></script>
3836
<script src="custom/js/md.js"></script>
3937
{% endif %}

templates/include/footer.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<footer class="footer" role="contentinfo">
22
<div class="container-fluid">
3-
<a href="http://leancloud.cn/" class="logo font-logo pull-left">
3+
<!-- <a href="http://leancloud.cn/" class="logo font-logo pull-left">
44
LeanCloud
5-
</a>
5+
</a> -->
66

77
<ul class="footer-links pull-right">
88
<li class="muted">·</li>

templates/include/header.html

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
11
<nav class="dashboard-subnav navbar navbar-default navbar-static-top" role="navigation">
22
<div class="container-fluid">
3-
<div class="navbar-collapse" id="app-options">
4-
<ul class="nav navbar-nav navbar-app-select">
3+
<div class="navbar-header">
4+
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#app-options" aria-expanded="false">
5+
<span class="sr-only">Toggle navigation</span>
6+
<span class="icon-bar"></span>
7+
<span class="icon-bar"></span>
8+
<span class="icon-bar"></span>
9+
</button>
10+
<a href="/" class="navbar-brand nav-logo font-logo" title="LeanCloud 官网">LeanCloud</a>
11+
</div>
12+
13+
<div class="collapse navbar-collapse" id="app-options">
14+
<!-- <ul class="nav navbar-nav navbar-app-select">
515
<li>
6-
<a href="/applist.html" class="nav-logo font-logo">L<span class="visible-xs-inline">eanCloud</span></a>
16+
<a href="/dashboard/applist.html" class="nav-logo font-logo" title="LeanCloud 控制台">LeanCloud</a>
717
</li>
8-
</ul>
18+
</ul> -->
919
<div class="navbar-app-actions-wrap">
1020
<ul class="nav navbar-nav navbar-app-actions">
21+
{% if basename != "index" %}
1122
<li class="dropdown dropdown-toggle-app-name">
1223
<a href="index.html">
1324
<i class="icon icon-dashbd-icon icon-home"></i>
1425
<div class="name">文档首页</div>
1526
</a>
1627
</li>
28+
{% endif %}
1729
<li class="dropdown dropdown-toggle-app-name">
1830
<a href="sdk_down.html" title="SDK 下载">
1931
<i class="icon icon-dashbd-icon icon-package"></i>
@@ -35,6 +47,14 @@
3547
{% include '_apidocs.html' %}
3648
</ul>
3749
</li>
50+
{% if basename != "index" && basename != "opencourse" %}
51+
<li class="dropdown dropdown-toggle-app-name">
52+
<a href="opencourse.html">
53+
<i class="icon icon-dashbd-icon icon-play"></i>
54+
<div class="name">公开课</div>
55+
</a>
56+
</li>
57+
{% endif %}
3858
<li class="dropdown dropdown-toggle-app-name">
3959
<a class="nav-key-6 dropdown-toggle" title="帮助" data-toggle="dropdown">
4060
<i class="icon icon-dashbd-icon icon-question"></i>
@@ -55,7 +75,7 @@
5575
</li>
5676
</ul>
5777
<!-- hide search input on the home page -->
58-
{% if isHome != true %}
78+
{% if basename != "index" %}
5979
<form role="search" action="/search.html" method="get">
6080
<div class="app-search">
6181
<input name="q" type="text" class="form-control" placeholder="搜索文档&hellip;">

templates/layouts/empty.swig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{body}}

0 commit comments

Comments
 (0)