mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 10:42:44 +00:00
feat: style of progress bar in various scenarios (#5492)
This commit is contained in:
@@ -12,12 +12,15 @@
|
|||||||
'lg-node absolute rounded-2xl',
|
'lg-node absolute rounded-2xl',
|
||||||
// border
|
// border
|
||||||
'border border-solid border-sand-100 dark-theme:border-charcoal-300',
|
'border border-solid border-sand-100 dark-theme:border-charcoal-300',
|
||||||
|
!!executing && 'border-blue-500 dark-theme:border-blue-500',
|
||||||
!!error && 'border-red-700 dark-theme:border-red-300',
|
!!error && 'border-red-700 dark-theme:border-red-300',
|
||||||
// hover
|
// hover
|
||||||
'hover:ring-7 ring-gray-500/50 dark-theme:ring-gray-500/20',
|
'hover:ring-7 ring-gray-500/50 dark-theme:ring-gray-500/20',
|
||||||
// Selected
|
// Selected
|
||||||
'outline-transparent -outline-offset-2 outline-2',
|
'outline-transparent -outline-offset-2 outline-2',
|
||||||
!!isSelected && 'outline-black dark-theme:outline-white',
|
!!isSelected && 'outline-black dark-theme:outline-white',
|
||||||
|
!!(isSelected && executing) &&
|
||||||
|
'outline-blue-500 dark-theme:outline-blue-500',
|
||||||
!!(isSelected && error) && 'outline-red-500 dark-theme:outline-red-500',
|
!!(isSelected && error) && 'outline-red-500 dark-theme:outline-red-500',
|
||||||
{
|
{
|
||||||
'animate-pulse': executing,
|
'animate-pulse': executing,
|
||||||
@@ -56,8 +59,35 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-if="
|
||||||
|
(isMinimalLOD || isCollapsed) && executing && progress !== undefined
|
||||||
|
"
|
||||||
|
:class="
|
||||||
|
cn(
|
||||||
|
'absolute inset-x-4 -bottom-[1px] translate-y-1/2 rounded-full',
|
||||||
|
progressClasses
|
||||||
|
)
|
||||||
|
"
|
||||||
|
:style="{ width: `${Math.min(progress * 100, 100)}%` }"
|
||||||
|
/>
|
||||||
|
|
||||||
<template v-if="!isMinimalLOD && !isCollapsed">
|
<template v-if="!isMinimalLOD && !isCollapsed">
|
||||||
<div :class="cn(separatorClasses, 'mb-4')" />
|
<div class="mb-4 relative">
|
||||||
|
<div :class="separatorClasses" />
|
||||||
|
<!-- Progress bar for executing state -->
|
||||||
|
<div
|
||||||
|
v-if="executing && progress !== undefined"
|
||||||
|
:class="
|
||||||
|
cn(
|
||||||
|
'absolute inset-x-0 top-1/2 -translate-y-1/2',
|
||||||
|
!!(progress < 1) && 'rounded-r-full',
|
||||||
|
progressClasses
|
||||||
|
)
|
||||||
|
"
|
||||||
|
:style="{ width: `${Math.min(progress * 100, 100)}%` }"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Node Body - rendered based on LOD level and collapsed state -->
|
<!-- Node Body - rendered based on LOD level and collapsed state -->
|
||||||
<div
|
<div
|
||||||
@@ -102,13 +132,6 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- Progress bar for executing state -->
|
|
||||||
<div
|
|
||||||
v-if="executing && progress !== undefined"
|
|
||||||
class="absolute bottom-0 left-0 h-1 bg-primary-500 transition-all duration-300"
|
|
||||||
:style="{ width: `${progress * 100}%` }"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -232,6 +255,7 @@ const hasCustomContent = computed(() => {
|
|||||||
// Computed classes and conditions for better reusability
|
// Computed classes and conditions for better reusability
|
||||||
const separatorClasses =
|
const separatorClasses =
|
||||||
'bg-sand-100 dark-theme:bg-charcoal-300 h-[1px] mx-0 w-full'
|
'bg-sand-100 dark-theme:bg-charcoal-300 h-[1px] mx-0 w-full'
|
||||||
|
const progressClasses = 'h-2 bg-primary-500 transition-all duration-300'
|
||||||
|
|
||||||
// Common condition computations to avoid repetition
|
// Common condition computations to avoid repetition
|
||||||
const shouldShowWidgets = computed(
|
const shouldShowWidgets = computed(
|
||||||
|
|||||||
Reference in New Issue
Block a user