diff --git a/html/changelog.html b/html/changelog.html
index 5aa4260..fe9b89e 100644
--- a/html/changelog.html
+++ b/html/changelog.html
@@ -6,6 +6,7 @@
- FEATURE: Both Acid and Amber Fade skins now display a fade badge, similar to CSFloat's Fade skins. This badge displays both the fade percentage as well as their ranking from 1 to 500 best/worst fade. For more details, refer to chescos's csgo-fade-percentage-calculator on Github.
+ - FEATURE: All sites now offer the option to change the Buff difference colors. The profit, loss and neutral colors can all be adjusted individually for each site. If you dislike your changed color, there is an additional "reset"-button to get back to the default colors. Thanks to @bycop for contributing this amazing addition.
- BUG-FIX: Fixed a bug where the newly introduced "Buff Pattern"-tab made it impossible to switch back to the table or graph.
diff --git a/src/@typings/ExtensionTypes.d.ts b/src/@typings/ExtensionTypes.d.ts
index ad5745e..fd148f2 100644
--- a/src/@typings/ExtensionTypes.d.ts
+++ b/src/@typings/ExtensionTypes.d.ts
@@ -32,20 +32,20 @@ export namespace Extension {
skbBuffDifference: boolean;
skbListingAge: boolean;
skbStickerPrices: boolean;
- colors: IColorsSites
+ colors: IColorsSites;
};
export type IColors = {
profit: string;
loss: string;
neutral: string;
- }
+ };
export type IColorsSites = {
csfloat: IColors;
skinport: IColors;
skinbid: IColors;
- }
+ };
export type CSGOTraderMapping = {
[name: string]: {
@@ -129,7 +129,7 @@ export namespace BlueGem {
}
export interface FadePercentage {
- seed: number,
- percentage: number,
- ranking: number,
-}
\ No newline at end of file
+ seed: number;
+ percentage: number;
+ ranking: number;
+}
diff --git a/src/background.ts b/src/background.ts
index f5000df..2f05d91 100644
--- a/src/background.ts
+++ b/src/background.ts
@@ -35,21 +35,21 @@ export const defaultSettings: Extension.Settings = {
skbStickerPrices: true,
colors: {
csfloat: {
- profit: "#008000",
- loss: "#ce0000",
- neutral: "#708090"
+ profit: '#008000',
+ loss: '#ce0000',
+ neutral: '#708090',
},
skinport: {
- profit: "#008000",
- loss: "#ce0000",
- neutral: "#000000"
+ profit: '#008000',
+ loss: '#ce0000',
+ neutral: '#000000',
},
skinbid: {
- profit: "#0cb083",
- loss: "#ce0000",
- neutral: "#FFFFFF"
- }
- }
+ profit: '#0cb083',
+ loss: '#ce0000',
+ neutral: '#FFFFFF',
+ },
+ },
};
// Check whether new version is installed
diff --git a/src/csfloat/content_script.ts b/src/csfloat/content_script.ts
index d054633..9f18f27 100644
--- a/src/csfloat/content_script.ts
+++ b/src/csfloat/content_script.ts
@@ -661,11 +661,11 @@ async function addFadePercentages(container: Element, item: CSFloat.ListingData)
const paintSeed = item.item.paint_seed;
if (!itemName.includes('Fade')) return;
const weapon = itemName.split(' | ')[0];
- let fadePercentage: FadePercentage & {background: string} | null = null;
+ let fadePercentage: (FadePercentage & { background: string }) | null = null;
if (itemName.includes('Amber Fade')) {
- fadePercentage = {...AmberFadeCalculator.getFadePercentage(weapon, paintSeed), background: 'linear-gradient(to right,#627d66,#896944,#3b2814)'};
+ fadePercentage = { ...AmberFadeCalculator.getFadePercentage(weapon, paintSeed), background: 'linear-gradient(to right,#627d66,#896944,#3b2814)' };
} else if (itemName.includes('Acid Fade')) {
- fadePercentage = {...AcidFadeCalculator.getFadePercentage(weapon, paintSeed), background: 'linear-gradient(to right,#6d5f55,#76c788, #574828)'};
+ fadePercentage = { ...AcidFadeCalculator.getFadePercentage(weapon, paintSeed), background: 'linear-gradient(to right,#6d5f55,#76c788, #574828)' };
}
if (fadePercentage != null) {
let fadeTooltip = document.createElement('div');
@@ -818,7 +818,6 @@ async function caseHardenedDetection(container: Element, listing: CSFloat.Listin
runtimePublicURL + '/arrow-up-right-from-square-solid.svg'
}" style="height: 18px; filter: brightness(0) saturate(100%) invert(100%) sepia(0%) saturate(7461%) hue-rotate(14deg) brightness(94%) contrast(106%);">${tableBody}`;
-
// has to be the first child as they are associated with the tab change listeners
const historyComponent = gridHistory?.querySelector('.history-component')?.firstElementChild;
if (historyComponent) {
diff --git a/src/popup.ts b/src/popup.ts
index f86e174..e8764b4 100644
--- a/src/popup.ts
+++ b/src/popup.ts
@@ -65,15 +65,14 @@ function addListeners() {
if (data.colors && data.colors[site]) {
data.colors[site][color] = $(this).val();
chrome.storage.local.set({
- colors: data.colors
+ colors: data.colors,
});
- }
- else {
+ } else {
chrome.storage.local.set({
colors: {
[site]: {
- [color]: $(this).val()
- }
+ [color]: $(this).val(),
+ },
},
});
}
@@ -103,7 +102,7 @@ function addListeners() {
$('#InputProfitColor').val(defaultColors[attrSite].profit);
$('#InputLossColor').val(defaultColors[attrSite].loss);
$('#InputNeutralColor').val(defaultColors[attrSite].neutral);
-
+
$('.SideBar').css('height', '528px');
$('.MainContent').css('height', '528px');
$('.Warning').show(100);
diff --git a/src/skinbid/content_script.ts b/src/skinbid/content_script.ts
index 137d78f..3573c0d 100644
--- a/src/skinbid/content_script.ts
+++ b/src/skinbid/content_script.ts
@@ -298,7 +298,8 @@ async function addBuffPrice(item: Skinbid.HTMLItem, container: Element, selector
discountContainer = discountSpan;
}
discountContainer.className += ' betterfloat-sale-tag';
- discountContainer.style.color = difference == 0 ? extensionSettings.colors.skinbid.neutral : difference < 0 ? extensionSettings.colors.skinbid.profit : extensionSettings.colors.skinbid.loss;
+ discountContainer.style.color =
+ difference == 0 ? extensionSettings.colors.skinbid.neutral : difference < 0 ? extensionSettings.colors.skinbid.profit : extensionSettings.colors.skinbid.loss;
discountContainer.style.fontWeight = '400';
discountContainer.style.fontSize = '14px';
discountContainer.textContent = difference == 0 ? `-${currencySymbol}0` : (difference > 0 ? '+' : '-') + currencySymbol + Math.abs(difference).toFixed(2);
diff --git a/src/skinport/content_script.ts b/src/skinport/content_script.ts
index a39eb84..6aaa3f8 100644
--- a/src/skinport/content_script.ts
+++ b/src/skinport/content_script.ts
@@ -406,7 +406,9 @@ async function adjustItemPage(container: Element) {
const newContainer = document.createElement('div');
const saleTag = document.createElement('span');
newContainer.className = 'ItemPage-discount betterfloat-discount-container';
- newContainer.style.background = `linear-gradient(135deg,#0073d5,${difference == 0 ? extensionSettings.colors.skinport.neutral : difference < 0 ? extensionSettings.colors.skinport.profit : extensionSettings.colors.skinport.loss})`;
+ newContainer.style.background = `linear-gradient(135deg,#0073d5,${
+ difference == 0 ? extensionSettings.colors.skinport.neutral : difference < 0 ? extensionSettings.colors.skinport.profit : extensionSettings.colors.skinport.loss
+ })`;
newContainer.style.transform = 'skewX(-15deg)';
newContainer.style.borderRadius = '3px';
newContainer.style.paddingTop = '2px';
@@ -755,7 +757,9 @@ async function addBuffPrice(item: Skinport.Listing, container: Element) {
const saleTag = discountContainer.firstChild;
if (item.price !== 0 && !isNaN(item.price) && saleTag && tooltipLink && !discountContainer.querySelector('.betterfloat-sale-tag')) {
saleTag.className = 'sale-tag betterfloat-sale-tag';
- discountContainer.style.background = `linear-gradient(135deg,#0073d5,${difference == 0 ? extensionSettings.colors.skinport.neutral : difference < 0 ? extensionSettings.colors.skinport.profit : extensionSettings.colors.skinport.loss})`;
+ discountContainer.style.background = `linear-gradient(135deg,#0073d5,${
+ difference == 0 ? extensionSettings.colors.skinport.neutral : difference < 0 ? extensionSettings.colors.skinport.profit : extensionSettings.colors.skinport.loss
+ })`;
saleTag.textContent = difference == 0 ? `-${item.currency}0` : (difference > 0 ? '+' : '-') + item.currency + Math.abs(difference).toFixed(2);
}
} else {