组件 图像灯箱 图像灯箱组件

图像灯箱组件

一个响应式图像灯箱组件,采用复古主题,使用Tailwind CSS,支持黑暗模式,并具有占位符图片。

预览

HTML 代码

<div class="relative bg-white dark:bg-gray-800 rounded-lg shadow-lg max-w-md mx-auto mt-10">
    <img id="lightbox-trigger" src="https://picsum.photos/600/400?random=1" class="w-full h-48 object-cover rounded-t-lg" alt="Vintage Image">
    <div class="p-4">
        <h2 class="text-lg font-bold text-gray-800 dark:text-gray-200">Vintage Aesthetic</h2>
        <p class="text-gray-600 dark:text-gray-400">A nostalgic look into the past with a touch of modern design.</p>
    </div>
    <div class="flex justify-center pb-4">
        <button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">View More Images</button>
    </div>
    <div id="lightbox" class="hidden fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50">
        <span class="absolute top-4 right-4 text-white cursor-pointer" onclick="document.getElementById('lightbox').classList.add('hidden')">&times;</span>
        <img src="https://picsum.photos/1200/800?random=1" class="max-w-full max-h-full rounded shadow-lg" alt="Lightbox Image">
    </div>
</div>

<style>
    /* Dark mode styling */
    @media (prefers-color-scheme: dark) {
        .bg-white {
            background-color: #1f2937;
        }
        .text-gray-800 {
            color: #e5e7eb;
        }
        .text-gray-600 {
            color: #d1d5db;
        }
    }
</style>

相关组件

图片灯箱组件

一个为仪表板设计的响应式图像灯箱组件,具有3D风格和单色配色方案。它包括悬停效果和使用Tailwind CSS实现暗模式支持的模态功能。

打开

Image Lightbox 组件

一个复杂的图像灯箱组件,设计有拟物化元素和柔和的配色方案,适用于仪表板环境。它包括响应式布局、深色主题支持和交互式界面。

打开

回到顶部按钮

响应式图像灯箱组件,具有复古/复古设计和大地色调配色方案,适用于仪表板。

打开