Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def main():
- timezone = "America/Santiago"
- now = time.now().in_location(timezone)
- return render.Root(
- child=render.Column(
- children=[
- render.Row(
- cross_align="center",
- main_align="space_between",
- children=[
- get_time(now),
- laughing(),
- ],
- ),
- ],
- )
- )
- def laughing():
- return animation.Transformation(
- child=render.Image(src=base64.decode(WHITE), height=32),
- duration=60,
- direction="alternate",
- fill_mode="forwards",
- keyframes=[
- animation.Keyframe(
- percentage=0.0,
- transforms=[animation.Rotate(-360)],
- curve="ease_in_out",
- )
- ],
- )
- def get_time(now):
- return render.Padding(
- pad=(2, 0, 2, 0),
- child=render.Animation(
- children=[
- render.Text(
- content=now.format("15:04"),
- font="CG-pixel-4x5-mono",
- ),
- render.Text(
- content=now.format("15:04"),
- font="CG-pixel-4x5-mono",
- ),
- ]
- ),
- )
Add Comment
Please, Sign In to add comment