Skip to content

Commit

Permalink
Merge pull request #522 from Yeghro/mobile
Browse files Browse the repository at this point in the history
More mobile improvments
  • Loading branch information
aljazceru authored Jan 26, 2025
2 parents 75cbe72 + a361469 commit c4833d9
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 139 deletions.
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- Add favicon links -->
<link rel="icon" type="image/png" href="Logo.png">
<link rel="apple-touch-icon" href="Logo.png">

<meta name="description" content="A comprehensive collection of Nostr resources, tools, clients, and protocols for developers and users.">
<meta name="keywords" content="nostr, cryptocurrency, decentralized social, protocols, tools, clients, resources">
<meta name="author" content="Your Name">
Expand Down
48 changes: 24 additions & 24 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,37 +623,37 @@ function createResourceCard(resource) {
let faviconUrl = '';
try {
const url = new URL(resource.link);
// Using Google's favicon service as a fallback if the direct favicon isn't available
faviconUrl = `https://www.google.com/s2/favicons?domain=${url.hostname}&sz=32`;
faviconUrl = `https://www.google.com/s2/favicons?domain=${url.hostname}&sz=64`;
} catch (e) {
console.warn('Invalid URL:', resource.link);
}

card.innerHTML = `
<div class="resource-header">
<h3 class="resource-title">
<a href="${resource.link}"
target="_blank"
rel="noopener"
itemprop="name">
${faviconUrl ? `<img src="${faviconUrl}" alt="" class="resource-favicon" />` : ''}
${resource.name}
<i class="fas fa-external-link-alt" aria-hidden="true"></i>
</a>
</h3>
${resource.stars ? `
<div class="resource-stars" itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating">
<i class="fas fa-star" aria-hidden="true"></i>
<span itemprop="ratingValue">${resource.stars}</span>
<meta itemprop="ratingCount" content="${resource.stars}">
</div>
` : ''}
</div>
${resource.description ? `
<div class="resource-description" itemprop="description">
${resource.description}
${faviconUrl ? `<img src="${faviconUrl}" alt="" class="resource-favicon" />` : ''}
<div class="resource-content">
<h3 class="resource-title">
<a href="${resource.link}"
target="_blank"
rel="noopener"
itemprop="name">
${resource.name}
</a>
${resource.stars ? `
<div class="resource-stars" itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating">
<i class="fas fa-star" aria-hidden="true"></i>
<span itemprop="ratingValue">${resource.stars}</span>
<meta itemprop="ratingCount" content="${resource.stars}">
</div>
` : ''}
</h3>
${resource.description ? `
<div class="resource-description" itemprop="description">
${resource.description}
</div>
` : ''}
</div>
` : ''}
</div>
`;

return card;
Expand Down
Loading

0 comments on commit c4833d9

Please sign in to comment.