Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,39 +28,44 @@ def process_figma(figma_url, figma_token):
|
|
| 28 |
|
| 29 |
return zip_file_path
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
inputs=["text", "text"],
|
| 34 |
-
outputs="file",
|
| 35 |
-
title="Figma to Tkinter Converter",
|
| 36 |
-
description=""
|
| 37 |
-
)
|
| 38 |
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
<br>
|
| 43 |
|
| 44 |
-
|
|
|
|
| 45 |
|
| 46 |
-
|
| 47 |
-
| --- | --- |
|
| 48 |
-
| Button | Button |
|
| 49 |
-
| Line | Line |
|
| 50 |
-
| Text | Name it anything |
|
| 51 |
-
| Rectangle | Rectangle |
|
| 52 |
-
| TextArea | Text Area |
|
| 53 |
-
| TextBox | Entry |
|
| 54 |
-
| Image | Canvas.Image() |
|
| 55 |
-
| ButtonHover (EXPERIMENTAL) | Button shown on hover |
|
| 56 |
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
-
|
| 60 |
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
-
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
return zip_file_path
|
| 30 |
|
| 31 |
+
with gr.Blocks() as demo:
|
| 32 |
+
gr.Markdown("## Figma to Tkinter Converter") # Title
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
|
| 34 |
+
with gr.Row():
|
| 35 |
+
url_input = gr.Textbox(label="Figma URL")
|
| 36 |
+
token_input = gr.Textbox(label="Figma Token")
|
|
|
|
| 37 |
|
| 38 |
+
submit_button = gr.Button("Convert")
|
| 39 |
+
output_file = gr.File(label="Download Output")
|
| 40 |
|
| 41 |
+
submit_button.click(fn=process_figma, inputs=[url_input, token_input], outputs=output_file)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
description = gr.Markdown(
|
| 44 |
+
"""
|
| 45 |
+
Upload your Figma design by providing the URL and token.
|
| 46 |
+
<br>
|
| 47 |
|
| 48 |
+
### Naming is Important
|
| 49 |
|
| 50 |
+
| Figma Element Name | Tkinter Element |
|
| 51 |
+
| --- | --- |
|
| 52 |
+
| Button | Button |
|
| 53 |
+
| Line | Line |
|
| 54 |
+
| Text | Name it anything |
|
| 55 |
+
| Rectangle | Rectangle |
|
| 56 |
+
| TextArea | Text Area |
|
| 57 |
+
| TextBox | Entry |
|
| 58 |
+
| Image | Canvas.Image() |
|
| 59 |
+
| ButtonHover (EXPERIMENTAL) | Button shown on hover |
|
| 60 |
|
| 61 |
+
<br>
|
| 62 |
+
|
| 63 |
+
**NOTE** : This project is created by : ParthJadhav
|
| 64 |
+
|
| 65 |
+
Checkout this repo to know more : [GitHub Repo](https://github.com/ParthJadhav/Tkinter-Designer)
|
| 66 |
+
"""
|
| 67 |
+
)
|
| 68 |
+
|
| 69 |
+
description.render()
|
| 70 |
+
|
| 71 |
+
demo.launch()
|