|
2 | 2 | Configuration constants for the Bingo application. |
3 | 3 | """ |
4 | 4 |
|
| 5 | +from typing import Final, Literal |
| 6 | + |
| 7 | +# Type definitions for CSS properties |
| 8 | +CssColor = str # Hex color code like "#123456" or named color like "red" |
| 9 | +CssFontFamily = str # Font family names like "'Font Name', sans-serif" |
| 10 | +CssFontWeight = str # Font weight like "400", "700", etc. |
| 11 | +CssFontStyle = Literal["normal", "italic", "oblique"] |
| 12 | +CssClass = str # CSS class name or space-separated class names |
| 13 | + |
5 | 14 | # Header text and display settings |
6 | | -HEADER_TEXT = "COMMIT !BINGO" |
7 | | -HEADER_TEXT_COLOR = "#0CB2B3" |
8 | | -CLOSED_HEADER_TEXT = "Bingo Is Closed" |
| 15 | +HEADER_TEXT: Final[str] = "COMMIT !BINGO" |
| 16 | +HEADER_TEXT_COLOR: Final[CssColor] = "#0CB2B3" |
| 17 | +CLOSED_HEADER_TEXT: Final[str] = "Bingo Is Closed" |
| 18 | +CLOSED_MESSAGE_TEXT: Final[str] = "GAME CLOSED" |
| 19 | +CLOSED_MESSAGE_COLOR: Final[CssColor] = "#FF7f33" |
9 | 20 |
|
10 | 21 | # Free space settings |
11 | | -FREE_SPACE_TEXT = "FREE MEAT" |
12 | | -FREE_SPACE_TEXT_COLOR = "#FF7f33" |
| 22 | +FREE_SPACE_TEXT: Final[str] = "FREE MEAT" |
| 23 | +FREE_SPACE_TEXT_COLOR: Final[CssColor] = "#FF7f33" |
13 | 24 |
|
14 | 25 | # Tile appearance settings |
15 | | -TILE_CLICKED_BG_COLOR = "#100079" |
16 | | -TILE_CLICKED_TEXT_COLOR = "#1BEFF5" |
17 | | -TILE_UNCLICKED_BG_COLOR = "#1BEFF5" |
18 | | -TILE_UNCLICKED_TEXT_COLOR = "#100079" |
| 26 | +TILE_CLICKED_BG_COLOR: Final[CssColor] = "#100079" |
| 27 | +TILE_CLICKED_TEXT_COLOR: Final[CssColor] = "#1BEFF5" |
| 28 | +TILE_UNCLICKED_BG_COLOR: Final[CssColor] = "#1BEFF5" |
| 29 | +TILE_UNCLICKED_TEXT_COLOR: Final[CssColor] = "#100079" |
19 | 30 |
|
20 | 31 | # Page backgrounds |
21 | | -HOME_BG_COLOR = "#100079" |
22 | | -STREAM_BG_COLOR = "#00FF00" |
| 32 | +HOME_BG_COLOR: Final[CssColor] = "#100079" |
| 33 | +STREAM_BG_COLOR: Final[CssColor] = "#00FF00" |
23 | 34 |
|
24 | 35 | # Font settings |
25 | | -HEADER_FONT_FAMILY = "'Super Carnival', sans-serif" |
26 | | -BOARD_TILE_FONT = "Inter" |
27 | | -BOARD_TILE_FONT_WEIGHT = "700" |
28 | | -BOARD_TILE_FONT_STYLE = "normal" |
| 36 | +HEADER_FONT_FAMILY: Final[CssFontFamily] = "'Super Carnival', sans-serif" |
| 37 | +BOARD_TILE_FONT: Final[str] = "Inter" |
| 38 | +BOARD_TILE_FONT_WEIGHT: Final[CssFontWeight] = "700" |
| 39 | +BOARD_TILE_FONT_STYLE: Final[CssFontStyle] = "normal" |
29 | 40 |
|
30 | 41 | # UI Class Constants |
31 | | -BOARD_CONTAINER_CLASS = "flex justify-center items-center w-full" |
32 | | -HEADER_CONTAINER_CLASS = "w-full" |
33 | | -CARD_CLASSES = ( |
| 42 | +BOARD_CONTAINER_CLASS: Final[CssClass] = "flex justify-center items-center w-full" |
| 43 | +HEADER_CONTAINER_CLASS: Final[CssClass] = "w-full" |
| 44 | +CARD_CLASSES: Final[CssClass] = ( |
34 | 45 | "relative p-2 rounded-xl shadow-8 w-full h-full flex items-center justify-center" |
35 | 46 | ) |
36 | | -COLUMN_CLASSES = "flex flex-col items-center justify-center gap-0 w-full" |
37 | | -GRID_CONTAINER_CLASS = "w-full aspect-square p-4" |
38 | | -GRID_CLASSES = "gap-2 h-full grid-rows-5" |
39 | | -ROW_CLASSES = "w-full" |
40 | | -LABEL_SMALL_CLASSES = "fit-text-small text-center select-none" |
41 | | -LABEL_CLASSES = "fit-text text-center select-none" |
| 47 | +COLUMN_CLASSES: Final[CssClass] = ( |
| 48 | + "flex flex-col items-center justify-center gap-0 w-full" |
| 49 | +) |
| 50 | +GRID_CONTAINER_CLASS: Final[CssClass] = "w-full aspect-square p-4" |
| 51 | +GRID_CLASSES: Final[CssClass] = "gap-2 h-full grid-rows-5" |
| 52 | +ROW_CLASSES: Final[CssClass] = "w-full" |
| 53 | +LABEL_SMALL_CLASSES: Final[CssClass] = "fit-text-small text-center select-none" |
| 54 | +LABEL_CLASSES: Final[CssClass] = "fit-text text-center select-none" |
0 commit comments