|
| 1 | +--- |
| 2 | +interface Props { |
| 3 | + title: string; |
| 4 | + href: string; |
| 5 | + tagline?: string; |
| 6 | +} |
| 7 | +
|
| 8 | +const { title, href, tagline } = Astro.props; |
| 9 | +--- |
| 10 | + |
| 11 | +<a class="feature-card" href={href}> |
| 12 | + <div class="feature-card__title"> |
| 13 | + <span>{title}</span> |
| 14 | + {tagline && <small>{tagline}</small>} |
| 15 | + </div> |
| 16 | + <div class="feature-card__body"> |
| 17 | + <slot /> |
| 18 | + </div> |
| 19 | + <div class="feature-card__arrow" aria-hidden="true">↗</div> |
| 20 | +</a> |
| 21 | + |
| 22 | +<style> |
| 23 | + :global(.card-grid) { |
| 24 | + gap: clamp(1rem, 2vw, 2rem); |
| 25 | + } |
| 26 | + |
| 27 | + .feature-card { |
| 28 | + display: flex; |
| 29 | + flex-direction: column; |
| 30 | + gap: 0.75rem; |
| 31 | + padding: clamp(1.5rem, 2vw, 2.25rem); |
| 32 | + border-radius: 1.25rem; |
| 33 | + border: 1px solid transparent; |
| 34 | + text-decoration: none; |
| 35 | + color: inherit; |
| 36 | + position: relative; |
| 37 | + background: |
| 38 | + linear-gradient(135deg, rgba(243, 183, 92, 0.18), rgba(62, 126, 171, 0.18)), |
| 39 | + var(--sl-color-gray-6); |
| 40 | + box-shadow: 0 20px 45px rgba(5, 7, 15, 0.35); |
| 41 | + backdrop-filter: blur(12px); |
| 42 | + transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease; |
| 43 | + } |
| 44 | + |
| 45 | + :global([data-theme='light']) .feature-card { |
| 46 | + background: |
| 47 | + linear-gradient(135deg, rgba(243, 183, 92, 0.22), rgba(62, 126, 171, 0.12)), |
| 48 | + #ffffff; |
| 49 | + box-shadow: 0 15px 30px rgba(15, 23, 42, 0.12); |
| 50 | + } |
| 51 | + |
| 52 | + .feature-card:hover, |
| 53 | + .feature-card:focus-visible { |
| 54 | + transform: translateY(-6px); |
| 55 | + border-color: rgba(243, 183, 92, 0.55); |
| 56 | + box-shadow: 0 30px 55px rgba(5, 7, 15, 0.45); |
| 57 | + } |
| 58 | + |
| 59 | + .feature-card__title { |
| 60 | + font-family: var(--sl-font-headings); |
| 61 | + font-size: 1.25rem; |
| 62 | + font-weight: 600; |
| 63 | + display: flex; |
| 64 | + flex-direction: column; |
| 65 | + gap: 0.4rem; |
| 66 | + color: var(--sl-color-gray-1); |
| 67 | + } |
| 68 | + |
| 69 | + :global([data-theme='light']) .feature-card__title { |
| 70 | + color: var(--sl-color-gray-6); |
| 71 | + } |
| 72 | + |
| 73 | + .feature-card__title small { |
| 74 | + font-size: 0.9rem; |
| 75 | + color: var(--sl-color-gray-3); |
| 76 | + text-transform: uppercase; |
| 77 | + letter-spacing: 0.08em; |
| 78 | + } |
| 79 | + |
| 80 | + .feature-card__body { |
| 81 | + color: var(--sl-color-gray-2); |
| 82 | + line-height: 1.5; |
| 83 | + } |
| 84 | + |
| 85 | + :global([data-theme='light']) .feature-card__body { |
| 86 | + color: var(--sl-color-gray-4); |
| 87 | + } |
| 88 | + |
| 89 | + .feature-card__arrow { |
| 90 | + position: absolute; |
| 91 | + bottom: 1.25rem; |
| 92 | + right: 1.5rem; |
| 93 | + font-size: 1.5rem; |
| 94 | + color: var(--sl-color-accent-high); |
| 95 | + transition: transform 200ms ease; |
| 96 | + } |
| 97 | + |
| 98 | + .feature-card:hover .feature-card__arrow, |
| 99 | + .feature-card:focus-visible .feature-card__arrow { |
| 100 | + transform: translate(4px, -4px); |
| 101 | + } |
| 102 | +</style> |
| 103 | + |
0 commit comments