portfolio / app.py
milliyin's picture
Update app.py
c0eeea5 verified
Raw
History Blame Contribute Delete
2.01 kB
from __future__ import annotations
import gradio as gr
SITE_URL = "https://milliyin.dev/"
def render_embed() -> str:
return f"""
<div style="height:100vh;display:flex;flex-direction:column;background:#ffffff;">
<div style="flex:0 0 auto;display:flex;align-items:center;padding:10px 14px;border-bottom:1px solid #e5e7eb;background:#ffffff;">
<a href="{SITE_URL}" target="_blank" rel="noopener noreferrer"
style="color:#111827;text-decoration:none;font:600 14px system-ui,sans-serif;">
Open milliyin.dev
</a>
</div>
<iframe
src="{SITE_URL}"
title="canirunaimodel check"
style="flex:1 1 auto;width:100%;border:0;background:#ffffff;"
loading="eager"
referrerpolicy="strict-origin-when-cross-origin"
></iframe>
</div>
"""
with gr.Blocks(
title="canirunaimodel check",
theme=gr.themes.Base(),
css="""
html, body {
margin: 0 !important;
padding: 0 !important;
width: 100% !important;
height: 100% !important;
overflow: hidden !important;
background: #ffffff !important;
}
body > gradio-app,
.gradio-container,
.app,
.main,
.wrap {
margin: 0 !important;
padding: 0 !important;
width: 100vw !important;
max-width: 100vw !important;
min-width: 100vw !important;
height: 100vh !important;
min-height: 100vh !important;
overflow: hidden !important;
background: #ffffff !important;
}
.contain,
.gr-block,
.gr-box,
.gr-panel {
margin: 0 !important;
padding: 0 !important;
border: 0 !important;
box-shadow: none !important;
background: transparent !important;
}
#app-root {
width: 100vw !important;
height: 100vh !important;
margin: 0 !important;
padding: 0 !important;
}
""",
) as demo:
gr.HTML(render_embed(), elem_id="app-root")
if __name__ == "__main__":
demo.launch()