base rio setup
This commit is contained in:
parent
be5b9183bb
commit
e57d47e38f
38
ezgg_website/__init__.py
Normal file
38
ezgg_website/__init__.py
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
from typing import * # type: ignore
|
||||||
|
|
||||||
|
import rio
|
||||||
|
|
||||||
|
from . import pages
|
||||||
|
from . import components as comps
|
||||||
|
|
||||||
|
# Define a theme for Rio to use.
|
||||||
|
#
|
||||||
|
# You can modify the colors here to adapt the appearance of your app or website.
|
||||||
|
# The most important parameters are listed, but more are available! You can find
|
||||||
|
# them all in the docs
|
||||||
|
#
|
||||||
|
# https://rio.dev/docs/api/theme
|
||||||
|
theme = rio.Theme.from_colors(
|
||||||
|
primary_color=rio.Color.from_hex("01dffdff"),
|
||||||
|
secondary_color=rio.Color.from_hex("0083ffff"),
|
||||||
|
light=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# Create the Rio app
|
||||||
|
app = rio.App(
|
||||||
|
name='ezgg-website',
|
||||||
|
pages=[
|
||||||
|
rio.Page(
|
||||||
|
name="Home",
|
||||||
|
page_url='',
|
||||||
|
build=pages.SamplePage,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
theme=theme,
|
||||||
|
assets_dir=Path(__file__).parent / "assets",
|
||||||
|
)
|
||||||
|
|
||||||
0
ezgg_website/components/__init__.py
Normal file
0
ezgg_website/components/__init__.py
Normal file
1
ezgg_website/pages/__init__.py
Normal file
1
ezgg_website/pages/__init__.py
Normal file
@ -0,0 +1 @@
|
|||||||
|
from .sample_page import SamplePage
|
||||||
27
ezgg_website/pages/sample_page.py
Normal file
27
ezgg_website/pages/sample_page.py
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from dataclasses import KW_ONLY, field
|
||||||
|
from typing import * # type: ignore
|
||||||
|
|
||||||
|
import rio
|
||||||
|
|
||||||
|
from .. import components as comps
|
||||||
|
|
||||||
|
class SamplePage(rio.Component):
|
||||||
|
"""
|
||||||
|
This is an example Page. Pages are identical to other Components and only
|
||||||
|
differ in how they're used.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def build(self) -> rio.Component:
|
||||||
|
return rio.Column(
|
||||||
|
rio.Text("My App", style="heading2"),
|
||||||
|
rio.Text(
|
||||||
|
"This is a sample page. Replace it with your own content."
|
||||||
|
),
|
||||||
|
spacing=2,
|
||||||
|
margin=2,
|
||||||
|
align_x=0.5,
|
||||||
|
align_y=0,
|
||||||
|
)
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user