-
Notifications
You must be signed in to change notification settings - Fork 163
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,43 @@ | ||
# This file has been modified by the Nextpy Team in 2023 using AI tools and automation scripts. | ||
# We have rigorously tested these modifications to ensure reliability and performance. Based on successful test results, we are confident in the quality and stability of these changes. | ||
|
||
from xtconfig import config | ||
|
||
import nextpy as xt | ||
|
||
# This code block represents a style dictionary generated using a large language model (LLM). | ||
# The original prompt for this generation was: "Generate a style dictionary for the following code [paste the code here]". | ||
# Additionally, we have developed the "Nextpy Style Assistant", a tool designed to assist in code styling and best practices. | ||
# This assistant will be available on our Discord server soon for further support and guidance in code styling. | ||
|
||
style = { | ||
"heading": { | ||
"text_align": "center", | ||
"font_size": "28px", | ||
"line_height": "36px", | ||
"color": "#F3F5F7", | ||
"font_family": "DM Sans", | ||
"max_width": "620px", | ||
"padding_top": "16px", | ||
"padding_bottom": "16px", | ||
}, | ||
"get_started_box": { | ||
"font_family": "Inter", | ||
"text_align": "center", | ||
"font_size": "14px", | ||
"color": "black", | ||
"background": "white", | ||
"padding_x": "48px", | ||
"padding_y": "12px", | ||
"border_radius": "lg", | ||
}, | ||
"vertical_stack_style": { | ||
"background": "#04090B", | ||
"height": "100vh", | ||
"padding_top": "20%", | ||
"padding_left":"5%", | ||
"padding_right":"5%", | ||
|
||
} | ||
} | ||
|
||
docs_url = "https://nextpy.org/nextpy/getting-started/introduction" | ||
# Construct the filename to display | ||
from xtconfig import config | ||
filename = f"{config.app_name}/{config.app_name}.py" | ||
|
||
class State(xt.State): | ||
"""The app state.""" | ||
|
||
pass | ||
|
||
# define index page. Frontend Pages are just functions that return a frontend components | ||
def index() -> xt.Component: | ||
return xt.fragment( | ||
xt.vstack( | ||
xt.image(src="/logo_darkmode.svg", width="150px"), | ||
xt.text("High performance web apps in pure python with built in AI functions", **style["heading"]), | ||
xt.text( | ||
"High performance web apps in pure python with built in AI functions", | ||
color="#F3F5F7", # Hexadecimal color code for text | ||
font_size="28px", | ||
padding="12px", # Space between an element and its border | ||
max_width="620px", # Maximum width of the text element | ||
), | ||
xt.box( | ||
"Get started by editing ", | ||
xt.span(filename, as_="b"), # `as_` exports it as <b> tag : Bold . Default is <p> tag . More at docs.nextpy.org/typography/text/ | ||
xt.span(filename, as_="b"), # Bold text using <b> tag, default is <p> tag | ||
xt.image(src="/gradient_underline.svg", width="150px"), | ||
**style["get_started_box"] | ||
background="white", | ||
padding="12px 42px", # Vertical padding = 12px & Horizonal padding = 42px | ||
border_radius="lg", # Large border radius | ||
), | ||
**style["vertical_stack_style"] | ||
height="100vh", # Full viewport height | ||
background="#04090B", # Background color | ||
padding_top="20%", # Top padding percentage for responsive design | ||
), | ||
) | ||
|
||
# Add state and page to the app. | ||
app = xt.App( | ||
# Add fonts here! | ||
stylesheets=[ | ||
"https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,700&family=Inter&display=swap", | ||
], | ||
) | ||
# Global styles defined as a Python dictionary | ||
style = { | ||
"text_align": "center", | ||
} | ||
|
||
|
||
app = xt.App(style=style) | ||
app.add_page(index) |