Skip to content

Commit

Permalink
use image cdn for comm assets
Browse files Browse the repository at this point in the history
  • Loading branch information
secondl1ght committed Dec 20, 2023
1 parent cd04825 commit 08ee04e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/components/AboutCommunity.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<a bind:this={communityTooltip} href="/community/{community.id}">
<img
src={community.tags['icon:square']}
src={`https://btcmap.org/.netlify/images?url=${community.tags['icon:square']}&fit=cover&w=256&h=256`}
alt="avatar"
class="h-24 w-24 rounded-full object-cover"
on:error={function () {
Expand Down
4 changes: 3 additions & 1 deletion src/components/CommunityCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
<div class="my-4 space-y-2 p-4">
<a href="/community/{id}" class="space-y-2 text-link transition-colors hover:text-hover">
<img
src={image ? image : '/images/communities/bitcoin.svg'}
src={image
? `https://btcmap.org/.netlify/images?url=${image}&fit=cover&w=256&h=256`
: '/images/communities/bitcoin.svg'}
alt={tags.name}
class="mx-auto h-20 w-20 rounded-full object-cover"
on:error={function () {
Expand Down
2 changes: 1 addition & 1 deletion src/components/CommunityLeaderboardItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<div class="my-5 lg:my-0">
<img
src={avatar}
src={`https://btcmap.org/.netlify/images?url=${avatar}&fit=cover&w=256&h=256`}
alt="avatar"
class="mx-auto mb-2 h-20 w-20 rounded-full object-cover lg:h-14 lg:w-14"
on:error={function () {
Expand Down
4 changes: 1 addition & 3 deletions src/routes/communities/map/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@
popupContainer.innerHTML = `
<div class='text-center space-y-2'>
<img loading='lazy' src=${
community.tags['icon:square']
} alt='avatar' class='w-24 h-24 rounded-full mx-auto' title='Community icon' onerror="this.src='/images/communities/bitcoin.svg'" />
<img loading='lazy' src=${`https://btcmap.org/.netlify/images?url=${community.tags['icon:square']}&fit=cover&w=256&h=256`} alt='avatar' class='w-24 h-24 rounded-full mx-auto' title='Community icon' onerror="this.src='/images/communities/bitcoin.svg'" />
<span class='text-primary dark:text-white font-semibold text-xl' title='Community name'>${
community.tags.name
Expand Down
2 changes: 1 addition & 1 deletion src/routes/community/[area]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
const community = communityFound.tags;
avatar = community['icon:square'];
avatar = `https://btcmap.org/.netlify/images?url=${community['icon:square']}&fit=cover&w=256&h=256`;
org = community.organization;
sponsor = community.sponsor;
continent = community.continent;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/merchant/[id]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@
<div class="m-4 space-y-1 transition-transform hover:scale-110">
<a href="/community/{community.id}">
<img
src={community.tags['icon:square']}
src={`https://btcmap.org/.netlify/images?url=${community.tags['icon:square']}&fit=cover&w=256&h=256`}
alt="logo"
class="mx-auto h-20 w-20 rounded-full object-cover"
on:error={function () {
Expand Down

0 comments on commit 08ee04e

Please sign in to comment.