mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 23:04:06 +00:00
## Summary Adds the [tailwind lint plugin](https://github.com/francoismassart/eslint-plugin-tailwindcss/?tab=readme-ov-file#eslint-plugin-tailwindcss) and fixes the currently fixable rules ([v4 is still in beta](https://github.com/francoismassart/eslint-plugin-tailwindcss/?tab=readme-ov-file#about-tailwind-css-4-support)). ## Changes - **What**: Enforces things like consistent class order, and eventually can prohibit extra classes that could be utilities instead - **Dependencies**: The plugin and its types ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5984-Lint-Add-tailwind-linter-2866d73d365081d89db0d998232533bb) by [Unito](https://www.unito.io) --------- Co-authored-by: GitHub Action <action@github.com>
56 lines
1.5 KiB
Vue
56 lines
1.5 KiB
Vue
<template>
|
|
<BaseThumbnail :is-hovered="isHovered">
|
|
<div class="relative h-full w-full">
|
|
<div class="absolute inset-0">
|
|
<LazyImage
|
|
:src="baseImageSrc"
|
|
:alt="alt"
|
|
:image-class="baseImageClass"
|
|
/>
|
|
</div>
|
|
<div class="absolute inset-0 z-10">
|
|
<LazyImage
|
|
:src="overlayImageSrc"
|
|
:alt="alt"
|
|
:image-class="overlayImageClass"
|
|
/>
|
|
</div>
|
|
</div>
|
|
</BaseThumbnail>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue'
|
|
|
|
import LazyImage from '@/components/common/LazyImage.vue'
|
|
import BaseThumbnail from '@/components/templates/thumbnails/BaseThumbnail.vue'
|
|
|
|
const { baseImageSrc, overlayImageSrc, isVideo, isHovered } = defineProps<{
|
|
baseImageSrc: string
|
|
overlayImageSrc: string
|
|
alt: string
|
|
isHovered: boolean
|
|
isVideo?: boolean
|
|
}>()
|
|
|
|
const isVideoType =
|
|
isVideo ||
|
|
baseImageSrc?.toLowerCase().endsWith('.webp') ||
|
|
overlayImageSrc?.toLowerCase().endsWith('.webp') ||
|
|
false
|
|
|
|
const baseImageClass = computed(() => {
|
|
const sizeClasses = isVideoType
|
|
? 'size-full object-cover'
|
|
: 'size-full object-contain'
|
|
return sizeClasses
|
|
})
|
|
|
|
const overlayImageClass = computed(() => {
|
|
const baseClasses = 'size-full transition-opacity duration-300'
|
|
const sizeClasses = isVideoType ? 'object-cover' : 'object-contain'
|
|
const opacityClasses = isHovered ? 'opacity-100' : 'opacity-0'
|
|
return `${baseClasses} ${sizeClasses} ${opacityClasses}`
|
|
})
|
|
</script>
|