ddsnowboard / FantasyStocks

A website where you play a game of fantasy stocks.
http://fantasystocks.herokuapp.com
Apache License 2.0
0 stars 1 forks source link

Improve Dashboard #20

Closed ddsnowboard closed 8 years ago

ddsnowboard commented 9 years ago

Make sure that the stocks that the player in question owns are somehow indicated, and make it so that he can't click on his own name or stocks that he himself owns.

Also, when you first update a stock, the colors don't come out right. I don't know why, but I should fix that.

ddsnowboard commented 8 years ago

Also, on the bottom of the page, where I didn't know what to put there, I should put your trade inbox. At the top, it should say "Active Trades", and below should be horizontal boxes holding trades. This should include the trades that you yourself sent. How should we do that? It could have senders and recipients in the same spot, but then there might be just your username repeated over and over. That's not very good. Or we could just have the name of the other person shown, and somehow show which ones are from you and which ones are to you. I dunno. I'll fiddle with it. Anyway, if you click somewhere or other on the trade, it takes you to the Received Trade page, which I haven't made yet.

ddsnowboard commented 8 years ago

I made the stocks owned by the player stand out, but it doesn't look very good. At this point, it's just for testing. I should probably improve the design at some point, but I'm working on other things right now, so maybe later.

Also, make it so that, when you mouse over someone, all their stocks light up and when you select a stock, it's owner lights up.

ddsnowboard commented 8 years ago

I'm going to start on this tomorrow. I wrote earlier about changing the colors that show whether you own the stock, and I had a person tell me that it was confusing, but I think that I don't have to worry about that because I'm going to add some JavaScript that shows exactly who a stock belongs to when you mouse over it, and also shows all the stocks that belong to someone when you mouse over them. Specifically, I was thinking about outlining them in red or something. Really, I just want to outline them, and I'll worry about the specific color later because that will be easy to change.

The implementation of this isn't difficult, but I want to think about it enough because I don't want to go down a path that is hard to return from. I thought that it would be really ugly to inject it, but it really wouldn't. According to the tubes, I can make my own HTML attributes with this tag, and then I can easily query them from JavaScript.

So, with that new knowledge, here is my plan. I'm going to have a data-owner attribute on the stock that holds the primary key of the Player object that owns that stock. Each <td> on the leaderboard will have its id set to the primary key of the Player object shown in that <td>. Each time you click a tab, the script will run through the stocks and the players, making an object with player pks as keys and lists of DOM elements of stocks as values. This might be slow as hell, especially if you change tabs a bunch of times, so I might send it to a WebWorker. I'll have to test. Either way, when you mouse over a player, it will look at this object, and then it will highlight all the stocks in the list. When you mouse out, it will de-highlight them. The opposite way will be simpler. When you mouse over a stock, it will query for it's owner in real time and highlight him, and then when you mouse out, it will de-highlight him. Easy.

So there are a few things to do.

ddsnowboard commented 8 years ago

A usability test indicated that a tooltip might be a better way to show it than my current setup. I'm going to open another branch and dev that in parallel, and then I'll look at what I have at the end and see which looks better.