Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
projects = [
|
|
@@ -11,153 +13,146 @@ projects = [
|
|
| 11 |
|
| 12 |
css = """
|
| 13 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
}
|
| 18 |
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
.glass-card {
|
| 22 |
-
background: rgba(255, 255, 255, 0.
|
| 23 |
-
backdrop-filter: blur(
|
| 24 |
-
-webkit-backdrop-filter: blur(20px) saturate(180%) !important;
|
| 25 |
border: 1px solid rgba(255, 255, 255, 0.2) !important;
|
| 26 |
-
border-radius:
|
| 27 |
-
box-shadow: 0
|
| 28 |
-
margin: 1rem !important;
|
| 29 |
}
|
| 30 |
|
| 31 |
-
.
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
text-align: center !important;
|
| 36 |
-
|
| 37 |
-
margin: 1.5rem auto !important;
|
| 38 |
-
max-width: 800px !important;
|
| 39 |
}
|
| 40 |
|
| 41 |
.demo-btn {
|
| 42 |
-
background: linear-gradient(135deg, #ff6b6b, #feca57
|
| 43 |
border: none !important;
|
| 44 |
border-radius: 16px !important;
|
| 45 |
color: white !important;
|
| 46 |
font-weight: 600 !important;
|
| 47 |
-
|
| 48 |
-
|
| 49 |
width: 100% !important;
|
| 50 |
-
max-width:
|
| 51 |
margin: 1rem auto !important;
|
| 52 |
transition: all 0.3s ease !important;
|
| 53 |
text-decoration: none !important;
|
| 54 |
-
display: inline-
|
| 55 |
-
align
|
| 56 |
-
justify-content: center !important;
|
| 57 |
-
text-shadow: 0 2px 4px rgba(0,0,0,0.2);
|
| 58 |
}
|
| 59 |
|
| 60 |
.demo-btn:hover {
|
| 61 |
-
transform:
|
| 62 |
-
box-shadow: 0
|
| 63 |
}
|
| 64 |
|
| 65 |
-
.video-
|
| 66 |
-
|
| 67 |
-
max-width:
|
| 68 |
-
|
| 69 |
border-radius: 16px !important;
|
| 70 |
-
box-shadow: 0
|
| 71 |
-
margin: 1rem auto !important;
|
| 72 |
-
display: flex;
|
| 73 |
-
align-items: center;
|
| 74 |
-
justify-content: center;
|
| 75 |
-
background: rgba(0,0,0,0.1);
|
| 76 |
}
|
| 77 |
|
| 78 |
-
.
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
text-align: center !important;
|
| 83 |
-
|
| 84 |
-
gap: 1.5rem !important;
|
| 85 |
-
}
|
| 86 |
-
|
| 87 |
-
.skill-badge {
|
| 88 |
-
background: rgba(255, 255, 255, 0.15) !important;
|
| 89 |
-
padding: 0.4rem 1rem !important;
|
| 90 |
-
border-radius: 20px !important;
|
| 91 |
-
font-size: 0.85rem !important;
|
| 92 |
-
font-weight: 500 !important;
|
| 93 |
-
border: 1px solid rgba(255, 255, 255, 0.2) !important;
|
| 94 |
-
margin: 0.2rem;
|
| 95 |
-
display: inline-block;
|
| 96 |
}
|
| 97 |
|
| 98 |
@media (max-width: 768px) {
|
| 99 |
-
.
|
| 100 |
-
.video-
|
| 101 |
-
.demo-btn { padding: 0.9rem 1.5rem !important; max-width: 280px !important; }
|
| 102 |
-
}
|
| 103 |
-
|
| 104 |
-
@media (max-width: 480px) {
|
| 105 |
-
.video-wrapper { height: 220px !important; }
|
| 106 |
}
|
| 107 |
"""
|
| 108 |
|
| 109 |
-
with gr.Blocks(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 115 |
|
| 116 |
-
|
|
|
|
| 117 |
for proj in projects:
|
| 118 |
with gr.TabItem(proj["name"]):
|
| 119 |
with gr.Column(elem_classes="glass-card center-content"):
|
| 120 |
gr.Markdown(f"# 🚀 **{proj['name']}**")
|
| 121 |
gr.Markdown(f"**📝 {proj['desc']}**")
|
| 122 |
-
|
| 123 |
-
gr.HTML(f"""
|
| 124 |
-
<div style="display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin: 1rem 0;">
|
| 125 |
-
{' '.join([f'<span class="skill-badge">{skill}</span>' for skill in proj["skills"]])}
|
| 126 |
-
</div>
|
| 127 |
-
""")
|
| 128 |
|
| 129 |
gr.HTML(f'''
|
| 130 |
-
<
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
</a>
|
| 134 |
-
</div>
|
| 135 |
''')
|
| 136 |
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
<div style="margin-bottom: 1rem;">
|
| 146 |
-
Click "Download Video" to view the demo
|
| 147 |
-
</div>
|
| 148 |
-
<a href="{proj['video']}" target="_blank" download
|
| 149 |
-
style="background: linear-gradient(135deg, #4facfe, #00f2fe); color: white; padding: 0.8rem 2rem; border-radius: 12px; text-decoration: none; font-weight: 600;">
|
| 150 |
-
📥 Download Video
|
| 151 |
-
</a>
|
| 152 |
-
</div>
|
| 153 |
-
</div>
|
| 154 |
-
''')
|
| 155 |
|
| 156 |
-
demo.launch(
|
| 157 |
-
share=True,
|
| 158 |
-
debug=True,
|
| 159 |
-
show_error=True,
|
| 160 |
-
height="auto",
|
| 161 |
-
css=css,
|
| 162 |
-
theme=gr.themes.Soft()
|
| 163 |
-
)
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
projects = [
|
|
|
|
| 13 |
|
| 14 |
css = """
|
| 15 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
|
| 16 |
+
|
| 17 |
+
* { font-family: 'Inter', sans-serif !important; }
|
| 18 |
+
|
| 19 |
+
body {
|
| 20 |
+
margin: 0 !important;
|
| 21 |
+
padding: 0 !important;
|
| 22 |
+
overflow-x: hidden !important;
|
| 23 |
}
|
| 24 |
|
| 25 |
+
.gradio-container {
|
| 26 |
+
background: none !important;
|
| 27 |
+
position: relative !important;
|
| 28 |
+
min-height: 100vh !important;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
#background-video {
|
| 32 |
+
position: fixed !important;
|
| 33 |
+
top: 0 !important;
|
| 34 |
+
left: 0 !important;
|
| 35 |
+
width: 100vw !important;
|
| 36 |
+
height: 100vh !important;
|
| 37 |
+
object-fit: cover !important;
|
| 38 |
+
z-index: -2 !important;
|
| 39 |
+
pointer-events: none !important;
|
| 40 |
+
}
|
| 41 |
+
|
| 42 |
+
.video-overlay {
|
| 43 |
+
position: fixed !important;
|
| 44 |
+
top: 0 !important;
|
| 45 |
+
left: 0 !important;
|
| 46 |
+
width: 100vw !important;
|
| 47 |
+
height: 100vh !important;
|
| 48 |
+
background: linear-gradient(rgba(15,15,35,0.85), rgba(45,27,105,0.85)) !important;
|
| 49 |
+
z-index: -1 !important;
|
| 50 |
+
}
|
| 51 |
|
| 52 |
.glass-card {
|
| 53 |
+
background: rgba(255, 255, 255, 0.15) !important;
|
| 54 |
+
backdrop-filter: blur(25px) !important;
|
|
|
|
| 55 |
border: 1px solid rgba(255, 255, 255, 0.2) !important;
|
| 56 |
+
border-radius: 24px !important;
|
| 57 |
+
box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4) !important;
|
|
|
|
| 58 |
}
|
| 59 |
|
| 60 |
+
.center-content {
|
| 61 |
+
display: flex !important;
|
| 62 |
+
flex-direction: column !important;
|
| 63 |
+
align-items: center !important;
|
| 64 |
text-align: center !important;
|
| 65 |
+
justify-content: center !important;
|
|
|
|
|
|
|
| 66 |
}
|
| 67 |
|
| 68 |
.demo-btn {
|
| 69 |
+
background: linear-gradient(135deg, #ff6b6b, #feca57) !important;
|
| 70 |
border: none !important;
|
| 71 |
border-radius: 16px !important;
|
| 72 |
color: white !important;
|
| 73 |
font-weight: 600 !important;
|
| 74 |
+
padding: 1.2rem 2.5rem !important;
|
| 75 |
+
font-size: 1.1rem !important;
|
| 76 |
width: 100% !important;
|
| 77 |
+
max-width: 350px !important;
|
| 78 |
margin: 1rem auto !important;
|
| 79 |
transition: all 0.3s ease !important;
|
| 80 |
text-decoration: none !important;
|
| 81 |
+
display: inline-block !important;
|
| 82 |
+
text-align: center !important;
|
|
|
|
|
|
|
| 83 |
}
|
| 84 |
|
| 85 |
.demo-btn:hover {
|
| 86 |
+
transform: scale(1.05) !important;
|
| 87 |
+
box-shadow: 0 20px 40px rgba(255, 107, 107, 0.4) !important;
|
| 88 |
}
|
| 89 |
|
| 90 |
+
.video-medium {
|
| 91 |
+
height: 350px !important;
|
| 92 |
+
max-width: 100% !important;
|
| 93 |
+
width: 650px !important;
|
| 94 |
border-radius: 16px !important;
|
| 95 |
+
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3) !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
}
|
| 97 |
|
| 98 |
+
.header-gradient {
|
| 99 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
|
| 100 |
+
border-radius: 24px !important;
|
| 101 |
+
padding: 2.5rem !important;
|
| 102 |
text-align: center !important;
|
| 103 |
+
box-shadow: 0 25px 50px rgba(102, 126, 234, 0.4) !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
}
|
| 105 |
|
| 106 |
@media (max-width: 768px) {
|
| 107 |
+
.demo-btn { padding: 1rem 2rem !important; font-size: 1rem !important; }
|
| 108 |
+
.video-medium { height: 280px !important; width: 100% !important; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
}
|
| 110 |
"""
|
| 111 |
|
| 112 |
+
with gr.Blocks(css=css, theme=gr.themes.Soft()) as demo:
|
| 113 |
+
# Background Video - SINGLE PATH ONLY: bg.mp4
|
| 114 |
+
gr.HTML("""
|
| 115 |
+
<video autoplay muted loop id="background-video">
|
| 116 |
+
<source src="bg.mp4" type="video/mp4">
|
| 117 |
+
</video>
|
| 118 |
+
<div class="video-overlay"></div>
|
| 119 |
+
""")
|
| 120 |
|
| 121 |
+
# Centered Header
|
| 122 |
+
with gr.Row(variant="compact", elem_classes="center-content"):
|
| 123 |
+
gr.HTML("""
|
| 124 |
+
<div class="header-gradient glass-card">
|
| 125 |
+
<h1 style="margin: 0; font-weight: 800; font-size: 3rem; background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;">
|
| 126 |
+
✨ AI/ML Projects
|
| 127 |
+
</h1>
|
| 128 |
+
<p style="margin: 1rem 0 0 0; font-size: 1.3rem; opacity: 0.9;">
|
| 129 |
+
6 Production-Ready Projects • Live on Hugging Face
|
| 130 |
+
</p>
|
| 131 |
+
</div>
|
| 132 |
+
""")
|
| 133 |
|
| 134 |
+
# Project Tabs
|
| 135 |
+
with gr.Tabs():
|
| 136 |
for proj in projects:
|
| 137 |
with gr.TabItem(proj["name"]):
|
| 138 |
with gr.Column(elem_classes="glass-card center-content"):
|
| 139 |
gr.Markdown(f"# 🚀 **{proj['name']}**")
|
| 140 |
gr.Markdown(f"**📝 {proj['desc']}**")
|
| 141 |
+
gr.Markdown(f"**🛠️ Tech Stack:** {' • '.join(proj['skills'])}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
|
| 143 |
gr.HTML(f'''
|
| 144 |
+
<a href="{proj["live"]}" target="_blank" class="demo-btn" style="display: inline-block; text-align: center; line-height: 1.5;">
|
| 145 |
+
🎮 Launch {proj['name']} Live Demo
|
| 146 |
+
</a>
|
|
|
|
|
|
|
| 147 |
''')
|
| 148 |
|
| 149 |
+
gr.Video(
|
| 150 |
+
value=proj["video"],
|
| 151 |
+
label="📹 Project Demo",
|
| 152 |
+
height=350,
|
| 153 |
+
show_download_button=True,
|
| 154 |
+
interactive=False,
|
| 155 |
+
elem_classes="video-medium"
|
| 156 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
|
| 158 |
+
demo.launch(share=True, debug=True, height=950, show_error=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|