Kosala Nayanajith Deshapriya commited on
Commit
65ff6c9
Β·
1 Parent(s): 2e1637f

Replace target emoji with favicon in hero header

Browse files
Files changed (1) hide show
  1. dashboard.py +13 -2
dashboard.py CHANGED
@@ -10,6 +10,7 @@ import json
10
  import math
11
  import pandas as pd
12
  import plotly.graph_objects as go
 
13
  from PIL import Image
14
  from youtube_auth import get_credentials, show_login_button, logout
15
 
@@ -591,13 +592,23 @@ def build_retention_ring(percent, color, size=76):
591
  font-family="Inter, sans-serif">{percent:.0f}%</text>
592
  </svg>"""
593
 
 
 
 
 
 
 
 
594
 
595
  # ═══════════════════════════════════════════════════════════════
596
  # HERO HEADER
597
  # ═══════════════════════════════════════════════════════════════
598
- st.markdown("""
 
 
 
599
  <div style="animation: fadeInUp 0.5s ease-out both;">
600
- <div class="hero-title">🎯 Ad Placement Recommender</div>
601
  <div class="hero-subtitle">
602
  Find the perfect moments in your video to place ads β€” so viewers stay happy and you earn more.
603
  </div>
 
10
  import math
11
  import pandas as pd
12
  import plotly.graph_objects as go
13
+ import base64
14
  from PIL import Image
15
  from youtube_auth import get_credentials, show_login_button, logout
16
 
 
592
  font-family="Inter, sans-serif">{percent:.0f}%</text>
593
  </svg>"""
594
 
595
+ def get_base64_image(image_path):
596
+ try:
597
+ with open(image_path, "rb") as img_file:
598
+ return base64.b64encode(img_file.read()).decode()
599
+ except Exception:
600
+ return ""
601
+
602
 
603
  # ═══════════════════════════════════════════════════════════════
604
  # HERO HEADER
605
  # ═══════════════════════════════════════════════════════════════
606
+ favicon_b64 = get_base64_image("favicon.png")
607
+ icon_html = f'<img src="data:image/png;base64,{favicon_b64}" style="height:1.2em; vertical-align:middle; margin-right:0.3rem;" />' if favicon_b64 else "🎯"
608
+
609
+ st.markdown(f"""
610
  <div style="animation: fadeInUp 0.5s ease-out both;">
611
+ <div class="hero-title">{icon_html} Ad Placement Recommender</div>
612
  <div class="hero-subtitle">
613
  Find the perfect moments in your video to place ads β€” so viewers stay happy and you earn more.
614
  </div>