add WIP frontend

This commit is contained in:
David Rodenkirchen
2024-08-24 01:57:47 +02:00
parent 69c3ea9b68
commit 446956f721
11 changed files with 328 additions and 24 deletions
+65
View File
@@ -0,0 +1,65 @@
from __future__ import annotations
from typing import * # type: ignore
from rio import Component, event, Spacer, Card, Container, Column, Row, Rectangle, TextStyle, Color, Text
from src.ez_lan_manager.components.DesktopNavigation import DesktopNavigation
class BasePage(Component):
content: Component
@event.on_window_size_change
async def on_window_size_change(self):
await self.force_refresh()
def build(self) -> Component:
if self.content is None:
content = Spacer()
else:
content = Card(
self.content,
color="secondary",
min_width=38,
corner_radius=(0, 0.5, 0, 0)
)
if self.session.window_width > 28:
return Container(
content=Column(
Row(),
Column(
Row(
Spacer(grow_x=True, grow_y=True),
DesktopNavigation(),
content,
Spacer(grow_x=True, grow_y=True),
grow_y=True
),
Row(
Spacer(grow_x=True, grow_y=False),
Card(
content=Text("EZ LAN Manager Version 0.0.1 © EZ GG e.V.", align_x=0.5, align_y=0.5, style=TextStyle(fill=self.session.theme.primary_color, font_size=0.5)),
color=self.session.theme.neutral_color,
corner_radius=(0, 0, 0.5, 0.5),
grow_x=False,
grow_y=False,
min_height=1.2,
min_width=53.1
),
Spacer(grow_x=True, grow_y=False),
grow_y=False
)
),
Row(),
proportions=[4, 92, 4]
),
grow_x=True,
grow_y=True
)
else:
return Text(
"Der EZ LAN Manager wird\nauf mobilen Endgeräten nur\nim Querformat unterstützt.\nBitte drehe dein Gerät.",
align_x=0.5,
align_y=0.5,
style=TextStyle(fill=Color.from_hex("FFFFFF"), font_size=0.8)
)