From c2e36347814803cc9eeea35871ed8525a9e4370b Mon Sep 17 00:00:00 2001 From: Philippe Loctaux Date: Thu, 1 Jun 2023 23:44:40 +0200 Subject: [PATCH] added experience card --- src/components/experience-card.astro | 113 +++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 src/components/experience-card.astro diff --git a/src/components/experience-card.astro b/src/components/experience-card.astro new file mode 100644 index 0000000..69d0d5a --- /dev/null +++ b/src/components/experience-card.astro @@ -0,0 +1,113 @@ +--- +interface Props { + backgroundColor: string; + logo?: string; + logoTransparentBackground?: boolean; + name: string; + dates: string; + title: string; + link?: { label: string; uri: string }; + notAvailable?: boolean; + image?: { uri: string; breakpoint: string }; + tech?: string[]; +} +const { + backgroundColor, + logo, + logoTransparentBackground, + name, + dates, + title, + link, + notAvailable, + image, + tech, +} = Astro.props; + +// Define how to display logo +const logoCss = `h-16 w-16 rounded-xl mr-4 ${ + logoTransparentBackground === true ? "p-2 bg-white" : "" +}`; + +// Card behavior with and without image +const cardCss = `${ + image + ? `${image.breakpoint}:flex ${image.breakpoint}:flex-row-reverse items-stretch justify-between` + : "" +} w-full rounded-2xl ${backgroundColor}`; + +// Image behavior +const imageCss = `flex ${image?.breakpoint}:w-1/2 grow ${image?.breakpoint}:rounded-tl-none ${image?.breakpoint}:rounded-r-2xl rounded-t-2xl object-cover`; +--- + +
+ + {image && } + + +
+
+
+ {logo && } +
+
{name}
+
{dates}
+
+
+

{title}

+
+
+ + + + + { + tech && ( +
+
+ Technologies +
+
    + {tech.map((t) => ( +
  • {t}
  • + ))} +
+
+ ) + } +
+ + + { + link && notAvailable !== true && ( + +
+ + + + + {link.label} +
+
+ ) + } + + + { + notAvailable === true && ( + + No longer available + + ) + } +
+