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

Adding set icon/numbers to cards in deck comparison #663

Merged
merged 4 commits into from
Jul 16, 2022

Conversation

andreshomeroloz
Copy link
Contributor

Hello there! First time contributor here. Got into Netrunner recently and just starting to get familiar with NetrunnerDB (and GitHub itself :P), so please bear with me.

When playing around with decklists I found the 'Compare' functions in the My Decks page. I thought it was pretty cool and useful to quickly see what needs to be replaced in order to turn a physical deck into a different version of it, except that for a new player like me it's kinda hard to know where I might be able to find a particular card without knowing what its set and number is. I saw in some other parts of the site that this info is sometime displayed on card lists when they're being sorted by set, so I thought I'd propose for them to be added here.

Aside from adding the icons and set numbers, I refactored the generation of these items into its own function in that same file, hopefully making any future changes here a little bit easier and more uniform.

I was not able to set up a proper local copy of the site, but I WAS able to run the modified JS code on the prod site directly through the Chrome dev console and these were the results:
Screen Shot 2022-07-14 at 11 46 07 PM
Screen Shot 2022-07-14 at 11 45 39 PM
Screen Shot 2022-07-14 at 11 45 25 PM
Screen Shot 2022-07-14 at 11 42 03 PM

I'd totally understand if this is something that might need more of a justification or more testing, but I thought it'd be cool to have.

Copy link
Contributor

@distributive distributive left a comment

Choose a reason for hiding this comment

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

Hi! Thanks for the contribution, this looks great! As far as I can tell this works fine. If you wanted to expand on this it might be nice if the cards were sorted by set rather than alphabetically.

If you're having trouble running a local dev version I'd suggest looking at this, it might be a little more manageable: https://github.com/Absotively/nrdb-dev-env

web/js/decks.v2.js Outdated Show resolved Hide resolved
Added spacing between operators for readability

Co-authored-by: Noah <[email protected]>
@andreshomeroloz
Copy link
Contributor Author

@distributive thanks! I do want to expand on this (maybe with a "sort by" selector somewhere), but wanted to get my feet wet first.

@distributive distributive merged commit bfcc1a8 into NetrunnerDB:main Jul 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants