이미지 라이트박스 구성 요소
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')">×</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>
관련 구성 요소
이미지 라이트박스 구성 요소
다크 모드를 지원하는 반응형 이미지 라이트박스 구성 요소입니다. 이 구성 요소는 이미지 갤러리를 표시하고, 이미지를 클릭하면 탐색 화살표가 있는 전체 화면 모달이 열려 이미지를 탐색할 수 있습니다. 닫기 버튼이 있으며 대화형 요소를 강조하기 위해 생생한 색상을 사용합니다. 디자인은 비즈니스/기업 컨텍스트에 맞게 조정되어 전문적이면서도 매력적인 사용자 경험을 보장합니다.