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

图片灯箱组件

一个复杂的图像灯箱组件,以粗犷主义风格设计,适合社交媒体界面,具有灰度色彩方案和高对比度的暗模式支持。

预览

HTML 代码

<div class="relative z-10">
    <!-- Thumbnail Trigger -->
    <div class="mb-4">
        <img src="https://picsum.photos/200/300" alt="Thumbnail" class="cursor-pointer h-auto w-full border border-gray-700 hover:border-gray-500 dark:border-gray-300 dark:hover:border-gray-100">
    </div>

    <!-- Modal for Lightbox -->
    <div class="fixed inset-0 bg-gray-900 bg-opacity-75 dark:bg-opacity-95 flex items-center justify-center hidden group-hover:block">
        <div class="bg-gray-800 w-full max-w-3xl p-6 rounded-lg shadow-lg border border-gray-700">
            <!-- Image Display -->
            <img src="https://picsum.photos/800/600" alt="Large Image" class="w-full h-auto mb-4 rounded-lg border border-gray-600 dark:border-gray-400">
            <!-- Close Button -->
            <button class="absolute top-4 right-4 text-white hover:text-gray-400">
                &times;
            </button>
            <div class="flex justify-end mt-4">
                <a href="#" class="text-gray-300 hover:text-gray-100 transition-colors duration-200">Next</a>
                <a href="#" class="ml-4 text-gray-300 hover:text-gray-100 transition-colors duration-200">Previous</a>
            </div>
        </div>
    </div>
</div>

<style>
    /* Brutalist Styles */
    img {
        user-select: none;
    }
    button {
        background: none;
        border: none;
        font-size: 2rem;
        cursor: pointer;
    }
    button:hover {
        color: #ddd;
    }
    .hidden {
        display: none;
    }
</style>

相关组件

图像灯箱组件

具有 Retro/Vintage 设计的图像灯箱组件,相似的配色方案,简单的复杂性,用于商业/公司目的。响应式,支持深色主题。仅限 HTML 与 Tailwind CSS。

打开

图片灯箱组件

专为电子商务网站设计的简单响应式图像灯箱组件,具有深色模式样式和类似的配色方案。

打开

Image Lightbox 组件

响应式图像灯箱组件,具有极简的平面设计、单色配色方案和适度的复杂度,适用于社交媒体界面。它支持使用 Tailwind CSS 的 dark: 前缀的深色主题,并且不需要 JavaScript。图片来自 picsum.photos。

打开