This repository has been archived on 2026-01-04. You can view files and clone it, but cannot push or open issues or pull requests.
polyplus/js/membership-themes.js
Index 6a42004dba disable best friends feature & improvements
- disabled best friends feature

- improved load asset by ID in avatar sandbox (originally was quickly added cause I was bored, now it actually works with different asset types and stuff)

- add work in progress "automatic ad bidding" feature modal

- fixed apply membership themes with nested setting objects

- fixed try-on items feature defaulting to giving the preview avatar shirt and pants even if the user's avatar didn't have them

- fixed "download place file" because site no longer uses csrf tokens
2024-06-08 21:21:33 -05:00

55 lines
2.1 KiB
JavaScript
Executable file

chrome.storage.sync.get(['PolyPlus_Settings'], function (result) {
Settings = result.PolyPlus_Settings || {
ApplyMembershipTheme: {
Enabled: false,
Theme: 0
},
ApplyMembershipThemeOn: false,
ApplyMembershipThemeTheme: 0
};
if (Settings.ApplyMembershipTheme.Enabled !== true) {
return;
}
MembershipTheme = Settings.ApplyMembershipTheme.Theme === 0 ? 'plus' : 'plusdx';
document.addEventListener('DOMContentLoaded', function () {
if (document.getElementsByClassName('card-header')[0] && document.getElementsByClassName('card-header')[0].innerText === ' Page not found') {
return;
}
if (document.getElementsByTagName('NAV')[0].classList.contains('navbar-plus') === true || document.getElementsByTagName('NAV')[0].classList.contains('navbar-plusdx') === true) {
return;
}
const Navbar = document.querySelector('.navbar.navbar-expand-lg.navbar-light.bg-navbar.nav-topbar');
const Sidebar = document.querySelector('.d-flex.flex-column.flex-shrink-0.bg-sidebar.nav-sidebar');
Navbar.classList.add('navbar-' + MembershipTheme);
Sidebar.classList.add('sidebar-' + MembershipTheme);
let SidebarLogo = Sidebar.getElementsByTagName('img')[0];
if (MembershipTheme === 'plus') {
SidebarLogo.src = 'https://c0.ptacdn.com/static/images/branding/icon-plus.8f6e41f1.svg'
} else {
SidebarLogo.src = 'https://c0.ptacdn.com/static/images/branding/icon-plusdx.bd9daa92.svg'
}
let SidebarLogoLabel = document.createElement('div');
SidebarLogoLabel.classList = 'n' + MembershipTheme + '-banner';
SidebarLogoLabel.innerHTML = `
<i class="pi pi-${MembershipTheme}" style="margin-right:-0.4em"></i>
`;
SidebarLogo.parentElement.appendChild(SidebarLogoLabel);
if (MembershipTheme === 'plusdx' && window.location.pathname === '/home') {
let HomeUsernameText = document.getElementsByClassName('home-title2')[0];
HomeUsernameText.classList.add('text-plusdx');
let Label = document.createElement('div');
Label.classList = 'hplusdx-banner reqFadeAnim rounded-2';
Label.setAttribute('style', 'margin-top:-8px');
Label.innerText = 'Deluxe';
HomeUsernameText.parentElement.appendChild(Label);
}
});
});