Skip to content

Commit 3ad68e4

Browse files
committed
preview link
1 parent 0279e55 commit 3ad68e4

1 file changed

Lines changed: 39 additions & 4 deletions

File tree

src/components/features-section.astro

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,45 @@
1414
</div>
1515

1616
<div class="mt-8 text-left">
17-
<a href="https://docs.github.com/pages" target="_blank" rel="noopener noreferrer" class="text-sm text-gray-400 hover:text-white transition-colors inline-flex items-center gap-1">
18-
Read docs
19-
<i class="ph ph-arrow-right"></i>
20-
</a>
17+
<span class="link-preview-container inline-block relative group">
18+
<a href="https://docs.github.com/pages" target="_blank" rel="noopener noreferrer" class="text-sm text-gray-400 hover:text-white transition-colors inline-flex items-center gap-1">
19+
Read docs
20+
<i class="ph ph-arrow-right"></i>
21+
</a>
22+
<!-- Link Preview Panel -->
23+
<div class="link-preview-panel absolute bottom-full left-0 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">
24+
<div class="bg-[#1a1a1a] border border-white/10 overflow-hidden shadow-2xl">
25+
<!-- Preview Image -->
26+
<div class="relative h-[160px] bg-gradient-to-br from-gray-800 to-gray-900 overflow-hidden">
27+
<img
28+
src="https://api.microlink.io/?url=https://docs.github.com/pages&screenshot=true&meta=false&embed=screenshot.url"
29+
alt="GitHub Pages Docs Preview"
30+
class="absolute inset-0 w-full h-full object-cover"
31+
onerror="this.style.display='none'; this.nextElementSibling.style.display='flex';"
32+
/>
33+
<!-- Fallback -->
34+
<div class="hidden absolute inset-0 items-center justify-center bg-gradient-to-br from-gray-800 to-gray-900">
35+
<svg class="w-12 h-12 text-gray-600" fill="currentColor" viewBox="0 0 24 24">
36+
<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"/>
37+
</svg>
38+
</div>
39+
<div class="absolute inset-0 bg-gradient-to-t from-[#1a1a1a] via-transparent to-transparent"></div>
40+
</div>
41+
<!-- Preview Content -->
42+
<div class="p-3">
43+
<div class="flex items-center gap-2 mb-1">
44+
<svg class="w-4 h-4 text-white" fill="currentColor" viewBox="0 0 24 24">
45+
<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"/>
46+
</svg>
47+
<span class="text-xs text-gray-400">docs.github.com</span>
48+
</div>
49+
<p class="text-xs text-gray-500 line-clamp-2">Learn how to create and deploy websites with GitHub Pages.</p>
50+
</div>
51+
</div>
52+
<!-- Arrow -->
53+
<div class="absolute -bottom-2 left-6 w-4 h-4 bg-[#1a1a1a] border-r border-b border-white/10 rotate-45"></div>
54+
</div>
55+
</span>
2156
</div>
2257
</div>
2358
</section>

0 commit comments

Comments
 (0)