@@ -16,6 +16,22 @@ interface Props {
16
16
17
17
const ThumbnailWidth = 165 ;
18
18
const Thumbnail2X = 2 * ThumbnailWidth ;
19
+ const IconClass = `
20
+ inline-block
21
+ mr-1
22
+ min-w-[1.5em]
23
+ text-center
24
+ data-[icon^=fa:github]:top-[-.1em]
25
+ data-[icon^=fa:github]:relative
26
+ ` ;
27
+ const ThumbnailClass = `
28
+ aspect-square
29
+ object-contain
30
+ object-top
31
+ w-4col
32
+ h-auto
33
+ max-w-none
34
+ ` ;
19
35
20
36
const {
21
37
project : {
@@ -40,125 +56,63 @@ const localImageMetadata = thumbnail && !isExternal
40
56
41
57
---
42
58
43
- <li class =" project" >
44
- <article >
45
- <OptionalAnchor href ={ url } >
46
- { thumbnail && isExternal ? (
47
- <img class = " thumbnail" src = { thumbnail } alt = { name } width = { ThumbnailWidth } />
48
- ) : localImageMetadata ? (
49
- <Image
50
- class = " thumbnail"
51
- src = { localImageMetadata }
52
- alt = { name }
53
- widths = { [ThumbnailWidth , Thumbnail2X ]}
54
- sizes = { ` (max-width: 768px) ${ThumbnailWidth }px, ${ThumbnailWidth }px ` }
55
- />
56
- ) : (
57
- <DefaultThumbnail size = { ThumbnailWidth } />
58
- )}
59
- </OptionalAnchor >
60
-
61
- <section >
62
- <h3 >
63
- <OptionalAnchor href ={ url } >
64
- { name }
65
- </OptionalAnchor >
66
- </h3 >
67
-
68
- { /* descriptionHTML is formatted as a <p> tag */ }
69
- <Fragment set:html ={ descriptionHTML } />
59
+ <li class =" flex flex-row items-start gap-1u mb-2u" >
60
+ <OptionalAnchor href ={ url } >
61
+ { thumbnail && isExternal ? (
62
+ <img class = { ThumbnailClass } src = { thumbnail } alt = { name } width = { ThumbnailWidth } />
63
+ ) : localImageMetadata ? (
64
+ <Image
65
+ class = { ThumbnailClass }
66
+ src = { localImageMetadata }
67
+ alt = { name }
68
+ widths = { [ThumbnailWidth , Thumbnail2X ]}
69
+ sizes = { ` (max-width: 768px) ${ThumbnailWidth }px, ${ThumbnailWidth }px ` }
70
+ />
71
+ ) : (
72
+ <DefaultThumbnail size = { ThumbnailWidth } />
73
+ )}
74
+ </OptionalAnchor >
75
+
76
+ <article class =" flex-1 prose" >
77
+ <h3 class =" text-3xl font-semibold font-condensed mb-1u not-prose trim-start" >
78
+ <OptionalAnchor href ={ url } class =" text-text-base! decoration-text-base/20! hover:decoration-text-base!" >
79
+ { name }
80
+ </OptionalAnchor >
81
+ </h3 >
82
+
83
+ { /* descriptionHTML is formatted as a <p> tag */ }
84
+ <Fragment set:html ={ descriptionHTML } />
85
+
86
+ { technologies &&
87
+ <h4 >Tech stack</h4 >
88
+ <p >{ technologies .join (" , " )} </p >
89
+ }
70
90
71
- { technologies &&
72
- <h4 >Tech stack</h4 >
73
- <p >{ technologies .join (" , " )} </p >
91
+ <ul class =" *:my-3 not-prose" role =" list" >
92
+ { (slack && status !== " completed" ) &&
93
+ <li >
94
+ <Icon name = { " fa:slack" } class = { IconClass } aria-label = " Slack icon" />
95
+ Join: <a href = { slack .url } >{ slack .name } </a >
96
+ </li >
74
97
}
75
98
76
- <div class =" links" >
77
- { (slack && status !== " completed" ) &&
78
- <p >
79
- <Icon name = { " fa:slack" } class = " icon" /> Join: <a href = { slack .url } >{ slack .name } </a >
80
- </p >
81
- }
82
-
83
- { repos ?.length &&
84
- <>
85
- { repos .map ((url ) => (
86
- <p >
87
- <Icon name = { " fa:github" } class = " icon" /> Contribute: <a href = { url } >{ url .replace (" https://github.com/" , " " )} </a >
88
- </p >
89
- ))}
90
- </>
91
- }
99
+ { repos ?.length &&
100
+ <>
101
+ { repos .map ((url : string ) => (
102
+ <li >
103
+ <Icon name = { " fa:github" } class = { IconClass } aria-label = " GitHub icon" />
104
+ Contribute: <a href = { url } >{ url .replace (/ https? :\/\/ (www\. )? github\. com\/ / , " " )} </a >
105
+ </li >
106
+ ))}
107
+ </>
108
+ }
92
109
93
- { website &&
94
- < p >
95
- <Icon name = { " fa:external-link" } class = " icon" /> Visit: < a href = { website } > { cleanWebsite ( website ) } </ a >
96
- </ p >
97
- }
98
- </ div >
99
- </section >
110
+ { website &&
111
+ < li >
112
+ <Icon name = { " fa:external-link" } class = { IconClass } aria-label = " External link icon" />
113
+ Visit: < a href = { website } > { cleanWebsite ( website ) } </ a >
114
+ </ li >
115
+ }
116
+ </ul >
100
117
</article >
101
118
</li >
102
-
103
- <style >
104
- li.project {
105
- margin: var(--pico-block-spacing-vertical) 0 0 0;
106
- }
107
-
108
- article {
109
- display: flex;
110
- flex-direction: row;
111
- align-items: flex-start;
112
- gap: var(--pico-block-spacing-horizontal);
113
- }
114
-
115
- img.thumbnail {
116
- aspect-ratio: 1;
117
- object-fit: contain;
118
- object-position: center top;
119
- width: 165px;
120
- height: 165px;
121
- max-width: unset;
122
- }
123
-
124
- section {
125
- margin-bottom: 0;
126
- }
127
-
128
- h4 {
129
- margin-bottom: calc(.5 * var(--pico-typography-spacing-vertical));
130
- }
131
-
132
- .links {
133
- margin-top: calc(1.75 * var(--pico-typography-spacing-vertical));
134
- }
135
-
136
- .icon {
137
- display: inline-block;
138
- min-width: 1.5rem;
139
- text-align: center;
140
- }
141
-
142
- .icon[data-icon="fa:github"] {
143
- top: -.15rem;
144
- position: relative;
145
- }
146
-
147
- @media only screen and (max-width: 768px) {
148
- article {
149
- flex-direction: column;
150
- gap: calc(.5 * var(--pico-block-spacing-vertical));
151
- }
152
-
153
- img.thumbnail {
154
- aspect-ratio: auto;
155
- height: auto;
156
- }
157
-
158
- .links {
159
- a {
160
- word-break: break-all;
161
- }
162
- }
163
- }
164
- </style >
0 commit comments