Spaces:
Sleeping
Sleeping
293droid commited on
Commit ·
4c2e7ee
1
Parent(s): 532ce3a
fix: UI polish - cream header, full recipe cards, wider layout
Browse files343 unmodified lines344345346347348349350170 unmodified lines5215225235245255265275285295305313 unmodified lines53553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362415 unmodified lines6406416426436446456461 unmodified line64864965065165265365465523 unmodified lines67968068168268368416 unmodified lines70170270370470570670770870971071171231 unmodified lines744745746747748749343 unmodified lines#soap-shell {border: 0 !important;border-radius: 0 !important;padding: 0 !important;background: var(--soap-cream) !important;box-shadow: none !important;}170 unmodified lines.section-divider {height: 1px;margin: 24px 0 18px;background: rgba(212, 168, 83, 0.58);}.output-row {background: transparent !important;}.output-row > *,3 unmodified linesbackground: transparent !important;}.examples-card {margin: 18px 0 20px;}.examples-card .table-wrap,.examples-card table,.examples .table-wrap,.examples table {overflow: visible !important;}.examples-card table,.examples table {display: grid !important;grid-template-columns: repeat(2, minmax(0, 1fr));gap: 12px;border: 0 !important;}.examples-card thead,.examples thead {display: none !important;}.examples-card tbody,.examples-card tr,.examples-card td,.examples tbody,.examples tr,.examples td {display: contents !important;}.examples table td {white-space: normal !important;overflow: visible !important;max-width: none !important;text-overflow: unset !important;}.examples .label-wrap {display: none !important;}.examples-card td:first-child,.examples td:first-child {display: block !important;min-height: 70px;height: auto !important;padding: 14px 16px !important;border: 1.5px solid rgba(212, 168, 83, 0.62) !important;border-left: 6px solid var(--soap-amber) !important;border-radius: 12px !important;background: #FFF9EF !important;color: var(--soap-ink) !important;box-shadow: 0 8px 16px rgba(61, 43, 31, 0.09);cursor: pointer;transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;white-space: normal !important;overflow: visible !important;text-overflow: unset !important;line-height: 1.35;}.examples-card td:first-child *,.examples td:first-child * {white-space: normal !important;overflow: visible !important;max-width: none !important;text-overflow: unset !important;-webkit-line-clamp: unset !important;line-clamp: unset !important;}.examples-card td:first-child:hover,.examples td:first-child:hover {transform: translateY(-2px);border-color: var(--soap-amber-dark) !important;box-shadow: 0 12px 22px rgba(61, 43, 31, 0.14);}.examples-card td:nth-child(2),.examples td:nth-child(2) {display: none !important;}.safety-note {15 unmodified lines}#soap-shell {padding: 0 !important;border-radius: 0 !important;}1 unmodified linefont-size: 14px;}.examples-card table {grid-template-columns: 1fr;}.notebook-card {23 unmodified linesinput_background_fill="#FFFDF8",)with gr.Blocks(title="🧼 Soap Lab") as demo:with gr.Group(elem_id="soap-shell"):with gr.Group(elem_id="soap-header", elem_classes=["header-panel"]):16 unmodified linesvegan_toggle = gr.Checkbox(label="🌿 Plant-based only", value=False)submit_btn = gr.Button("Calculate →", variant="primary", size="lg", elem_id="calculate-btn")with gr.Group(elem_classes=["examples-card"]):gr.Examples(examples=EXAMPLES,inputs=[user_input, vegan_toggle],label="Recipe cards",)gr.HTML("<div class='section-divider'></div>")31 unmodified linesinputs=[user_input, vegan_toggle],outputs=[lye_output, scores_output, explanation_output],)if __name__ == "__main__":demo.launch(css=CSS, theme=soap_theme)343 unmodified lines344345346347348349350170 unmodified lines5215225235245255265275285295305315323 unmodified lines53653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259315 unmodified lines6096106116126136146151 unmodified line61761861962062162262362423 unmodified lines64864965065165265365465565665765865966066116 unmodified lines67867968068168268368468568668768868969069169269369469531 unmodified lines727728729730731732733734735736737738343 unmodified lines#soap-shell {border: 0 !important;border-radius: 0 !important;padding: 16px !important;background: var(--soap-cream) !important;box-shadow: none !important;}170 unmodified lines.section-divider {height: 1px;margin: 24px 0 18px;background: transparent !important;}.output-row {background: transparent !important;padding: 16px 0 !important;}.output-row > *,3 unmodified linesbackground: transparent !important;}.recipe-card-grid {margin: 18px 0 20px;background: transparent !important;}.recipe-card-grid .form,.recipe-card-grid .block {background: transparent !important;}.recipe-card-row {gap: 12px !important;margin-bottom: 12px !important;background: transparent !important;}.recipe-card {width: 100%;}.recipe-card button {width: 100% !important;min-height: 70px !important;height: auto !important;padding: 12px 14px !important;border: 1.5px solid var(--soap-amber-dark) !important;border-radius: 12px !important;background: #D4A853 !important;color: var(--soap-ink) !important;box-shadow: 0 6px 14px rgba(169, 120, 34, 0.18);font-family: Georgia, "Times New Roman", serif !important;font-size: 14px !important;line-height: 1.35 !important;text-align: left !important;white-space: normal !important;overflow: visible !important;text-overflow: unset !important;}.recipe-card button span,.recipe-card button div,.recipe-card button p {white-space: normal !important;overflow: visible !important;max-width: none !important;text-overflow: unset !important;}.recipe-card button:hover {transform: translateY(-2px);background: #DEB766 !important;box-shadow: 0 10px 20px rgba(169, 120, 34, 0.24);}.safety-note {15 unmodified lines}#soap-shell {padding: 16px !important;border-radius: 0 !important;}1 unmodified linefont-size: 14px;}.recipe-card-row {gap: 10px !important;}.notebook-card {23 unmodified linesinput_background_fill="#FFFDF8",)def make_example_loader(example_text: str):def load_example() -> str:return example_textreturn load_examplewith gr.Blocks(title="🧼 Soap Lab") as demo:with gr.Group(elem_id="soap-shell"):with gr.Group(elem_id="soap-header", elem_classes=["header-panel"]):16 unmodified linesvegan_toggle = gr.Checkbox(label="🌿 Plant-based only", value=False)submit_btn = gr.Button("Calculate →", variant="primary", size="lg", elem_id="calculate-btn")recipe_buttons = []with gr.Group(elem_classes=["recipe-card-grid"]):for row_start in range(0, len(EXAMPLES), 2):with gr.Row(elem_classes=["recipe-card-row"]):for example_text, _ in EXAMPLES[row_start:row_start + 2]:recipe_buttons.append(gr.Button(example_text,variant="secondary",elem_classes=["recipe-card"],))gr.HTML("<div class='section-divider'></div>")31 unmodified linesinputs=[user_input, vegan_toggle],outputs=[lye_output, scores_output, explanation_output],)for recipe_button, example in zip(recipe_buttons, EXAMPLES):recipe_button.click(fn=make_example_loader(example[0]),inputs=[],outputs=user_input,)if __name__ == "__main__":demo.launch(css=CSS, theme=soap_theme)
app.py+60-71