hysts HF Staff commited on
Commit
9ac366f
·
1 Parent(s): 231fe43

Use style.css

Browse files
Files changed (2) hide show
  1. app.py +1 -129
  2. style.css +123 -3
app.py CHANGED
@@ -60,134 +60,6 @@ custom_theme = gr.themes.Soft(
60
  block_label_text_weight="500",
61
  )
62
 
63
- # Custom CSS for mobile-first responsive design
64
- custom_css = """
65
- /* Mobile-first responsive design */
66
- .gradio-container {
67
- max-width: 900px !important;
68
- margin: 0 auto !important;
69
- padding: 1rem !important;
70
- }
71
-
72
- /* Header styling */
73
- .header-container {
74
- text-align: center;
75
- margin-bottom: 2rem;
76
- padding: 1.5rem 1rem;
77
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
78
- border-radius: 1rem;
79
- color: white;
80
- }
81
-
82
- .header-title {
83
- font-size: 2rem;
84
- font-weight: 700;
85
- margin-bottom: 0.5rem;
86
- line-height: 1.2;
87
- }
88
-
89
- .header-subtitle {
90
- font-size: 1rem;
91
- opacity: 0.95;
92
- font-weight: 400;
93
- }
94
-
95
- /* Main content card */
96
- .main-card {
97
- background: white;
98
- border-radius: 1rem;
99
- padding: 1.5rem;
100
- box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
101
- margin-bottom: 1.5rem;
102
- }
103
-
104
- /* Audio component styling */
105
- .audio-container {
106
- margin-bottom: 1.5rem;
107
- }
108
-
109
- /* Transcription output styling */
110
- .transcription-output {
111
- min-height: 120px;
112
- background: #f8fafc;
113
- border-radius: 0.75rem;
114
- padding: 1rem;
115
- font-size: 1rem;
116
- line-height: 1.6;
117
- }
118
-
119
- /* Examples styling */
120
- .examples-container {
121
- margin-top: 2rem;
122
- }
123
-
124
- /* Footer */
125
- .footer-container {
126
- text-align: center;
127
- padding: 1.5rem 1rem;
128
- margin-top: 2rem;
129
- border-top: 1px solid #e2e8f0;
130
- font-size: 0.875rem;
131
- color: #64748b;
132
- }
133
-
134
- .footer-link {
135
- color: #667eea;
136
- text-decoration: none;
137
- font-weight: 500;
138
- transition: color 0.2s;
139
- }
140
-
141
- .footer-link:hover {
142
- color: #764ba2;
143
- }
144
-
145
- /* Mobile optimizations */
146
- @media (max-width: 640px) {
147
- .header-title {
148
- font-size: 1.5rem;
149
- }
150
-
151
- .header-subtitle {
152
- font-size: 0.875rem;
153
- }
154
-
155
- .main-card {
156
- padding: 1rem;
157
- }
158
-
159
- .gradio-container {
160
- padding: 0.5rem !important;
161
- }
162
- }
163
-
164
- /* Button styling */
165
- .primary-button {
166
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
167
- border: none !important;
168
- font-weight: 600 !important;
169
- padding: 0.75rem 2rem !important;
170
- font-size: 1rem !important;
171
- transition: transform 0.2s, box-shadow 0.2s !important;
172
- }
173
-
174
- .primary-button:hover {
175
- transform: translateY(-2px) !important;
176
- box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3) !important;
177
- }
178
-
179
- /* Info banner */
180
- .info-banner {
181
- background: #eff6ff;
182
- border-left: 4px solid #3b82f6;
183
- padding: 1rem;
184
- border-radius: 0.5rem;
185
- margin-bottom: 1.5rem;
186
- font-size: 0.875rem;
187
- color: #1e40af;
188
- }
189
- """
190
-
191
  with gr.Blocks(fill_height=False) as demo:
192
  # Header
193
  gr.HTML("""
@@ -265,7 +137,7 @@ with gr.Blocks(fill_height=False) as demo:
265
  if __name__ == "__main__":
266
  demo.launch(
267
  theme=custom_theme,
268
- css=custom_css,
269
  footer_links=[
270
  {"label": "Built with anycoder", "url": "https://huggingface.co/spaces/akhaliq/anycoder"},
271
  {"label": "Model", "url": "https://huggingface.co/kyutai/stt-2.6b-en-trfs"},
 
60
  block_label_text_weight="500",
61
  )
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  with gr.Blocks(fill_height=False) as demo:
64
  # Header
65
  gr.HTML("""
 
137
  if __name__ == "__main__":
138
  demo.launch(
139
  theme=custom_theme,
140
+ css_paths="style.css",
141
  footer_links=[
142
  {"label": "Built with anycoder", "url": "https://huggingface.co/spaces/akhaliq/anycoder"},
143
  {"label": "Model", "url": "https://huggingface.co/kyutai/stt-2.6b-en-trfs"},
style.css CHANGED
@@ -1,4 +1,124 @@
1
- h1 {
2
- text-align: center;
3
- display: block;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  }
 
1
+ /* Mobile-first responsive design */
2
+ .gradio-container {
3
+ max-width: 900px !important;
4
+ margin: 0 auto !important;
5
+ padding: 1rem !important;
6
+ }
7
+
8
+ /* Header styling */
9
+ .header-container {
10
+ text-align: center;
11
+ margin-bottom: 2rem;
12
+ padding: 1.5rem 1rem;
13
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
14
+ border-radius: 1rem;
15
+ color: white;
16
+ }
17
+
18
+ .header-title {
19
+ font-size: 2rem;
20
+ font-weight: 700;
21
+ margin-bottom: 0.5rem;
22
+ line-height: 1.2;
23
+ }
24
+
25
+ .header-subtitle {
26
+ font-size: 1rem;
27
+ opacity: 0.95;
28
+ font-weight: 400;
29
+ }
30
+
31
+ /* Main content card */
32
+ .main-card {
33
+ background: white;
34
+ border-radius: 1rem;
35
+ padding: 1.5rem;
36
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
37
+ margin-bottom: 1.5rem;
38
+ }
39
+
40
+ /* Audio component styling */
41
+ .audio-container {
42
+ margin-bottom: 1.5rem;
43
+ }
44
+
45
+ /* Transcription output styling */
46
+ .transcription-output {
47
+ min-height: 120px;
48
+ background: #f8fafc;
49
+ border-radius: 0.75rem;
50
+ padding: 1rem;
51
+ font-size: 1rem;
52
+ line-height: 1.6;
53
+ }
54
+
55
+ /* Examples styling */
56
+ .examples-container {
57
+ margin-top: 2rem;
58
+ }
59
+
60
+ /* Footer */
61
+ .footer-container {
62
+ text-align: center;
63
+ padding: 1.5rem 1rem;
64
+ margin-top: 2rem;
65
+ border-top: 1px solid #e2e8f0;
66
+ font-size: 0.875rem;
67
+ color: #64748b;
68
+ }
69
+
70
+ .footer-link {
71
+ color: #667eea;
72
+ text-decoration: none;
73
+ font-weight: 500;
74
+ transition: color 0.2s;
75
+ }
76
+
77
+ .footer-link:hover {
78
+ color: #764ba2;
79
+ }
80
+
81
+ /* Mobile optimizations */
82
+ @media (max-width: 640px) {
83
+ .header-title {
84
+ font-size: 1.5rem;
85
+ }
86
+
87
+ .header-subtitle {
88
+ font-size: 0.875rem;
89
+ }
90
+
91
+ .main-card {
92
+ padding: 1rem;
93
+ }
94
+
95
+ .gradio-container {
96
+ padding: 0.5rem !important;
97
+ }
98
+ }
99
+
100
+ /* Button styling */
101
+ .primary-button {
102
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
103
+ border: none !important;
104
+ font-weight: 600 !important;
105
+ padding: 0.75rem 2rem !important;
106
+ font-size: 1rem !important;
107
+ transition: transform 0.2s, box-shadow 0.2s !important;
108
+ }
109
+
110
+ .primary-button:hover {
111
+ transform: translateY(-2px) !important;
112
+ box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3) !important;
113
+ }
114
+
115
+ /* Info banner */
116
+ .info-banner {
117
+ background: #eff6ff;
118
+ border-left: 4px solid #3b82f6;
119
+ padding: 1rem;
120
+ border-radius: 0.5rem;
121
+ margin-bottom: 1.5rem;
122
+ font-size: 0.875rem;
123
+ color: #1e40af;
124
  }