User:Canadabonk/common.js: Difference between revisions
Content deleted Content added
Canadabonk (talk | contribs) No edit summary |
Canadabonk (talk | contribs) No edit summary |
||
(3 intermediate revisions by the same user not shown) | |||
Line 2:
canada's cosmostweaks
last updated:
refer to [[CosmosTweaks]] on dev.miraheze.org
Line 180:
});
}// end banner navigation ------------------------------------------------------------------------------------------------------
// back to top button▼
if (enableBackToTop) {▼
$('#mw-content-container').append('<div class="ct-top"><div class="ct-top-arrow"></div></div>');▼
const backToTop = $('.ct-top');▼
backToTop.attr('title', 'Back to top');▼
backToTop.click(function(){▼
});▼
backToTop.hide().css({▼
'opacity': '0',▼
'transform': 'translateY(100%)'▼
});▼
$(window).scroll(function(){▼
if (window.scrollY > 200) {▼
backToTop.show().css({▼
'opacity': 'unset',▼
'transform': 'unset'▼
});▼
backToTop.css({▼
'opacity': '0',▼
'transform': 'translateY(100%)'▼
});▼
backToTop.hide("slow");▼
}▼
});▼
} // end back to top------------------------------------------------------------------------------------------------------▼
if (enableHideRail) {
Line 232 ⟶ 201:
toolbar.append('<li id="ct-toolbar-pagetools" class="toolbar-dropup">Page tools<ul></ul></li>');
if ($('
toolbar.find('#t-whatlinkshere, #t-recentchangeslinked, #t-print, #t-permalink, #t-info, #t-cite, #t-urlshortener, #t-createredirect').appendTo('#ct-toolbar-pagetools > ul');
toolbar.find('#t-contributions, #t-log, #t-emailuser, #t-mute, #t-userrights').appendTo('#ct-toolbar-usertools > ul');
▲
backToTop.click(function
▲ });
} else {
▲ 'opacity': '0',
▲ 'transform': 'translateY(100%)'
▲ });
}
});
} // end
▲ } //end desktop ------------------------------------------------------------------------------------------------------
// dark mode
Line 294 ⟶ 282:
}
}// end dark mode ------------------------------------------------------------------------------------------------------
if ($('.cosmos-mobile-navigation').length) {
$('.cosmos-mobile-menu-button').click(function(){
$('.wds-tabs').css('left', '0');
const $target = $(e.target);
if (!$target.closest('.cosmos-mobile-navigation').length && $('.wds-tabs').is(':visible')) {
$('.wds-tabs').css('left','').fadeout(200);
▲ }
}
function hideOnClickOutside(container, hiddenitem) {
|