stylized cards
Browse files
app.py
CHANGED
|
@@ -502,6 +502,8 @@ footer,
|
|
| 502 |
white-space: pre-line !important;
|
| 503 |
margin: 0 !important;
|
| 504 |
height: 116px !important;
|
|
|
|
|
|
|
| 505 |
}
|
| 506 |
|
| 507 |
.ai-button-card button,
|
|
@@ -519,9 +521,66 @@ button.ai-button-card {
|
|
| 519 |
border: 1px solid var(--custom-divider) !important;
|
| 520 |
border-radius: 8px !important;
|
| 521 |
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 522 |
}
|
| 523 |
|
| 524 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 525 |
border-color: rgba(94, 107, 255, 0.7) !important;
|
| 526 |
background: #141519 !important;
|
| 527 |
transform: translateY(-1px);
|
|
@@ -898,15 +957,19 @@ RIGHT_PANEL_HTML = """
|
|
| 898 |
"""
|
| 899 |
|
| 900 |
|
| 901 |
-
def ai_card(title, body):
|
| 902 |
return f"""
|
| 903 |
-
<div class="ai-card-html">
|
| 904 |
<h3>{title}</h3>
|
| 905 |
<p>{body}</p>
|
| 906 |
</div>
|
| 907 |
"""
|
| 908 |
|
| 909 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 910 |
# ==================================================
|
| 911 |
# DATA
|
| 912 |
# ==================================================
|
|
@@ -1034,19 +1097,19 @@ with gr.Blocks(fill_height=True, fill_width=True, css=CSS) as demo:
|
|
| 1034 |
|
| 1035 |
with gr.Row(elem_classes=["ai-row"]):
|
| 1036 |
analyze_ads_card = gr.Button(
|
| 1037 |
-
value="Ads Analyst
|
| 1038 |
-
elem_classes=["ai-button-card"],
|
| 1039 |
)
|
| 1040 |
gr.HTML(ai_card("Budget Optimizer", "Where to adjust spend?"))
|
| 1041 |
keyword_inspector_card = gr.Button(
|
| 1042 |
-
value="Keyword Inspector
|
| 1043 |
-
elem_classes=["ai-button-card"],
|
| 1044 |
)
|
| 1045 |
|
| 1046 |
with gr.Row(elem_classes=["ai-row"]):
|
| 1047 |
-
|
| 1048 |
-
value="Search Term Cleaner
|
| 1049 |
-
elem_classes=["ai-button-card"],
|
| 1050 |
)
|
| 1051 |
gr.HTML(ai_card("Growth Finder", "Where to scale?"))
|
| 1052 |
gr.HTML(ai_card("Campaign Doctor", "What limits performance?"))
|
|
@@ -1071,7 +1134,7 @@ with gr.Blocks(fill_height=True, fill_width=True, css=CSS) as demo:
|
|
| 1071 |
outputs=ads_output,
|
| 1072 |
)
|
| 1073 |
|
| 1074 |
-
|
| 1075 |
fn=run_search_term_optimizer_card,
|
| 1076 |
inputs=campaign_state,
|
| 1077 |
outputs=ads_output,
|
|
|
|
| 502 |
white-space: pre-line !important;
|
| 503 |
margin: 0 !important;
|
| 504 |
height: 116px !important;
|
| 505 |
+
position: relative !important;
|
| 506 |
+
overflow: hidden !important;
|
| 507 |
}
|
| 508 |
|
| 509 |
.ai-button-card button,
|
|
|
|
| 521 |
border: 1px solid var(--custom-divider) !important;
|
| 522 |
border-radius: 8px !important;
|
| 523 |
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
|
| 524 |
+
line-height: 1.55 !important;
|
| 525 |
+
position: relative !important;
|
| 526 |
+
font-size: 14px !important;
|
| 527 |
+
font-weight: 700 !important;
|
| 528 |
+
}
|
| 529 |
+
|
| 530 |
+
.ai-button-card button::after,
|
| 531 |
+
button.ai-button-card::after {
|
| 532 |
+
content: "";
|
| 533 |
+
position: absolute;
|
| 534 |
+
left: 16px;
|
| 535 |
+
right: 16px;
|
| 536 |
+
top: 48px;
|
| 537 |
+
height: 1px;
|
| 538 |
+
background: rgba(255, 255, 255, 0.05);
|
| 539 |
+
}
|
| 540 |
+
|
| 541 |
+
.ai-button-card button::before,
|
| 542 |
+
button.ai-button-card::before {
|
| 543 |
+
position: absolute;
|
| 544 |
+
left: 16px;
|
| 545 |
+
right: 16px;
|
| 546 |
+
top: 64px;
|
| 547 |
+
color: #ffffff !important;
|
| 548 |
+
font-size: 14px;
|
| 549 |
+
font-weight: 400;
|
| 550 |
+
line-height: 1.5;
|
| 551 |
+
}
|
| 552 |
+
|
| 553 |
+
.ads-analyst-card button::before,
|
| 554 |
+
button.ads-analyst-card::before {
|
| 555 |
+
content: "Campaign insights.";
|
| 556 |
}
|
| 557 |
|
| 558 |
+
.keyword-inspector-card button::before,
|
| 559 |
+
button.keyword-inspector-card::before {
|
| 560 |
+
content: "Winning versus wasting keywords.";
|
| 561 |
+
}
|
| 562 |
+
|
| 563 |
+
.search-term-cleaner-card button::before,
|
| 564 |
+
button.search-term-cleaner-card::before {
|
| 565 |
+
content: "Optimize search terms.";
|
| 566 |
+
}
|
| 567 |
+
|
| 568 |
+
.ai-button-card:hover,
|
| 569 |
+
.ai-button-card:hover button,
|
| 570 |
+
button.ai-button-card:hover {
|
| 571 |
+
border-color: rgba(94, 107, 255, 0.7) !important;
|
| 572 |
+
background: #141519 !important;
|
| 573 |
+
transform: translateY(-1px);
|
| 574 |
+
}
|
| 575 |
+
|
| 576 |
+
.clickable-card {
|
| 577 |
+
cursor: pointer;
|
| 578 |
+
transition: border-color 0.15s ease,
|
| 579 |
+
transform 0.15s ease,
|
| 580 |
+
background 0.15s ease;
|
| 581 |
+
}
|
| 582 |
+
|
| 583 |
+
.clickable-card:hover {
|
| 584 |
border-color: rgba(94, 107, 255, 0.7) !important;
|
| 585 |
background: #141519 !important;
|
| 586 |
transform: translateY(-1px);
|
|
|
|
| 957 |
"""
|
| 958 |
|
| 959 |
|
| 960 |
+
def ai_card(title, body, onclick=""):
|
| 961 |
return f"""
|
| 962 |
+
<div class="ai-card-html clickable-card" onclick="{onclick}">
|
| 963 |
<h3>{title}</h3>
|
| 964 |
<p>{body}</p>
|
| 965 |
</div>
|
| 966 |
"""
|
| 967 |
|
| 968 |
|
| 969 |
+
def ai_button_card(title, body):
|
| 970 |
+
return f"{title}\n{body}"
|
| 971 |
+
|
| 972 |
+
|
| 973 |
# ==================================================
|
| 974 |
# DATA
|
| 975 |
# ==================================================
|
|
|
|
| 1097 |
|
| 1098 |
with gr.Row(elem_classes=["ai-row"]):
|
| 1099 |
analyze_ads_card = gr.Button(
|
| 1100 |
+
value="Ads Analyst",
|
| 1101 |
+
elem_classes=["ai-button-card", "ads-analyst-card"],
|
| 1102 |
)
|
| 1103 |
gr.HTML(ai_card("Budget Optimizer", "Where to adjust spend?"))
|
| 1104 |
keyword_inspector_card = gr.Button(
|
| 1105 |
+
value="Keyword Inspector",
|
| 1106 |
+
elem_classes=["ai-button-card", "keyword-inspector-card"],
|
| 1107 |
)
|
| 1108 |
|
| 1109 |
with gr.Row(elem_classes=["ai-row"]):
|
| 1110 |
+
search_term_cleaner_card = gr.Button(
|
| 1111 |
+
value="Search Term Cleaner",
|
| 1112 |
+
elem_classes=["ai-button-card", "search-term-cleaner-card"],
|
| 1113 |
)
|
| 1114 |
gr.HTML(ai_card("Growth Finder", "Where to scale?"))
|
| 1115 |
gr.HTML(ai_card("Campaign Doctor", "What limits performance?"))
|
|
|
|
| 1134 |
outputs=ads_output,
|
| 1135 |
)
|
| 1136 |
|
| 1137 |
+
search_term_cleaner_card.click(
|
| 1138 |
fn=run_search_term_optimizer_card,
|
| 1139 |
inputs=campaign_state,
|
| 1140 |
outputs=ads_output,
|