イメージライトボックスコンポーネント
シンプルでレスポンシブなglassmorphismスタイルの画像ライトボックスコンポーネントで、ソーシャルメディア用のオーシャン/ブルートーンで、ダークモードをサポートします。
HTMLコード
<div class="flex items-center justify-center min-h-screen bg-gradient-to-br from-blue-100 via-blue-200 to-blue-300 dark:from-gray-900 dark:via-gray-800 dark:to-gray-700 p-4 font-sans">
<!-- Lightbox Container (visible only when 'open', hidden by default using styling concepts, not direct JS) -->
<!-- In a real scenario, this would be toggled by JS. For pure HTML/CSS, it's assumed to be 'open' for demonstration. -->
<!-- To simulate true hidden/shown: display: none initially, display: flex on active class. -->
<div class="fixed inset-0 z-50 flex items-center justify-center bg-blue-900 bg-opacity-30 dark:bg-black dark:bg-opacity-70 backdrop-blur-sm">
<div class="relative w-full max-w-3xl mx-auto p-4 bg-white bg-opacity-20 dark:bg-gray-800 dark:bg-opacity-30 rounded-2xl shadow-xl border border-blue-500 border-opacity-30 dark:border-gray-600 dark:border-opacity-30 backdrop-filter backdrop-blur-lg">
<!-- Close Button -->
<button class="absolute top-3 right-3 text-white hover:text-blue-200 dark:text-gray-300 dark:hover:text-gray-100 text-3xl font-bold transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 rounded-full w-10 h-10 flex items-center justify-center">
×
</button>
<!-- Lightbox Content -->
<div class="flex flex-col md:flex-row gap-4 items-center">
<!-- Image Area -->
<div class="w-full md:w-3/5 rounded-lg overflow-hidden border border-blue-400 dark:border-gray-500 shadow-md">
<img src="https://picsum.photos/800/600?random=1" alt="Full size image" class="w-full h-auto object-cover">
</div>
<!-- Details Area -->
<div class="w-full md:w-2/5 text-white dark:text-gray-200 p-2 md:p-0">
<h3 class="text-2xl font-semibold mb-2 text-white dark:text-white">Ocean Sunset</h3>
<p class="text-sm mb-4 text-blue-100 dark:text-gray-300">A breathtaking view of the sunset over the serene ocean. Captured during my recent trip, truly mesmerizing.</p>
<!-- User Info -->
<div class="flex items-center mb-4">
<img src="https://randomuser.me/api/portraits/women/44.jpg" alt="User Avatar" class="w-10 h-10 rounded-full mr-3 border-2 border-blue-300 dark:border-gray-400">
<div>
<p class="font-medium text-blue-50 dark:text-gray-100">Jane Doe</p>
<p class="text-xs text-blue-100 dark:text-gray-300">@janedoe | 2 hours ago</p>
</div>
</div>
<!-- Action Buttons -->
<div class="flex gap-3 mt-4">
<button class="flex-1 py-2 px-4 bg-blue-600 bg-opacity-70 dark:bg-blue-700 dark:bg-opacity-60 text-white rounded-lg hover:bg-blue-700 hover:bg-opacity-80 dark:hover:bg-blue-800 dark:hover:bg-opacity-70 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-70">
<span class="mr-2 text-lg">♥</span> Like
</button>
<button class="flex-1 py-2 px-4 bg-blue-600 bg-opacity-70 dark:bg-blue-700 dark:bg-opacity-60 text-white rounded-lg hover:bg-blue-700 hover:bg-opacity-80 dark:hover:bg-blue-800 dark:hover:bg-opacity-70 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-70">
<span class="mr-2 text-lg">💭</span> Comment
</button>
</div>
</div>
</div>
</div>
</div>
</div>
関連コンポーネント
レトロ イメージ ライトボックス コンポーネント
レトロ/ビンテージデザイン、類似の配色、ダークモードのサポートを備えたレスポンシブでシンプルな画像ライトボックスコンポーネントで、ブログやコンテンツサイトに適しています。
イメージライトボックスコンポーネント
ブログやコンテンツプラットフォームに適したブルータリズムスタイルの画像ライトボックスコンポーネントで、アースカラーと複雑なインタラクティブ要素で設計されています。
イメージライトボックスコンポーネント
Skeuomorphism デザイン、鮮やかな色、ダークモードのサポートを備えたレスポンシブ画像ライトボックスコンポーネントで、Tailwind CSS で構築されています。パフォーマンスを向上させるための JavaScript はありません。