rdsarjito commited on
Commit
86f9eec
·
1 Parent(s): 9d24073
Files changed (1) hide show
  1. app.py +35 -121
app.py CHANGED
@@ -473,139 +473,53 @@ def predict_batch_urls(file_obj):
473
 
474
  # Custom CSS for professional styling
475
  custom_css = """
476
- * {
477
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
478
- }
479
  .main-header {
480
  text-align: center;
481
- padding: 3rem 2rem;
482
- background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
483
- color: #ffffff;
484
- border-radius: 8px;
485
- margin-bottom: 2.5rem;
486
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
487
  }
488
  .main-header h1 {
489
  margin: 0;
490
- font-size: 2.25rem;
491
- font-weight: 600;
492
- letter-spacing: -0.5px;
493
- color: #ffffff;
494
  }
495
  .main-header p {
496
- margin: 0.75rem 0 0 0;
497
- font-size: 1rem;
498
- opacity: 0.95;
499
- font-weight: 400;
500
- color: #e2e8f0;
501
- }
502
- .gradio-container {
503
- max-width: 1400px;
504
- margin: 0 auto;
505
- padding: 0 1.5rem;
506
- }
507
- .gradio-block {
508
- background: #ffffff;
509
- }
510
- h2, h3, h4 {
511
- color: #1a202c;
512
- font-weight: 600;
513
- letter-spacing: -0.3px;
514
- }
515
- .gr-markdown {
516
- color: #4a5568;
517
- line-height: 1.6;
518
- }
519
- .gr-button {
520
- background: #2c5282;
521
- color: #ffffff;
522
- border: none;
523
- font-weight: 500;
524
- transition: all 0.2s ease;
525
- }
526
- .gr-button:hover {
527
- background: #2a4d7a;
528
- transform: translateY(-1px);
529
- box-shadow: 0 4px 8px rgba(44, 82, 130, 0.3);
530
  }
531
- .gr-textbox, .gr-textbox input {
532
- border: 1px solid #cbd5e0;
533
- border-radius: 6px;
534
- transition: border-color 0.2s ease;
 
 
535
  }
536
- .gr-textbox:focus-within, .gr-textbox input:focus {
537
- border-color: #2c5282;
538
- box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.1);
539
- }
540
- .gr-tabs {
541
- border-bottom: 2px solid #e2e8f0;
542
- }
543
- .gr-tab {
544
- color: #4a5568;
545
- font-weight: 500;
546
- padding: 1rem 1.5rem;
547
- }
548
- .gr-tab.selected {
549
- color: #2c5282;
550
- border-bottom: 2px solid #2c5282;
551
- }
552
- .gr-label {
553
- background: #f7fafc;
554
- border: 1px solid #e2e8f0;
555
- border-radius: 6px;
556
- }
557
- .gr-image {
558
- border: 1px solid #e2e8f0;
559
- border-radius: 6px;
560
- overflow: hidden;
561
  }
562
- .gr-accordion {
563
- border: 1px solid #e2e8f0;
564
- border-radius: 6px;
565
- background: #f7fafc;
566
  }
567
- .gr-dataframe {
568
- border: 1px solid #e2e8f0;
569
- border-radius: 6px;
570
  }
571
- hr {
572
- border: none;
573
- border-top: 1px solid #e2e8f0;
574
- margin: 2rem 0;
575
  }
576
  """
577
 
578
- # Professional theme configuration
579
- professional_theme = gr.themes.Default(
580
- primary_hue=gr.themes.colors.blue,
581
- font=("-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica Neue", "Arial", "sans-serif"),
582
- ).set(
583
- button_primary_background_fill="#2c5282",
584
- button_primary_background_fill_hover="#2a4d7a",
585
- button_primary_text_color="#ffffff",
586
- button_primary_background_fill_dark="#2c5282",
587
- border_color_primary="#e2e8f0",
588
- border_color_accent="#2c5282",
589
- background_fill_primary="#ffffff",
590
- background_fill_secondary="#f7fafc",
591
- body_text_color="#1a202c",
592
- body_text_color_subdued="#4a5568",
593
- block_background_fill="#ffffff",
594
- block_border_color="#e2e8f0",
595
- block_border_width="1px",
596
- block_radius="8px",
597
- block_shadow="0 2px 4px rgba(0,0,0,0.05)",
598
- input_background_fill="#ffffff",
599
- input_border_color="#cbd5e0",
600
- input_border_width="1px",
601
- input_radius="6px",
602
- checkbox_background_color="#2c5282",
603
- checkbox_border_color="#cbd5e0",
604
- checkbox_border_radius="4px",
605
- slider_color="#2c5282",
606
- )
607
-
608
- with gr.Blocks(theme=professional_theme, css=custom_css, title="Gambling Website Detector") as app:
609
  # Header Section
610
  with gr.Row():
611
  gr.HTML("""
@@ -748,9 +662,9 @@ with gr.Blocks(theme=professional_theme, css=custom_css, title="Gambling Website
748
  # Footer
749
  gr.Markdown("---")
750
  gr.Markdown("""
751
- <div style="text-align: center; color: #4a5568; padding: 2rem 1rem; font-size: 0.875rem; line-height: 1.6;">
752
- <p style="margin: 0.5rem 0; color: #2c5282; font-weight: 500;">Powered by PyTorch • Gradio • EfficientNet • IndoBERT</p>
753
- <p style="margin: 0.5rem 0; color: #718096;">This tool is for educational and research purposes only</p>
754
  </div>
755
  """)
756
 
 
473
 
474
  # Custom CSS for professional styling
475
  custom_css = """
 
 
 
476
  .main-header {
477
  text-align: center;
478
+ padding: 2rem 0;
479
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
480
+ color: white;
481
+ border-radius: 10px;
482
+ margin-bottom: 2rem;
 
483
  }
484
  .main-header h1 {
485
  margin: 0;
486
+ font-size: 2.5rem;
487
+ font-weight: 700;
 
 
488
  }
489
  .main-header p {
490
+ margin: 0.5rem 0 0 0;
491
+ font-size: 1.1rem;
492
+ opacity: 0.9;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
493
  }
494
+ .result-card {
495
+ background: #f8f9fa;
496
+ padding: 1.5rem;
497
+ border-radius: 10px;
498
+ border: 2px solid #e9ecef;
499
+ margin: 1rem 0;
500
  }
501
+ .info-box {
502
+ background: #e7f3ff;
503
+ padding: 1rem;
504
+ border-radius: 8px;
505
+ border-left: 4px solid #2196F3;
506
+ margin: 1rem 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
507
  }
508
+ .success-box {
509
+ background: #d4edda;
510
+ border-left-color: #28a745;
 
511
  }
512
+ .warning-box {
513
+ background: #fff3cd;
514
+ border-left-color: #ffc107;
515
  }
516
+ .gradio-container {
517
+ max-width: 1200px;
518
+ margin: 0 auto;
 
519
  }
520
  """
521
 
522
+ with gr.Blocks(theme=gr.themes.Soft(), css=custom_css, title="Gambling Website Detector") as app:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
523
  # Header Section
524
  with gr.Row():
525
  gr.HTML("""
 
662
  # Footer
663
  gr.Markdown("---")
664
  gr.Markdown("""
665
+ <div style="text-align: center; color: #666; padding: 1rem;">
666
+ <p>Powered by PyTorch • Gradio • EfficientNet • IndoBERT</p>
667
+ <p style="font-size: 0.9rem;">This tool is for educational and research purposes only</p>
668
  </div>
669
  """)
670