humainflow-web/src/app/shared/nodes/resource-node/resource-node.css

308 lines
5.7 KiB
CSS

/*
* SPDX-FileCopyrightText: 2025-2026 Lucio Lelii <lucio.lelii@isti.cnr.it> - ISTI-CNR
* SPDX-License-Identifier: AGPL-3.0-or-later
* Attribution term under AGPL-3.0 section 7(b): see LICENSE-ADDENDUM.
*/
/*
* Deliberately unlike a step: a compact card, no columns of ports, its handle underneath rather
* than on a side, so a resource never reads as one more box in the chain.
*/
:host {
display: block;
}
.resource-card {
position: relative;
width: 340px;
box-sizing: border-box;
padding: 12px 16px 12px 12px;
border: 1.5px solid #99f6e4;
border-radius: 14px;
background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
box-shadow: 0 1px 2px rgba(15, 118, 110, 0.08), 0 6px 16px -10px rgba(15, 118, 110, 0.35);
font-family: inherit;
cursor: move;
}
.resource-card--open {
width: 340px;
}
/*
* Expanded: lifted out of the canvas at full size, so the fields - an init script above all - can
* be read and edited whatever the zoom.
*/
.resource-card__focus-backdrop {
position: fixed;
inset: 0;
z-index: 9990;
background: rgba(15, 23, 42, 0.36);
backdrop-filter: blur(10px) saturate(0.8);
}
.resource-card.resource-card--focus {
position: fixed;
inset: 0;
z-index: 9991;
width: 460px;
max-width: calc(100vw - 32px);
height: fit-content;
max-height: calc(100vh - 32px);
margin: auto;
padding: 18px 20px;
overflow-y: auto;
overscroll-behavior: contain;
box-shadow: 0 30px 70px rgba(15, 23, 42, 0.34);
cursor: default;
}
.resource-card--focus .resource-card__badge {
width: 46px;
height: 46px;
font-size: 23px;
}
.resource-card--focus .resource-card__name {
font-size: 17px;
}
.resource-card--focus .resource-card__type {
font-size: 13px;
}
/* Its handle stays on the canvas's business: out here there is nothing to link it to. */
.resource-card--focus .resource-card__link {
visibility: hidden;
}
.resource-card--error {
border-color: #fca5a5;
}
.resource-card--deleting {
border-color: #fecaca;
}
:host(.selected) .resource-card {
box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.28), 0 6px 16px -10px rgba(15, 118, 110, 0.35);
}
.resource-card__loading {
position: absolute;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
border-radius: 14px;
background: rgba(255, 255, 255, 0.6);
z-index: 2;
}
.resource-card__main {
display: flex;
align-items: center;
gap: 10px;
}
.resource-card__badge {
display: flex;
flex: 0 0 auto;
align-items: center;
justify-content: center;
width: 38px;
height: 38px;
border-radius: 10px;
background: #ccfbf1;
color: #0f766e;
font-size: 19px;
}
.resource-card__text {
flex: 1 1 auto;
min-width: 0;
}
.resource-card__name-row {
display: flex;
align-items: center;
gap: 2px;
min-width: 0;
}
.resource-card__name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 14px;
font-weight: 600;
color: #0f172a;
}
.resource-card__type {
margin-top: 1px;
font-size: 11.5px;
font-weight: 500;
color: #0f766e;
}
.resource-card__actions {
display: flex;
flex: 0 0 auto;
align-items: center;
gap: 2px;
}
.resource-card__icon-btn {
display: flex;
align-items: center;
justify-content: center;
width: 26px;
height: 26px;
padding: 0;
border: none;
border-radius: 8px;
background: transparent;
color: #64748b;
font-size: 13px;
cursor: pointer;
}
.resource-card__icon-btn:hover {
background: #e6fffa;
color: #0f766e;
}
.resource-card__icon-btn--active {
background: #ccfbf1;
color: #0f766e;
}
.resource-card__icon-btn--quiet {
width: 20px;
height: 20px;
font-size: 11px;
opacity: 0;
}
.resource-card:hover .resource-card__icon-btn--quiet {
opacity: 1;
}
.resource-card__icon-btn--danger:hover {
background: #fef2f2;
color: #dc2626;
}
.resource-card__warning {
color: #d97706;
font-size: 13px;
padding: 0 3px;
}
.resource-card__error {
color: #dc2626;
font-size: 13px;
padding: 0 3px;
}
.resource-card__summary {
display: flex;
flex-wrap: wrap;
gap: 4px;
margin-top: 9px;
}
.resource-card__summary-part {
padding: 2px 8px;
border-radius: 999px;
background: rgba(13, 148, 136, 0.09);
color: #115e59;
font-size: 11px;
line-height: 16px;
}
.resource-card__settings {
cursor: default;
}
.resource-card__settings--open {
margin-top: 10px;
}
.resource-card__confirm {
display: flex;
align-items: center;
gap: 6px;
margin-top: 8px;
padding: 6px 8px;
border-radius: 8px;
background: #fef2f2;
color: #991b1b;
font-size: 12px;
}
.resource-card__confirm span {
flex: 1 1 auto;
}
.resource-card__confirm button {
padding: 3px 8px;
border: 1px solid transparent;
border-radius: 6px;
font-size: 11.5px;
cursor: pointer;
}
.resource-card__confirm-cancel {
border-color: #fecaca;
background: #ffffff;
color: #7f1d1d;
}
.resource-card__confirm-delete {
background: #dc2626;
color: #ffffff;
}
/*
* The handle is centered on the card but has a fixed height. It must not grow with the optional
* settings panel, otherwise opening settings would stretch every resource connection.
*/
.resource-card__link {
position: absolute;
top: 50%;
right: -5px;
width: 9px;
height: 52px;
transform: translateY(-50%);
}
.resource-card__socket {
display: block;
width: 100%;
height: 100%;
}
/* The socket sizes itself as a square; here it is stretched into the bar. */
.resource-card__socket ::ng-deep > * {
width: 7px !important;
height: 100% !important;
border-radius: 4px !important;
}
.llm-spinner {
width: 18px;
height: 18px;
border: 2px solid #99f6e4;
border-top-color: #0f766e;
border-radius: 50%;
animation: resource-card-spin 0.8s linear infinite;
}
@keyframes resource-card-spin {
to {
transform: rotate(360deg);
}
}