Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -144,17 +144,17 @@ BREED_INFO = {
|
|
| 144 |
"Ross 308": {
|
| 145 |
"description": "Big chest, thick legs, very fast growth. Excellent for meat production.",
|
| 146 |
"available_at": "Agrited, Sayed, Valentine",
|
| 147 |
-
"color": "#
|
| 148 |
},
|
| 149 |
"Cobb 500": {
|
| 150 |
"description": "Good early growth, strong legs, solid feed conversion.",
|
| 151 |
"available_at": "Chikun, Zartech",
|
| 152 |
-
"color": "#
|
| 153 |
},
|
| 154 |
"Arbor Acres": {
|
| 155 |
"description": "Balanced growth, hardy and adaptable. Great survival rate.",
|
| 156 |
"available_at": "Supreme, CHI, GS, Vertex, Fidan, Cascada, Orobor, Sunchi, Farm Support, Ajila",
|
| 157 |
-
"color": "#
|
| 158 |
}
|
| 159 |
}
|
| 160 |
|
|
@@ -571,7 +571,7 @@ def get_share_links(app_url="https://howmuchfeed.com"):
|
|
| 571 |
|
| 572 |
|
| 573 |
# ============================================================
|
| 574 |
-
# FEED CALCULATION
|
| 575 |
# ============================================================
|
| 576 |
|
| 577 |
def calculate_feed(birds, weeks, days, bag_size, price_per_bag, email, country_code, breed, request: gr.Request):
|
|
@@ -645,7 +645,7 @@ def calculate_feed(birds, weeks, days, bag_size, price_per_bag, email, country_c
|
|
| 645 |
# Generate share links
|
| 646 |
share_links = get_share_links()
|
| 647 |
|
| 648 |
-
# Output HTML
|
| 649 |
starter_bags_display = f"{starter_bags:.1f}"
|
| 650 |
finisher_bags_display = f"{finisher_bags:.1f}"
|
| 651 |
|
|
@@ -654,101 +654,229 @@ def calculate_feed(birds, weeks, days, bag_size, price_per_bag, email, country_c
|
|
| 654 |
age_text += f" + {days} day{'s' if days != 1 else ''}"
|
| 655 |
|
| 656 |
html = f"""
|
| 657 |
-
<div style="
|
| 658 |
-
|
| 659 |
-
|
| 660 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 661 |
|
| 662 |
-
<
|
| 663 |
-
|
| 664 |
-
|
| 665 |
-
|
| 666 |
-
|
| 667 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 668 |
</div>
|
| 669 |
-
|
| 670 |
-
|
|
|
|
|
|
|
| 671 |
</div>
|
| 672 |
-
|
| 673 |
-
|
| 674 |
-
|
| 675 |
-
|
| 676 |
-
|
| 677 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 678 |
</div>
|
| 679 |
</div>
|
| 680 |
|
|
|
|
| 681 |
<div style="margin-bottom: 12px;">
|
| 682 |
-
<div style="font-size: 12px; font-weight: 700; color: #
|
| 683 |
-
<table style="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 684 |
<thead>
|
| 685 |
-
<tr style="background: #
|
| 686 |
-
<th style="padding: 8px 10px; text-align: left; font-weight: 600; color: #
|
| 687 |
-
<th style="padding: 8px 10px; text-align: right; font-weight: 600; color: #
|
| 688 |
-
<th style="padding: 8px 10px; text-align: right; font-weight: 600; color: #
|
| 689 |
</tr>
|
| 690 |
</thead>
|
| 691 |
<tbody>
|
| 692 |
-
<tr style="border-bottom: 1px solid #
|
| 693 |
-
<td style="padding: 8px 10px; color: #
|
| 694 |
-
<td style="padding: 8px 10px; text-align: right; color: #
|
| 695 |
-
<td style="padding: 8px 10px; text-align: right; font-weight: 700; color: #
|
| 696 |
</tr>
|
| 697 |
-
<tr style="border-bottom: 1px solid #
|
| 698 |
-
<td style="padding: 8px 10px; color: #
|
| 699 |
-
<td style="padding: 8px 10px; text-align: right; color: #
|
| 700 |
-
<td style="padding: 8px 10px; text-align: right; font-weight: 700; color: #
|
| 701 |
</tr>
|
| 702 |
-
<tr style="background: #
|
| 703 |
-
<td style="padding: 8px 10px; color: #
|
| 704 |
-
<td style="padding: 8px 10px; text-align: right; color: #
|
| 705 |
-
<td style="padding: 8px 10px; text-align: right; font-weight: 800; font-size: 16px; color: #
|
| 706 |
</tr>
|
| 707 |
</tbody>
|
| 708 |
</table>
|
| 709 |
</div>
|
| 710 |
|
| 711 |
-
<
|
| 712 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 713 |
<div style="display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 14px;">
|
| 714 |
-
<span style="color: #
|
| 715 |
-
<span style="
|
| 716 |
-
|
| 717 |
-
|
| 718 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 719 |
</div>
|
| 720 |
-
<div style="font-size:
|
| 721 |
{currency_symbol}{total_cost:,.0f}
|
| 722 |
</div>
|
| 723 |
</div>
|
| 724 |
|
| 725 |
-
<
|
| 726 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 727 |
<div style="display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px;">
|
| 728 |
-
<div>
|
| 729 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 730 |
</div>
|
| 731 |
</div>
|
| 732 |
|
| 733 |
-
<
|
| 734 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 735 |
<div style="display: flex; gap: 8px; flex-wrap: wrap;">
|
| 736 |
<a href="{share_links['whatsapp']}" target="_blank" style="text-decoration: none;">
|
| 737 |
-
<span style="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 738 |
</a>
|
| 739 |
<a href="{share_links['email']}" target="_blank" style="text-decoration: none;">
|
| 740 |
-
<span style="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 741 |
</a>
|
| 742 |
<a href="{share_links['facebook']}" target="_blank" style="text-decoration: none;">
|
| 743 |
-
<span style="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 744 |
</a>
|
| 745 |
<a href="{share_links['twitter']}" target="_blank" style="text-decoration: none;">
|
| 746 |
-
<span style="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 747 |
</a>
|
| 748 |
</div>
|
| 749 |
</div>
|
| 750 |
|
| 751 |
-
<div style="
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 752 |
β οΈ Estimate based on {breed} benchmark. Actual results may vary.
|
| 753 |
</div>
|
| 754 |
</div>
|
|
@@ -968,14 +1096,41 @@ def export_calculations_wrapper():
|
|
| 968 |
|
| 969 |
|
| 970 |
# ============================================================
|
| 971 |
-
# CSS
|
| 972 |
# ============================================================
|
| 973 |
|
| 974 |
CSS = """
|
| 975 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 976 |
body, .gradio-container, .gradio-row, .gradio-column, .gradio-group {
|
| 977 |
-
background-color:
|
| 978 |
-
color:
|
| 979 |
}
|
| 980 |
|
| 981 |
.gradio-container {
|
|
@@ -983,6 +1138,7 @@ body, .gradio-container, .gradio-row, .gradio-column, .gradio-group {
|
|
| 983 |
padding: 6px 8px !important;
|
| 984 |
}
|
| 985 |
|
|
|
|
| 986 |
.main-title {
|
| 987 |
text-align: center;
|
| 988 |
padding: 8px 4px 4px 4px;
|
|
@@ -990,51 +1146,55 @@ body, .gradio-container, .gradio-row, .gradio-column, .gradio-group {
|
|
| 990 |
.main-title h1 {
|
| 991 |
font-size: 24px;
|
| 992 |
margin-bottom: 2px;
|
| 993 |
-
color:
|
| 994 |
}
|
| 995 |
.main-title p {
|
| 996 |
font-size: 14px;
|
| 997 |
-
color:
|
| 998 |
}
|
| 999 |
|
|
|
|
| 1000 |
.answer-box {
|
| 1001 |
-
background:
|
| 1002 |
border-radius: 12px !important;
|
| 1003 |
padding: 8px 10px !important;
|
| 1004 |
-
border: 1px solid
|
| 1005 |
}
|
| 1006 |
|
|
|
|
| 1007 |
.email-box {
|
| 1008 |
-
border: 2px solid
|
| 1009 |
border-radius: 10px !important;
|
| 1010 |
padding: 8px !important;
|
| 1011 |
-
background: #
|
| 1012 |
}
|
| 1013 |
|
| 1014 |
-
|
| 1015 |
-
|
| 1016 |
-
|
| 1017 |
-
|
| 1018 |
-
|
| 1019 |
-
|
| 1020 |
-
|
|
|
|
| 1021 |
}
|
| 1022 |
|
| 1023 |
-
|
| 1024 |
-
|
| 1025 |
-
color: #1a1a1a !important;
|
| 1026 |
}
|
| 1027 |
|
| 1028 |
-
|
| 1029 |
-
|
| 1030 |
-
|
| 1031 |
-
border:
|
|
|
|
|
|
|
| 1032 |
}
|
| 1033 |
|
| 1034 |
/* Force dark mode override */
|
| 1035 |
.dark, .dark * {
|
| 1036 |
-
background-color:
|
| 1037 |
-
color:
|
| 1038 |
}
|
| 1039 |
|
| 1040 |
/* Mobile */
|
|
@@ -1144,10 +1304,10 @@ with gr.Blocks(title=APP_NAME, css=CSS, theme=gr.themes.Default()) as demo:
|
|
| 1144 |
gr.Markdown("## π Quick Answer")
|
| 1145 |
result = gr.HTML(
|
| 1146 |
value="""
|
| 1147 |
-
<div style="font-size: 14px; color: #
|
| 1148 |
<div style="font-size: 40px; margin-bottom: 10px;">π</div>
|
| 1149 |
<div>Enter your details and click <strong>Calculate</strong></div>
|
| 1150 |
-
<div style="font-size: 13px; margin-top: 6px;">Your feed estimate appears here</div>
|
| 1151 |
</div>
|
| 1152 |
""",
|
| 1153 |
elem_classes=["answer-box"],
|
|
|
|
| 144 |
"Ross 308": {
|
| 145 |
"description": "Big chest, thick legs, very fast growth. Excellent for meat production.",
|
| 146 |
"available_at": "Agrited, Sayed, Valentine",
|
| 147 |
+
"color": "#1E4620"
|
| 148 |
},
|
| 149 |
"Cobb 500": {
|
| 150 |
"description": "Good early growth, strong legs, solid feed conversion.",
|
| 151 |
"available_at": "Chikun, Zartech",
|
| 152 |
+
"color": "#1E4620"
|
| 153 |
},
|
| 154 |
"Arbor Acres": {
|
| 155 |
"description": "Balanced growth, hardy and adaptable. Great survival rate.",
|
| 156 |
"available_at": "Supreme, CHI, GS, Vertex, Fidan, Cascada, Orobor, Sunchi, Farm Support, Ajila",
|
| 157 |
+
"color": "#1E4620"
|
| 158 |
}
|
| 159 |
}
|
| 160 |
|
|
|
|
| 571 |
|
| 572 |
|
| 573 |
# ============================================================
|
| 574 |
+
# FEED CALCULATION - WITH PROFESSIONAL COLOR SCHEME
|
| 575 |
# ============================================================
|
| 576 |
|
| 577 |
def calculate_feed(birds, weeks, days, bag_size, price_per_bag, email, country_code, breed, request: gr.Request):
|
|
|
|
| 645 |
# Generate share links
|
| 646 |
share_links = get_share_links()
|
| 647 |
|
| 648 |
+
# Output HTML - WITH PROFESSIONAL COLOR SCHEME
|
| 649 |
starter_bags_display = f"{starter_bags:.1f}"
|
| 650 |
finisher_bags_display = f"{finisher_bags:.1f}"
|
| 651 |
|
|
|
|
| 654 |
age_text += f" + {days} day{'s' if days != 1 else ''}"
|
| 655 |
|
| 656 |
html = f"""
|
| 657 |
+
<div style="
|
| 658 |
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
| 659 |
+
font-size: 15px;
|
| 660 |
+
line-height: 1.5;
|
| 661 |
+
color: #212529;
|
| 662 |
+
background: #ffffff;
|
| 663 |
+
border-radius: 12px;
|
| 664 |
+
padding: 12px 14px;
|
| 665 |
+
border: 1px solid #DEE2E6;
|
| 666 |
+
width: 100%;
|
| 667 |
+
box-sizing: border-box;
|
| 668 |
+
">
|
| 669 |
+
|
| 670 |
+
<!-- RESULTS CARD -->
|
| 671 |
+
<div style="
|
| 672 |
+
background: #F8F9FA;
|
| 673 |
+
border: 2px solid #1E4620;
|
| 674 |
+
border-radius: 10px;
|
| 675 |
+
padding: 14px 16px;
|
| 676 |
+
margin-bottom: 14px;
|
| 677 |
+
">
|
| 678 |
+
<div style="
|
| 679 |
+
font-size: 12px;
|
| 680 |
+
font-weight: 700;
|
| 681 |
+
color: #1E4620;
|
| 682 |
+
text-transform: uppercase;
|
| 683 |
+
letter-spacing: 0.5px;
|
| 684 |
+
margin-bottom: 4px;
|
| 685 |
+
">π Your Feed Estimate</div>
|
| 686 |
|
| 687 |
+
<!-- Total Feed - Brown Card -->
|
| 688 |
+
<div style="
|
| 689 |
+
background: #F5F0EE;
|
| 690 |
+
border-radius: 8px;
|
| 691 |
+
padding: 10px 14px;
|
| 692 |
+
margin: 4px 0 8px 0;
|
| 693 |
+
">
|
| 694 |
+
<div style="font-size: 13px; color: #6C757D; font-weight: 600;">
|
| 695 |
+
Total Feed Needed
|
| 696 |
+
</div>
|
| 697 |
+
<div style="font-size: 28px; font-weight: 800; color: #8D6E63;">
|
| 698 |
+
{total_feed_kg:,.1f} kg
|
| 699 |
+
</div>
|
| 700 |
+
<div style="font-size: 14px; color: #6C757D;">
|
| 701 |
+
({total_bags:.1f} bags of {bag_size} kg)
|
| 702 |
+
</div>
|
| 703 |
</div>
|
| 704 |
+
|
| 705 |
+
<!-- Birds Info -->
|
| 706 |
+
<div style="font-size: 14px; color: #212529;">
|
| 707 |
+
For <strong>{birds:,}</strong> {breed} broilers Β· <strong>{age_text} ({total_days} days)</strong>
|
| 708 |
</div>
|
| 709 |
+
|
| 710 |
+
<!-- Buy Recommendation - Gold Accent -->
|
| 711 |
+
<div style="
|
| 712 |
+
background: #FFF8E1;
|
| 713 |
+
border: 2px solid #FFB800;
|
| 714 |
+
border-radius: 8px;
|
| 715 |
+
padding: 8px 12px;
|
| 716 |
+
margin-top: 8px;
|
| 717 |
+
">
|
| 718 |
+
<span style="font-size: 14px; font-weight: 600; color: #212529;">Buy</span>
|
| 719 |
+
<span style="
|
| 720 |
+
display: inline-block;
|
| 721 |
+
background: #FFB800;
|
| 722 |
+
color: #212529;
|
| 723 |
+
border-radius: 6px;
|
| 724 |
+
padding: 2px 12px;
|
| 725 |
+
font-size: 18px;
|
| 726 |
+
font-weight: 800;
|
| 727 |
+
">{rounded_bags}</span>
|
| 728 |
+
<span style="font-size: 14px; color: #6C757D;">bags (rounded up for safety)</span>
|
| 729 |
</div>
|
| 730 |
</div>
|
| 731 |
|
| 732 |
+
<!-- FEED BREAKDOWN TABLE -->
|
| 733 |
<div style="margin-bottom: 12px;">
|
| 734 |
+
<div style="font-size: 12px; font-weight: 700; color: #6C757D; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;">πΎ Feed Breakdown</div>
|
| 735 |
+
<table style="
|
| 736 |
+
width: 100%;
|
| 737 |
+
border-collapse: collapse;
|
| 738 |
+
font-size: 14px;
|
| 739 |
+
background: #ffffff;
|
| 740 |
+
border: 1px solid #DEE2E6;
|
| 741 |
+
border-radius: 8px;
|
| 742 |
+
overflow: hidden;
|
| 743 |
+
">
|
| 744 |
<thead>
|
| 745 |
+
<tr style="background: #F8F9FA; border-bottom: 2px solid #DEE2E6;">
|
| 746 |
+
<th style="padding: 8px 10px; text-align: left; font-weight: 600; color: #212529;">Stage</th>
|
| 747 |
+
<th style="padding: 8px 10px; text-align: right; font-weight: 600; color: #212529;">Feed (kg)</th>
|
| 748 |
+
<th style="padding: 8px 10px; text-align: right; font-weight: 600; color: #212529;">Bags (25 kg)</th>
|
| 749 |
</tr>
|
| 750 |
</thead>
|
| 751 |
<tbody>
|
| 752 |
+
<tr style="border-bottom: 1px solid #DEE2E6;">
|
| 753 |
+
<td style="padding: 8px 10px; color: #212529;"><strong>π± Starter</strong></td>
|
| 754 |
+
<td style="padding: 8px 10px; text-align: right; color: #212529;">{starter_kg:,.1f}</td>
|
| 755 |
+
<td style="padding: 8px 10px; text-align: right; font-weight: 700; color: #212529;">{starter_bags_display}</td>
|
| 756 |
</tr>
|
| 757 |
+
<tr style="border-bottom: 1px solid #DEE2E6;">
|
| 758 |
+
<td style="padding: 8px 10px; color: #212529;"><strong>π½ Finisher</strong></td>
|
| 759 |
+
<td style="padding: 8px 10px; text-align: right; color: #212529;">{finisher_kg:,.1f}</td>
|
| 760 |
+
<td style="padding: 8px 10px; text-align: right; font-weight: 700; color: #212529;">{finisher_bags_display}</td>
|
| 761 |
</tr>
|
| 762 |
+
<tr style="background: #F8F9FA; font-weight: 700;">
|
| 763 |
+
<td style="padding: 8px 10px; color: #212529;">TOTAL</td>
|
| 764 |
+
<td style="padding: 8px 10px; text-align: right; color: #212529;">{total_feed_kg:,.1f}</td>
|
| 765 |
+
<td style="padding: 8px 10px; text-align: right; font-weight: 800; font-size: 16px; color: #1E4620;">{total_bags:.1f}</td>
|
| 766 |
</tr>
|
| 767 |
</tbody>
|
| 768 |
</table>
|
| 769 |
</div>
|
| 770 |
|
| 771 |
+
<!-- FEED COST - RED CARD -->
|
| 772 |
+
<div style="
|
| 773 |
+
background: #FFEBEE;
|
| 774 |
+
border: 2px solid #C62828;
|
| 775 |
+
border-radius: 10px;
|
| 776 |
+
padding: 12px 16px;
|
| 777 |
+
margin-bottom: 12px;
|
| 778 |
+
">
|
| 779 |
+
<div style="font-size: 12px; font-weight: 700; color: #6C757D; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px;">π° Feed Cost</div>
|
| 780 |
<div style="display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 14px;">
|
| 781 |
+
<span style="color: #212529;">Approximately</span>
|
| 782 |
+
<span style="
|
| 783 |
+
display: inline-block;
|
| 784 |
+
background: #C62828;
|
| 785 |
+
color: #FFFFFF;
|
| 786 |
+
border-radius: 6px;
|
| 787 |
+
padding: 2px 12px;
|
| 788 |
+
font-size: 18px;
|
| 789 |
+
font-weight: 700;
|
| 790 |
+
">{rounded_bags}</span>
|
| 791 |
+
<span style="color: #212529;">bags Γ {currency_symbol}{price_per_bag:,.0f}</span>
|
| 792 |
</div>
|
| 793 |
+
<div style="font-size: 26px; font-weight: 800; color: #C62828; margin-top: 2px;">
|
| 794 |
{currency_symbol}{total_cost:,.0f}
|
| 795 |
</div>
|
| 796 |
</div>
|
| 797 |
|
| 798 |
+
<!-- EXPECTED PERFORMANCE -->
|
| 799 |
+
<div style="
|
| 800 |
+
border-top: 1px solid #DEE2E6;
|
| 801 |
+
padding-top: 10px;
|
| 802 |
+
margin-bottom: 12px;
|
| 803 |
+
">
|
| 804 |
+
<div style="font-size: 12px; font-weight: 700; color: #6C757D; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px;">π Expected Performance</div>
|
| 805 |
<div style="display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px;">
|
| 806 |
+
<div>
|
| 807 |
+
Body weight: <span style="font-weight: 700; color: #212529;">{expected_weight:.3f} kg</span>
|
| 808 |
+
</div>
|
| 809 |
+
<div>
|
| 810 |
+
Flock weight: <span style="font-weight: 700; color: #212529;">{flock_weight:,.1f} kg</span>
|
| 811 |
+
</div>
|
| 812 |
</div>
|
| 813 |
</div>
|
| 814 |
|
| 815 |
+
<!-- SHARE BUTTONS -->
|
| 816 |
+
<div style="
|
| 817 |
+
border-top: 1px solid #DEE2E6;
|
| 818 |
+
padding-top: 12px;
|
| 819 |
+
">
|
| 820 |
+
<div style="font-size: 12px; font-weight: 700; color: #6C757D; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;">π€ Share Results</div>
|
| 821 |
<div style="display: flex; gap: 8px; flex-wrap: wrap;">
|
| 822 |
<a href="{share_links['whatsapp']}" target="_blank" style="text-decoration: none;">
|
| 823 |
+
<span style="
|
| 824 |
+
display: inline-block;
|
| 825 |
+
background: #25D366;
|
| 826 |
+
color: #ffffff;
|
| 827 |
+
padding: 6px 14px;
|
| 828 |
+
border-radius: 6px;
|
| 829 |
+
font-size: 13px;
|
| 830 |
+
font-weight: 600;
|
| 831 |
+
cursor: pointer;
|
| 832 |
+
">WhatsApp</span>
|
| 833 |
</a>
|
| 834 |
<a href="{share_links['email']}" target="_blank" style="text-decoration: none;">
|
| 835 |
+
<span style="
|
| 836 |
+
display: inline-block;
|
| 837 |
+
background: #ea4335;
|
| 838 |
+
color: #ffffff;
|
| 839 |
+
padding: 6px 14px;
|
| 840 |
+
border-radius: 6px;
|
| 841 |
+
font-size: 13px;
|
| 842 |
+
font-weight: 600;
|
| 843 |
+
cursor: pointer;
|
| 844 |
+
">Email</span>
|
| 845 |
</a>
|
| 846 |
<a href="{share_links['facebook']}" target="_blank" style="text-decoration: none;">
|
| 847 |
+
<span style="
|
| 848 |
+
display: inline-block;
|
| 849 |
+
background: #1877f2;
|
| 850 |
+
color: #ffffff;
|
| 851 |
+
padding: 6px 14px;
|
| 852 |
+
border-radius: 6px;
|
| 853 |
+
font-size: 13px;
|
| 854 |
+
font-weight: 600;
|
| 855 |
+
cursor: pointer;
|
| 856 |
+
">Facebook</span>
|
| 857 |
</a>
|
| 858 |
<a href="{share_links['twitter']}" target="_blank" style="text-decoration: none;">
|
| 859 |
+
<span style="
|
| 860 |
+
display: inline-block;
|
| 861 |
+
background: #000000;
|
| 862 |
+
color: #ffffff;
|
| 863 |
+
padding: 6px 14px;
|
| 864 |
+
border-radius: 6px;
|
| 865 |
+
font-size: 13px;
|
| 866 |
+
font-weight: 600;
|
| 867 |
+
cursor: pointer;
|
| 868 |
+
">Twitter/X</span>
|
| 869 |
</a>
|
| 870 |
</div>
|
| 871 |
</div>
|
| 872 |
|
| 873 |
+
<div style="
|
| 874 |
+
margin-top: 10px;
|
| 875 |
+
font-size: 11px;
|
| 876 |
+
color: #6C757D;
|
| 877 |
+
border-top: 1px solid #DEE2E6;
|
| 878 |
+
padding-top: 8px;
|
| 879 |
+
">
|
| 880 |
β οΈ Estimate based on {breed} benchmark. Actual results may vary.
|
| 881 |
</div>
|
| 882 |
</div>
|
|
|
|
| 1096 |
|
| 1097 |
|
| 1098 |
# ============================================================
|
| 1099 |
+
# CSS - PROFESSIONAL COLOR SCHEME
|
| 1100 |
# ============================================================
|
| 1101 |
|
| 1102 |
CSS = """
|
| 1103 |
+
/* ============================================================
|
| 1104 |
+
PROFESSIONAL COLOR SCHEME - 60-30-10 Design Rule
|
| 1105 |
+
============================================================ */
|
| 1106 |
+
|
| 1107 |
+
/* GLOBAL TOKENS - 60% Dominant Neutrals */
|
| 1108 |
+
:root {
|
| 1109 |
+
--color-bg-main: #F8F9FA;
|
| 1110 |
+
--color-bg-surface: #FFFFFF;
|
| 1111 |
+
--color-text-primary: #212529;
|
| 1112 |
+
--color-text-muted: #6C757D;
|
| 1113 |
+
--color-border: #DEE2E6;
|
| 1114 |
+
}
|
| 1115 |
+
|
| 1116 |
+
/* 30% Structural/Brand Colors */
|
| 1117 |
+
:root {
|
| 1118 |
+
--color-brand-primary: #1E4620;
|
| 1119 |
+
--color-brand-secondary: #386F3E;
|
| 1120 |
+
}
|
| 1121 |
+
|
| 1122 |
+
/* 10% Accent Colors */
|
| 1123 |
+
:root {
|
| 1124 |
+
--color-accent-gold: #FFB800;
|
| 1125 |
+
--color-feed-brown: #8D6E63;
|
| 1126 |
+
--color-cost-red: #C62828;
|
| 1127 |
+
--color-yield-green: #2E7D32;
|
| 1128 |
+
}
|
| 1129 |
+
|
| 1130 |
+
/* Apply to body */
|
| 1131 |
body, .gradio-container, .gradio-row, .gradio-column, .gradio-group {
|
| 1132 |
+
background-color: var(--color-bg-main) !important;
|
| 1133 |
+
color: var(--color-text-primary) !important;
|
| 1134 |
}
|
| 1135 |
|
| 1136 |
.gradio-container {
|
|
|
|
| 1138 |
padding: 6px 8px !important;
|
| 1139 |
}
|
| 1140 |
|
| 1141 |
+
/* Main Title */
|
| 1142 |
.main-title {
|
| 1143 |
text-align: center;
|
| 1144 |
padding: 8px 4px 4px 4px;
|
|
|
|
| 1146 |
.main-title h1 {
|
| 1147 |
font-size: 24px;
|
| 1148 |
margin-bottom: 2px;
|
| 1149 |
+
color: var(--color-text-primary) !important;
|
| 1150 |
}
|
| 1151 |
.main-title p {
|
| 1152 |
font-size: 14px;
|
| 1153 |
+
color: var(--color-text-muted) !important;
|
| 1154 |
}
|
| 1155 |
|
| 1156 |
+
/* Answer Box - Surface */
|
| 1157 |
.answer-box {
|
| 1158 |
+
background: var(--color-bg-surface) !important;
|
| 1159 |
border-radius: 12px !important;
|
| 1160 |
padding: 8px 10px !important;
|
| 1161 |
+
border: 1px solid var(--color-border) !important;
|
| 1162 |
}
|
| 1163 |
|
| 1164 |
+
/* Email Box */
|
| 1165 |
.email-box {
|
| 1166 |
+
border: 2px solid var(--color-brand-secondary) !important;
|
| 1167 |
border-radius: 10px !important;
|
| 1168 |
padding: 8px !important;
|
| 1169 |
+
background: #F8F9FA !important;
|
| 1170 |
}
|
| 1171 |
|
| 1172 |
+
/* Buttons - Brand Primary */
|
| 1173 |
+
button {
|
| 1174 |
+
min-height: 44px !important;
|
| 1175 |
+
background-color: var(--color-brand-primary) !important;
|
| 1176 |
+
color: #FFFFFF !important;
|
| 1177 |
+
font-weight: 600 !important;
|
| 1178 |
+
border: none !important;
|
| 1179 |
+
border-radius: 8px !important;
|
| 1180 |
}
|
| 1181 |
|
| 1182 |
+
button:hover {
|
| 1183 |
+
background-color: #122D14 !important;
|
|
|
|
| 1184 |
}
|
| 1185 |
|
| 1186 |
+
/* Admin Login */
|
| 1187 |
+
.admin-login {
|
| 1188 |
+
border: 2px solid var(--color-accent-gold) !important;
|
| 1189 |
+
border-radius: 10px !important;
|
| 1190 |
+
padding: 12px !important;
|
| 1191 |
+
background: #FFF8E1 !important;
|
| 1192 |
}
|
| 1193 |
|
| 1194 |
/* Force dark mode override */
|
| 1195 |
.dark, .dark * {
|
| 1196 |
+
background-color: var(--color-bg-main) !important;
|
| 1197 |
+
color: var(--color-text-primary) !important;
|
| 1198 |
}
|
| 1199 |
|
| 1200 |
/* Mobile */
|
|
|
|
| 1304 |
gr.Markdown("## π Quick Answer")
|
| 1305 |
result = gr.HTML(
|
| 1306 |
value="""
|
| 1307 |
+
<div style="font-size: 14px; color: #6C757D; text-align: center; padding: 30px 10px; background: #FFFFFF; border-radius: 12px; border: 1px solid #DEE2E6;">
|
| 1308 |
<div style="font-size: 40px; margin-bottom: 10px;">π</div>
|
| 1309 |
<div>Enter your details and click <strong>Calculate</strong></div>
|
| 1310 |
+
<div style="font-size: 13px; margin-top: 6px; color: #6C757D;">Your feed estimate appears here</div>
|
| 1311 |
</div>
|
| 1312 |
""",
|
| 1313 |
elem_classes=["answer-box"],
|