-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.py
86 lines (81 loc) · 2.5 KB
/
main.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import flet as ft
from utils import image_loader
# Components
from libs.components.appbar import appbar
from libs.components.story import story_view, add_story
from libs.components.post import post_view
from libs.components.navigation_bar import navigation_bar
def main(page: ft.Page):
page.theme_mode = ft.ThemeMode.LIGHT
page.padding = 0
page.spacing = 0
page.window_width = 330
page.window_height = 660
page.update()
# configure custom fonts
page.fonts = {
# Instagram logo font
"Fontspring": "fonts/Fontspring/Fontspring-bold.otf",
# Roboto ( default font ) variants
"Roboto": "fonts/Roboto/Roboto-Regular.ttf",
"Roboto-Medium": "fonts/Roboto/Roboto-Medium.ttf",
"Roboto-Bold": "fonts/Roboto/Roboto-Bold.ttf",
}
stories = ft.Container(
content = ft.Row(
[
ft.Container(
content=ft.Row(
[
# add story button
add_story(pfp="images/tokito.jpg"),
# other stories
story_view(image="images/baseplate.png", username="sheldon_shit"),
story_view(image="images/pfp-1.jpg", username="marin"),
story_view(image="images/pfp-2.jpg", username="sunx_prox"),
story_view(image="images/pfp-3.jpg", username="monkey.d.luffy"),
story_view(image="images/pfp-4.jpg", username="sssuneeth"),
]
),
padding=ft.padding.symmetric(horizontal=10)
)
],
scroll=ft.ScrollMode.HIDDEN
),
padding=ft.padding.symmetric(vertical=10),
border=ft.border.symmetric(vertical=ft.BorderSide(1, ft.colors.with_opacity(0.05, ft.colors.BLACK)))
)
posts = ft.ListView([
post_view(
page=page,
pfp="images/tokito.jpg",
username="tokitou_san",
image="images/post-1.jpg",
likes=10574,
title="⚡ Joyboy has returned!!!",
bg_song="One piece ft.Luffy bgm"
),
post_view(
page=page,
pfp="images/baseplate.png",
username="sheldon_shit",
image="images/post-2.jpg",
likes=24875,
title="Like if I'm a Gay :P",
bg_song="I'm a Gay!"
),
])
page.add(
ft.ListView([
appbar(),
stories,
posts,
],
expand=True),
navigation_bar
)
if __name__ == "__main__":
ft.app(
target=main,
assets_dir="assets",
)