Skip to content

Commit

Permalink
anim fix/update
Browse files Browse the repository at this point in the history
  • Loading branch information
BustosAndrew committed Apr 23, 2024
1 parent 0a6b8b6 commit ba66e3d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lahacks/lahacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@ def dynamic_form():
rx.button(
"Reset", on_click=DynamicFormState.handle_reset, type="button", style=button_style),
rx.cond(
DynamicFormState.submitted,
rx.html('''<script src="https://unpkg.com/@dotlottie/player-component@latest/dist/dotlottie-player.mjs" type="module"></script>
<dotlottie-player src="https://lottie.host/d395e1a4-28dc-4e60-bffd-8a8ed8844318/qvoNVQ79Bc.json" background="transparent" speed="1" style="width: 50px; height: 40px;" loop autoplay></dotlottie-player>'''),
DynamicFormState.buttonText == "Generating...",
rx.html('''<dotlottie-player src="https://lottie.host/d395e1a4-28dc-4e60-bffd-8a8ed8844318/qvoNVQ79Bc.json" background="transparent" speed="1" style="width: 50px; height: 40px;" loop autoplay></dotlottie-player>'''),
),
align="center",
),
Expand Down Expand Up @@ -83,6 +81,8 @@ def dynamic_form():

def index() -> rx.Component:
return rx.center(
rx.script(src="https://unpkg.com/@dotlottie/player-component@latest/dist/dotlottie-player.mjs",
custom_attrs={"type": "module"}),
rx.vstack(
rx.heading("Chef.ai", marginX="auto", paddingY=10),
rx.box(
Expand Down
5 changes: 4 additions & 1 deletion lahacks/pages/components/recipe_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
@rx.page(route="/output/")
def output():
return rx.center(
rx.script(src="https://unpkg.com/@dotlottie/player-component@latest/dist/dotlottie-player.mjs",
custom_attrs={"type": "module"}),
rx.vstack(
rx.link(rx.button("Go Back", _hover={"cursor": "pointer"}, style=button_style), href="/",
),
rx.cond(
DynamicFormState.imageLink == "",
rx.text("Generating Image..."),
rx.box(rx.text("Cooking something up..."), rx.html(
'''<dotlottie-player src="https://lottie.host/f3bf595a-c177-4b15-bd92-7b77c9c1cb7f/5rP9GZJohZ.json" background="transparent" speed="1" style="width: 300px; height: 300px;" loop autoplay></dotlottie-player>''')),
rx.image(
src=DynamicFormState.imageLink,
alt="Recipe Image",
Expand Down

0 comments on commit ba66e3d

Please sign in to comment.