Toya0421 commited on
Commit
9d661b1
·
verified ·
1 Parent(s): 232fa70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +69 -4
app.py CHANGED
@@ -408,20 +408,85 @@ def finish_or_retire(pages_json, current_page, pid, orig_lev, action):
408
  # UI
409
  # ======================================================
410
  custom_css = """
 
 
 
411
  .big-text {
412
  font-size: 20px !important;
413
  line-height: 1.8 !important;
414
  font-family: "Noto Sans", sans-serif !important;
415
  }
416
 
 
417
  .reading-area {
418
- background-color: #fafafa;
419
- padding: 20px;
420
- border-radius: 10px;
421
- border: 1px solid #ddd;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
422
  }
423
  """
424
 
 
425
  with gr.Blocks(css=custom_css) as demo:
426
  gr.Markdown("# 📚 Reading Exercise")
427
 
 
408
  # UI
409
  # ======================================================
410
  custom_css = """
411
+ /* ===============================
412
+ 共通(両モード)
413
+ =============================== */
414
  .big-text {
415
  font-size: 20px !important;
416
  line-height: 1.8 !important;
417
  font-family: "Noto Sans", sans-serif !important;
418
  }
419
 
420
+ /* 教材表示ボックス */
421
  .reading-area {
422
+ padding: 20px !important;
423
+ border-radius: 12px !important;
424
+ border: 1px solid #ccc !important;
425
+ transition: background-color 0.2s ease, color 0.2s ease;
426
+ }
427
+
428
+ /* ===============================
429
+ ライトモード
430
+ =============================== */
431
+ @media (prefers-color-scheme: light) {
432
+ body, .gradio-container {
433
+ background-color: #ffffff !important;
434
+ color: #222 !important;
435
+ }
436
+
437
+ .reading-area {
438
+ background-color: #fafafa !important;
439
+ color: #222 !important;
440
+ border-color: #ddd !important;
441
+ }
442
+
443
+ textarea, input, .gr-textbox textarea {
444
+ background-color: #ffffff !important;
445
+ color: #222 !important;
446
+ border: 1px solid #ccc !important;
447
+ }
448
+ }
449
+
450
+ /* ===============================
451
+ ダークモード
452
+ =============================== */
453
+ @media (prefers-color-scheme: dark) {
454
+ body, .gradio-container {
455
+ background-color: #1e1e1e !important;
456
+ color: #e6e6e6 !important;
457
+ }
458
+
459
+ /* 教材の背景は黒すぎると読みにくいのでやや明るめのチャコール */
460
+ .reading-area {
461
+ background-color: #2a2a2a !important;
462
+ color: #f2f2f2 !important;
463
+ border-color: #444 !important;
464
+ }
465
+
466
+ textarea, input, .gr-textbox textarea {
467
+ background-color: #2c2c2c !important;
468
+ color: #f0f0f0 !important;
469
+ border: 1px solid #555 !important;
470
+ }
471
+
472
+ /* ボタンを見やすく */
473
+ button {
474
+ background-color: #3a3a3a !important;
475
+ color: #f0f0f0 !important;
476
+ border: 1px solid #555 !important;
477
+ }
478
+ button:hover {
479
+ background-color: #4a4a4a !important;
480
+ }
481
+
482
+ .gr-panel, .gr-box, .gr-group {
483
+ background-color: #272727 !important;
484
+ border-color: #444 !important;
485
+ }
486
  }
487
  """
488
 
489
+
490
  with gr.Blocks(css=custom_css) as demo:
491
  gr.Markdown("# 📚 Reading Exercise")
492