注意:在保存之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。
?_=1
来访问最新页面。https://zh.moegirl.org.cn/User:AnnAngela/js/heimu-toggle.js?_=1
// <pre> mw.loader.implement('AnnToolsHeimuToggle', function($, jQuery) { $(function() { if (!$('.heimu')[0]) return; $('<div/>', { id: 'heimu_toggle', text: '半隐黑幕', css: { 'user-select': 'none' } }).appendTo(document.body).bind('click', function() { if ($('body.heimu_toggle_on')[0]) $(this).text('半隐黑幕'); else $(this).text('隐藏黑幕'); $(document.body).toggleClass('heimu_toggle_on'); }); $(document.body).append('<style>.heimu{transition:.37s all linear}#heimu_toggle{transition:.37s all ease-in-out;width:20px;padding:5px 0;background-color:#000;color:#fff;font-size:12px;text-align:center;position:fixed;right:0;cursor:pointer;opacity:.6;bottom:100px}body.heimu_toggle_on .heimu,body.heimu_toggle_on .heimu a,body.heimu_toggle_on a .heimu,body.heimu_toggle_on .heimu a.new{background-color:rgba(37,37,37,0.37)!important}body.heimu_toggle_on .heimu a,body.heimu_toggle_on a .heimu{color:#0645ad!important}body.heimu_toggle_on .heimu a.new{color:#ba0000!important}</style>'); if ($('.backToTop')[0]) $(window).bind('scroll', function() { $(document).scrollTop() > 0 ? $('#heimu_toggle').css('bottom', '193px') : $('#heimu_toggle').css('bottom', '100px'); }).scroll(); if (mw.config.exists('AnnToolsHeimuToggleDefaultOn')) mw.config.get('AnnToolsHeimuToggleDefaultOn')(); }); }); // </pre>