Git Product home page Git Product logo

magical-flash-cards's People

Contributors

dependabot[bot] avatar saifahn avatar

Watchers

 avatar

magical-flash-cards's Issues

Cards are displayed visually in the wrong order

The app is currently using CSS multi-column to display the cards. This looks appealing, but the cards are arranged in columns vertically so the first column displays the first cards.
The first row should display the first cards, followed by the second row, and so on.
After doing some research, it seems like this may be impossible with pure CSS and that it may be a good idea to use an existing Masonry layout library for React.

Split card text versions are rendered without any rules text

Split cards were not accounted for during the initial design of the app.
The card objects returned by the Scryfall API have some properties that will be useful in implementing split cards. One is layout; most cards have the property normal, but split cards have the layout split. In addition, cards with more than one face, like split cards, have the property card_faces. This property is an array of objects representing the different card faces, and the oracle text can be retrieved from there.

"card_faces": [
    {
        "object": "card_face",
        "name": "Invert",
        "mana_cost": "{U/R}",
        "type_line": "Instant",
        "printed_type_line": "",
        "oracle_text": "Switch the power and toughness of each of up to two target creatures until end of turn.",
        "printed_text": "",
        "watermark": "izzet"
    },
    {
        "object": "card_face",
        "name": "Invent",
        "mana_cost": "{4}{U}{R}",
        "type_line": "Instant",
        "printed_type_line": "",
        "oracle_text": "Search your library for an instant card and/or a sorcery card, reveal them, put them into your hand, then shuffle your library.",
        "printed_text": ""
    }
],

Reminder text is not italicised in the text version of cards

Oracle text returned by the Scryfall API doesn't contain italics for reminder text.

Target creature you control gains protection from the color of your choice until end of turn.\nRebound (If you cast this spell from your hand, exile it as it resolves. At the beginning of your next upkeep, you may cast this card from exile without paying its mana cost.)

The desired behaviour is to italicize the reminder text:

Target creature you control gains protection from the color of your choice until end of turn.

Rebound (If you cast this spell from your hand, exile it as it resolves. At the beginning of your next upkeep, you may cast this card from exile without paying its mana cost.)

This shouldn't be too hard, we can take anything inside parentheses to be reminder text.

Loading cards with no oracle text causes an error

A set such as Guilds of Ravnica contains split cards that do not function correctly at the moment. Split cards are loaded without oracle text, and this causes the app to crash as italicizeReminderText cannot run. Add a failcase to the function or where the function is called to make sure that this error does not occur.

Unwanted cards in cardset

Cards with Flashback are showing up, even if they are Sorceries.
This is due to the query that is given to the Scryfall API, which looks for the word 'flash' in the oracle text. The main Scryfall application accepts regular expressions to be more specific, but the API does not.

Possible Solutions

  • Get the entire cardset for the set, then filter in the application.
  • Keep the query the same, obtaining a small cardset, then filter further in the application.
    • I believe this to be optimal, as we are already requesting information from the API so we have to wait for the response regardless. Having a smaller set to filter will improve performance in the application.

Load the latest set upon load

Currently there is dummy data that is initially loaded. The app then queries Scryfall for a list of sets and loads them into the select element, but a set must be selected for it to update. This could be changed to load the latest set when all the sets have been loaded.

List of sets doesn't update automatically

The list of sets is fetched upon loading of the app. However, the range of sets is determined by hard-coded date values. This should be changed so that sets in the last 5 years or so are loaded, making sure that the most recent sets are available.

Newlines in card rules text are not used when rendering text versions of the cards

Oracle text for cards is returned with newlines as "\n". For example:

Electrolyze deals 2 damage divided as you choose among one or two targets.\nDraw a card.

Currently the character is trimmed out of the text in the rendered card text, so it looks like:

Electrolyze deals 2 damage divided as you choose among one or two targets. Draw a card.

But the desired behaviour is more like:

Electrolyze deals 2 damage divided as you choose among one or two targets.
Draw a card.

Undesired sorting behaviour

Current Behaviour

  • No sort toggled:
    • Cards are in alphabetical order (as desired.)
  • Sort by colour toggled:
    • Cards are sorted by colour, then alphabetically (as desired.)
  • Sort by mana cost toggled:
    • Cards are sorted in ascending converted mana cost (CMC), but otherwise seemingly in a random order.
  • Sort by mana cost and colour toggled:
    • As above; ascending but in a different random order.
  • The order for each combination is consistent, but undesired for the bottom two.

Desired Behaviour

  • Sort by mana cost toggled:
    • Sort by CMC, then alphabetically.
  • Sort by mana cost and colour toggled:
    • Sort by CMC, then colour, then alphabetical.
  • Gold (multicoloured) cards are sorted after green.
  • Colourless cards are sorted before white.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.