diff --git a/src/Gadgets/Compatibility/SiteCommonJS/SiteCommon.js b/src/Gadgets/Compatibility/SiteCommonJS/SiteCommon.js index 480bb7f..99c3e9a 100644 --- a/src/Gadgets/Compatibility/SiteCommonJS/SiteCommon.js +++ b/src/Gadgets/Compatibility/SiteCommonJS/SiteCommon.js @@ -318,3 +318,16 @@ $(function deprecatedFunctions() { */ }); /* */ + +/*右上角显示头像*/ +$(function () { + var loadingImage = "https://youshou.wiki/load.php?modules=skins.citizen.icons.wmui&image=userAvatar&format=original&skin=citizen&version=1qhza"; + var headeruser = mw.user.getName(); + var src = "https://youshou.wiki/extensions/Avatar/avatar.php?user=".concat(headeruser); + $('.mw-ui-icon-wikimedia-userAvatar').css({ + 'width':"75%", + 'height':"75%", + 'background-image':"url(" + src + ")", + 'background-size': "cover" + }); +}); diff --git a/src/others/Citizen.css b/src/others/Citizen.css index 6e6ebe4..059a431 100644 --- a/src/others/Citizen.css +++ b/src/others/Citizen.css @@ -217,4 +217,18 @@ header.mw-body-header{ } } +/* 右上角头像 */ +.mw-ui-icon-wikimedia-userAvatar:before { + background-image: none; +} + +.client-darkmode .mw-ui-icon-wikimedia-userAvatar { + -webkit-filter:invert(1) hue-rotate(180deg); + filter: invert(1) hue-rotate(180deg); +} + +.mw-ui-icon-wikimedia-userAvatar { + border-radius: 5px; +} + /* */