Skip to content

Commit 0279e55

Browse files
committed
microlink preview
1 parent 8fac9e9 commit 0279e55

2 files changed

Lines changed: 46 additions & 1 deletion

File tree

bun.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/install-code-block.astro

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,45 @@
4646
<!-- Requirements Note -->
4747
<div class="mt-3 flex items-center gap-2 text-xs text-gray-500">
4848
<i class="ph ph-terminal text-gray-400"></i>
49-
<span>Requires <a href="https://cli.github.com/" target="_blank" class="text-blue-400 hover:text-blue-300 underline">GitHub CLI (gh)</a> to be installed</span>
49+
<span>Requires
50+
<span class="link-preview-container inline-block relative group">
51+
<a href="https://cli.github.com/" target="_blank" class="text-blue-400 hover:text-blue-300 underline">GitHub CLI (gh)</a>
52+
<!-- Link Preview Panel -->
53+
<div class="link-preview-panel absolute bottom-full left-1/2 -translate-x-1/2 mb-2 w-[280px] opacity-0 invisible translate-y-2 transition-all duration-300 ease-out z-50 group-hover:opacity-100 group-hover:visible group-hover:translate-y-0 pointer-events-none">
54+
<div class="bg-[#1a1a1a] border border-white/10 overflow-hidden shadow-2xl">
55+
<!-- Preview Image -->
56+
<div class="relative h-[160px] bg-gradient-to-br from-gray-800 to-gray-900 overflow-hidden">
57+
<img
58+
src="https://api.microlink.io/?url=https://cli.github.com/&screenshot=true&meta=false&embed=screenshot.url"
59+
alt="GitHub CLI Preview"
60+
class="absolute inset-0 w-full h-full object-cover"
61+
onerror="this.style.display='none'; this.nextElementSibling.style.display='flex';"
62+
/>
63+
<!-- Fallback -->
64+
<div class="hidden absolute inset-0 items-center justify-center bg-gradient-to-br from-gray-800 to-gray-900">
65+
<svg class="w-12 h-12 text-gray-600" fill="currentColor" viewBox="0 0 24 24">
66+
<path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"/>
67+
</svg>
68+
</div>
69+
<div class="absolute inset-0 bg-gradient-to-t from-[#1a1a1a] via-transparent to-transparent"></div>
70+
</div>
71+
<!-- Preview Content -->
72+
<div class="p-3">
73+
<div class="flex items-center gap-2 mb-1">
74+
<svg class="w-4 h-4 text-white" fill="currentColor" viewBox="0 0 24 24">
75+
<path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"/>
76+
</svg>
77+
<span class="text-xs text-gray-400">cli.github.com</span>
78+
</div>
79+
<p class="text-xs text-gray-500 line-clamp-2">Take GitHub to the command line. GitHub CLI brings GitHub to your terminal.</p>
80+
</div>
81+
</div>
82+
<!-- Arrow -->
83+
<div class="absolute -bottom-2 left-1/2 -translate-x-1/2 w-4 h-4 bg-[#1a1a1a] border-r border-b border-white/10 rotate-45"></div>
84+
</div>
85+
</span>
86+
to be installed
87+
</span>
5088
</div>
5189
</div>
5290

0 commit comments

Comments
 (0)