Download app.py from Tesslate/Designer: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/Tesslate/Designer/resolve/main/app.py
- Command line
-
hf download hf://spaces/Tesslate/Designer/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Tesslate/Designer/resolve/main/app.py
1.03 kB
| import gradio as gr | |
| # 1. The HTML content for the iframe. | |
| # We embed the CSS directly here for simplicity. | |
| html_content = """ | |
| <style> | |
| body, html { | |
| margin: 0; | |
| padding: 0; | |
| height: 100%; | |
| overflow: hidden; | |
| background-color: #FFF; /* Set a background color in case the iframe is slow to load */ | |
| } | |
| iframe { | |
| position: absolute; | |
| top: 0; | |
| left: 0; | |
| width: 100%; | |
| height: 100%; | |
| border: none; | |
| } | |
| </style> | |
| <iframe src="https://designer.tesslate.com"></iframe> | |
| """ | |
| # 2. Create a Gradio Blocks interface | |
| # The `css` parameter injects CSS to remove Gradio's default padding and make our iframe container take up all the space. | |
| with gr.Blocks(css=".gradio-container {padding: 0px !important;}") as demo: | |
| # 3. Use the gr.HTML component to render our HTML string. | |
| # The `elem_id` gives the main container a unique ID for styling if needed. | |
| gr.HTML(value=html_content, elem_id="full-page-iframe") | |
| # 4. Launch the app | |
| demo.launch() |