Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

Commit

Permalink
New update
Browse files Browse the repository at this point in the history
  • Loading branch information
kuriv committed Mar 11, 2020
1 parent 54f68e5 commit f8ee9af
Show file tree
Hide file tree
Showing 62 changed files with 4,342 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.html linguist-language=javascript
*.css linguist-language=javascript
*.js linguist-language=javascript
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# manual-less
# Less

Less 是一种动态层叠样式表语言。
4 changes: 4 additions & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Summary

* [Less](README.md)

34 changes: 34 additions & 0 deletions book.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"root": "",
"structure": {
"readme": "README.md",
"summary": "SUMMARY.md"
},
"title": "Less",
"description": "Less 手册",
"author": "Kuriv Vesti",
"isbn": "",
"language": "zh-hans",
"direction": "ltr",
"gitbook": ">=3.0.0",
"plugins": [
"back-to-top-button", "chapter-fold", "favicon", "hide-element", "lightbox", "-highlight", "prism", "-lunr", "-search", "search-pro", "splitter"
],
"pluginsConfig": {
"favicon": {
"shortcut": "favicon.ico",
"bookmark": "favicon.ico",
"appleTouch": "favicon.png",
"appleTouchMore": {
"120x120": "favicon-120x120.png",
"180x180": "favicon-180x180.png"
}
},
"hide-element": {
"elements": [".gitbook-link"]
},
"prism": {
"css": ["prismjs/themes/prism-okaidia.css"]
}
}
}
3 changes: 3 additions & 0 deletions book/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.html linguist-language=javascript
*.css linguist-language=javascript
*.js linguist-language=javascript
1 change: 1 addition & 0 deletions book/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
21 changes: 21 additions & 0 deletions book/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 Kuriv Vesti

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Binary file added book/favicon-120x120.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added book/favicon-180x180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added book/favicon.ico
Binary file not shown.
Binary file added book/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added book/gitbook/fonts/fontawesome/FontAwesome.otf
Binary file not shown.
Binary file not shown.
685 changes: 685 additions & 0 deletions book/gitbook/fonts/fontawesome/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
55 changes: 55 additions & 0 deletions book/gitbook/gitbook-plugin-back-to-top-button/plugin.css
Original file line number Diff line number Diff line change
@@ -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;
}
}
25 changes: 25 additions & 0 deletions book/gitbook/gitbook-plugin-back-to-top-button/plugin.js
Original file line number Diff line number Diff line change
@@ -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;
});

});
29 changes: 29 additions & 0 deletions book/gitbook/gitbook-plugin-chapter-fold/chapter-fold.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.book .book-summary .chapter > .articles {
overflow: hidden;
max-height: 0px;
}

.book .book-summary .chapter.expanded > .articles {
max-height: 9999px;
}

.book .book-summary .exc-trigger {
position: absolute;
left: 12px;
top: 12px;
}

.book .book-summary ul.summary li a,
.book .book-summary ul.summary li span {
padding-left: 30px;
}

.book .book-summary .exc-trigger:before {
content: "\f105";
}

.book .book-summary .expanded > a .exc-trigger:before,
.book .book-summary .expanded > span .exc-trigger:before {
content: "\f107";
}

67 changes: 67 additions & 0 deletions book/gitbook/gitbook-plugin-chapter-fold/chapter-fold.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
require(['gitbook', 'jQuery'], function(gitbook, $) {
var TOGGLE_CLASSNAME = 'expanded',
CHAPTER = '.chapter',
ARTICLES = '.articles',
TRIGGER_TEMPLATE = '<i class="exc-trigger fa"></i>',
LS_NAMESPACE = 'expChapters';
var init = function () {
// adding the trigger element to each ARTICLES parent and binding the event
var chapterLink = $(ARTICLES).parent(CHAPTER).children('a');
chapterLink.append($(TRIGGER_TEMPLATE));
chapterLink.on('click', function (e) {
e.preventDefault();
//e.stopPropagation();
toggle($(e.target).closest(CHAPTER));
});

expand(lsItem());
//expand current selected chapter with it's parents
collapse($(CHAPTER));
var activeChapter = $(CHAPTER + '.active');
expand(activeChapter);
expand(activeChapter.parents(CHAPTER));
}
//on page.change will happend the function.

var toggle = function ($chapter) {
if ($chapter.hasClass('expanded')) {
collapse($chapter);
} else {
expand($chapter);
//$chapter.addClass('active').siblings().removeClass('active');
}
}
var collapse = function ($chapter) {
if ($chapter.length && $chapter.hasClass(TOGGLE_CLASSNAME)) {
$chapter.removeClass(TOGGLE_CLASSNAME);
lsItem($chapter);
}
}
var expand = function ($chapter) {
if ($chapter.length && !$chapter.hasClass(TOGGLE_CLASSNAME)) {
$chapter.addClass(TOGGLE_CLASSNAME);
lsItem($chapter);
}
}
var lsItem = function () {
var map = JSON.parse(localStorage.getItem(LS_NAMESPACE)) || {}
if (arguments.length) {
var $chapters = arguments[0];
$chapters.each(function (index, element) {
var level = $(this).data('level');
var value = $(this).hasClass(TOGGLE_CLASSNAME);
map[level] = value;
})
localStorage.setItem(LS_NAMESPACE, JSON.stringify(map));
} else {
return $(CHAPTER).map(function(index, element){
if (map[$(this).data('level')]) {
return this;
}
})
}
}
gitbook.events.bind('page.change', function() {
init()
});
});
Loading

0 comments on commit f8ee9af

Please sign in to comment.