|
18 | 18 | const onPrevious = () => (index = (index - 1 + articles.length) % articles.length); |
19 | 19 | </script> |
20 | 20 |
|
21 | | -<section |
22 | | - id="articles" |
23 | | - class="@container col-span-full grid *:col-span-full *:col-start-1 *:row-start-1" |
24 | | -> |
| 21 | +<section id="articles" class="@container grid gap-y-6"> |
25 | 22 | {#each articles as article, i} |
26 | 23 | {#key article.slug} |
27 | | - <div |
28 | | - class:sr-only={i !== index} |
29 | | - class="grid min-h-72 grid-cols-2 items-center gap-8 rounded-2xl @3xl:grid-cols-[auto_1fr_1fr_auto] @3xl:gap-y-10" |
30 | | - > |
31 | | - <IconButton |
32 | | - icon={ChevronLeft} |
33 | | - size="large" |
34 | | - class="text-muted col-start-1 row-start-3 @3xl:row-start-1" |
35 | | - onclick={onPrevious} |
36 | | - /> |
| 24 | + <div class:sr-only={i !== index} class="grid min-h-72 grid-cols-2 gap-8 rounded-2xl"> |
37 | 25 | <div class="col-span-full grid place-items-center @3xl:col-span-1"> |
38 | 26 | <a href={article.slug}> |
39 | 27 | {#key article.thumbnail} |
40 | 28 | <img |
41 | 29 | src={article.thumbnail} |
42 | 30 | alt={article.title} |
43 | | - class="rounded-2xl" |
| 31 | + class="h-[288px] rounded-2xl object-cover" |
44 | 32 | width="512" |
45 | 33 | height="288" |
46 | 34 | /> |
47 | 35 | {/key} |
48 | 36 | </a> |
49 | 37 | </div> |
50 | | - <div class="col-span-full grid place-items-center @3xl:col-span-1"> |
51 | | - <TextBlock title={article.title} text={article.description}> |
| 38 | + |
| 39 | + <div class="col-span-full grid place-items-center @3xl:col-span-1 @3xl:justify-start"> |
| 40 | + <TextBlock class="max-w-lg" title={article.title} text={article.description}> |
52 | 41 | <Button variant="primary" href={article.slug}> |
53 | 42 | {m.common_read_more()} |
54 | 43 | </Button> |
55 | 44 | </TextBlock> |
56 | 45 | </div> |
57 | | - <IconButton |
58 | | - icon={ChevronRight} |
59 | | - size="large" |
60 | | - class="text-muted col-start-2 row-start-3 justify-self-end @3xl:col-start-4 @3xl:row-start-1" |
61 | | - onclick={onNext} |
62 | | - /> |
63 | | - |
64 | | - <div |
65 | | - class="col-span-full col-start-1 row-start-3 flex items-center justify-center gap-2 @3xl:row-start-2" |
66 | | - > |
67 | | - {#each articles as article, i} |
68 | | - <button onclick={() => (index = i)}> |
69 | | - <Circle |
70 | | - id={article.slug} |
71 | | - aria-selected={i === index} |
72 | | - class="stroke-on-background aria-selected:fill-on-background size-2" |
73 | | - /> |
74 | | - </button> |
75 | | - {/each} |
76 | | - </div> |
77 | 46 | </div> |
78 | 47 | {/key} |
79 | 48 | {/each} |
| 49 | + |
| 50 | + <div class="flex items-center justify-center gap-2"> |
| 51 | + <IconButton |
| 52 | + icon={ChevronLeft} |
| 53 | + size="large" |
| 54 | + class="text-muted col-start-1 row-start-3 @3xl:row-start-1" |
| 55 | + onclick={onPrevious} |
| 56 | + /> |
| 57 | + {#each articles as article, i} |
| 58 | + <button onclick={() => (index = i)}> |
| 59 | + <Circle |
| 60 | + id={article.slug} |
| 61 | + aria-selected={i === index} |
| 62 | + class="stroke-on-background aria-selected:fill-on-background size-2" |
| 63 | + /> |
| 64 | + </button> |
| 65 | + {/each} |
| 66 | + <IconButton |
| 67 | + icon={ChevronRight} |
| 68 | + size="large" |
| 69 | + class="text-muted col-start-2 row-start-3 justify-self-end @3xl:col-start-4 @3xl:row-start-1" |
| 70 | + onclick={onNext} |
| 71 | + /> |
| 72 | + </div> |
80 | 73 | </section> |
0 commit comments