File size: 1,031 Bytes
e6fb104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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()