File tree Expand file tree Collapse file tree 4 files changed +30
-19
lines changed Expand file tree Collapse file tree 4 files changed +30
-19
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ import type { HTMLAttributes } from ' astro/types'
3+
4+ interface Props {
5+ title: string
6+ url: string
7+ description: string
8+ }
9+ const { title, url, description } = Astro .props
10+ ---
11+
12+ <div class =" project-card group relative" >
13+ <div class =" grid gap-1" >
14+ <a href ={ url } class =" after:absolute after:inset-0 after:content-['']" >
15+ <h3 class =" text-2xl font-medium transition-all" >
16+ { title }
17+ </h3 >
18+ </a >
19+ <p class =" text-base" >
20+ { description }
21+ </p >
22+ </div >
23+ </div >
Original file line number Diff line number Diff line change @@ -4,17 +4,17 @@ import ring from '../content/ring.json'
44import generatedRing from ' ../content/ring.generated.json'
55import events from ' ../content/events.json'
66import sponsors from ' ../content/sponsors.json'
7+ import CardLink from ' ../components/CardLink.astro'
78
89// TODO: refactor dedupe logic to separate file?
910// TODO: limit projects in index page
1011const projects = [... ring .projects ]
11- for (const project of generatedRing .projects ) {
12+ for (const project of generatedRing .projects as typeof ring . projects ) {
1213 const index = projects .findIndex ((x ) => x .name === project .name )
1314 if (index === - 1 ) {
1415 projects .push (project )
1516 }
1617}
17-
1818---
1919
2020<BaseLayout >
@@ -32,12 +32,7 @@ for (const project of generatedRing.projects) {
3232 {
3333 projects .map ((x ) => {
3434 return (
35- <a class = " project-card group" href = { x .repo } >
36- <div class = " grid gap-1" >
37- <h3 class = " text-2xl font-medium transition-all" >{ x .name } </h3 >
38- <p class = " text-base" >{ x .description } </p >
39- </div >
40- </a >
35+ <CardLink title = { x .name } url = { x .repo } description = { x .description } />
4136 )
4237 })
4338 }
Original file line number Diff line number Diff line change 22import BaseLayout from ' ../layouts/BaseLayout.astro'
33import ring from ' ../content/ring.json'
44import generatedRing from ' ../content/ring.generated.json'
5+ import CardLink from ' ../components/CardLink.astro'
56
67// TODO: refactor dedupe logic to separate file?
78const projects = [... ring .projects ]
8- for (const project of generatedRing .projects ) {
9+ for (const project of generatedRing .projects as typeof ring . projects ) {
910 const index = projects .findIndex ((x ) => x .name === project .name )
1011 if (index === - 1 ) {
1112 projects .push (project )
1213 }
1314}
14-
1515---
1616
1717<BaseLayout >
@@ -20,14 +20,7 @@ for (const project of generatedRing.projects) {
2020 <div class =" main-grid" >
2121 {
2222 projects .map ((x ) => {
23- return (
24- <a class = " project-card group" href = { x .repo } >
25- <div class = " grid gap-1" >
26- <h3 class = " text-2xl font-medium transition-all" >{ x .name } </h3 >
27- <p class = " text-base" >{ x .description } </p >
28- </div >
29- </a >
30- )
23+ return <CardLink title = { x .name } url = { x .repo } description = { x .description } />
3124 })
3225 }
3326 </div >
Original file line number Diff line number Diff line change 2929 @apply rounded-full bg-gradient-to-br from-neutral-800 to-neutral-900 px-6 py-3 text-xl text-neutral-50 shadow-sm transition-all hover:scale-[1.02 ] hover:text-neutral-50 hover:shadow-md;
3030}
3131
32- .project -card {
32+ .card -card {
3333 @apply flex flex-col gap-4 rounded-sm border border-bosf/30 bg-white p-6 shadow-sm transition-all hover:scale-[1.01 ] hover:border-bosf/50 hover:bg-gradient-to-br;
3434}
You can’t perform that action at this time.
0 commit comments