diff options
Diffstat (limited to 'src/components/Card.astro')
| -rw-r--r-- | src/components/Card.astro | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/src/components/Card.astro b/src/components/Card.astro index efcfaeb..d2d428e 100644 --- a/src/components/Card.astro +++ b/src/components/Card.astro @@ -5,20 +5,22 @@ interface Props { href: string; language: string; languageColor: string; + logoSrc?: string; + logoWidth?: string; } -const { href, title, body, language, languageColor } = Astro.props; +const { href, title, body, language, languageColor, logoSrc, logoWidth = '60%' } = Astro.props; --- <li class="link-card"> <a href={href}> + {logoSrc && <div class="logo-container"><img src={logoSrc} alt="Project Logo" style={{ maxWidth: logoWidth }} /></div>} <div class="content-container"> <h2>{title}</h2> <div class="language-container"> <span class="dot" style={{ backgroundColor: languageColor }}></span> <span class="language">{language}</span> </div> - <div class="separator"></div> <p>{body}</p> </div> </a> @@ -40,7 +42,6 @@ const { href, title, body, language, languageColor } = Astro.props; position: relative; overflow: hidden; } - .link-card > a { width: 100%; text-decoration: none; @@ -54,60 +55,51 @@ const { href, title, body, language, languageColor } = Astro.props; flex-direction: column; align-items: flex-start; justify-content: space-between; - position: relative; /* Add position property */ - box-sizing: border-box; /* Include padding in the element's total width/height. */ - height: 100%; /* Ensure it takes the full height of its parent. */ + position: relative; + box-sizing: border-box; + height: 100%; } - .content-container { display: flex; flex-direction: column; gap: 10px; margin-bottom: 0; } - h2 { margin: 0; font-size: 1.25rem; transition: color 0.6s cubic-bezier(0.22, 1, 0.36, 1); } - p { margin-top: 0.5rem; margin-bottom: 0; } - .separator { height: 1px; width: 100%; background-color: rgba(255, 255, 255, 0.1); } - .language-container { display: flex; align-items: center; gap: 5px; margin: 0; } - .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; } - .language { font-weight: bold; font-size: 1rem; color: rgba(255, 255, 255, 0.8); } - .link-card:is(:hover, :focus-within) { background-position: 0; background-image: var(--accent-gradient); } - .link-card:is(:hover, :focus-within) h2 { color: rgb(var(--accent-light)); } @@ -127,4 +119,17 @@ const { href, title, body, language, languageColor } = Astro.props; font-size: 24px; } } + + .logo-container { + width: 100%; + display: flex; + justify-content: center; + align-items: center; + padding: 1rem 0; + } + .logo-container img { + max-width: 60%; + height: auto; + border-radius: 8px; + } </style> |
