From 71b28b6059e825aeefcc4d6b63d883cedcb4f81b Mon Sep 17 00:00:00 2001 From: Timothy Pidashev Date: Sun, 10 Mar 2024 23:12:54 -0700 Subject: [PATCH] Sunday commit --- compose.prod.yml | 14 ++++++++ src/landing/landing/components/navbar.py | 36 +++++++++++++++++---- src/landing/landing/landing.py | 2 +- src/landing/landing/state/__init__.py | 1 + src/landing/landing/state/theme.py | 19 +++++++++++ src/landing/landing/style.py | 41 +++++++++++++++++++++--- 6 files changed, 101 insertions(+), 12 deletions(-) create mode 100644 src/landing/landing/state/theme.py diff --git a/compose.prod.yml b/compose.prod.yml index e69de29..b632f3e 100644 --- a/compose.prod.yml +++ b/compose.prod.yml @@ -0,0 +1,14 @@ +version: '3.8' + +services: + caddy: + container_name: caddy + image: caddy:latest + ports: + - 80:80 + - 443:443 + volumes: + - ./Caddyfile.prod:/etc/caddy/Caddyfile + restart: unless_stopped + networks: + - caddy diff --git a/src/landing/landing/components/navbar.py b/src/landing/landing/components/navbar.py index 1e8d700..a7a6bd7 100644 --- a/src/landing/landing/components/navbar.py +++ b/src/landing/landing/components/navbar.py @@ -4,12 +4,36 @@ from landing.style import * def navbar(): return rx.box( rx.center( - rx.vstack( - rx.heading("Navbar", size="9"), - align="center", - spacing="7" + rx.flex( + rx.link( + rx.text("About", color=color["white"]), + href="http://about.timmypidashev.localhost" + ) ), - border_bottom=f"2px solid {color['white']};", - height="10vh" + rx.flex( + rx.link( + rx.text("Projects", color=color["white"]), + href="http://projects.timmypidashev.localhost" + ) + ), + rx.flex( + rx.link( + rx.text("Resume", color=color["white"]), + href="http://resume.timmypidashev.localhost" + ) + ), + rx.flex( + rx.link( + rx.text("Blog", color=color["white"]), + href="http://blog.timmypidashev.localhost" + ) + ), + rx.flex( + rx.link( + rx.text("Shop", color=color["white"]), + href="http://shop.timmypidashev.localhost" + ) + ), + spacing="7", ) ) diff --git a/src/landing/landing/landing.py b/src/landing/landing/landing.py index 7bdafc2..cd79a8e 100644 --- a/src/landing/landing/landing.py +++ b/src/landing/landing/landing.py @@ -6,7 +6,7 @@ from landing.style import * # Create app instance and add index page. app = rx.App( - style=style, + style=base_style, stylesheets=[ "fonts/fonts.css", "css/scrollbar.css" diff --git a/src/landing/landing/state/__init__.py b/src/landing/landing/state/__init__.py index 3560a06..0a2dce5 100644 --- a/src/landing/landing/state/__init__.py +++ b/src/landing/landing/state/__init__.py @@ -1 +1,2 @@ from .state import State +from .theme import ThemeState diff --git a/src/landing/landing/state/theme.py b/src/landing/landing/state/theme.py new file mode 100644 index 0000000..a17e9e5 --- /dev/null +++ b/src/landing/landing/state/theme.py @@ -0,0 +1,19 @@ +import reflex as rx +from .state import State +from landing.style import * +from typing import Dict, Any, List + + +class ThemeState(State): + """App Theme State""" + + current_theme: int = 0 + + themes = { + 0: {"background_color": "#282828"}, + 1: {"background_color": "#000000"}, + } + + @rx.var + def theme(self) -> dict: + return self.themes[self.current_theme] diff --git a/src/landing/landing/style.py b/src/landing/landing/style.py index 60d392a..4cc046f 100644 --- a/src/landing/landing/style.py +++ b/src/landing/landing/style.py @@ -29,10 +29,11 @@ color = { } } -style = { - # Background color - "background_color": color["black"], - +base_style = { + # Background + # TODO: Implement dynamic background switching once reflex allows for Dict state management + "background_color": "#282828", + # Text rx.text: { "font_family": "ComicCode", @@ -52,9 +53,39 @@ style = { "font_family": "ComicCode", "font_size": 24, "color": color["black"], - "text_decoration": "none", + "text_decoration": "underline", "_hover": { "color": color["green"][100] } }, } + +# Dark Theme +#dark_theme = dict() +#dark_theme["background_color"] = "#282828" + +# Soft Contrast Dark Theme +# TODO + +# Medium Contrast Dark Theme +# TODO + +# Hard Contrast Dark Theme +# TODO + +# Amoled Contrast Dark Theme +#amoled_dark_theme = dict() +#amoled_dark_theme = "#000000" + +# Light Theme +# TODO + +# Soft Contrast Light Theme +# TODO + +# Medium Contrast Light Theme +# TODO + +# Hard Contrast Light Theme +# TODO +