dmmmmm commited on
Commit
c764f63
·
verified ·
1 Parent(s): 43255b1

Upload 25 files

Browse files
Files changed (2) hide show
  1. src/ui/interface.py +4 -2
  2. static/css/styles.css +51 -1
src/ui/interface.py CHANGED
@@ -222,7 +222,9 @@ class Veo3Interface:
222
  const wrap = input.querySelector('.wrap');
223
  if (wrap) {
224
  const allText = wrap.textContent;
225
- if (allText.includes('将文件') || allText.includes('点击上传') || allText.includes('拖放')) {
 
 
226
  hasChineseText = true;
227
  wrap.innerHTML = `
228
  <div style="font-size: 0.9rem; font-weight: 500; color: #4a5568; margin: 0.5rem 0;">Drag and drop files here</div>
@@ -237,7 +239,7 @@ class Veo3Interface:
237
  if (!hasChineseText) {
238
  clearInterval(textReplacer);
239
  }
240
- }, 100);
241
 
242
  // 监听DOM变化,处理动态添加的元素
243
  const observer = new MutationObserver(function(mutations) {
 
222
  const wrap = input.querySelector('.wrap');
223
  if (wrap) {
224
  const allText = wrap.textContent;
225
+ // 检查所有可能的中文文本
226
+ if (allText.includes('将文件') || allText.includes('点击上传') || allText.includes('拖放') ||
227
+ allText.includes('或') || allText.includes('此处')) {
228
  hasChineseText = true;
229
  wrap.innerHTML = `
230
  <div style="font-size: 0.9rem; font-weight: 500; color: #4a5568; margin: 0.5rem 0;">Drag and drop files here</div>
 
239
  if (!hasChineseText) {
240
  clearInterval(textReplacer);
241
  }
242
+ }, 50); // 更频繁的检查
243
 
244
  // 监听DOM变化,处理动态添加的元素
245
  const observer = new MutationObserver(function(mutations) {
static/css/styles.css CHANGED
@@ -522,7 +522,57 @@ footer {
522
  font-weight: 400 !important;
523
  }
524
 
525
- /* 文本样式保持原样,通过JavaScript替换内容 */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
526
 
527
  /* 拖拽状态 */
528
  .gr-file.dragover {
 
522
  font-weight: 400 !important;
523
  }
524
 
525
+ /* 强制隐藏中文文本并显示英文文本 */
526
+ .gr-file .wrap > div {
527
+ position: relative !important;
528
+ }
529
+
530
+ .gr-file .wrap > div::before {
531
+ content: "Drag and drop files here" !important;
532
+ position: absolute !important;
533
+ top: 0 !important;
534
+ left: 0 !important;
535
+ width: 100% !important;
536
+ height: 100% !important;
537
+ background: transparent !important;
538
+ color: #4a5568 !important;
539
+ font-size: 0.9rem !important;
540
+ font-weight: 500 !important;
541
+ display: flex !important;
542
+ align-items: center !important;
543
+ justify-content: center !important;
544
+ z-index: 10 !important;
545
+ }
546
+
547
+ .gr-file .wrap > div:nth-child(2)::before {
548
+ content: "- or -" !important;
549
+ color: #718096 !important;
550
+ font-size: 0.8rem !important;
551
+ font-weight: 400 !important;
552
+ }
553
+
554
+ .gr-file .wrap > div:nth-child(3)::before {
555
+ content: "or click to upload" !important;
556
+ color: #718096 !important;
557
+ font-size: 0.8rem !important;
558
+ font-weight: 400 !important;
559
+ }
560
+
561
+ /* 隐藏原始中文文本 */
562
+ .gr-file .wrap > div {
563
+ color: transparent !important;
564
+ font-size: 0 !important;
565
+ line-height: 0 !important;
566
+ height: 0 !important;
567
+ overflow: hidden !important;
568
+ margin: 0.5rem 0 !important;
569
+ }
570
+
571
+ .gr-file .wrap > div:nth-child(2),
572
+ .gr-file .wrap > div:nth-child(3) {
573
+ height: auto !important;
574
+ min-height: 20px !important;
575
+ }
576
 
577
  /* 拖拽状态 */
578
  .gr-file.dragover {