Skip to content
Draft
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
2 changes: 1 addition & 1 deletion skin.json
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@
{
"MatchRegexString": "https://steamcommunity\\.com(/.*)?",
"TargetCss": "src/css/custom/custom.css",
"TargetJs": "src/css/custom/custom.js"
"TargetJs": "src/js/webkit.js"
},
{
"MatchRegexString": ".ModalDialogPopup",
Expand Down
1 change: 1 addition & 0 deletions src/css/webkit.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

/*^ Profile */
@import url("./webkit/community/profile/awards.css");
@import url("./webkit/community/profile/friendsThatPlay.css");
@import url("./webkit/community/profile/user.css");

/*^ Workshop */
Expand Down
Empty file.
1 change: 1 addition & 0 deletions src/js/webkit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import './webkit/community/friendsThatPlayed.js';
52 changes: 52 additions & 0 deletions src/js/webkit/community/friendsThatPlayed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
function relocatePlaytime() {
const friendListContent = document.querySelector('.friends_that_play_content');
if (!friendListContent) return;

const firstFriendBlockSection = friendListContent.querySelector('.profile_friends.responsive_friendblocks');
if (!firstFriendBlockSection) return;

const myStatsBlock = firstFriendBlockSection.querySelector('.friendBlock.persona');
if (!myStatsBlock) return;

const mySmallText = myStatsBlock.querySelector('.friendSmallText');
if (!mySmallText) return;

const headerTextContainer = document.querySelector('.profile_small_header_text');
const locationArrow = document.querySelector('.profile_small_header_arrow');
const locationText = document.querySelector('.profile_small_header_location');

if (!headerTextContainer) return;

const clonedStats = mySmallText.cloneNode(true);

clonedStats.style.marginTop = '4px';
clonedStats.style.color = '#8e8e8e';
clonedStats.style.fontSize = '14px';
clonedStats.style.display = 'flex';
clonedStats.style.alignItems = 'center';
clonedStats.style.gap = '8px';

if (locationArrow) locationArrow.style.display = 'none';

if (locationText && locationText.parentElement) {
locationText.parentElement.style.display = 'none';
}

if (!headerTextContainer.querySelector('.friendSmallText')) {
headerTextContainer.appendChild(clonedStats);
}

const firstHeader = friendListContent.querySelector('.mainSectionHeader');
if (firstHeader && firstHeader.textContent.includes('Your own playtime')) {
firstHeader.style.display = 'none';
}
if (firstFriendBlockSection) {
firstFriendBlockSection.style.display = 'none';
}
}

if (document.readyState === 'loading') {
document.addEventListener("DOMContentLoaded", relocatePlaytime);
} else {
relocatePlaytime();
}