sreelekhaputta2 commited on
Commit
e6254c7
·
verified ·
1 Parent(s): 7f5eb6b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -41
app.py CHANGED
@@ -1,5 +1,3 @@
1
-
2
-
3
  import gradio as gr
4
 
5
  projects = [
@@ -18,11 +16,7 @@ css = """
18
  box-sizing: border-box;
19
  }
20
 
21
- body, .gradio-container {
22
- margin: 0 !important;
23
- padding: 0 !important;
24
- overflow-x: hidden !important;
25
- }
26
 
27
  .glass-card {
28
  background: rgba(255, 255, 255, 0.12) !important;
@@ -30,10 +24,7 @@ body, .gradio-container {
30
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
31
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
32
  border-radius: 20px !important;
33
- box-shadow:
34
- 0 8px 32px rgba(0, 0, 0, 0.15),
35
- inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
36
- position: relative !important;
37
  margin: 1rem !important;
38
  }
39
 
@@ -44,8 +35,6 @@ body, .gradio-container {
44
  text-align: center !important;
45
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3) !important;
46
  margin: 1.5rem auto !important;
47
- position: relative;
48
- overflow: hidden;
49
  max-width: 800px !important;
50
  }
51
 
@@ -60,14 +49,11 @@ body, .gradio-container {
60
  width: 100% !important;
61
  max-width: 320px !important;
62
  margin: 1rem auto !important;
63
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
64
  text-decoration: none !important;
65
  display: inline-flex !important;
66
  align-items: center !important;
67
  justify-content: center !important;
68
- gap: 0.5rem;
69
- position: relative;
70
- overflow: hidden;
71
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
72
  }
73
 
@@ -76,21 +62,17 @@ body, .gradio-container {
76
  box-shadow: 0 15px 35px rgba(255, 107, 107, 0.4) !important;
77
  }
78
 
79
- .video-player {
80
  width: 100% !important;
81
  max-width: 700px !important;
82
  height: 300px !important;
83
  border-radius: 16px !important;
84
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2) !important;
85
  margin: 1rem auto !important;
86
- display: block;
87
- }
88
-
89
- .video-player video {
90
- width: 100% !important;
91
- height: 100% !important;
92
- border-radius: 16px !important;
93
- object-fit: cover !important;
94
  }
95
 
96
  .center-content {
@@ -98,7 +80,6 @@ body, .gradio-container {
98
  flex-direction: column !important;
99
  align-items: center !important;
100
  text-align: center !important;
101
- justify-content: center !important;
102
  padding: 2rem 1rem !important;
103
  gap: 1.5rem !important;
104
  }
@@ -115,19 +96,16 @@ body, .gradio-container {
115
  }
116
 
117
  @media (max-width: 768px) {
118
- .header-gradient { padding: 2rem 1.5rem !important; margin: 1rem 0.5rem !important; border-radius: 16px !important; }
119
- .demo-btn { padding: 0.9rem 1.5rem !important; font-size: 0.95rem !important; max-width: 280px !important; }
120
- .video-player { height: 250px !important; }
121
- .center-content { padding: 1.5rem 1rem !important; gap: 1rem !important; }
122
  }
123
 
124
  @media (max-width: 480px) {
125
- .video-player { height: 220px !important; }
126
- .demo-btn { padding: 0.8rem 1.2rem !important; font-size: 0.9rem !important; }
127
  }
128
  """
129
 
130
- # ✅ FINAL VERSION - Gradio 6.0+ HF Spaces Compatible
131
  with gr.Blocks(fill_height=True) as demo:
132
 
133
  gr.Markdown(
@@ -144,7 +122,7 @@ with gr.Blocks(fill_height=True) as demo:
144
 
145
  gr.HTML(f"""
146
  <div style="display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin: 1rem 0;">
147
- {' '.join([f'<span class="skill-badge">🛠️ {skill}</span>' for skill in proj["skills"]])}
148
  </div>
149
  """)
150
 
@@ -156,16 +134,25 @@ with gr.Blocks(fill_height=True) as demo:
156
  </div>
157
  ''')
158
 
 
159
  gr.HTML(f'''
160
- <div class="video-player">
161
- <video controls preload="metadata">
162
- <source src="{proj['video']}" type="video/mp4">
163
- Your browser does not support the video tag.
164
- </video>
 
 
 
 
 
 
 
 
 
165
  </div>
166
  ''')
167
 
168
- # ✅ PERFECT HF SPACES LAUNCH - Removed enable_queue
169
  demo.launch(
170
  share=True,
171
  debug=True,
 
 
 
1
  import gradio as gr
2
 
3
  projects = [
 
16
  box-sizing: border-box;
17
  }
18
 
19
+ body, .gradio-container { margin: 0 !important; padding: 0 !important; overflow-x: hidden !important; }
 
 
 
 
20
 
21
  .glass-card {
22
  background: rgba(255, 255, 255, 0.12) !important;
 
24
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
25
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
26
  border-radius: 20px !important;
27
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
 
 
 
28
  margin: 1rem !important;
29
  }
30
 
 
35
  text-align: center !important;
36
  box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3) !important;
37
  margin: 1.5rem auto !important;
 
 
38
  max-width: 800px !important;
39
  }
40
 
 
49
  width: 100% !important;
50
  max-width: 320px !important;
51
  margin: 1rem auto !important;
52
+ transition: all 0.3s ease !important;
53
  text-decoration: none !important;
54
  display: inline-flex !important;
55
  align-items: center !important;
56
  justify-content: center !important;
 
 
 
57
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
58
  }
59
 
 
62
  box-shadow: 0 15px 35px rgba(255, 107, 107, 0.4) !important;
63
  }
64
 
65
+ .video-wrapper {
66
  width: 100% !important;
67
  max-width: 700px !important;
68
  height: 300px !important;
69
  border-radius: 16px !important;
70
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2) !important;
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
  .center-content {
 
80
  flex-direction: column !important;
81
  align-items: center !important;
82
  text-align: center !important;
 
83
  padding: 2rem 1rem !important;
84
  gap: 1.5rem !important;
85
  }
 
96
  }
97
 
98
  @media (max-width: 768px) {
99
+ .header-gradient { padding: 2rem 1.5rem !important; margin: 1rem 0.5rem !important; }
100
+ .video-wrapper { height: 250px !important; }
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(fill_height=True) as demo:
110
 
111
  gr.Markdown(
 
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
 
 
134
  </div>
135
  ''')
136
 
137
+ # ✅ FIXED VIDEOS - Screenshot + Download Link
138
  gr.HTML(f'''
139
+ <div class="video-wrapper">
140
+ <div style="text-align: center; padding: 2rem; color: #666;">
141
+ <div style="font-size: 3rem; margin-bottom: 1rem;">📹</div>
142
+ <div style="font-size: 1.2rem; font-weight: 600; margin-bottom: 0.5rem;">
143
+ {proj['name']} Demo
144
+ </div>
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,