SHAMIL SHAHBAZ AWAN
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
# Define gravity constants for each planet as a percentage of Earth's gravity
|
|
@@ -91,7 +91,6 @@ def main():
|
|
| 91 |
earth_weight_input = gr.Number(label="Enter your weight on Earth (kg)", interactive=True)
|
| 92 |
planet_input = gr.Dropdown(choices=list(gravity_factors.keys()), label="Choose a planet", interactive=True)
|
| 93 |
|
| 94 |
-
# Output section for the equivalent weight
|
| 95 |
output = gr.Textbox(label="Equivalent Weight on Planet", interactive=False)
|
| 96 |
|
| 97 |
# HTML component for balloon effect trigger
|
|
@@ -114,10 +113,9 @@ def main():
|
|
| 114 |
</script>
|
| 115 |
""")
|
| 116 |
|
| 117 |
-
# Function to trigger balloon effect
|
| 118 |
def trigger_balloon_and_weight(earth_weight, planet):
|
| 119 |
result = calculate_weight(earth_weight, planet)
|
| 120 |
-
# Trigger the balloon effect after calculating weight
|
| 121 |
balloon_script.trigger() # Trigger the balloon effect
|
| 122 |
return result
|
| 123 |
|
|
|
|
| 1 |
+
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
# Define gravity constants for each planet as a percentage of Earth's gravity
|
|
|
|
| 91 |
earth_weight_input = gr.Number(label="Enter your weight on Earth (kg)", interactive=True)
|
| 92 |
planet_input = gr.Dropdown(choices=list(gravity_factors.keys()), label="Choose a planet", interactive=True)
|
| 93 |
|
|
|
|
| 94 |
output = gr.Textbox(label="Equivalent Weight on Planet", interactive=False)
|
| 95 |
|
| 96 |
# HTML component for balloon effect trigger
|
|
|
|
| 113 |
</script>
|
| 114 |
""")
|
| 115 |
|
| 116 |
+
# Function to trigger balloon effect
|
| 117 |
def trigger_balloon_and_weight(earth_weight, planet):
|
| 118 |
result = calculate_weight(earth_weight, planet)
|
|
|
|
| 119 |
balloon_script.trigger() # Trigger the balloon effect
|
| 120 |
return result
|
| 121 |
|