From ba66e3d3da01546e5f54d33f3fbfef602e8069e0 Mon Sep 17 00:00:00 2001 From: Andrew Bustos Date: Tue, 23 Apr 2024 00:34:21 -0700 Subject: [PATCH] anim fix/update --- lahacks/lahacks.py | 8 ++++---- lahacks/pages/components/recipe_image.py | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lahacks/lahacks.py b/lahacks/lahacks.py index 700fe7b..1f3c5a5 100644 --- a/lahacks/lahacks.py +++ b/lahacks/lahacks.py @@ -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(''' - - '''), + DynamicFormState.buttonText == "Generating...", + rx.html(''''''), ), align="center", ), @@ -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( diff --git a/lahacks/pages/components/recipe_image.py b/lahacks/pages/components/recipe_image.py index bea2ea9..42b0972 100644 --- a/lahacks/pages/components/recipe_image.py +++ b/lahacks/pages/components/recipe_image.py @@ -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( + '''''')), rx.image( src=DynamicFormState.imageLink, alt="Recipe Image",