Page 1 of 1

Question about Stock and cards

Posted: 04 May 2020, 03:40
by VanHlebar
In El Grande players have a deck of cards that are used for bidding at the start of each turn. I am using the Stock JS item to handle the images and of course Cards on the backend.

After my first play through today with my gaming group they had a suggestion for the layout which I had not thought of and I fixed it tonight. In doing so though, I have run into a slight problem that I am sure can be fixed but I am struggling with how to do so.

The cards are sorted from 1 - 13 in order by default. When a player uses a card, it gets removed from their hand and placed into the discard pile. I had been putting them into a different DIV below the currnent hand, however what they would prefer to see is just the cards flipped over in the main "hand" DIV. I have figured out how to remove the card and then put a card "back' if you will at the end of the Stock and display a tool tip that shows the card face. Is there anyway to just flip the card over in place?

Here is a screen shot of what I am talking about.

https://photos.app.goo.gl/h4zvMDW8xHzqkUT29


What I would like to have happen in this image is when the Yellow player used the power card 7 that it would have just "flipped" over and showed the card back between the 6 and 8 cards.

Any help is greatly appreciated!

Thansk!

Re: Question about Stock and cards

Posted: 04 May 2020, 07:29
by Loreroth
Have a look at the sharedcode project by Victoria_La it has a very nice card filp animation that looks like is just done in css.
(if you have trouble finding it the recent purge may have unlisted it. source code is also here: https://github.com/elaskavaia/bga-sharedcode)

You could also just change the image without an animation.

Re: Question about Stock and cards

Posted: 04 May 2020, 12:49
by VanHlebar
Thanks for the direction. I was looking at Sharecode and struggled with it. I would be fine without the animation if I could just figure out how to replace the image and keep the location inside my Stock collection.

Re: Question about Stock and cards

Posted: 04 May 2020, 13:16
by tchobello
hi

perhaps you can use a addClass to blur the card...
with a something like background-color: rgba( 255,200,200,0.3 );

Re: Question about Stock and cards

Posted: 04 May 2020, 15:31
by A-dam
Hi,

take a look to King's Guild. I use card flipping a lot, just with changing css class.

I dont use Stock because I needed more flexibility but I dont see why it shoud not work with stock..

Adam

Re: Question about Stock and cards

Posted: 04 May 2020, 18:38
by VanHlebar
Thanks Adam, I will take a look.

Great game btw! I love it....just wish I was better. :)

Re: Question about Stock and cards

Posted: 05 May 2020, 01:02
by VanHlebar
So in the end I decided to scrap the Stock component for the power cards entirely and just rolled with CSS. While it meant ripping out all the graphic routines that had been setup, it ended giving me the flexibility that I needed. I really appreciate everyone's help and pointers!

Re: Question about Stock and cards

Posted: 06 May 2020, 21:54
by Volker78
You are implementing el grande for bga? How is your progress? Is it possible to help testing? I also have professional php/html/js/css programming skills and could help with programming. I also know el grande well, and have the german board version at home, so I also could help translating.

Re: Question about Stock and cards

Posted: 06 May 2020, 22:53
by VanHlebar
Volker78 wrote: 06 May 2020, 21:54 You are implementing el grande for bga? How is your progress? Is it possible to help testing? I also have professional php/html/js/css programming skills and could help with programming. I also know el grande well, and have the german board version at home, so I also could help translating.
I am in VERY early stages of testing. Had one play through with my game group and now working on trackign down the bugs they helped locate. Once I get those done I will definately reach out to you and add you to the list of players for the actual Alpha testing.

At this point all base game is installed and working.... well for the most part. :)