Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added click and drag #92

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
179 changes: 149 additions & 30 deletions app/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,19 @@ exports.effects = [
'Vexed Volcanics',
'Gourdian Angel',
'Pumpkin Party',
'Frozen Fractals',
'Lavender Landfall',
'Special Snowfall',
'Divine Desire',
'Distant Dream',
'Violent Wintertide',
'Blighted Snowstorm',
'Pale Nimbus',
'Genus Plasmos',
'Serenus Lumen',
'Ventum Maris',
'Mirthful Mistletoe',
'Attrib_Particle176',
'Hot',
'Isotope',
'Cool',
Expand Down Expand Up @@ -255,7 +268,15 @@ exports.effects = [
'Veno Shock',
'Toxic Terrors',
'Arachnid Assault',
'Creepy Crawlies'
'Creepy Crawlies',
'Delightful Star',
'Frosted Star',
'Apotheosis',
'Ascension',
'Reindoonicorn Rancher',
// 'Reindoonicorn Rancher',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't commit commented code

'Twinkling Lights',
'Shimmering Lights'
];

exports.effect = {
Expand Down Expand Up @@ -404,6 +425,19 @@ exports.effect = {
'Vexed Volcanics': 161,
'Gourdian Angel': 162,
'Pumpkin Party': 163,
'Frozen Fractals': 164,
'Lavender Landfall': 165,
'Special Snowfall': 166,
'Divine Desire': 167,
'Distant Dream': 168,
'Violent Wintertide': 169,
'Blighted Snowstorm': 170,
'Pale Nimbus': 171,
'Genus Plasmos': 172,
'Serenus Lumen': 173,
'Ventum Maris': 174,
'Mirthful Mistletoe': 175,
'Attrib_Particle176': 176,
'Hot': 701,
'Isotope': 702,
'Cool': 703,
Expand Down Expand Up @@ -462,6 +496,13 @@ exports.effect = {
'Toxic Terrors': 3046,
'Arachnid Assault': 3047,
'Creepy Crawlies': 3048,
'Delightful Star': 3049,
'Frosted Star': 3050,
'Apotheosis': 3051,
'Ascension': 3052,
'Reindoonicorn Rancher': 3053,
'Twinkling Lights': 3055,
'Shimmering Lights': 3056,
'Attrib_Particle22001': 22001,
'Attrib_Particle22002': 22002,
'Attrib_Particle22003': 22003,
Expand Down Expand Up @@ -616,6 +657,19 @@ exports.effect = {
'161': 'Vexed Volcanics',
'162': 'Gourdian Angel',
'163': 'Pumpkin Party',
'164': 'Frozen Fractals',
'165': 'Lavender Landfall',
'166': 'Special Snowfall',
'167': 'Divine Desire',
'168': 'Distant Dream',
'169': 'Violent Wintertide',
'170': 'Blighted Snowstorm',
'171': 'Pale Nimbus',
'172': 'Genus Plasmos',
'173': 'Serenus Lumen',
'174': 'Ventum Maris',
'175': 'Mirthful Mistletoe',
'176': 'Attrib_Particle176',
'701': 'Hot',
'702': 'Isotope',
'703': 'Cool',
Expand Down Expand Up @@ -674,6 +728,13 @@ exports.effect = {
'3046': 'Toxic Terrors',
'3047': 'Arachnid Assault',
'3048': 'Creepy Crawlies',
'3049': 'Delightful Star',
'3050': 'Frosted Star',
'3051': 'Apotheosis',
'3052': 'Ascension',
'3053': 'Reindoonicorn Rancher',
'3055': 'Twinkling Lights',
'3056': 'Shimmering Lights',
'22001': 'Attrib_Particle22001',
'22002': 'Attrib_Particle22002',
'22003': 'Attrib_Particle22003',
Expand Down Expand Up @@ -1259,35 +1320,93 @@ exports.qualityColors = {
};

exports.paintCanColors = {
'5052;6': '2f4f4f', // A Color Similar to Slate
'5031;6': '7d4071', // A Deep Commitment to Purple
'5040;6': '141414', // A Distinctive Lack of Hue
'5076;6': 'bcddb3', // A Mann's Mint
'5077;6': '2d2d24', // After Eight
'5038;6': '7e7e7e', // Aged Moustache Grey
'5063;6': '654740', // An Air of Debonair
'5039;6': 'e6e6e6', // An Extraordinary Abundance of Tinge
'5037;6': 'e7b53b', // Australium Gold
'5062;6': '3b1f23', // Balaclavas Are Forever
'5030;6': 'd8bed8', // Color No. 216-190-216
'5065;6': 'c36c2d', // Cream Spirit
'5056;6': 'e9967a', // Dark Salmon Injustice
'5053;6': '808000', // Drably Olive
'5027;6': '729e42', // Indubitably Green
'5032;6': 'cf7336', // Mann Co. Orange
'5033;6': 'a57545', // Muskelmannbraun
'5029;6': '51384a', // Noble Hatter's Violet
'5060;6': '483838', // Operator's Overalls
'5034;6': 'c5af91', // Peculiarly Drab Tincture
'5051;6': 'ff69b4', // Pink as Hell
'5035;6': '694d3a', // Radigan Conagher Brown
'5046;6': 'b8383b', // Team Spirit
'5054;6': '32cd32', // The Bitter Taste of Defeat and Lime
'5055;6': 'f0e68c', // The Color of a Gentlemann's Business Pants
'5064;6': '803020', // The Value of Teamwork
'5061;6': 'a89a8c', // Waterlogged Lab Coat
'5036;6': '7c6c57', // Ye Olde Rustic Colour
'5028;6': '424f3b' // Zepheniah's Greed
// A Color Similar to Slate
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you decide to open new lines? In practice this saves about 2 characters of horizontal space

'5052;6':
'TbL_ROFcpnqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvOvr1MdQ/',
// A Deep Commitment to Purple
'5031;6':
'TeLfQYFp1nqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvVs13Vys/',
// A Distinctive Lack of Hue
'5040;6':
'TYffEcEJhnqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvXrHVMg0/',
// A Mann's Mint
'5076;6':
'SLKqRMQ59nqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvU8z3W20/',
// After Eight
'5077;6':
'TbLfJME5hnqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvWdo-dtk/',
// Aged Moustache Grey
'5038;6':
'TeLPdNFslnqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvFkHADQU/',
// An Air of Debonair
'5063;6':
'TffPQfFZxnqWSMU5OD2NsHx3oIzChGKyv2yXdsa7g9fsrW0Az__LbZTDL-ZTCZJiLWEk0nCeYPaCiIp23hirHFAG-cX714QglReKMAoGJKO5qBPxRogIVe_DO5xxB4TBB6dJNEKVrtnidHNeVr2C8V0p8gFQg/',
// An Extraordinary Abundance of Tinge
'5039;6':
'SMf6UeRJpnqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgv64ewDK8/',
// Australium Gold
'5037;6':
'SMfqIdEs5nqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvsjysS5w/',
// Balaclavas Are Forever
'5062;6':
'TaK_FOE59nqWSMU5OD2NgHxnAPzChGKyv2yXdsa7g9fsrW0Az__LbZTDL-ZTCZJiLWEk0nCeYPaCiIp23hirHFAG-cX714QglReKMAoGJKO5qBPxRogIVe_DO5xxB4TBB6dJNEKVrtnidHNeVr2C8V3lcfHzA/',
// Color No. 216-190-216
'5030;6':
'SNcaJNRZRnqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvFOcRWGY/',
// Cream Spirit
'5065;6':
'SKevZLE8hnqWSMU5OD2IsHzHMPnShGKyv2yXdsa7g9fsrW0Az__LbZTDL-ZTCZJiLWEk0nCeYPaCiIp23hirHFAG-cX714QglReKMAoGJKO5qBPxRogIVe_DO5xxB4TBB6dJNEKVrtnidHNeVr2C8VQmu5hdU/',
// Dark Salmon Injustice
'5056;6':
'SMcPkeFs1nqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvy3dkty0/',
// Drably Olive
'5053;6':
'TRefgYEZxnqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvMuQVCSQ/',
// Indubitably Green
'5027;6':
'Tee_lNFZ5nqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvm153-6I/',
// Mann Co. Orange
'5032;6':
'SKL_cbEppnqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvTFGBHn4/',
// Muskelmannbraun
'5033;6':
'SIfPcdFZlnqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvcmoesjg/',
// Noble Hatter's Violet
'5029;6':
'TcePMQFc1nqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvgXmHfsU/',
// Operator's Overalls
'5060;6':
'TdcfMQEpRnqWSMU5OD2NoHwHEIkChGKyv2yXdsa7g9fsrW0Az__LbZTDL-ZTCZJiLWEk0nCeYPaCiIp23hirHFAG-cX714QglReKMAoGJKO5qBPxRogIVe_DO5xxB4TBB6dJNEKVrtnidHNeVr2C8V-hQN5Nc/',
// Peculiarly Drab Tincture
'5034;6':
'SKfKFOGJ1nqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvG7gZwMo/',
// Pink as Hell
'5051;6':
'SPL_YRQ5hnqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgv9O7ytVg/',
// Radigan Conagher Brown
'5035;6':
'TfcPRMEs1nqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgv4OlkQfA/',
// Team Spirit
'5046;6':
'SLcfMQEs5nqWSMU5OD2NwHzHZdmihGKyv2yXdsa7g9fsrW0Az__LbZTDL-ZTCZJiLWEk0nCeYPaCiIp23hirHFAG-cX714QglReKMAoGJKO5qBPxRogIVe_DO5xxB4TBB6dJNEKVrtnidHNeVr2C8VWwsKTpY/',
// The Bitter Taste of Defeat and Lime
'5054;6':
'Tae6NMEp5nqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvvmRKa6k/',
// The Color of a Gentlemann's Business Pants
'5055;6':
'SPeaUeGc9nqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvoDEBbxU/',
// The Value of Teamwork
'5064;6':
'TRefMYE5xnqWSMU5OD2NsKwicEzChGKyv2yXdsa7g9fsrW0Az__LbZTDL-ZTCZJiLWEk0nCeYPaCiIp23hirHFAG-cX714QglReKMAoGJKO5qBPxRogIVe_DO5xxB4TBB6dJNEKVrtnidHNeVr2C8Vs4Ux0YY/',
// Waterlogged Lab Coat
'5061;6':
'SIcflJGc9nqWSMU5OD2NEMzSVdmyhGKyv2yXdsa7g9fsrW0Az__LbZTDL-ZTCZJiLWEk0nCeYPaCiIp23hirHFAG-cX714QglReKMAoGJKO5qBPxRogIVe_DO5xxB4TBB6dJNEKVrtnidHNeVr2C8VT2CQ46M/',
// Ye Olde Rustic Colour
'5036;6':
'TeKvZLFJtnqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvmeRW1Z8/',
// Zepheniah's Greed
'5028;6':
'Tde_ROEs5nqWSMU5PShIcCxWVd2H5fLn-siSQrbOhrZcLFzwvo7vKMFXrjazbKEC3YDlltU7ILYTmKrTT3t-mdE2nBQewrRwpRKfEHoGxPOM3aPhM8045d-zTgwxczDhgvPiWjbeE/'
};

exports.defindexes = {
Expand Down
23 changes: 7 additions & 16 deletions assets/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
background-color:rgba(255, 255, 255, 0.7);
overflow-x: wrap;
overflow-y: hidden;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.item:hover .info {
visibility: visible;
Expand Down Expand Up @@ -103,21 +99,13 @@
left: 2px;
position: absolute;
z-index: 2;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.item-grid .autoprice-symbol {
top: 2px;
right: 2px;
position: absolute;
z-index: 2;
color: #29a30e;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
.item-list .autoprice-symbol {
color: #29a30e;
Expand All @@ -144,12 +132,15 @@
background-color:rgba(255, 255, 255, 0.7);
overflow-x: wrap;
overflow-y: hidden;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
background-color: #666;
}
.item:hover .price {
visibility: visible;
}

#pricelist {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try not to target on an ID directly.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the problem with targeting ID ?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://stackoverflow.com/questions/8084555/why-selecting-by-id-is-not-recommended-in-css You're basically cornering yourself in, and won't be able to override it later with another selector.

-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
}
10 changes: 10 additions & 0 deletions assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ const app = new Vue({
list: false
},
methods: {
mouseEntered: function (item, e) {
if (this.multiSelect.enabled && (e.buttons && e.buttons==1) && e.button == 0) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

e.buttons == 1 instead of e.buttons==1 , seems not to match your codestyle

  • try not to hook everything in brackets, a general preferance in JS is
if (!this.multiSelect.enabled || !(e.buttons && e.buttons==1) || e.button !== 0)
    return;

And that way save on horizontal space

const index = this.multiSelect.list.indexOf(item.sku);
if (index == -1) {
this.multiSelect.list.push(item.sku);
} else {
this.multiSelect.list.splice(index, 1);
}
}
},
addSingle: function() {
if (this.modal.edit) this.resetModal();
},
Expand Down
27 changes: 7 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"homepage": "https://github.com/ZeusJunior/tf2-automatic-gui#readme",
"dependencies": {
"axios": "^0.19.2",
"axios": "^0.21.1",
"body-parser": "^1.19.0",
"bottleneck": "^2.19.5",
"ejs": "^3.0.1",
Expand Down
2 changes: 1 addition & 1 deletion utils/getImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function getImageFromSKU(sku) {
return;
}
if ((Object.keys(paintCanColors).indexOf(sku)) > -1) {
found.image_url = found.image_url_large = `https://backpack.tf/images/440/cans/Paint_Can_${paintCanColors[sku]}.png`;
found.image_url = found.image_url_large = `https://steamcommunity-a.akamaihd.net/economy/image/IzMF03bi9WpSBq-S-ekoE33L-iLqGFHVaU25ZzQNQcXdEH9myp0erksICf${paintCanColors[sku]}188x188`;
} else if (item.paintkit !== null ) {
found.image_url = found.image_url_large = `https://scrap.tf/img/items/warpaint/${encodeURIComponent(found.item_name)}_${item.paintkit}_${item.wear}_${item.festive===true?1:0}.png`;
} else if (item.australium === true) {
Expand Down
6 changes: 4 additions & 2 deletions views/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@
</div>

<div v-if="!list" class="d-flex mt-3 flex justify-content-center flex-wrap" id="pricelist">
<div class="item item-grid m-1" v-for="item in pricelistSorted" :key="item.sku" :style="{ backgroundImage: `url( ${item.style.image_small} ), url( ${item.style.effect} )`, backgroundColor: item.style.quality_color, borderStyle: item.style.craftable? false : 'dashed', opacity: item.enabled?1:0.5, borderColor: item.style.border_color}" @click="itemClick(item, $event)">
<div class="item item-grid m-1" v-for="item in pricelistSorted" :key="item.sku"
:style="{ backgroundImage: `url( ${item.style.image_small} ), url( ${item.style.effect} )`, backgroundColor: item.style.quality_color, borderStyle: item.style.craftable? false : 'dashed', opacity: item.enabled?1:0.5, borderColor: item.style.border_color}"
Copy link

@poespas poespas Feb 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please split the style-properties up on new lines

@click="itemClick(item, $event)" @mouseenter="mouseEntered(item, $event)">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either make the decision, in general HTML, to put attributes on all new lines, or put them all on the same line. this will avoid confusion.

<div class="info text-center font-weight-bold" v-if="!multiSelect.list.includes(item.sku)">
{{item.name}}
</div>
Expand Down Expand Up @@ -310,7 +312,7 @@
</thead>
<tbody>

<tr class="item item-list m-1" v-for="item in pricelistSorted" :key="item.sku" @click="itemClick(item, $event)">
<tr class="item item-list m-1" v-for="item in pricelistSorted" :key="item.sku" @mousedown="itemClick(item, $event)" @mouseenter="mouseEntered(item, $event)">
<td>
<a :href="item.statslink" target="_blank" v-on:click.stop="">{{item.sku}}</a>
</td>
Expand Down