Badges 구성 요소
Tailwind CSS를 사용하여 설계된 매력적인 마이크로 상호 작용이 있는 반응형 Badges 구성 요소입니다. 다크 모드를 지원하며 이미지 자리 표시자를 포함합니다.
HTML 코드
<div class="flex flex-wrap gap-4 p-6 bg-white dark:bg-gray-800">
<div class="relative inline-block">
<img src="https://picsum.photos/200" alt="Badge Image" class="h-24 w-24 rounded-full shadow-lg transform transition-all duration-300 hover:scale-105">
<span class="absolute top-0 right-0 inline-flex items-center justify-center w-6 h-6 p-2 bg-blue-600 rounded-full text-white shadow-lg transform transition-all duration-300 hover:scale-110">1</span>
</div>
<div class="relative inline-block">
<img src="https://picsum.photos/201" alt="Badge Image" class="h-24 w-24 rounded-full shadow-lg transform transition-all duration-300 hover:scale-105">
<span class="absolute top-0 right-0 inline-flex items-center justify-center w-6 h-6 p-2 bg-green-600 rounded-full text-white shadow-lg transform transition-all duration-300 hover:scale-110">2</span>
</div>
<div class="relative inline-block">
<img src="https://picsum.photos/202" alt="Badge Image" class="h-24 w-24 rounded-full shadow-lg transform transition-all duration-300 hover:scale-105">
<span class="absolute top-0 right-0 inline-flex items-center justify-center w-6 h-6 p-2 bg-yellow-600 rounded-full text-white shadow-lg transform transition-all duration-300 hover:scale-110">3</span>
</div>
<div class="relative inline-block">
<img src="https://picsum.photos/203" alt="Badge Image" class="h-24 w-24 rounded-full shadow-lg transform transition-all duration-300 hover:scale-105">
<span class="absolute top-0 right-0 inline-flex items-center justify-center w-6 h-6 p-2 bg-red-600 rounded-full text-white shadow-lg transform transition-all duration-300 hover:scale-110">4</span>
</div>
</div>
<style>
/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
.bg-white {
background-color: #1f2937; /* Gray-800 */
}
.text-white {
color: #f9fafb; /* Gray-100 */
}
}
</style>