Skip to content

Commit

Permalink
barista: Use smaller images for contributors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lara Aigmueller committed Mar 19, 2020
1 parent ac1cbd2 commit a56a748
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
class="ba-contributors-list-item"
>
<a [href]="_profileUrl(contributor.githubuser)">
<img [src]="_imageUrl(contributor.githubuser)" [alt]="contributor.name" />
<img
[src]="_imageUrl(contributor.githubuser)"
[srcset]="_imageSrcset(contributor.githubuser)"
[alt]="contributor.name"
/>
<span>{{ contributor.name }}</span>
</a>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ export class BaContributors {

/** @internal */
_imageUrl(gitHubUser: string): string {
return `https://github.com/${gitHubUser}.png?s=64`;
return `https://github.com/${gitHubUser}.png?size=40`;
}

/** @internal */
_imageSrcset(gitHubUser: string): string {
return `https://github.com/${gitHubUser}.png?size=40 1x,
https://github.com/${gitHubUser}.png?size=80 2x,
https://github.com/${gitHubUser}.png?size=120 3x`;
}

/** @internal */
Expand Down

0 comments on commit a56a748

Please sign in to comment.