import streamlit as st import random import time from datetime import datetime # Page configuration st.set_page_config( page_title="Darbar-e-Dil | دربارِ دل", page_icon="💖", layout="centered", initial_sidebar_state="collapsed" ) # Custom CSS for enhanced styling st.markdown(""" """, unsafe_allow_html=True) # Compliment templates with placeholders COMPLIMENT_TEMPLATES = { 'beauty_based': [ "Your name {name} means {meaning}, and just like its meaning, your beauty illuminates every corner of my heart. You are the definition of grace and elegance.", "Like the meaning of {name} - {meaning}, your presence brings light to my darkest days. Your smile is more radiant than a thousand stars.", "The name {name} carries the essence of {meaning}, and you embody this beauty in every breath you take. You are poetry in motion.", ], 'personality_based': [ "Your name {name}, meaning {meaning}, perfectly captures your incredible spirit. Your kindness touches every soul you meet.", "Just as {name} means {meaning}, your heart reflects the same beautiful qualities. You make the world a better place simply by existing.", "The meaning of {name} - {meaning} - is written in your every gesture. Your compassion knows no bounds.", ], 'romantic': [ "My beloved {name}, your name means {meaning}, and you mean everything to me. My heart beats only for you.", "In the garden of my heart, you bloom like the most beautiful flower. {name}, meaning {meaning}, you are my eternal love.", "Every letter of your name {name} spells magic, and its meaning {meaning} describes the miracle you are in my life.", ] } # Urdu compliments corresponding to each category URDU_COMPLIMENTS = { 'beauty_based': [ "آپ کا نام {name} ہے جس کا مطلب {meaning} ہے، اور آپ اپنے نام کی طرح ہی خوبصورت ہیں۔ آپ کی خوبصورتی چاند کو بھی شرمندہ کر دیتی ہے۔", "جیسے آپ کے نام {name} کا مطلب {meaning} ہے، ویسے ہی آپ کی خوبصورتی میرے دل کو روشن کر دیتی ہے۔", "آپ کا نام {name} ہے اور اس کا مطلب {meaning} ہے، لیکن آپ کی خوبصورتی کا کوئی مطلب نہیں، وہ تو بے مثال ہے۔", ], 'personality_based': [ "آپ کا نام {name} ہے جس کا مطلب {meaning} ہے، اور آپ کی شخصیت بالکل اسی طرح پیاری ہے۔", "جس طرح {name} کا مطلب {meaning} ہے، اسی طرح آپ کا دل بھی اتنا ہی پاک اور صاف ہے۔", "آپ کے نام {name} کا مطلب {meaning} ہے، اور آپ اس کی زندہ مثال ہیں۔", ], 'romantic': [ "میری محبوبہ {name}، آپ کے نام کا مطلب {meaning} ہے، لیکن میرے لیے آپ کا مطلب زندگی ہے۔", "آپ کا نام {name} ہے اور اس کا مطلب {meaning} ہے، لیکن میرے دل میں آپ کا مطلب عشق ہے۔", "جب سے آپ کو دیکھا ہے {name}، میرا دل صرف آپ کا ہو گیا ہے۔ آپ کے نام کا مطلب {meaning} ہے، لیکن میرے لیے آپ کا مطلب محبت ہے۔", ] } def generate_compliment(name, meaning): """Generate a romantic compliment based on name and meaning""" if not name or not meaning: return None, None # Choose random category category = random.choice(list(COMPLIMENT_TEMPLATES.keys())) # Get templates for the category english_templates = COMPLIMENT_TEMPLATES[category] urdu_templates = URDU_COMPLIMENTS[category] # Choose random template from category english_template = random.choice(english_templates) urdu_template = random.choice(urdu_templates) # Format with name and meaning english_compliment = english_template.format(name=name, meaning=meaning) urdu_compliment = urdu_template.format(name=name, meaning=meaning) return english_compliment, urdu_compliment def display_floating_hearts(): """Display animated hearts effect""" st.markdown("""
Where hearts speak the language of love | جہاں دل محبت کی زبان بولتے ہیں
', unsafe_allow_html=True) # Heart divider st.markdown('