demo / app.py
cnfync's picture
Update app.py
0bf1c3f verified
import gradio as gr
# 定义你的 HTML 内容
html_content = """
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>个人简介</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 20px;
}
header {
background: #35424a;
color: white;
padding: 10px 0;
text-align: center;
}
section {
background: white;
padding: 20px;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
margin: 20px 0;
}
h2 {
color: #35424a;
}
footer {
text-align: center;
margin-top: 20px;
}
</style>
</head>
<body>
<header>
<h1>欢迎来到我的个人简介页面</h1>
</header>
<section>
<h2>关于我</h2>
<p>你好!我是一名对技术和创新充满热情的人。我喜欢编程、学习新的技能以及探索新的想法。</p>
<h2>我的技能</h2>
<ul>
<li>HTML & CSS</li>
<li>JavaScript</li>
<li>Python</li>
<li>机器学习</li>
</ul>
<h2>我的项目</h2>
<p>你可以在我的 GitHub 页面上找到我参与的项目。以下是我的 GitHub 个人资料链接:</p>
<a href="https://github.com/你的用户名" target="_blank">GitHub 个人资料</a>
<h2>联系方式</h2>
<p>Email: [你的邮箱地址]</p>
<p>LinkedIn: <a href="https://www.linkedin.com/in/你的用户名" target="_blank">我的LinkedIn</a></p>
</section>
<footer>
<p>© 2023 你的名字. 版权所有.</p>
</footer>
</body>
</html>
"""
# 创建 Gradio 界面
def show_html():
return html_content
iface = gr.Interface(fn=show_html, inputs=[], outputs=gr.HTML(), title="个人简介页面")
# 启动应用
iface.launch()