sreelekhaputta2 commited on
Commit
303f442
·
verified ·
1 Parent(s): 48bf197

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +103 -77
app.py CHANGED
@@ -1,84 +1,91 @@
1
  import gradio as gr
2
 
3
  projects = [
4
- {"name": "Idealyze", "desc": "AI-powered content optimization platform", "skills": ["NLP", "Transformers", "FastAPI"], "live": "https://huggingface.co/spaces/sreelekhaputta2/Idealyze", "video": "./Idealyze.mp4"},
5
- {"name": "DivineLoop", "desc": "Real-time audio-visual looping generator", "skills": ["Audio Processing", "Computer Vision", "WebRTC"], "live": "https://huggingface.co/spaces/sreelekhaputta2/DivineLoop", "video": "./Divineloop.mp4"},
6
- {"name": "GenDoc_AI", "desc": "Intelligent PDF document generation", "skills": ["LLMs", "PDF Generation", "LangChain"], "live": "https://huggingface.co/spaces/sreelekhaputta2/GenDoc_AI", "video": "./GendocAI.mp4"},
7
- {"name": "LinkShield", "desc": "Advanced URL security threat detection", "skills": ["Cybersecurity", "API Integration", "FastAPI"], "live": "https://huggingface.co/spaces/sreelekhaputta2/LinkShield", "video": "./Linkshield.mp4"},
8
- {"name": "Chatbot", "desc": "Multi-modal conversational AI with memory", "skills": ["LLMs", "RAG", "Vector DB"], "live": "https://huggingface.co/spaces/sreelekhaputta2/Chatbot", "video": "./Wiseverse.mp4"},
9
- {"name": "AvatarVerse", "desc": "Photorealistic AI avatar generator", "skills": ["Stable Diffusion", "ControlNet", "GANs"], "live": "https://huggingface.co/spaces/sreelekhaputta2/AvatarVerse", "video": "./Avatarverse.mp4"}
10
  ]
11
 
12
  css = """
13
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
14
 
15
- /* PERFECT HF SPACES BACKGROUND */
16
- .gradio-container {
17
- background: linear-gradient(rgba(10,10,26,0.92), rgba(45,27,105,0.92)),
18
- url('https://tse4.explicit.bing.net/th/id/OIP.CSOmF_Va1tPzTClwWuugnwHaEK?pid=Api&h=220&P=0') center/cover no-repeat !important;
19
- font-family: 'Inter', sans-serif !important;
20
- min-height: 100vh !important;
21
- color: white !important;
22
- padding: 0 !important;
23
- }
24
-
25
- /* WHITE TEXT EVERYWHERE */
26
- *, body {
27
  font-family: 'Inter', sans-serif !important;
28
  color: white !important;
29
- background: transparent !important;
 
 
 
 
 
 
 
 
30
  }
31
 
32
- /* MOBILE SCROLL + CENTER */
33
  .center-content {
34
  display: flex !important;
35
  flex-direction: column !important;
36
  align-items: center !important;
37
  justify-content: flex-start !important;
38
  text-align: center !important;
39
- width: 100% !important;
 
40
  padding: 1rem !important;
41
- box-sizing: border-box !important;
42
  }
43
 
44
- /* GLASS CARDS */
45
  .glass-card {
46
- background: rgba(255, 255, 255, 0.25) !important;
47
- backdrop-filter: blur(30px) !important;
48
- border: 1px solid rgba(255, 255, 255, 0.4) !important;
49
- border-radius: 24px !important;
50
- box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6) !important;
51
- color: white !important;
52
- padding: 2rem !important;
53
- margin: 1rem auto !important;
54
- width: 100% !important;
55
- max-width: 800px !important;
56
  }
57
 
58
- /* BUTTONS */
59
  .demo-btn {
60
  background: linear-gradient(135deg, #ff6b6b, #feca57) !important;
61
- border: none !important;
62
- border-radius: 16px !important;
63
  color: white !important;
64
- font-weight: 600 !important;
65
- padding: 1.2rem 2.5rem !important;
66
- font-size: 1.1rem !important;
67
- width: 100% !important;
68
- max-width: 350px !important;
69
- margin: 1rem auto !important;
70
- transition: all 0.3s ease !important;
71
  text-decoration: none !important;
72
  display: inline-block !important;
73
- box-shadow: 0 10px 30px rgba(255,107,107,0.4) !important;
 
 
 
 
 
 
 
74
  }
75
 
76
  .demo-btn:hover {
77
- transform: scale(1.05) !important;
78
- box-shadow: 0 20px 40px rgba(255, 107, 107, 0.6) !important;
 
 
 
 
 
 
 
 
 
79
  }
80
 
81
- /* VIDEOS */
82
  .video-container {
83
  width: 100% !important;
84
  margin: 1rem 0 !important;
@@ -86,36 +93,49 @@ css = """
86
  .video-container video {
87
  width: 100% !important;
88
  height: auto !important;
89
- max-height: 350px !important;
90
- border-radius: 16px !important;
91
- box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
 
92
  }
93
 
94
- /* HEADER */
95
- .header-gradient {
96
- background: linear-gradient(135deg, rgba(102,126,234,0.95), rgba(118,75,162,0.95)) !important;
97
- border-radius: 24px !important;
98
- padding: 3rem 2rem !important;
99
- text-align: center !important;
100
- box-shadow: 0 25px 50px rgba(102, 126, 234, 0.5) !important;
101
- margin: 2rem auto !important;
102
- max-width: 90% !important;
 
 
 
 
 
 
 
103
  }
104
 
105
- /* TABS + MOBILE */
106
- .gradio-tabs, .tab-header, .tab-content, .tab-button { color: white !important; }
107
- .tab-item { min-height: 60vh !important; color: white !important; }
 
 
 
 
108
 
109
- @media (max-width: 768px) {
110
- .center-content { padding: 1rem !important; width: 100vw !important; }
111
- .demo-btn { padding: 1rem 1.5rem !important; font-size: 1rem !important; max-width: 90vw !important; }
112
- .video-container video { max-height: 280px !important; }
113
- .header-gradient { padding: 2rem 1rem !important; max-width: 95vw !important; }
114
- .glass-card { padding: 1.5rem 1rem !important; }
 
 
115
  }
116
  """
117
 
118
- # **FIXED: Gradio 6.0 - css in launch()**
119
  with gr.Blocks() as demo:
120
  # HEADER
121
  with gr.Column(elem_classes="center-content"):
@@ -124,34 +144,40 @@ with gr.Blocks() as demo:
124
  elem_classes="header-gradient glass-card"
125
  )
126
 
127
- # TABS
128
  with gr.Tabs(elem_classes="center-content"):
129
  for proj in projects:
130
  with gr.TabItem(proj["name"]):
131
  with gr.Column(elem_classes="glass-card center-content"):
 
132
  gr.Markdown(f"# 🚀 **{proj['name']}**")
 
 
133
  gr.Markdown(f"**📝 {proj['desc']}**")
 
 
134
  gr.Markdown(f"**🛠️ Tech Stack:** {' • '.join(proj['skills'])}")
135
 
 
136
  gr.HTML(f'''
137
- <div style="width:100%; text-align:center;">
138
  <a href="{proj['live']}" target="_blank" class="demo-btn" style="text-decoration:none;">
139
  🎮 Launch {proj['name']} Live Demo
140
  </a>
141
  <div class="video-container">
142
- <video controls preload="metadata"
143
- style="width:100%; height:auto; max-height:350px; border-radius:16px; margin-top:1rem; box-shadow:0 20px 40px rgba(0,0,0,0.4);">
144
- <source src="{proj['video']}" type="video/mp4">
 
145
  </video>
146
  </div>
147
  </div>
148
  ''')
149
 
150
- # **FIXED: css + height in launch()**
151
  demo.launch(
152
  share=True,
153
  debug=True,
154
  show_error=True,
155
- css=css,
156
- height=1000
157
  )
 
1
  import gradio as gr
2
 
3
  projects = [
4
+ {"name": "Idealyze", "desc": "AI-powered content optimization platform", "skills": ["NLP", "Transformers", "FastAPI"], "live": "https://huggingface.co/spaces/sreelekhaputta2/Idealyze"},
5
+ {"name": "DivineLoop", "desc": "Real-time audio-visual looping generator", "skills": ["Audio Processing", "Computer Vision", "WebRTC"], "live": "https://huggingface.co/spaces/sreelekhaputta2/DivineLoop"},
6
+ {"name": "GenDoc_AI", "desc": "Intelligent PDF document generation", "skills": ["LLMs", "PDF Generation", "LangChain"], "live": "https://huggingface.co/spaces/sreelekhaputta2/GenDoc_AI"},
7
+ {"name": "LinkShield", "desc": "Advanced URL security threat detection", "skills": ["Cybersecurity", "API Integration", "FastAPI"], "live": "https://huggingface.co/spaces/sreelekhaputta2/LinkShield"},
8
+ {"name": "Chatbot", "desc": "Multi-modal conversational AI with memory", "skills": ["LLMs", "RAG", "Vector DB"], "live": "https://huggingface.co/spaces/sreelekhaputta2/Chatbot"},
9
+ {"name": "AvatarVerse", "desc": "Photorealistic AI avatar generator", "skills": ["Stable Diffusion", "ControlNet", "GANs"], "live": "https://huggingface.co/spaces/sreelekhaputta2/AvatarVerse"}
10
  ]
11
 
12
  css = """
13
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
14
 
15
+ /* MOBILE-FIRST BASE */
16
+ * {
 
 
 
 
 
 
 
 
 
 
17
  font-family: 'Inter', sans-serif !important;
18
  color: white !important;
19
+ box-sizing: border-box !important;
20
+ }
21
+ body, .gradio-container {
22
+ margin: 0 !important;
23
+ padding: 0 !important;
24
+ background: linear-gradient(rgba(10,10,26,0.95), rgba(45,27,105,0.95)),
25
+ url('https://tse4.explicit.bing.net/th/id/OIP.CSOmF_Va1tPzTClwWuugnwHaEK?pid=Api&h=220&P=0') center/cover !important;
26
+ min-height: 100vh !important;
27
+ overflow-x: hidden !important;
28
  }
29
 
30
+ /* MOBILE PERFECT CENTERING */
31
  .center-content {
32
  display: flex !important;
33
  flex-direction: column !important;
34
  align-items: center !important;
35
  justify-content: flex-start !important;
36
  text-align: center !important;
37
+ width: 100vw !important;
38
+ max-width: 100vw !important;
39
  padding: 1rem !important;
40
+ margin: 0 !important;
41
  }
42
 
43
+ /* GLASSMORPHISM - MOBILE SAFE */
44
  .glass-card {
45
+ background: rgba(255,255,255,0.2) !important;
46
+ backdrop-filter: blur(25px) !important;
47
+ border: 1px solid rgba(255,255,255,0.3) !important;
48
+ border-radius: 20px !important;
49
+ box-shadow: 0 20px 40px rgba(0,0,0,0.5) !important;
50
+ padding: 1.5rem !important;
51
+ margin: 0.5rem auto !important;
52
+ width: 95vw !important;
53
+ max-width: 600px !important;
 
54
  }
55
 
56
+ /* BUTTONS - MOBILE PERFECT */
57
  .demo-btn {
58
  background: linear-gradient(135deg, #ff6b6b, #feca57) !important;
 
 
59
  color: white !important;
60
+ padding: 1rem 2rem !important;
61
+ border-radius: 12px !important;
 
 
 
 
 
62
  text-decoration: none !important;
63
  display: inline-block !important;
64
+ font-weight: 600 !important;
65
+ font-size: 1rem !important;
66
+ width: 90% !important;
67
+ max-width: 300px !important;
68
+ margin: 1rem auto !important;
69
+ box-shadow: 0 10px 25px rgba(255,107,107,0.4) !important;
70
+ transition: all 0.3s !important;
71
+ line-height: 1.4 !important;
72
  }
73
 
74
  .demo-btn:hover {
75
+ transform: scale(1.02) !important;
76
+ box-shadow: 0 15px 35px rgba(255,107,107,0.6) !important;
77
+ }
78
+
79
+ /* HEADER - MOBILE RESPONSIVE */
80
+ .header-gradient {
81
+ background: linear-gradient(135deg, rgba(102,126,234,0.95), rgba(118,75,162,0.95)) !important;
82
+ border-radius: 20px !important;
83
+ padding: 2rem 1rem !important;
84
+ margin: 1rem auto !important;
85
+ max-width: 95vw !important;
86
  }
87
 
88
+ /* VIDEOS - MOBILE PERFECT */
89
  .video-container {
90
  width: 100% !important;
91
  margin: 1rem 0 !important;
 
93
  .video-container video {
94
  width: 100% !important;
95
  height: auto !important;
96
+ max-height: 300px !important;
97
+ border-radius: 12px !important;
98
+ box-shadow: 0 15px 30px rgba(0,0,0,0.4) !important;
99
+ display: block !important;
100
  }
101
 
102
+ /* TABS WHITE */
103
+ .gradio-tabs, .tab-header, .tab-content, .tab-button {
104
+ color: white !important;
105
+ background: transparent !important;
106
+ }
107
+ .tab-item {
108
+ padding: 1rem !important;
109
+ min-height: 70vh !important;
110
+ }
111
+
112
+ /* TABLET */
113
+ @media (min-width: 769px) and (max-width: 1024px) {
114
+ .glass-card { padding: 2rem !important; max-width: 700px !important; }
115
+ .demo-btn { padding: 1.1rem 2.2rem !important; font-size: 1.05rem !important; }
116
+ .video-container video { max-height: 320px !important; }
117
+ .header-gradient { padding: 2.5rem 1.5rem !important; }
118
  }
119
 
120
+ /* DESKTOP */
121
+ @media (min-width: 1025px) {
122
+ .glass-card { padding: 2.5rem !important; max-width: 800px !important; }
123
+ .demo-btn { padding: 1.2rem 2.5rem !important; font-size: 1.1rem !important; max-width: 350px !important; }
124
+ .video-container video { max-height: 350px !important; }
125
+ .header-gradient { padding: 3rem 2rem !important; max-width: 90% !important; }
126
+ }
127
 
128
+ /* ULTRA MOBILE FIXES */
129
+ @media (max-width: 480px) {
130
+ .gradio-container { padding: 0.5rem !important; }
131
+ .center-content { padding: 0.8rem !important; }
132
+ .glass-card { padding: 1.2rem 0.8rem !important; border-radius: 16px !important; }
133
+ .demo-btn { padding: 0.9rem 1.5rem !important; font-size: 0.95rem !important; }
134
+ .video-container video { max-height: 250px !important; }
135
+ .header-gradient { padding: 1.5rem 0.8rem !important; margin: 0.5rem auto !important; }
136
  }
137
  """
138
 
 
139
  with gr.Blocks() as demo:
140
  # HEADER
141
  with gr.Column(elem_classes="center-content"):
 
144
  elem_classes="header-gradient glass-card"
145
  )
146
 
147
+ # MOBILE PERFECT TABS
148
  with gr.Tabs(elem_classes="center-content"):
149
  for proj in projects:
150
  with gr.TabItem(proj["name"]):
151
  with gr.Column(elem_classes="glass-card center-content"):
152
+ # TITLE
153
  gr.Markdown(f"# 🚀 **{proj['name']}**")
154
+
155
+ # DESCRIPTION
156
  gr.Markdown(f"**📝 {proj['desc']}**")
157
+
158
+ # SKILLS
159
  gr.Markdown(f"**🛠️ Tech Stack:** {' • '.join(proj['skills'])}")
160
 
161
+ # BUTTON + VIDEO
162
  gr.HTML(f'''
163
+ <div style="width:100%; text-align:center; padding:1rem 0;">
164
  <a href="{proj['live']}" target="_blank" class="demo-btn" style="text-decoration:none;">
165
  🎮 Launch {proj['name']} Live Demo
166
  </a>
167
  <div class="video-container">
168
+ <video controls preload="metadata" playsinline
169
+ style="width:100%; height:auto; max-height:300px; border-radius:12px; margin-top:1rem; box-shadow:0 15px 30px rgba(0,0,0,0.4);">
170
+ <source src="./{proj['name']}.mp4" type="video/mp4">
171
+ Video demo (tap to play)
172
  </video>
173
  </div>
174
  </div>
175
  ''')
176
 
177
+ # HF SPACES + MOBILE PERFECT
178
  demo.launch(
179
  share=True,
180
  debug=True,
181
  show_error=True,
182
+ css=css
 
183
  )