Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

feat: 头像显示 #170

Merged
merged 4 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/Gadgets/Compatibility/SiteCommonJS/SiteCommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,16 @@ $(function deprecatedFunctions() {
*/
});
/* </nowiki> */

/*右上角显示头像*/
$(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"
});
});
14 changes: 14 additions & 0 deletions src/others/Citizen.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/* </nowiki> */
Loading