/
__init__.fyre
88 lines (73 loc) · 1.65 KB
/
__init__.fyre
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
87
88
from .parent import parent
from .store import store
def mocked_request():
return "fetched on the server"
async def handle_on_click(e):
alert("click rendered on client")
if 1==1:
print("Hello world")
current_value = get_parent_signal()
set_parent_signal(current_value + 1)
a = await fetch('https://jsonplaceholder.typicode.com/todos/1')
print(await a.text())
print("handles on click")
<style>
body {
background: url('https://images.pexels.com/photos/7130469/pexels-photo-7130469.jpeg?cs=srgb&dl=pexels-codioful-%28formerly-gradienta%29-7130469.jpg&fm=jpg');
}
#root {
text-align: center;
height: 100vh;
width: 100%;
font-size: 1.5rem;
}
@media screen and (max-width:468px) {
#root {
font-size: 2rem;
}
}
@media screen and (min-width: 468px){
#root {
font-size: 1.5rem;
}
}
.wrapper {
padding: 20px;
height: 100%;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.header {
padding-top: 5vh;
}
</style>
<pyml>
<store>
<div class="wrapper">
<parent hello='world'>
<div class="header">
<b>
Welcome to the first Starfyre(⭐🔥) App!
</b>
<div>
This page aims to showcase the direction and vision of Starfyre.
</div>
<div>
We aim to showcase the state store, server side rendering, and client side rendering.
</div>
<b>
All in Python!
</b>
<b> </b>
</div>
</parent>
</div>
</store>
</pyml>
<script>
// this is optional
// as I don't know why someone would need it
</script>