From 7f7302d330b1d7ab96b5b1a8537fa0ed64408f90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Fern=C3=A1ndez=20Tirado?= Date: Wed, 15 May 2024 16:29:59 +0200 Subject: [PATCH] Add meta tags, fix lang tag, change main color scheme, fix h1 titles --- assets/images/favicon/safari-pinned-tab.svg | 15 -------- assets/scripts.js | 34 ++++++++++++------- assets/styles.css | 8 ++++- assets/tailwind.css | 2 +- portafolio_personal/components/banner.py | 3 +- portafolio_personal/components/heading.py | 4 +-- portafolio_personal/components/icon_button.py | 6 ++-- portafolio_personal/components/navbar.py | 2 +- portafolio_personal/portafolio_personal.py | 5 ++- portafolio_personal/views/header.py | 5 +-- 10 files changed, 45 insertions(+), 39 deletions(-) delete mode 100644 assets/images/favicon/safari-pinned-tab.svg diff --git a/assets/images/favicon/safari-pinned-tab.svg b/assets/images/favicon/safari-pinned-tab.svg deleted file mode 100644 index 7f521fc..0000000 --- a/assets/images/favicon/safari-pinned-tab.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - -Created by potrace 1.14, written by Peter Selinger 2001-2017 - - - - - diff --git a/assets/scripts.js b/assets/scripts.js index 50c01ac..8e37a17 100644 --- a/assets/scripts.js +++ b/assets/scripts.js @@ -1,13 +1,10 @@ +var path = window.location.pathname; +var htmlTag = document.documentElement; -window.onload = function() { - var path = window.location.pathname; - var htmlTag = document.documentElement; - - if (path === "/") { - htmlTag.lang = "es"; - } else if (path === "/en") { - htmlTag.lang = "en"; - } +if (path.startsWith("/en")) { + htmlTag.lang = "en"; +} else { + htmlTag.lang = "es"; } // Obtenemos los botones de cambio de idioma @@ -76,12 +73,23 @@ function initializeDarkMode() { document.head.innerHTML += ` - - - - + + + + + + + + + + + + + + `; initializeDarkMode(); diff --git a/assets/styles.css b/assets/styles.css index b86ee4e..7df1e88 100644 --- a/assets/styles.css +++ b/assets/styles.css @@ -465,7 +465,7 @@ video { .box-s:hover{ outline-style: solid; outline-width: 1px; - outline-color: #7dd3fc; + outline-color: #a5b4fc; } :is(.dark .box-s){ --tw-bg-opacity: 1; @@ -521,9 +521,15 @@ video { .h-24{ height: 6rem; } +.h-40{ + height: 10rem; +} .h-96{ height: 24rem; } +.w-40{ + width: 10rem; +} .w-full{ width: 100%; } diff --git a/assets/tailwind.css b/assets/tailwind.css index 526a695..ef81c55 100644 --- a/assets/tailwind.css +++ b/assets/tailwind.css @@ -5,6 +5,6 @@ @layer components { .box-s { - @apply shadow-md p-7 md:p-10 dark:shadow-slate-950 hover:outline hover:outline-1 hover:outline-sky-300 bg-stone-100 rounded-2xl dark:bg-slate-800; + @apply shadow-md p-7 md:p-10 dark:shadow-slate-950 hover:outline hover:outline-1 hover:outline-indigo-300 bg-stone-100 rounded-2xl dark:bg-slate-800; } } \ No newline at end of file diff --git a/portafolio_personal/components/banner.py b/portafolio_personal/components/banner.py index 100cf34..abccec5 100644 --- a/portafolio_personal/components/banner.py +++ b/portafolio_personal/components/banner.py @@ -4,10 +4,11 @@ def banner(lang) -> rx.Component: return rx.vstack( - rx.text( + rx.heading( "", id="typed-text", class_name="font-extrabold text-center text-base md:text-xl md:text-2xl text-slate-600 dark:text-slate-300 noto-sans-mono", + _as="h1" ), rx.script( """ diff --git a/portafolio_personal/components/heading.py b/portafolio_personal/components/heading.py index b8132d1..2ef8ade 100644 --- a/portafolio_personal/components/heading.py +++ b/portafolio_personal/components/heading.py @@ -7,7 +7,7 @@ def heading(text: str, h1=False) -> rx.Component: rx.tablet_and_desktop( rx.heading( text, - as_="h1" if h1 else "h2", + as_="h2", size=Size.LARGE.value if h1 else Size.MEDIUM.value, font_family="Rubik", ) @@ -15,7 +15,7 @@ def heading(text: str, h1=False) -> rx.Component: rx.mobile_only( rx.heading( text, - as_="h1" if h1 else "h2", + as_="h2", size=Size.MEDIUM.value if h1 else Size.SMALL.value, font_family="Rubik", ) diff --git a/portafolio_personal/components/icon_button.py b/portafolio_personal/components/icon_button.py index 5a5b703..a8fad3d 100644 --- a/portafolio_personal/components/icon_button.py +++ b/portafolio_personal/components/icon_button.py @@ -5,9 +5,11 @@ def icon_button(icon: str, url: str, text="", solid=False) -> rx.Component: rx.button( rx.icon(icon), text, - variant="solid" if solid else "surface" + variant="solid" if solid else "surface", + title="Button: " + icon + " - " + text ), href=url, is_external=True, - class_name="flex justify-center" + class_name="flex justify-center", + title="Link: " + icon + " - " + text ) diff --git a/portafolio_personal/components/navbar.py b/portafolio_personal/components/navbar.py index ee4e296..363e7bb 100644 --- a/portafolio_personal/components/navbar.py +++ b/portafolio_personal/components/navbar.py @@ -40,7 +40,7 @@ def navbar() -> rx.Component: spacing=Size.SMALL.value, ), rx.html( - '', + '', class_name="flex darkThemeBtn" ), spacing=Size.DEFAULT.value, diff --git a/portafolio_personal/portafolio_personal.py b/portafolio_personal/portafolio_personal.py index e4b8260..7807baa 100644 --- a/portafolio_personal/portafolio_personal.py +++ b/portafolio_personal/portafolio_personal.py @@ -44,7 +44,10 @@ def index(lang='es') -> rx.Component: app = rx.App( stylesheets=STYLESHEETS, - style=BASE_STYLE + style=BASE_STYLE, + theme= rx.theme( + accent_color="indigo" + ) ) app.add_page(index("es"), route="/", title=get_translation("page_title", "es")) diff --git a/portafolio_personal/views/header.py b/portafolio_personal/views/header.py index 8a66927..3583118 100644 --- a/portafolio_personal/views/header.py +++ b/portafolio_personal/views/header.py @@ -7,9 +7,10 @@ def header(data: Data) -> rx.Component: return rx.flex( - rx.avatar( + rx.image( src=data.avatar, - size=Size.EXTRALARGE.value + class_name="shadow-xl rounded-xl w-40 h-40", + alt="Logo R" ), rx.vstack( heading(data.name, h1=True),