📝 add new skin

This commit is contained in:
Van 2018-09-02 22:34:31 +08:00
parent a89f2a42b4
commit f9607e2c43
No known key found for this signature in database
GPG Key ID: 7059B8783A78F16C
5 changed files with 18 additions and 14 deletions

View File

@ -23,6 +23,9 @@
## 皮肤
* [nijigen](https://github.com/b3log/solo-skins/tree/master/nijigen)
![nijigen](https://solo.b3log.org/images/themes/nijigen.jpg)
* [Medium](https://github.com/b3log/solo-skins/tree/master/Medium)
![Medium](https://solo.b3log.org/images/themes/medium.png)

File diff suppressed because one or more lines are too long

View File

@ -60,20 +60,21 @@ var Skin = {
window.imageIntersectionObserver.observe(this)
})
} else {
window.imageIntersectionObserver = new IntersectionObserver((entries) => {
entries.forEach((entrie) => {
if (typeof entrie.isIntersecting === 'undefined'
? entrie.intersectionRatio !== 0 : entrie.isIntersecting) {
$(entrie.target).addClass('item--active')
} else {
if ($(entrie.target).closest('.side').length === 1 ||
$(entrie.target).closest('.article-list').hasClass('content')) {
return
window.imageIntersectionObserver = new IntersectionObserver(
function (entries) {
entries.forEach(function (entrie) {
if (typeof entrie.isIntersecting === 'undefined'
? entrie.intersectionRatio !== 0 : entrie.isIntersecting) {
$(entrie.target).addClass('item--active')
} else {
if ($(entrie.target).closest('.side').length === 1 ||
$(entrie.target).closest('.article-list').hasClass('content')) {
return
}
$(entrie.target).removeClass('item--active')
}
$(entrie.target).removeClass('item--active')
}
})
})
})
$('.item').each(function () {
window.imageIntersectionObserver.observe(this)
})

View File

@ -15,4 +15,4 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
var Skin={_initCommon:function(i){$("body").on("click",".content-reset img",function(){window.open(this.src)});var t=$("header .banner"),n=$("header .navbar");$(window).scroll(function(){if($(window).scrollTop()>125?i.show():i.hide(),$(window).width()<701)return!1;$(window).scrollTop()>t.height()?(n.addClass("pin"),$(".main-wrap").parent().css("margin-top","86px")):(n.removeClass("pin"),$(".main-wrap").parent().css("margin-top","0"))})},init:function(){this._initCommon($(".icon-up")),$(".navbar nav a").each(function(){this.href===location.href&&(this.className="current")}),$(".responsive .list a").each(function(){this.href===location.href&&$(this).parent().addClass("current")}),$(".responsive .icon-list").click(function(){$(".responsive .list").slideToggle()})},_initArticleCommon:function(i,t){if($(".b3-solo-list li").length>0&&$(window).width()>1e3){$("aside").addClass("has-toc");var n='<ul class="fn-clear"><li class="current" data-tab="toc">'+i+'</li><li data-tab="site">'+t+"</li></ul><section></section>";$("aside").prepend(n);var o=$("aside section:first").html($(".b3-solo-list")),s=$("aside section:last");o.height($(window).height()-154).css({overflow:"auto",width:$("aside").width()+"px"}),s.hide(),$("aside > ul > li").click(function(){"toc"===$(this).data("tab")?s.animate({opacity:"0",top:"-50px"},300,function(){o.show().css("top","-50px"),o.animate({opacity:"1",top:"0"},300).show()}):o.animate({opacity:"0",top:"-50px"},300,function(){o.hide().css("top","-50px"),s.animate({opacity:"1",top:"0"},300).show()}).hide(),$("aside > ul > li").removeClass("current"),$(this).addClass("current")}),$(window).scroll(function(){$(window).scrollTop()>125?$("aside section:eq(0)").css({position:"fixed",top:"51px",backgroundColor:"#fff"}):$("aside section:eq(0)").css({position:"inherit",borderLeft:0})})}},initArticle:function(i,t){this._initArticleCommon(i,t)}};Skin.init();
var Skin={_initCommon:function(e){$(window).scroll(function(){$(window).scrollTop()>125?e.show():e.hide()})},init:function(){if($("body").on("click",".content-reset img",function(){window.open(this.src)}),this._initCommon($(".icon__up")),$(".header__nav a, .header__m a").each(function(){this.href===location.href&&(this.className="current")}),!("IntersectionObserver"in window))return $(".item").addClass("item--active"),!1;window.imageIntersectionObserver?(window.imageIntersectionObserver.disconnect(),$(".item").each(function(){window.imageIntersectionObserver.observe(this)})):(window.imageIntersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){if(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)$(e.target).addClass("item--active");else{if(1===$(e.target).closest(".side").length||$(e.target).closest(".article-list").hasClass("content"))return;$(e.target).removeClass("item--active")}})}),$(".item").each(function(){window.imageIntersectionObserver.observe(this)}))},_initArticleCommon:function(){$(".b3-solo-list li").length>0&&$(window).width()>1e3&&($(".side").prepend('<div class="module"><div class="module__list"></div></div>'),$(".side .module:eq(0) .module__list").html($(".b3-solo-list")))},initArticle:function(){this._initArticleCommon(),setTimeout(function(){0===$("#externalRelevantArticlesWrap li").length&&($("#externalRelevantArticlesWrap").next().remove(),$("#externalRelevantArticlesWrap").remove()),0===$("#relevantArticlesWrap li").length&&($("#relevantArticlesWrap").prev().remove(),$("#relevantArticlesWrap").remove()),0===$("#randomArticlesWrap li").length&&($("#randomArticlesWrap").prev().remove(),$("#randomArticlesWrap").remove())},1e3)}};Skin.init();

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 84 KiB