|
165 | 165 | {#each packageOrder as pkgId} |
166 | 166 | {@const pkg = packages[pkgId]} |
167 | 167 | <div class="package-card elevated"> |
168 | | - <div class="panel-header"> |
169 | | - <span>{pkg.shortName}</span> |
170 | | - <div class="header-actions"> |
171 | | - <a href="{base}/{pkg.api}" class="icon-btn" use:tooltip={'API'}> |
172 | | - <Icon name="braces" size={14} /> |
173 | | - </a> |
174 | | - <a href="{base}/{pkg.docs}" class="icon-btn" use:tooltip={'Docs'}> |
175 | | - <Icon name="book" size={14} /> |
176 | | - </a> |
177 | | - {#if pkg.pypi} |
178 | | - <a href={pkg.pypi} class="icon-btn" use:tooltip={'PyPI'}> |
179 | | - <Icon name="package" size={14} /> |
| 168 | + <div class="card-info"> |
| 169 | + <div class="card-info-row"> |
| 170 | + <span>{pkg.shortName}</span> |
| 171 | + <div class="header-actions"> |
| 172 | + <a href="{base}/{pkg.api}" class="icon-btn" use:tooltip={'API'}> |
| 173 | + <Icon name="braces" size={14} /> |
180 | 174 | </a> |
181 | | - {/if} |
182 | | - {#if pkg.examples} |
183 | | - <a href="{base}/{pkg.examples}" class="icon-btn" use:tooltip={'Examples'}> |
184 | | - <Icon name="play" size={14} /> |
| 175 | + <a href="{base}/{pkg.docs}" class="icon-btn" use:tooltip={'Docs'}> |
| 176 | + <Icon name="book" size={14} /> |
185 | 177 | </a> |
186 | | - {/if} |
187 | | - {#if roadmapFlags[pkgId]} |
188 | | - <a href="{base}/{pkgId}/roadmap" class="icon-btn" use:tooltip={'Roadmap'}> |
189 | | - <Icon name="roadmap" size={14} /> |
| 178 | + {#if pkg.pypi} |
| 179 | + <a href={pkg.pypi} class="icon-btn" use:tooltip={'PyPI'}> |
| 180 | + <Icon name="package" size={14} /> |
| 181 | + </a> |
| 182 | + {/if} |
| 183 | + {#if pkg.examples} |
| 184 | + <a href="{base}/{pkg.examples}" class="icon-btn" use:tooltip={'Examples'}> |
| 185 | + <Icon name="play" size={14} /> |
| 186 | + </a> |
| 187 | + {/if} |
| 188 | + {#if roadmapFlags[pkgId]} |
| 189 | + <a href="{base}/{pkgId}/roadmap" class="icon-btn" use:tooltip={'Roadmap'}> |
| 190 | + <Icon name="roadmap" size={14} /> |
| 191 | + </a> |
| 192 | + {/if} |
| 193 | + <a href={pkg.github} class="icon-btn" use:tooltip={'GitHub'}> |
| 194 | + <Icon name="github" size={14} /> |
190 | 195 | </a> |
191 | | - {/if} |
192 | | - <a href={pkg.github} class="icon-btn" use:tooltip={'GitHub'}> |
193 | | - <Icon name="github" size={14} /> |
194 | | - </a> |
| 196 | + </div> |
195 | 197 | </div> |
| 198 | + <div class="card-description">{pkg.description}</div> |
196 | 199 | </div> |
197 | 200 | <button class="package-body" onclick={() => navigateWithTransition(`${base}/${pkg.docs}`)}> |
198 | 201 | <img src="{base}/{pkg.logo}" alt={pkg.name} /> |
|
384 | 387 | } |
385 | 388 |
|
386 | 389 | .package-card { |
| 390 | + position: relative; |
387 | 391 | border-radius: var(--radius-lg); |
388 | 392 | border: 1px solid var(--border); |
389 | 393 | overflow: hidden; |
|
395 | 399 | box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); |
396 | 400 | } |
397 | 401 |
|
| 402 | + .card-info { |
| 403 | + position: absolute; |
| 404 | + top: 0; |
| 405 | + left: 0; |
| 406 | + right: 0; |
| 407 | + z-index: 1; |
| 408 | + padding: var(--space-sm) var(--space-lg); |
| 409 | + background: var(--surface-raised); |
| 410 | + border-bottom: 1px solid var(--border); |
| 411 | + border-radius: var(--radius-lg) var(--radius-lg) 0 0; |
| 412 | + font-size: var(--font-base); |
| 413 | + font-weight: 600; |
| 414 | + color: var(--text-muted); |
| 415 | + text-transform: uppercase; |
| 416 | + letter-spacing: 0.5px; |
| 417 | + } |
| 418 | +
|
| 419 | + .card-info-row { |
| 420 | + display: flex; |
| 421 | + align-items: center; |
| 422 | + justify-content: space-between; |
| 423 | + } |
| 424 | +
|
| 425 | + .card-description { |
| 426 | + font-size: var(--font-base); |
| 427 | + font-weight: 400; |
| 428 | + color: var(--text-muted); |
| 429 | + text-transform: none; |
| 430 | + letter-spacing: normal; |
| 431 | + max-height: 0; |
| 432 | + overflow: hidden; |
| 433 | + opacity: 0; |
| 434 | + transition: max-height 0.15s ease, opacity 0.15s ease, margin 0.15s ease; |
| 435 | + } |
| 436 | +
|
| 437 | + .package-card:hover .card-description { |
| 438 | + max-height: 100px; |
| 439 | + opacity: 1; |
| 440 | + margin-top: 4px; |
| 441 | + } |
| 442 | +
|
398 | 443 | .header-actions { |
399 | 444 | display: flex; |
400 | 445 | gap: var(--space-xs); |
|
406 | 451 | justify-content: center; |
407 | 452 | width: 100%; |
408 | 453 | padding: var(--space-xl); |
| 454 | + padding-top: calc(40px + var(--space-xl)); |
409 | 455 | background: var(--surface); |
410 | 456 | border: none; |
411 | 457 | cursor: pointer; |
|
0 commit comments