parent
a28204c908
commit
8b32a3a831
5 changed files with 114 additions and 99 deletions
@ -0,0 +1,50 @@ |
||||
--- |
||||
export interface FeaturedItemType { |
||||
isUpcoming?: boolean; |
||||
isNew?: boolean; |
||||
url: string; |
||||
text: string; |
||||
} |
||||
|
||||
export interface Props extends FeaturedItemType {} |
||||
|
||||
const { isUpcoming = false, isNew = false, text, url } = Astro.props; |
||||
--- |
||||
|
||||
<a |
||||
class:list={[ |
||||
'group border border-slate-800 bg-slate-900 p-2.5 sm:p-3.5 block no-underline rounded-lg relative text-slate-400 font-regular text-md hover:border-slate-600 hover:text-slate-100', |
||||
{ |
||||
'opacity-50': isUpcoming, |
||||
}, |
||||
]} |
||||
href={url} |
||||
> |
||||
<span class='text-slate-400'> |
||||
{text} |
||||
</span> |
||||
|
||||
{ |
||||
isNew && ( |
||||
<span class='absolute bottom-1.5 right-2 text-xs font-medium rounded-br rounded-tl text-purple-300 flex items-center'> |
||||
<span class='flex h-2 w-2 mr-1.5'> |
||||
<span class='animate-ping absolute inline-flex h-2 w-2 rounded-full bg-purple-400 opacity-75' /> |
||||
<span class='relative inline-flex rounded-full h-2 w-2 bg-purple-500' /> |
||||
</span> |
||||
New |
||||
</span> |
||||
) |
||||
} |
||||
|
||||
{ |
||||
isUpcoming && ( |
||||
<span class='absolute bottom-1.5 right-2 text-xs font-medium rounded-br rounded-tl text-slate-500 flex items-center'> |
||||
<span class='flex h-2 w-2 mr-1.5'> |
||||
<span class='animate-ping absolute inline-flex h-2 w-2 rounded-full bg-slate-500 opacity-75' /> |
||||
<span class='relative inline-flex rounded-full h-2 w-2 bg-slate-600' /> |
||||
</span> |
||||
Upcoming |
||||
</span> |
||||
) |
||||
} |
||||
</a> |
@ -0,0 +1,35 @@ |
||||
--- |
||||
import FeaturedItem, { FeaturedItemType } from './FeaturedItem.astro'; |
||||
|
||||
export interface Props { |
||||
featuredItems: FeaturedItemType[]; |
||||
heading: string; |
||||
} |
||||
|
||||
const { featuredItems, heading } = Astro.props; |
||||
--- |
||||
|
||||
<div class='py-4 sm:py-14 border-b border-b-slate-900 relative'> |
||||
<div class='container'> |
||||
<h2 |
||||
class='hidden sm:flex absolute rounded-lg -top-[17px] left-1/2 -translate-x-1/2 bg-slate-900 py-1 px-3 border border-slate-900 text-md text-slate-400 font-regular' |
||||
> |
||||
{heading} |
||||
</h2> |
||||
|
||||
<ul class='grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-2'> |
||||
{ |
||||
featuredItems.map((featuredItem) => ( |
||||
<li> |
||||
<FeaturedItem |
||||
text={featuredItem.text} |
||||
url={featuredItem.url} |
||||
isNew={featuredItem.isNew} |
||||
isUpcoming={featuredItem.isUpcoming} |
||||
/> |
||||
</li> |
||||
)) |
||||
} |
||||
</ul> |
||||
</div> |
||||
</div> |
@ -1,56 +0,0 @@ |
||||
--- |
||||
import type { RoadmapFileType } from '../../lib/roadmap'; |
||||
|
||||
export interface Props { |
||||
roadmap: RoadmapFileType; |
||||
} |
||||
|
||||
const { roadmap } = Astro.props; |
||||
const frontmatter = roadmap.frontmatter; |
||||
|
||||
let roadmapTitle = frontmatter.featuredTitle; |
||||
|
||||
// Lighthouse considers "Go" as a non-descriptive text such as "Submit" etc. |
||||
// Adding "Roadmap" as a postfix to make it not complain ¯\_(ツ)_/¯ |
||||
if (roadmapTitle === 'Go') { |
||||
roadmapTitle = 'Go Roadmap'; |
||||
} |
||||
--- |
||||
|
||||
<a |
||||
class:list={[ |
||||
'group border border-slate-800 bg-slate-900 p-2.5 sm:p-3.5 block no-underline rounded-lg relative text-slate-400 font-regular text-md hover:border-slate-600 hover:text-slate-100', |
||||
{ |
||||
'opacity-50': roadmap.frontmatter.isUpcoming, |
||||
}, |
||||
]} |
||||
href={`/${roadmap.id}/`} |
||||
> |
||||
<span class="text-slate-400"> |
||||
{roadmapTitle} |
||||
</span> |
||||
|
||||
{ |
||||
frontmatter.isNew && ( |
||||
<span class="absolute bottom-1.5 right-2 text-xs font-medium rounded-br rounded-tl text-purple-300 flex items-center"> |
||||
<span class="flex h-2 w-2 mr-1.5"> |
||||
<span class="animate-ping absolute inline-flex h-2 w-2 rounded-full bg-purple-400 opacity-75" /> |
||||
<span class="relative inline-flex rounded-full h-2 w-2 bg-purple-500" /> |
||||
</span> |
||||
New |
||||
</span> |
||||
) |
||||
} |
||||
|
||||
{ |
||||
frontmatter.isUpcoming && ( |
||||
<span class="absolute bottom-1.5 right-2 text-xs font-medium rounded-br rounded-tl text-slate-500 flex items-center"> |
||||
<span class="flex h-2 w-2 mr-1.5"> |
||||
<span class="animate-ping absolute inline-flex h-2 w-2 rounded-full bg-slate-500 opacity-75" /> |
||||
<span class="relative inline-flex rounded-full h-2 w-2 bg-slate-600" /> |
||||
</span> |
||||
Upcoming |
||||
</span> |
||||
) |
||||
} |
||||
</a> |
@ -1,31 +0,0 @@ |
||||
--- |
||||
import type { RoadmapFileType } from '../../lib/roadmap'; |
||||
import FeaturedRoadmapItem from './FeaturedRoadmapItem.astro'; |
||||
|
||||
export interface Props { |
||||
roadmaps: RoadmapFileType[]; |
||||
heading: string; |
||||
} |
||||
|
||||
const { roadmaps, heading } = Astro.props; |
||||
--- |
||||
|
||||
<div class="py-4 sm:py-14 border-b border-b-slate-900 relative"> |
||||
<div class="container"> |
||||
<h2 |
||||
class="hidden sm:flex absolute rounded-lg -top-[17px] left-1/2 -translate-x-1/2 bg-slate-900 py-1 px-3 border border-slate-900 text-md text-slate-400 font-regular" |
||||
> |
||||
{heading} |
||||
</h2> |
||||
|
||||
<ul class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-2"> |
||||
{ |
||||
roadmaps.map((roadmap) => ( |
||||
<li> |
||||
<FeaturedRoadmapItem roadmap={roadmap} /> |
||||
</li> |
||||
)) |
||||
} |
||||
</ul> |
||||
</div> |
||||
</div> |
Loading…
Reference in new issue