-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathachievements.py
47 lines (38 loc) · 1.24 KB
/
achievements.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from textual.app import App, ComposeResult
from textual.containers import Horizontal, Vertical
from textual.widgets import Footer, Header, Label
class AchievementsBoard(App[None]):
CSS = """
Screen {
align: center middle;
hatch: right $secondary-background;
}
Horizontal, Vertical {
width: auto;
height: auto;
}
#panel {
border: round $primary;
background: $surface;
padding: 1 2;
#achievements {
margin: 1 0;
.medal {
width: 2;
}
}
}
"""
def compose(self) -> ComposeResult:
yield Header(icon="🥇")
yield Footer()
with Vertical(id="panel"):
yield Label(
"Hi [bold]Codey McBugface[/bold], you've done well!\nHere are your achievements:"
)
achievements = "🥇🥇◌🥇🥇◌🥇🥇◌◌◌◌"
with Horizontal(id="achievements"):
for c in achievements:
yield Label(c, classes="medal")
yield Label("[italic]Write some code[/italic] and earn even more!")
AchievementsBoard().run()