|
| 1 | +import reflex as rx |
| 2 | +import reflex_ui as ui |
| 3 | +from reflex_ui.blocks.calcom import get_cal_attrs |
| 4 | + |
| 5 | +from pcweb.components.numbers_pattern import numbers_pattern |
| 6 | + |
| 7 | + |
| 8 | +def left_content( |
| 9 | + h1: str, h1_accent: str, h2: str, button_1: str, button_2: str |
| 10 | +) -> rx.Component: |
| 11 | + return rx.el.div( |
| 12 | + rx.el.h1( |
| 13 | + h1, |
| 14 | + rx.el.span( |
| 15 | + h1_accent, |
| 16 | + class_name="text-m-violet-11", |
| 17 | + ), |
| 18 | + class_name="text-slate-12 lg:text-5xl text-3xl font-semibold", |
| 19 | + ), |
| 20 | + rx.el.h2( |
| 21 | + h2, |
| 22 | + class_name="text-m-slate-11 dark:text-slate-9 text-base font-medium", |
| 23 | + ), |
| 24 | + rx.el.div( |
| 25 | + ui.button( |
| 26 | + button_1, |
| 27 | + size="lg", |
| 28 | + class_name="font-semibold", |
| 29 | + custom_attrs=get_cal_attrs(), |
| 30 | + ), |
| 31 | + ui.button( |
| 32 | + button_2, |
| 33 | + size="lg", |
| 34 | + variant="outline", |
| 35 | + class_name="font-semibold text-m-slate-11 dark:text-slate-9 border-m-slate-5 dark:border-m-slate-12", |
| 36 | + custom_attrs=get_cal_attrs(), |
| 37 | + ), |
| 38 | + class_name="flex lg:flex-row flex-col items-center max-lg:justify-center gap-4 mt-2", |
| 39 | + ), |
| 40 | + class_name="flex flex-col gap-6 max-lg:items-center max-lg:justify-center max-lg:text-center", |
| 41 | + ) |
| 42 | + |
| 43 | + |
| 44 | +def feature_row(icon: str, title: str) -> rx.Component: |
| 45 | + return rx.el.div( |
| 46 | + ui.icon( |
| 47 | + icon, |
| 48 | + class_name="size-5 text-m-violet-11 dark:text-m-violet-10 shrink-0", |
| 49 | + stroke_width=1.5, |
| 50 | + ), |
| 51 | + rx.el.span(title, class_name="font-medium text-slate-12 text-sm"), |
| 52 | + class_name="flex flex-row items-start gap-2.5", |
| 53 | + ) |
| 54 | + |
| 55 | + |
| 56 | +def right_content(features: list[tuple[str, str]]) -> rx.Component: |
| 57 | + return rx.el.div( |
| 58 | + rx.el.span( |
| 59 | + "Why Reflex?", |
| 60 | + class_name="font-semibold text-slate-12 text-base", |
| 61 | + ), |
| 62 | + rx.el.div( |
| 63 | + *[feature_row(icon, title) for icon, title in features], |
| 64 | + class_name="flex flex-col gap-4", |
| 65 | + ), |
| 66 | + class_name="shadow-large rounded-xl border-m-slate-4 border p-8 bg-white-1 dark:bg-m-slate-14 dark:border-m-slate-12 flex flex-col gap-6 max-w-[24.25rem] w-full shrink-0", |
| 67 | + ) |
| 68 | + |
| 69 | + |
| 70 | +def hero() -> rx.Component: |
| 71 | + return rx.el.section( |
| 72 | + numbers_pattern( |
| 73 | + side="right", |
| 74 | + class_name="lg:top-[65px] top-[45px] lg:h-[calc(100%-65px)] h-[calc(100%-45px)] max-lg:hidden", |
| 75 | + ), |
| 76 | + rx.el.div( |
| 77 | + left_content(), |
| 78 | + right_content(), |
| 79 | + class_name="flex lg:flex-row flex-col lg:gap-20 gap-10 max-lg:items-center max-lg:justify-center max-lg:text-center", |
| 80 | + ), |
| 81 | + class_name="flex flex-col justify-center items-center gap-4 mx-auto w-full max-w-[64.19rem] lg:border-x border-slate-3 pb-[3rem] pt-32 lg:pt-[11.5rem] lg:pb-[7.5rem] relative lg:overflow-hidden overflow-hidden z-[1] lg:px-10", |
| 82 | + ) |
0 commit comments