paulcalzada commited on
Commit
87774d4
·
verified ·
1 Parent(s): ddd06fc

Update app.py

Browse files

logo animation debugging JS issues right now

Files changed (1) hide show
  1. app.py +31 -32
app.py CHANGED
@@ -73,8 +73,8 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) a
73
  with gr.Column(scale=3):
74
  # --- DeepV Logo with CSS Background Image and animation ---
75
  with gr.Row(elem_id="logo-and-output-row"):
76
- # The div for the logo - the animation will be applied here
77
- gr.HTML("""
78
  <div id="animated-deepv-logo">
79
  <span class="deepv-char" id="deepv-D">D</span>
80
  <span class="deepv-char" id="deepv-E1">E</span>
@@ -82,7 +82,8 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) a
82
  <span class="deepv-char" id="deepv-P">P</span>
83
  <span class="deepv-char" id="deepv-V">V</span>
84
  </div>
85
- """)
 
86
  gr.Markdown("**Output**", elem_id="output-title")
87
 
88
  with gr.Group():
@@ -172,44 +173,44 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) a
172
  /* Logo and Output Row Layout */
173
  #logo-and-output-row {
174
  display: flex;
175
- align-items: center; /* Vertically align items */
176
- justify-content: center; /* Horizontally center contents */
177
- margin-bottom: 10px; /* Space between logo/title and output textbox */
178
- height: 80px; /* Give it enough height for the animation */
179
- position: relative; /* For absolute positioning of letters */
180
  }
181
 
182
  /* Styling for the animated logo container */
183
  #animated-deepv-logo {
184
  position: relative;
185
- width: 150px; /* Adjust width to fit "DEEPV" */
186
- height: 70px; /* Adjust height to fit "DEEPV" */
187
- display: flex; /* Use flex to align characters (initial state) */
188
  justify-content: center;
189
  align-items: center;
190
  font-family: 'Poppins', sans-serif;
191
  font-weight: 800;
192
- font-size: 4em; /* Make the V bigger */
193
  line-height: 1;
194
- overflow: hidden; /* Hide parts that are off-screen during animation */
195
- padding-right: 15px; /* Adjust for V overlap */
196
  }
197
 
198
  .deepv-char {
199
- position: absolute; /* Position characters independently */
200
  opacity: 0;
201
- transition: all 0.3s ease-out; /* Smooth transitions for non-animated changes */
202
  white-space: nowrap;
203
  }
204
 
205
  #deepv-V {
206
  color: var(--v-orange);
207
- font-size: 1.5em; /* Make V even bigger */
208
- opacity: 1; /* V is always present */
209
  top: 50%;
210
  left: 50%;
211
- transform: translate(-50%, -50%); /* Center the V */
212
- z-index: 1; /* V is behind other letters initially */
213
  }
214
 
215
  /* Positioning for DEEP letters relative to V */
@@ -228,20 +229,18 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) a
228
  @keyframes charHopAway {
229
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
230
  50% { opacity: 1; transform: translate(-50%, -100%) scale(1.1); }
231
- 100% { opacity: 0; transform: translate(-50%, -200%) scale(0.5); } /* Hop upwards and fade */
232
  }
233
 
234
 
235
- /* Output Title Styling */
236
  #output-title {
237
- margin: 0; /* Remove default margin from Markdown to prevent offset */
238
  font-size: 1.2em;
239
  font-weight: bold;
240
- margin-left: 20px; /* Adjust spacing from the logo */
241
- animation: fadeInScale 1.5s ease-out forwards; /* Keep fade animation */
242
  }
243
 
244
- /* General UI element styling */
245
  #verilog-output > label > .label-wrap {
246
  position: relative;
247
  }
@@ -276,13 +275,13 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) a
276
  100% { background-color: #e6f2ff; }
277
  }
278
  """
279
-
280
- # --- JavaScript for the custom animation ---
281
  demo.load(
282
- None,
283
- None,
284
- None,
285
- _js="""
286
  () => {
287
  const chars = ['deepv-D', 'deepv-E1', 'deepv-E2', 'deepv-P'];
288
  const V_char = document.getElementById('deepv-V');
 
73
  with gr.Column(scale=3):
74
  # --- DeepV Logo with CSS Background Image and animation ---
75
  with gr.Row(elem_id="logo-and-output-row"):
76
+ gr.Markdown(
77
+ """
78
  <div id="animated-deepv-logo">
79
  <span class="deepv-char" id="deepv-D">D</span>
80
  <span class="deepv-char" id="deepv-E1">E</span>
 
82
  <span class="deepv-char" id="deepv-P">P</span>
83
  <span class="deepv-char" id="deepv-V">V</span>
84
  </div>
85
+ """
86
+ )
87
  gr.Markdown("**Output**", elem_id="output-title")
88
 
89
  with gr.Group():
 
173
  /* Logo and Output Row Layout */
174
  #logo-and-output-row {
175
  display: flex;
176
+ align-items: center;
177
+ justify-content: center;
178
+ margin-bottom: 10px;
179
+ height: 80px;
180
+ position: relative;
181
  }
182
 
183
  /* Styling for the animated logo container */
184
  #animated-deepv-logo {
185
  position: relative;
186
+ width: 150px;
187
+ height: 70px;
188
+ display: flex;
189
  justify-content: center;
190
  align-items: center;
191
  font-family: 'Poppins', sans-serif;
192
  font-weight: 800;
193
+ font-size: 4em;
194
  line-height: 1;
195
+ overflow: hidden;
196
+ padding-right: 15px;
197
  }
198
 
199
  .deepv-char {
200
+ position: absolute;
201
  opacity: 0;
202
+ transition: all 0.3s ease-out;
203
  white-space: nowrap;
204
  }
205
 
206
  #deepv-V {
207
  color: var(--v-orange);
208
+ font-size: 1.5em;
209
+ opacity: 1;
210
  top: 50%;
211
  left: 50%;
212
+ transform: translate(-50%, -50%);
213
+ z-index: 1;
214
  }
215
 
216
  /* Positioning for DEEP letters relative to V */
 
229
  @keyframes charHopAway {
230
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
231
  50% { opacity: 1; transform: translate(-50%, -100%) scale(1.1); }
232
+ 100% { opacity: 0; transform: translate(-50%, -200%) scale(0.5); }
233
  }
234
 
235
 
 
236
  #output-title {
237
+ margin: 0;
238
  font-size: 1.2em;
239
  font-weight: bold;
240
+ margin-left: 20px;
241
+ animation: fadeInScale 1.5s ease-out forwards;
242
  }
243
 
 
244
  #verilog-output > label > .label-wrap {
245
  position: relative;
246
  }
 
275
  100% { background-color: #e6f2ff; }
276
  }
277
  """
278
+
279
+ # --- JavaScript to run on page load ---
280
  demo.load(
281
+ fn=None,
282
+ inputs=None,
283
+ outputs=None,
284
+ js="""
285
  () => {
286
  const chars = ['deepv-D', 'deepv-E1', 'deepv-E2', 'deepv-P'];
287
  const V_char = document.getElementById('deepv-V');