From f233fb8288cdd1cfacd56b2086f1ac7181816f7e Mon Sep 17 00:00:00 2001 From: lauralog Date: Mon, 7 Oct 2024 13:06:20 +0200 Subject: [PATCH] customCards update --- app/about/page.js | 96 ++++++++++++++++++++++-------------- app/globals.css | 9 +++- app/page.js | 7 ++- components/core/Cards.jsx | 14 ++++-- components/ui/Heading.jsx | 2 +- components/ui/button.jsx | 9 ++-- components/ui/customCard.jsx | 14 +++--- components/ui/image-old.jsx | 57 --------------------- tailwind.config.js | 4 +- 9 files changed, 94 insertions(+), 118 deletions(-) delete mode 100644 components/ui/image-old.jsx diff --git a/app/about/page.js b/app/about/page.js index 5b2647b..8a532fd 100644 --- a/app/about/page.js +++ b/app/about/page.js @@ -4,10 +4,21 @@ import { useEffect, useState } from "react"; import Link from "next/link"; import { projects } from "@/constants/projects.js"; import { useTranslation } from "react-i18next"; -import { FaceIcon, FigmaLogoIcon, HeartIcon, Pencil2Icon, ScissorsIcon } from "@radix-ui/react-icons"; +import { + FaceIcon, + FigmaLogoIcon, + HeartIcon, + Pencil2Icon, + ScissorsIcon, +} from "@radix-ui/react-icons"; import Heading from "@/components/ui/Heading"; import { Button, ButtonVariants } from "@/components/ui/button"; - +import { + CustomCard, + CardContent, + CardTitle, + CardDescription, +} from "@/components/ui/customCard"; export default function About() { // const [projects, setProjects] = useState(myprojectCards); @@ -20,54 +31,67 @@ export default function About() { return (
+ {/* INTRO */}
- {t("about.Intro.sectionTitle")} + + {t("about.Intro.sectionTitle")} +

{t("about.Intro.sectionBody")}

- + {t("about.Intro.sectionHighlight")}
- + {/* CARDS */}
{t("about.Goals.sectionTitle")} +
-
- + + - + -
- {t("about.Goals.Goal1.GoalTitle")} -

{t("about.Goals.Goal1.GoalBody")}

-
-
-
- + {t("about.Goals.Goal1.GoalTitle")} + {t("about.Goals.Goal1.GoalBody")} + + + - + -
- {t("about.Goals.Goal2.GoalTitle")} -

{t("about.Goals.Goal2.GoalBody")}

-
-
-
- + {t("about.Goals.Goal2.GoalTitle")} + {t("about.Goals.Goal2.GoalBody")} + + + - + -
- {t("about.Goals.Goal3.GoalTitle")} -

{t("about.Goals.Goal3.GoalBody")}

-
-
+ {t("about.Goals.Goal3.GoalTitle")} + {t("about.Goals.Goal3.GoalBody")} + + + + + + + {/* */} + Título de la card + + Lorem Ipsum es simplemente el texto de relleno de las imprentas y + archivos de texto. + +
@@ -77,7 +101,7 @@ export default function About() {
- + {t("about.Columns.Column1.Title")}
{t("about.Columns.Column1.Subtitle")}
@@ -91,34 +115,34 @@ export default function About() { > {t("about.Columns.Column1.Button")} -
- +
{t("about.Columns.Column2.Title")}
{t("about.Columns.Column2.Subtitle")}

{t("about.Columns.Column2.Body")}

-
- +
- {t("about.Impact.sectionTitle")} + + {t("about.Impact.sectionTitle")} +

{t("about.Impact.sectionBody")}

diff --git a/app/globals.css b/app/globals.css index a6c7c9a..cb5bfc4 100644 --- a/app/globals.css +++ b/app/globals.css @@ -3,7 +3,7 @@ @tailwind utilities; * { - /*border: 1px solid salmon*/ + /* border: 1px solid salmon */ } /*TYPE*/ @@ -75,6 +75,13 @@ del filter cambia de bloque a inline*/ .gap_grid-r { @apply gap-x-4 sm:gap-x-6 lg:gap-x-8 xl:gap-x-10 } + +/* DIVIDERS */ +.divider_auto { + @apply h-full; +} + + main { min-height: 85dvh; } diff --git a/app/page.js b/app/page.js index 8d3a053..4cccfd5 100644 --- a/app/page.js +++ b/app/page.js @@ -10,8 +10,7 @@ import Heading from "@/components/ui/Heading"; import Divider from "@/components/ui/divider"; import Text from "@/components/ui/Text"; import { ArrowRightIcon, EnvelopeOpenIcon } from "@radix-ui/react-icons"; -import Image from "@/components/ui/image-old"; -import Img from "@/components/ui/image"; +import Image from "@/components/ui/image"; //Card import { @@ -65,7 +64,7 @@ export default function Projects() { {t("front.action-button")} - Descripción de la imagen - { if (!tags) return null; const tagsArray = tags.split(",").map((tag) => tag.trim()); // Convierte el string en array y elimina espacios @@ -122,7 +128,7 @@ const Card = React.forwardRef( {/* card header */} {(date || category) && (
- {date && ( + {date && ( {date} )} {category && ( @@ -181,7 +187,7 @@ const Card = React.forwardRef( // PROJECT const projectCard = (
-
+
{date} @@ -205,7 +211,7 @@ const Card = React.forwardRef( // COURSE const courseCard = (
-
+
{date} @@ -229,7 +235,7 @@ const Card = React.forwardRef( // PUBLICATIONS - ok const publicationCard = (
-
+
{date} diff --git a/components/ui/Heading.jsx b/components/ui/Heading.jsx index 384a39c..5adf44a 100644 --- a/components/ui/Heading.jsx +++ b/components/ui/Heading.jsx @@ -49,7 +49,7 @@ const Heading = ({ level = "h1", children, className }) => { "text-h4 2xl:text-xl mb-2 text-title": level === "h4", "text-h5 2xl:text-lg mb-2 text-title": level === "h5", "text-h6 uppercase mb-2 text-title": level === "h6", - "text-h5 2xl:text-lg mb-2 text-primary": level === "highlight" + "text-h4 2xl:text-lg mb-2 text-primary max-w-[45ch]": level === "highlight" }, className ]) diff --git a/components/ui/button.jsx b/components/ui/button.jsx index b2d49d3..79bb675 100644 --- a/components/ui/button.jsx +++ b/components/ui/button.jsx @@ -19,19 +19,16 @@ const ButtonVariants = cva( outlineForeground: //for outline buttons over dark backgrounds "border border-input border-secondary text-secondary-100 shadow-sm hover:bg-primary/30 hover:text-accent-foreground", secondary: - "bg-secondary-300 text-secondary-foreground shadow-sm hover:bg-secondary-200", + "bg-secondary-300 text-secondary-foreground shadow-sm hover:bg-secondary-400", ghost: - "bg-transparent text-primary hover:underline-offset-4 hover:bg-secondary-100/60 shadow-none", + "bg-transparent text-primary hover:underline-offset-4 hover:bg-secondary-200 shadow-none", link: "!px-0.5 text-secondary-foreground bg-transparent hover:bg-transparent hover:underline shadow-none", - ghostForeground: - "text-primary-foreground bg-transparent hover:bg-accent/10 hover:text-accent-foreground shadow-none", - linkForeground: "bg-transparent text-primary-foreground underline-offset-4 underline hover:bg-secondary-100/60 shadow-none", }, size: { - default: " px-5 py-2.5 text-base", + default: "px-5 py-2.5 text-base", sm: "px-4 py-2 text-sm font-semibold", lg: "px-5 py-2.5 text-lg", icon: "px-5 w-8 py-2.5", diff --git a/components/ui/customCard.jsx b/components/ui/customCard.jsx index 7808acf..aed1f3a 100644 --- a/components/ui/customCard.jsx +++ b/components/ui/customCard.jsx @@ -10,13 +10,13 @@ import { cva } from "class-variance-authority"; import { cn } from "@/lib/utils" import Heading from "@/components/ui/Heading" -const customCard = React.forwardRef(({ className, ...props }, ref) => ( -
( +
)) -customCard.displayName = "customCard" +CustomCard.displayName = "CustomCard" const CardHeader = React.forwardRef(({ className, ...props }, ref) => (
(

)) CardDescription.displayName = "CardDescription" const CardContent = React.forwardRef(({ className, ...props }, ref) => ( -

+
)) CardContent.displayName = "CardContent" @@ -67,4 +67,4 @@ const CardFooter = React.forwardRef(({ className, ...props }, ref) => ( )) CardFooter.displayName = "CardFooter" -export { customCard, CardHeader, CardFooter, CardTitle, CardSubtitle, CardDescription, CardContent } +export { CustomCard, CardHeader, CardFooter, CardTitle, CardSubtitle, CardDescription, CardContent } diff --git a/components/ui/image-old.jsx b/components/ui/image-old.jsx deleted file mode 100644 index 7cc93ab..0000000 --- a/components/ui/image-old.jsx +++ /dev/null @@ -1,57 +0,0 @@ -"use client"; - -import React from "react"; -import clsx from "clsx"; -import { Badge } from "./badge"; // Importamos el Badge y sus variantes - -const Image = ({ - fit = "cover", - src, - alt = "", - className, - layout = "top-right", - hasBadge = false, - badgeVariant = "", - badgeSize = "", -}) => { - const imageContainerClasses = clsx( - "relative flex w-full h-full", - className - ); - const imageClasses = clsx( - "w-full h-full", // La imagen ocupará todo el contenedor - { - "object-cover": fit === "cover", // Uso de object-cover para cubrir el contenedor - "object-contain": fit === "contain", // Uso de object-contain para mantener la relación de aspecto - } - ); - - const badgeLayout = clsx( - "absolute", - { - "top-2 left-2": layout === "top-left", - "top-2 right-2": layout === "top-right", - "bottom-2 left-2": layout === "bottom-left", - "bottom-2 right-2": layout === "bottom-right", - "top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2": layout === "center", - } - ); - - return ( -
- {alt} - {hasBadge && ( - - Hola - - )} -
- ); -}; - - -export default Image; diff --git a/tailwind.config.js b/tailwind.config.js index ed621d0..aabaa80 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -44,8 +44,8 @@ module.exports = { 400: "#97A7FF", 300: "#b2bef7", 200: "#DBE2FF", - // 100: "#EBF0FF", - // 50: "#F5F8FF", + 100: "#e0effe", + 50: "#f0f7ff", foreground: "#FFFFFF", },