|
2 | 2 |
|
3 | 3 | from ..ui.base import base_page
|
4 | 4 |
|
| 5 | +def feature_item(feature: str) -> rx.Component: |
| 6 | + return rx.hstack( |
| 7 | + rx.icon( |
| 8 | + "check", color=rx.color("blue", 9), size=21 |
| 9 | + ), |
| 10 | + rx.text(feature, size="4", weight="regular"), |
| 11 | + ) |
| 12 | + |
| 13 | + |
| 14 | +def standard_features() -> rx.Component: |
| 15 | + return rx.vstack( |
| 16 | + feature_item("40 credits for image generation"), |
| 17 | + feature_item("Credits never expire"), |
| 18 | + feature_item("High quality images"), |
| 19 | + feature_item("Commercial license"), |
| 20 | + spacing="3", |
| 21 | + width="100%", |
| 22 | + align_items="start", |
| 23 | + ) |
| 24 | + |
| 25 | + |
| 26 | +def popular_features() -> rx.Component: |
| 27 | + return rx.vstack( |
| 28 | + feature_item("250 credits for image generation"), |
| 29 | + feature_item("+30% Extra free credits"), |
| 30 | + feature_item("Credits never expire"), |
| 31 | + feature_item("High quality images"), |
| 32 | + feature_item("Commercial license"), |
| 33 | + spacing="3", |
| 34 | + width="100%", |
| 35 | + align_items="start", |
| 36 | + ) |
| 37 | + |
| 38 | + |
| 39 | +def pricing_card_standard() -> rx.Component: |
| 40 | + return rx.vstack( |
| 41 | + rx.hstack( |
| 42 | + rx.hstack( |
| 43 | + rx.text( |
| 44 | + "$14.99", |
| 45 | + trim="both", |
| 46 | + as_="s", |
| 47 | + size="3", |
| 48 | + weight="regular", |
| 49 | + opacity=0.8, |
| 50 | + ), |
| 51 | + rx.text( |
| 52 | + "$3.99", |
| 53 | + trim="both", |
| 54 | + size="6", |
| 55 | + weight="regular", |
| 56 | + ), |
| 57 | + width="100%", |
| 58 | + spacing="2", |
| 59 | + align_items="end", |
| 60 | + ), |
| 61 | + height="35px", |
| 62 | + align_items="center", |
| 63 | + justify="between", |
| 64 | + width="100%", |
| 65 | + ), |
| 66 | + rx.text( |
| 67 | + "40 Image Credits", |
| 68 | + weight="bold", |
| 69 | + size="7", |
| 70 | + width="100%", |
| 71 | + text_align="left", |
| 72 | + ), |
| 73 | + standard_features(), |
| 74 | + rx.spacer(), |
| 75 | + rx.button( |
| 76 | + "Purchase", |
| 77 | + size="3", |
| 78 | + variant="outline", |
| 79 | + width="100%", |
| 80 | + color_scheme="blue", |
| 81 | + ), |
| 82 | + spacing="6", |
| 83 | + border=f"1.5px solid {rx.color('gray', 5)}", |
| 84 | + background=rx.color("gray", 1), |
| 85 | + padding="28px", |
| 86 | + width="100%", |
| 87 | + max_width="400px", |
| 88 | + min_height="475px", |
| 89 | + border_radius="0.5rem", |
| 90 | + ) |
| 91 | + |
| 92 | + |
| 93 | +def pricing_card_popular() -> rx.Component: |
| 94 | + return rx.vstack( |
| 95 | + rx.hstack( |
| 96 | + rx.hstack( |
| 97 | + rx.text( |
| 98 | + "$69.99", |
| 99 | + trim="both", |
| 100 | + as_="s", |
| 101 | + size="3", |
| 102 | + weight="regular", |
| 103 | + opacity=0.8, |
| 104 | + ), |
| 105 | + rx.text( |
| 106 | + "$18.99", |
| 107 | + trim="both", |
| 108 | + size="6", |
| 109 | + weight="regular", |
| 110 | + ), |
| 111 | + width="100%", |
| 112 | + spacing="2", |
| 113 | + align_items="end", |
| 114 | + ), |
| 115 | + rx.badge( |
| 116 | + "POPULAR", |
| 117 | + size="2", |
| 118 | + radius="full", |
| 119 | + variant="soft", |
| 120 | + color_scheme="blue", |
| 121 | + ), |
| 122 | + align_items="center", |
| 123 | + justify="between", |
| 124 | + height="35px", |
| 125 | + width="100%", |
| 126 | + ), |
| 127 | + rx.text( |
| 128 | + "250 Image Credits", |
| 129 | + weight="bold", |
| 130 | + size="7", |
| 131 | + width="100%", |
| 132 | + text_align="left", |
| 133 | + ), |
| 134 | + popular_features(), |
| 135 | + rx.spacer(), |
| 136 | + rx.button( |
| 137 | + "Purchase", |
| 138 | + size="3", |
| 139 | + width="100%", |
| 140 | + color_scheme="blue", |
| 141 | + ), |
| 142 | + spacing="6", |
| 143 | + border=f"1.5px solid {rx.color('blue', 6)}", |
| 144 | + background=rx.color("blue", 1), |
| 145 | + padding="28px", |
| 146 | + width="100%", |
| 147 | + max_width="400px", |
| 148 | + min_height="475px", |
| 149 | + border_radius="0.5rem", |
| 150 | + ) |
| 151 | + |
| 152 | + |
| 153 | +def pricing_cards() -> rx.Component: |
| 154 | + return rx.flex( |
| 155 | + pricing_card_standard(), |
| 156 | + pricing_card_popular(), |
| 157 | + spacing="4", |
| 158 | + flex_direction=["column", "column", "row"], |
| 159 | + width="100%", |
| 160 | + align_items="center", |
| 161 | + ) |
| 162 | + |
5 | 163 | def pricing_page() -> rx.Component:
|
6 | 164 | my_child = rx.vstack(
|
7 | 165 | rx.heading("Pricing", size="9"),
|
8 |
| - rx.text( |
9 |
| - "Our Pricing", |
10 |
| - ), |
| 166 | + pricing_cards(), |
11 | 167 | spacing="5",
|
12 | 168 | justify="center",
|
13 | 169 | align="center",
|
|
0 commit comments