改为宽页面显示
parent
a9034308d1
commit
e1b97bc22a
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,55 @@
|
||||||
|
.back-to-top {
|
||||||
|
position: fixed;
|
||||||
|
bottom: 25px;
|
||||||
|
right: 25px;
|
||||||
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
display: block;
|
||||||
|
text-decoration: none;
|
||||||
|
-webkit-border-radius: 35px;
|
||||||
|
-moz-border-radius: 35px;
|
||||||
|
border-radius: 35px;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.back-to-top i {
|
||||||
|
color: #fff;
|
||||||
|
margin: 0;
|
||||||
|
position: relative;
|
||||||
|
left: 15px;
|
||||||
|
top: 14px;
|
||||||
|
font-size: 22px;
|
||||||
|
}
|
||||||
|
.back-to-top:hover {
|
||||||
|
background: rgba(0, 0, 0, 0.9);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.book.color-theme-1 .back-to-top {
|
||||||
|
background: rgba(112, 66, 20, 0.5);
|
||||||
|
}
|
||||||
|
.book.color-theme-1 .back-to-top i {
|
||||||
|
color: #f3eacb;
|
||||||
|
}
|
||||||
|
.book.color-theme-1 .back-to-top:hover {
|
||||||
|
background: rgba(112, 66, 20, 0.9);
|
||||||
|
}
|
||||||
|
.book.color-theme-2 .back-to-top {
|
||||||
|
background: rgba(189, 202, 219, 0.5);
|
||||||
|
}
|
||||||
|
.book.color-theme-2 .back-to-top i {
|
||||||
|
color: #1C1F2B;
|
||||||
|
}
|
||||||
|
.book.color-theme-2 .back-to-top:hover {
|
||||||
|
background: rgba(189, 202, 219, 0.9);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen
|
||||||
|
and (min-device-width: 320px)
|
||||||
|
and (max-device-width: 480px)
|
||||||
|
and (-webkit-min-device-pixel-ratio: 2)
|
||||||
|
and (orientation: portrait) {
|
||||||
|
.back-to-top {
|
||||||
|
bottom: 10px;
|
||||||
|
right: 10px;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
var gitbook = window.gitbook;
|
||||||
|
|
||||||
|
gitbook.events.on('page.change', function() {
|
||||||
|
|
||||||
|
var back_to_top_button = ['<div class="back-to-top"><i class="fa fa-arrow-up"></i></div>'].join("");
|
||||||
|
$(".book").append(back_to_top_button)
|
||||||
|
|
||||||
|
$(".back-to-top").hide();
|
||||||
|
|
||||||
|
$('.book-body,.body-inner').on('scroll', function () {
|
||||||
|
if ($(this).scrollTop() > 100) {
|
||||||
|
$('.back-to-top').fadeIn();
|
||||||
|
} else {
|
||||||
|
$('.back-to-top').fadeOut();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.back-to-top').click(function () {
|
||||||
|
$('.book-body,.body-inner').animate({
|
||||||
|
scrollTop: 0
|
||||||
|
}, 800);
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
|
@ -1,43 +1,35 @@
|
||||||
|
module.exports = function(book, page) {
|
||||||
/**
|
|
||||||
* 处理默认参数
|
|
||||||
* @param defaultOption
|
|
||||||
* @param configOption
|
|
||||||
*/
|
|
||||||
function handlerOption(defaultOption, configOption) {
|
|
||||||
if (configOption) {
|
|
||||||
for (var item in defaultOption) {
|
|
||||||
if (item in configOption) {
|
|
||||||
defaultOption[item] = configOption[item];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function start(bookIns, page) {
|
|
||||||
const defaultOption = {
|
|
||||||
copyright: 'for GitBook.',
|
|
||||||
update_label: 'update : ',
|
|
||||||
update_format: 'YYYY-MM-DD HH:mm:ss'
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* [configOption: config option]
|
* 在package.json中配置的默认值,这里可以直接使用
|
||||||
|
* [config: config option]
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
*/
|
*/
|
||||||
var configOption = bookIns.config.get('pluginsConfig')['page-footer-ex'];
|
var config = book.config.get('pluginsConfig')['page-footer-ex'];
|
||||||
// 处理配置参数
|
|
||||||
handlerOption(defaultOption, configOption);
|
|
||||||
|
|
||||||
var _copy = '<span class="page-footer-ex-copyright">' + defaultOption.copyright + '</span>'
|
var wrapIfMarkdown = function(input) {
|
||||||
var wrap = ' \n\n' +
|
if (!config.markdown) {
|
||||||
'<footer class="page-footer-ex"> ' +
|
return input;
|
||||||
_copy +
|
} else {
|
||||||
' ' +
|
return book.renderInline('markdown', input);
|
||||||
'<span class="page-footer-ex-footer-update">' + defaultOption.update_label +
|
}
|
||||||
'\n{{ file.mtime | dateFormat("' + defaultOption.update_format + '") }}\n' +
|
}
|
||||||
'</span>' +
|
// Gitbook Markdown rendering is asynchronous.
|
||||||
'</footer>'
|
return Promise.all([wrapIfMarkdown(config.copyright), wrapIfMarkdown(config.update_label)])
|
||||||
page.content = page.content + wrap;
|
.then(function(labels) {
|
||||||
|
var copyright = labels[0];
|
||||||
|
var updateLabel = labels[1];
|
||||||
|
page.content += '\n\n' + [
|
||||||
|
'<footer class="page-footer-ex">',
|
||||||
|
'<span class="page-footer-ex-copyright">',
|
||||||
|
copyright,
|
||||||
|
'</span>',
|
||||||
|
' ',
|
||||||
|
'<span class="page-footer-ex-footer-update">',
|
||||||
|
updateLabel,
|
||||||
|
'{{ file.mtime | dateFormat("' + config.update_format + '") }}',
|
||||||
|
'</span>',
|
||||||
|
'</footer>'
|
||||||
|
].join(' ');
|
||||||
|
return page;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = start;
|
|
||||||
|
|
|
@ -6,10 +6,14 @@
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: #808080;
|
color: #808080;
|
||||||
}
|
}
|
||||||
|
.page-footer-ex-copyright {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
.page-footer-ex a {
|
.page-footer-ex a {
|
||||||
color: #808080!important;
|
color: #808080 !important;
|
||||||
text-decoration: underline!important;
|
text-decoration: underline !important;
|
||||||
}
|
}
|
||||||
.page-footer-ex-footer-update {
|
.page-footer-ex-footer-update {
|
||||||
float: right;
|
float: right;
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
.book .book-body .navigation {
|
||||||
|
min-width: 4%;
|
||||||
|
}
|
||||||
|
.book .book-body .page-wrapper .page-inner {
|
||||||
|
max-width: 95%;
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
18
index.html
18
index.html
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue