mirror of
https://github.com/LukeHagar/sveltesociety.dev.git
synced 2025-12-06 04:21:38 +00:00
Add repository node to json (#438)
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
export let stars;
|
||||
export let url = '';
|
||||
export let npm = '';
|
||||
export let repo = '';
|
||||
export let repository = undefined;
|
||||
|
||||
let clipboardCopy = false;
|
||||
|
||||
@@ -34,7 +34,8 @@
|
||||
|
||||
<div class="card" class:active id="component-{title}">
|
||||
<h3>
|
||||
<a href="#component-{title}">#</a> <a href={url}>{title}</a>
|
||||
<a href="#component-{title}">#</a>
|
||||
{#if url || repository}<a href={url || repository}>{title}</a>{:else}<span>{title}</span>{/if}
|
||||
{#if npm}<Tag
|
||||
click={() => copy()}
|
||||
variant="copy"
|
||||
@@ -49,24 +50,28 @@
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
{#if typeof stars !== 'undefined'}
|
||||
<div class="card__bottom">
|
||||
<div>
|
||||
{#if (repo || url).includes('github')}
|
||||
<img style="display:inline" src="/images/github_logo.svg" alt="github logo" />
|
||||
{:else if (repo || url).includes('gitlab')}
|
||||
<img style="display:inline" src="/images/gitlab_logo.svg" alt="gitlab logo" />
|
||||
<!-- {:else} -->
|
||||
{/if}
|
||||
</div>
|
||||
<div>
|
||||
<div class="card__bottom">
|
||||
<div>
|
||||
{#if (repository || url || '').includes('github')}
|
||||
<a title="Go to the source code" href={repository || url}
|
||||
><img style="display:inline" src="/images/github_logo.svg" alt="github logo" /></a
|
||||
>
|
||||
{:else if (repository || url || '').includes('gitlab')}
|
||||
<a title="Go to the source code" href={repository || url}
|
||||
><img style="display:inline" src="/images/gitlab_logo.svg" alt="gitlab logo" /></a
|
||||
>
|
||||
<!-- {:else} -->
|
||||
{/if}
|
||||
</div>
|
||||
<div>
|
||||
{#if typeof stars !== 'undefined'}
|
||||
★
|
||||
<code>{stars}</code>
|
||||
</div>
|
||||
<!-- commenting out dates just cause it is not very updated yet - all the cards show same date. put back in when we have better scraping -->
|
||||
<!-- <datetime value={addedOn}>{new Intl.DateTimeFormat('en-Us').format(Date.parse(addedOn))}</datetime> -->
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
<!-- commenting out dates just cause it is not very updated yet - all the cards show same date. put back in when we have better scraping -->
|
||||
<!-- <datetime value={addedOn}>{new Intl.DateTimeFormat('en-Us').format(Date.parse(addedOn))}</datetime> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
@@ -95,10 +100,26 @@
|
||||
.card__bottom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: end;
|
||||
}
|
||||
.card__bottom > * {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.card__bottom a {
|
||||
border-bottom: none;
|
||||
aspect-ratio: 1/1;
|
||||
display: flex;
|
||||
min-height: 26px;
|
||||
padding: 4px;
|
||||
border-radius: 50%;
|
||||
margin: -4px;
|
||||
box-sizing: border-box;
|
||||
background-color: rgba(0, 0, 0, 0);
|
||||
transition: background-color 200ms ease-out;
|
||||
}
|
||||
.card__bottom a:hover {
|
||||
background-color: rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
|
||||
.flex-grow {
|
||||
flex-grow: 1;
|
||||
|
||||
Reference in New Issue
Block a user