74 lines
3.0 KiB
Python
74 lines
3.0 KiB
Python
import rio
|
|
from from_root import from_root
|
|
from rio import TextStyle
|
|
|
|
from ezgg_website.components.ticker import Ticker
|
|
|
|
|
|
class Header(rio.Component):
|
|
def build(self) -> rio.Component:
|
|
# FixMe: Temporary fix for low screen widths. Fixable once Rio offers better mobile-targeted layouting
|
|
if self.session.window_width < 67.125:
|
|
return rio.Column(
|
|
rio.Rectangle(
|
|
content=rio.Column(
|
|
rio.Row(
|
|
rio.Link(
|
|
rio.Image(from_root("ezgg_website/assets/logo.svg"), align_x=0,
|
|
width=8),
|
|
"/"
|
|
)
|
|
),
|
|
margin=1
|
|
),
|
|
fill=self.session.theme.neutral_color,
|
|
corner_radius=self.session.theme.corner_radius_medium,
|
|
shadow_radius=0.5,
|
|
shadow_color=self.session.theme.hud_color,
|
|
shadow_offset_y=0
|
|
),
|
|
align_y=0,
|
|
margin_top=1,
|
|
margin_left=1,
|
|
margin_right=1,
|
|
height=4
|
|
)
|
|
|
|
return rio.Column(
|
|
rio.Rectangle(
|
|
content=rio.Column(
|
|
rio.Row(
|
|
rio.Link(
|
|
rio.Image(from_root("ezgg_website/assets/logo.svg"), align_x=0, width=8),
|
|
"/"
|
|
),
|
|
rio.Text("Sinnlose Infos aus dem Vereinskern:", justify="left", width="grow", margin_left=0.8),
|
|
Ticker(
|
|
texts=[
|
|
"Die EZ GG wurde in einer schlecht beleuchteten Kellerbar gegründet",
|
|
"Aktuelle hat die EZ GG e.V. vierzehn Mitglieder",
|
|
"Bist du auch ein Gamer? Dann tritt uns doch bei!",
|
|
"Auch Wasser wird zum edlen Tropfen, mischt man es mit Malz und Hopfen."
|
|
],
|
|
refresh_interval=30,
|
|
tick_in_order=False,
|
|
style=TextStyle(italic=True),
|
|
width="grow",
|
|
justify="right"
|
|
)
|
|
),
|
|
margin=1
|
|
),
|
|
fill=self.session.theme.neutral_color,
|
|
corner_radius=self.session.theme.corner_radius_medium,
|
|
shadow_radius=0.5,
|
|
shadow_color=self.session.theme.hud_color,
|
|
shadow_offset_y=0
|
|
),
|
|
align_y=0,
|
|
margin_top=1,
|
|
margin_left=1,
|
|
margin_right=1,
|
|
height=4
|
|
)
|