Tachyeon commited on
Commit
eb3243f
·
verified ·
1 Parent(s): 2f2c81e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -35
app.py CHANGED
@@ -1,23 +1,23 @@
1
  import gradio as gr
2
 
3
  # -----------------------------
4
- # CSS (FINAL, FIXED, ALIGNED)
5
  # -----------------------------
6
  css = """
7
  :root {
8
  --bg1: #1a0c12;
9
  --bg2: #3a1523;
10
- --surface: rgba(255,255,255,0.04);
11
- --surface-soft: rgba(255,255,255,0.03);
12
  --border: rgba(255,255,255,0.10);
13
- --text: #f5f5f5;
14
  --muted: rgba(255,255,255,0.65);
15
  --accent: #ff5c8a;
16
  }
17
 
18
  body {
19
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
20
- font-family: Poppins, system-ui, sans-serif;
21
  }
22
 
23
  .gradio-container {
@@ -27,7 +27,7 @@ body {
27
 
28
  /* Header */
29
  .header {
30
- margin-bottom: 28px;
31
  }
32
  .logo {
33
  font-size: 42px;
@@ -40,7 +40,7 @@ body {
40
  color: var(--accent);
41
  }
42
 
43
- /* Section text */
44
  .section-title {
45
  font-size: 20px;
46
  font-weight: 600;
@@ -51,7 +51,7 @@ body {
51
  margin-bottom: 14px;
52
  }
53
 
54
- /* GRID — THIS IS THE KEY FIX */
55
  .main-grid {
56
  display: grid;
57
  grid-template-columns: 2fr 1fr 1fr;
@@ -59,18 +59,18 @@ body {
59
  gap: 22px;
60
  }
61
 
62
- /* Upload box */
63
  .upload-box {
64
  grid-row: span 2;
65
- background: var(--surface);
66
  border: 1px solid var(--border);
67
  border-radius: 14px;
68
- padding: 20px;
69
  }
70
 
71
- /* Stem boxes */
72
  .stem-box {
73
- background: var(--surface-soft);
74
  border: 1px solid var(--border);
75
  border-radius: 14px;
76
  padding: 14px;
@@ -99,7 +99,6 @@ body {
99
  letter-spacing: 0.3px;
100
  }
101
 
102
- /* Footer off */
103
  footer { display: none !important; }
104
  """
105
 
@@ -109,50 +108,44 @@ footer { display: none !important; }
109
  with gr.Blocks() as demo:
110
 
111
  # Header
112
- gr.Markdown(
113
- """
114
  <div class="header">
115
  <div class="logo">SWARA STUDIO</div>
116
  <div class="tagline">Separating Music Into Its elements</div>
117
  </div>
118
- """,
119
- unsafe_allow_html=True
120
- )
121
 
122
- # Intro text
123
- gr.Markdown(
124
- """
125
  <div class="section-title">Select a track</div>
126
  <div class="section-sub">We’ll break it down into individual parts</div>
127
- """,
128
- unsafe_allow_html=True
129
- )
130
 
131
- # MAIN GRID
132
  with gr.Row(elem_classes="main-grid"):
133
 
134
- # LEFT — Upload (spans 2 rows visually via CSS)
135
  with gr.Column(elem_classes="upload-box"):
136
  audio_in = gr.Audio(label="Audio", type="filepath")
137
 
138
- # RIGHT — Vocals
139
  with gr.Column(elem_classes="stem-box"):
140
- gr.Markdown('<div class="stem-title">Vocals</div>', unsafe_allow_html=True)
141
  vocals = gr.Audio(label=None)
142
 
143
- # RIGHT — Drums
144
  with gr.Column(elem_classes="stem-box"):
145
- gr.Markdown('<div class="stem-title">Drums</div>', unsafe_allow_html=True)
146
  drums = gr.Audio(label=None)
147
 
148
- # RIGHT — Bass
149
  with gr.Column(elem_classes="stem-box"):
150
- gr.Markdown('<div class="stem-title">Bass</div>', unsafe_allow_html=True)
151
  bass = gr.Audio(label=None)
152
 
153
- # RIGHT — Other
154
  with gr.Column(elem_classes="stem-box"):
155
- gr.Markdown('<div class="stem-title">Other</div>', unsafe_allow_html=True)
156
  other = gr.Audio(label=None)
157
 
158
  # Action
 
1
  import gradio as gr
2
 
3
  # -----------------------------
4
+ # CSS (Gradio 6 compatible)
5
  # -----------------------------
6
  css = """
7
  :root {
8
  --bg1: #1a0c12;
9
  --bg2: #3a1523;
10
+ --panel: rgba(255,255,255,0.04);
11
+ --panel-soft: rgba(255,255,255,0.03);
12
  --border: rgba(255,255,255,0.10);
13
+ --text: #f4f4f4;
14
  --muted: rgba(255,255,255,0.65);
15
  --accent: #ff5c8a;
16
  }
17
 
18
  body {
19
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
20
+ font-family: Inter, system-ui, sans-serif;
21
  }
22
 
23
  .gradio-container {
 
27
 
28
  /* Header */
29
  .header {
30
+ margin-bottom: 26px;
31
  }
32
  .logo {
33
  font-size: 42px;
 
40
  color: var(--accent);
41
  }
42
 
43
+ /* Section */
44
  .section-title {
45
  font-size: 20px;
46
  font-weight: 600;
 
51
  margin-bottom: 14px;
52
  }
53
 
54
+ /* GRID */
55
  .main-grid {
56
  display: grid;
57
  grid-template-columns: 2fr 1fr 1fr;
 
59
  gap: 22px;
60
  }
61
 
62
+ /* Upload */
63
  .upload-box {
64
  grid-row: span 2;
65
+ background: var(--panel);
66
  border: 1px solid var(--border);
67
  border-radius: 14px;
68
+ padding: 18px;
69
  }
70
 
71
+ /* Stems */
72
  .stem-box {
73
+ background: var(--panel-soft);
74
  border: 1px solid var(--border);
75
  border-radius: 14px;
76
  padding: 14px;
 
99
  letter-spacing: 0.3px;
100
  }
101
 
 
102
  footer { display: none !important; }
103
  """
104
 
 
108
  with gr.Blocks() as demo:
109
 
110
  # Header
111
+ gr.HTML("""
 
112
  <div class="header">
113
  <div class="logo">SWARA STUDIO</div>
114
  <div class="tagline">Separating Music Into Its elements</div>
115
  </div>
116
+ """)
 
 
117
 
118
+ # Intro
119
+ gr.HTML("""
 
120
  <div class="section-title">Select a track</div>
121
  <div class="section-sub">We’ll break it down into individual parts</div>
122
+ """)
 
 
123
 
124
+ # Main grid
125
  with gr.Row(elem_classes="main-grid"):
126
 
127
+ # Upload (aligned by grid, not hacks)
128
  with gr.Column(elem_classes="upload-box"):
129
  audio_in = gr.Audio(label="Audio", type="filepath")
130
 
131
+ # Vocals
132
  with gr.Column(elem_classes="stem-box"):
133
+ gr.HTML('<div class="stem-title">Vocals</div>')
134
  vocals = gr.Audio(label=None)
135
 
136
+ # Drums
137
  with gr.Column(elem_classes="stem-box"):
138
+ gr.HTML('<div class="stem-title">Drums</div>')
139
  drums = gr.Audio(label=None)
140
 
141
+ # Bass
142
  with gr.Column(elem_classes="stem-box"):
143
+ gr.HTML('<div class="stem-title">Bass</div>')
144
  bass = gr.Audio(label=None)
145
 
146
+ # Other
147
  with gr.Column(elem_classes="stem-box"):
148
+ gr.HTML('<div class="stem-title">Other</div>')
149
  other = gr.Audio(label=None)
150
 
151
  # Action