11<script >
22 import Badge from ' ./Badge.svelte' ;
3- import ReadingTime from ' ./ReadingTime.svelte' ;
4- import HumanDate from ' ./HumanDate.svelte' ;
5- /**
6- * @typedef {Object} Props
7- * @property {string} [tag ]
8- * @property {string} [title]
9- * @property {string} [slug]
10- * @property {string} [date]
11- * @property {string} [image]
12- * @property {Array<{authors_id: {name: string}}>} [authors]
13- * @property {string} [content]
14- */
3+ import ReadingTime from ' ./ReadingTime.svelte' ;
4+ import HumanDate from ' ./HumanDate.svelte' ;
5+ /**
6+ * @typedef {Object} Props
7+ * @property {Array< string> } [tags ]
8+ * @property {string} [title]
9+ * @property {string} [slug]
10+ * @property {string} [date]
11+ * @property {string} [image]
12+ * @property {Array<{authors_id: {name: string}}>} [authors]
13+ * @property {string} [content]
14+ */
1515
16- /** @type {Props} */
17- let {
18- tag = ' ' ,
19- title = ' Blog' ,
20- slug = ' ' ,
21- date = ' ' ,
22- image = ' https://images.unsplash.com/photo-1582005450386-52b25f82d9bb?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D ' ,
23- authors = [],
24- content = ' '
25- } = $props ();
16+ /** @type {Props} */
17+ let {
18+ tags = [] ,
19+ title = ' Blog' ,
20+ slug = ' ' ,
21+ date = ' ' ,
22+ image = ' ' ,
23+ authors = [],
24+ content = ' '
25+ } = $props ();
2626 </script >
2727
28- <a href ="/blog/ {slug }" >
29- <div class =" h-[400px] relative " >
30- <div
31- class ="
32- group
33- absolute
34- w-full
35- h-full
36- top-0
37- left-0
38- right-0
39- bottom-0
40- bg-black
41- opacity-50
42- z-10
43- flex
44- "
45- ></div >
46-
47- <div
48- class ="
49- absolute
50- w-full
51- h-full
52- top-0
53- left-0
54- right-0
55- bottom-0
56- z-20
57- flex
58- flex-col
59- justify-center
60- p-10"
61- >
62- <div class =" left" >
63- {#if tag }
64- <Badge text ={tag } />
65- {/if }
66- </div >
67- <h1 class =" text-2xl md:text-4xl font-bold text-white md:leading-normal group:hover:underline " >
68- {title }
69- </h1 >
28+ <div class =" hero flex gap-2 md:gap-4 flex-col md:flex-row" >
29+ <div class =" hero_left aspect-16/9 border border-cmxblack border-2" >
30+ <img src ={image } alt =" " class =" " />
7031 </div >
71-
72- <div
73- class ="
74- absolute
75- w-full
76- h-full
77- top-0
78- left-0
79- right-0
80- bottom-0
81- z-30
82- flex
83- flex-col
84- justify-end
85- p-10
86- "
87- >
88- <div class =" bottom-0" >
89- <p class =" text-2xl text-left text-white font-thin" >
90- {#each authors as author , i }
91- <span >{author .authors_id .name || ' ' }{#if i < (authors .length - 1 )}, {/if }</span >
92- {/each }
93- </p >
94- <p class =" text-left text-gray-300 font-bold" >
95- <HumanDate date ={date }/>
96- <span class =" mx-2" >·</span >
97- <ReadingTime text ={content }/>
98- </p >
32+ <div class =" hero_right flex flex-col gap-4" >
33+ <div ></div >
34+ <h1 class =" text-2xl md:text-4xl font-black text-cmxblack leading-1 hover:underline" >
35+ <a href ="/blog/ {slug }" >{title }</a >
36+ </h1 >
37+ <div class =" " >
38+ <p class =" text-md font-semibold" >
39+ {#each authors as author , i }
40+ <span
41+ >{author .authors_id .name || ' ' }{#if i < authors .length - 1 },
42+ {/if }</span
43+ >
44+ {/each }
45+ </p >
46+ <p class =" text-sm" >
47+ <HumanDate {date } />
48+ <span class =" mx-2" >•</span >
49+ <ReadingTime text ={content } />
50+ </p >
51+ </div >
52+ <div class =" flex flex-row gap-1" >
53+ {#each tags as tag }
54+ <Badge text ={tag } />
55+ {/each }
9956 </div >
10057 </div >
101-
102- <img class ="object-cover w-full h-full" src ={image } alt =" Hero" />
10358</div >
104- </a >
0 commit comments