Skip to content

msaJustPyUI Module

.ui_demos.card


Attributes

button_classes module-attribute

button_classes = "\ninline-flex items-center px-6 py-6 border border-gray-700 text-2xl leading-6 font-bold rounded-md text-gray-700 \nbg-white hover:text-gray-500 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:text-gray-800 \nactive:bg-gray-50 transition ease-in-out duration-150\n"

card_height module-attribute

card_height = int(card_width * 314 / 226)

card_size module-attribute

card_size = 0.5

card_width module-attribute

card_width = int(226 * card_size)

div_classes module-attribute

div_classes = "items-center px-6 py-6 border border-gray-700 text-3xl leading-6 font-bold rounded-md text-gray-700; bg-white "

Classes

Card

Bases: jp.Img

Card component: an extended image with predefined width and height and a transition

Attributes

height instance-attribute
height = card_height
transition instance-attribute
transition = {
    "load": "transition origin-left ease-out duration-1000",
    "load_start": "transform scale-x-0",
    "load_end": "transform scale-x-100",
    "enter": "transition origin-left ease-out duration-1000",
    "enter_start": "transform scale-x-0",
    "enter_end": "transform scale-x-100",
}
width instance-attribute
width = card_width

Functions

__init__
__init__(**kwargs)

constructor

Functions

blackjack async

blackjack()

the async web page to serve

cards_demo async

cards_demo()

create_deck async

create_deck()

get a new deck

deal async

deal(deck_id, count = 1)

deal

hand_value

hand_value(hand)

calculate the hand value

hit async

hit(self, msg)

react on hit button

play_again async

play_again(self, msg)

react on play again button

stand async

stand(self, msg)

react on stand button


Last update: September 28, 2022
Created: September 28, 2022