Skip to content

Commit

Permalink
Show profile link icon on left side
Browse files Browse the repository at this point in the history
  • Loading branch information
tfedor committed Sep 14, 2019
1 parent 03a8662 commit 2d0d63d
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 66 deletions.
16 changes: 8 additions & 8 deletions css/enhancedsteam-chrome.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,29 +64,29 @@
background-image: url("chrome-extension://__MSG_@@extension_id__/img/itad.png");
}

.es_sites_icons.es_steamrepcn_icon:after {
.es_sites_icons.es_steamrepcn_icon:before {
background-image: url("chrome-extension://__MSG_@@extension_id__/img/ico/srcn.png");
}
.es_sites_icons.es_steamrep_icon:after {
.es_sites_icons.es_steamrep_icon:before {
background-image: url("chrome-extension://__MSG_@@extension_id__/img/ico/steamrep.png");
background-color: rgb(235, 235, 235);
}
.es_sites_icons.es_steamdbcalc_icon:after {
.es_sites_icons.es_steamdbcalc_icon:before {
background-image: url("chrome-extension://__MSG_@@extension_id__/img/ico/steamdb.png");
}
.es_sites_icons.es_steamgifts_icon:after {
.es_sites_icons.es_steamgifts_icon:before {
background-image: url("chrome-extension://__MSG_@@extension_id__/img/ico/steamgifts.png");
}
.es_sites_icons.es_steamtrades_icon:after {
.es_sites_icons.es_steamtrades_icon:before {
background-image: url("chrome-extension://__MSG_@@extension_id__/img/ico/steamtrades.png");
}
.es_sites_icons.es_astats_icon:after {
.es_sites_icons.es_astats_icon:before {
background-image: url("chrome-extension://__MSG_@@extension_id__/img/ico/achievementstats.png");
}
.es_sites_icons.es_backpacktf_icon:after {
.es_sites_icons.es_backpacktf_icon:before {
background-image: url("chrome-extension://__MSG_@@extension_id__/img/ico/backpacktf.png");
}
.es_sites_icons.es_astatsnl_icon:after {
.es_sites_icons.es_astatsnl_icon:before {
background-image: url("chrome-extension://__MSG_@@extension_id__/img/ico/astatsnl.png");
}

Expand Down
16 changes: 8 additions & 8 deletions css/enhancedsteam-firefox.css
Original file line number Diff line number Diff line change
Expand Up @@ -68,28 +68,28 @@
background-image: url("moz-extension://__MSG_@@extension_id__/img/itad.png");
}

.es_sites_icons.es_steamrepcn_icon:after {
.es_sites_icons.es_steamrepcn_icon:before {
background-image: url("moz-extension://__MSG_@@extension_id__/img/ico/srcn.png");
}
.es_sites_icons.es_steamrep_icon:after {
.es_sites_icons.es_steamrep_icon:before {
background-image: url("moz-extension://__MSG_@@extension_id__/img/ico/steamrep.png");
}
.es_sites_icons.es_steamdbcalc_icon:after {
.es_sites_icons.es_steamdbcalc_icon:before {
background-image: url("moz-extension://__MSG_@@extension_id__/img/ico/steamdb.png");
}
.es_sites_icons.es_steamgifts_icon:after {
.es_sites_icons.es_steamgifts_icon:before {
background-image: url("moz-extension://__MSG_@@extension_id__/img/ico/steamgifts.png");
}
.es_sites_icons.es_steamtrades_icon:after {
.es_sites_icons.es_steamtrades_icon:before {
background-image: url("moz-extension://__MSG_@@extension_id__/img/ico/steamtrades.png");
}
.es_sites_icons.es_astats_icon:after {
.es_sites_icons.es_astats_icon:before {
background-image: url("moz-extension://__MSG_@@extension_id__/img/ico/achievementstats.png");
}
.es_sites_icons.es_backpacktf_icon:after {
.es_sites_icons.es_backpacktf_icon:before {
background-image: url("moz-extension://__MSG_@@extension_id__/img/ico/backpacktf.png");
}
.es_sites_icons.es_astatsnl_icon:after {
.es_sites_icons.es_astatsnl_icon:before {
background-image: url("moz-extension://__MSG_@@extension_id__/img/ico/astatsnl.png");
}

Expand Down
16 changes: 4 additions & 12 deletions css/enhancedsteam.css
Original file line number Diff line number Diff line change
Expand Up @@ -2250,14 +2250,6 @@ input[type=checkbox].es_dlc_selection:checked + label {
color: #ffffff;
}

.es_profile_link a {
display: inline-block;
margin-top: 10px;
}
.es_profile_link:first-child a {
margin-top: 0;
}

/***************************************
* Users profiles
* add_community_profile_links()
Expand Down Expand Up @@ -2810,12 +2802,13 @@ input[type=checkbox].es_dlc_selection:checked + label {
display: inline-flex;
align-items: center;
}
.es_sites_icons:not(.es_none):after, .es_sites_custom_icon {

.es_sites_icons:not(.es_none):before, .es_sites_custom_icon {
content: "";
display: inline-block;
width: 16px;
height: 16px;
margin: 0 4px;
margin: 0 5px 0 0;
background-color: #222222;
background-repeat: no-repeat;
background-size: 16px !important;
Expand All @@ -2826,11 +2819,10 @@ input[type=checkbox].es_dlc_selection:checked + label {
0 0 0 1px rgba(193, 193, 193, 0.17);
vertical-align: top;
}
.es_sites_icons.es_gray:after, .es_sites_icons .es_gray {
.es_sites_icons.es_gray:before, .es_sites_icons .es_gray {
filter: grayscale(100%);
}


/**
* Flags
*/
Expand Down
72 changes: 34 additions & 38 deletions js/content/community.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,23 @@ let CommunityCommon = (function() {
}
};

self.makeProfileLink = function (id, link, name, iconType, iconUrl) {
let mainType = iconUrl ? "none" : iconType;
let result =
`<div class="es_profile_link profile_count_link">
<a class="es_sites_icons es_${id}_icon es_${mainType}" href="${link}" target="_blank">`;

if (iconType !== "none" && iconUrl) {
result += `<i class="es_sites_custom_icon es_${iconType}" style="background-image: url('${iconUrl}');"></i>`;
}

result += `<span class="count_link_label">${name}</span>
<span class="profile_count_link_total">&nbsp;</span> <!-- Steam spacing -->
</a>
</div>`;
return result;
}

return self;
})();

Expand Down Expand Up @@ -481,37 +498,37 @@ let ProfileHomePageClass = (function(){
let links = [
{
"id": "steamrep",
"link": `//steamrep.com/profiles/${steamId}`,
"link": `https://steamrep.com/profiles/${steamId}`,
"name": "SteamRep",
},
{
"id": "steamdbcalc",
"link": `//steamdb.info/calculator/?player=${steamId}`,
"link": `https://steamdb.info/calculator/?player=${steamId}`,
"name": "SteamDB",
},
{
"id": "steamgifts",
"link": `//www.steamgifts.com/go/user/${steamId}`,
"link": `https://www.steamgifts.com/go/user/${steamId}`,
"name": "SteamGifts",
},
{
"id": "steamtrades",
"link": `//www.steamtrades.com/user/${steamId}`,
"link": `https://www.steamtrades.com/user/${steamId}`,
"name": "SteamTrades",
},
{
"id": "astats",
"link": `//www.achievementstats.com/index.php?action=profile&playerId=${steamId}`,
"link": `https://www.achievementstats.com/index.php?action=profile&playerId=${steamId}`,
"name": "Achievement Stats",
},
{
"id": "backpacktf",
"link": `//backpack.tf/profiles/${steamId}`,
"link": `https://backpack.tf/profiles/${steamId}`,
"name": "Backpack.tf",
},
{
"id": "astatsnl",
"link": `//astats.astats.nl/astats/User_Info.php?steamID64=${steamId}`,
"link": `https://astats.astats.nl/astats/User_Info.php?steamID64=${steamId}`,
"name": "AStats.nl",
}
];
Expand All @@ -529,17 +546,10 @@ let ProfileHomePageClass = (function(){
// Build the links HTML
let htmlstr = "";

links.forEach(link => {
if (!SyncedStorage.get("profile_" + link.id)) { return; }

htmlstr +=
`<div class="es_profile_link profile_count_link">
<a class="es_sites_icons es_${link.id}_icon es_${iconType}" href="${link.link}" target="_blank">
<span class="count_link_label">${link.name}</span>
</a>
</div>`;

});
for (let link of links) {
if (!SyncedStorage.get("profile_" + link.id)) { continue; }
htmlstr += CommunityCommon.makeProfileLink(link.id, link.link, link.name, iconType);
}

// custom profile link
for (let customLink of SyncedStorage.get('profile_custom_link')) {
Expand All @@ -561,15 +571,7 @@ let ProfileHomePageClass = (function(){
iconType = "none";
}

htmlstr +=
`<div class="es_profile_link profile_count_link">
<a class="es_sites_icons es_none es_custom_icon" href="${link}" target="_blank">
<span class="count_link_label">${name}</span>`;
if (iconType !== "none") {
htmlstr += `<i class="es_sites_custom_icon es_${iconType}" style="background-image: url(${icon});"></i>`;
}
htmlstr += `</a>
</div>`;
htmlstr += CommunityCommon.makeProfileLink("custom", link, name, iconType, icon);
}

// profile permalink
Expand Down Expand Up @@ -1026,7 +1028,7 @@ let GroupHomePageClass = (function(){
let links = [
{
"id": "steamgifts",
"link": `//www.steamgifts.com/go/group/${groupId}`,
"link": `https://www.steamgifts.com/go/group/${groupId}`,
"name": "SteamGifts",
}
];
Expand All @@ -1035,16 +1037,10 @@ let GroupHomePageClass = (function(){
// Build the links HTML
let htmlstr = "";

links.forEach(link => {
if (!SyncedStorage.get("group_" + link.id)) { return; }
htmlstr +=
`<div class="es_profile_link profile_count_link weblink">
<a class="es_sites_icons es_${link.id}_icon es_${iconType}" href="${link.link}" target="_blank">
<span class="count_link_label">${link.name}</span>
</a>
</div>`;

});
for (let link of links) {
if (!SyncedStorage.get("group_" + link.id)) { continue; }
htmlstr += CommunityCommon.makeProfileLink(link.id, link.link, link.name, iconType);
}

// Insert the links HMTL into the page
if (htmlstr) {
Expand Down

0 comments on commit 2d0d63d

Please sign in to comment.