SuperGradio / frontend /src /CustomNode.css
hadinicknam's picture
Handling different key value of the Json
9212968
@keyframes running-glow {
0% { box-shadow: 0 0 3px 0px #f0ad4e; }
50% { box-shadow: 0 0 10px 3px #f0ad4e; }
100% { box-shadow: 0 0 3px 0px #f0ad4e; }
}
@keyframes polling-glow {
0% { box-shadow: 0 0 3px 0px #007bff; }
50% { box-shadow: 0 0 10px 3px #007bff; }
100% { box-shadow: 0 0 3px 0px #007bff; }
}
.custom-node {
border: 2px solid #777; /* Increased border width */
border-radius: 8px;
background: #f9f9f9;
width: 350px;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
transition: border-color 0.3s, box-shadow 0.3s; /* Smooth transition */
}
.custom-node.running {
border-color: #f0ad4e;
animation: running-glow 1.5s infinite;
}
.custom-node.polling {
border-color: #007bff;
animation: polling-glow 1.5s infinite;
}
.custom-node.success {
border-color: #5cb85c;
}
.custom-node.error {
border-color: #d9534f;
}
.custom-node-header {
background: #e0e0e0;
padding: 10px;
border-top-left-radius: 6px; /* Adjusted for new border width */
border-top-right-radius: 6px;
border-bottom: 1px solid #ccc;
}
.custom-node-header strong {
font-size: 14px;
display: block;
}
.custom-node-header p {
font-family: monospace;
font-size: 12px;
color: #333;
margin: 4px 0 0;
}
.custom-node-content {
padding: 0;
}
.custom-node-section {
padding: 10px;
border-bottom: 1px solid #eee;
position: relative;
}
.custom-node-section:last-child {
border-bottom: none;
}
.custom-node-section-title {
font-weight: bold;
font-size: 11px;
color: #888;
text-transform: uppercase;
margin-bottom: 10px;
}
.custom-node-input-row, .custom-node-output-row {
position: relative;
display: flex;
flex-direction: column;
margin-bottom: 12px;
padding-left: 15px; /* Make space for handles */
padding-right: 15px; /* Make space for handles */
}
.custom-node-input-row:last-child, .custom-node-output-row:last-child {
margin-bottom: 0;
}
.custom-node-input-row .react-flow__handle,
.custom-node-output-row .react-flow__handle {
width: 8px;
height: 8px;
top: 50%; /* Vertically center on the row */
transform: translateY(-50%);
}
.custom-node-input-row .react-flow__handle-left {
left: -4px;
}
.custom-node-output-row .react-flow__handle-right {
right: -4px;
}
.custom-node-input-row label, .custom-node-output-row label {
font-size: 12px;
margin-bottom: 5px;
font-weight: bold;
color: #555;
}
.custom-node-input-row.connected {
padding-top: 8px;
padding-bottom: 8px;
}
.custom-node-input-row.connected label {
color: #999;
margin-bottom: 0;
}
.custom-node-input-row.connected span {
font-size: 12px;
color: #007bff;
background-color: #e7f3ff;
padding: 8px;
border-radius: 4px;
border: 1px solid #b3d7ff;
margin-top: 5px;
}
.custom-node-output-row {
flex-direction: row;
justify-content: space-between;
align-items: center;
padding-top: 4px;
padding-bottom: 4px;
}
.custom-node-output-row label {
margin-bottom: 0;
}
.custom-node-input-row input[type="text"],
.custom-node-input-row input[type="number"],
.custom-node-input-row textarea,
.custom-node-input-row select {
width: 100%;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
font-size: 12px;
}
.custom-node-input-row input[type="range"] {
width: 100%;
}
.checkbox-wrapper {
display: flex;
flex-direction: row;
align-items: center;
}
.checkbox-wrapper input {
margin-right: 8px;
}
.checkbox-wrapper label {
margin-bottom: 0;
font-weight: normal;
}
.file-input-wrapper {
display: flex;
align-items: center;
}
.file-input-wrapper input[type="file"] {
flex-grow: 1;
font-size: 11px;
}
.file-input-wrapper button {
padding: 6px 10px;
font-size: 12px;
background-color: #007bff;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
margin-left: 8px;
}
.file-input-wrapper button:hover {
background-color: #0056b3;
}
.advanced-settings {
margin-top: 15px;
border-top: 1px solid #eee;
padding-top: 10px;
}
.advanced-settings-toggle {
background: none;
border: none;
cursor: pointer;
font-size: 12px;
font-weight: bold;
color: #007bff;
padding: 0;
margin-bottom: 10px;
}
.advanced-settings-toggle:hover {
text-decoration: underline;
}
.custom-node.running .custom-node-header {
background-color: #fff3cd;
color: #856404;
border-color: #ffeeba;
}
.custom-node.polling .custom-node-header {
background-color: #e7f3ff;
color: #004085;
border-color: #b8daff;
}
.custom-node.success .custom-node-header {
background-color: #d4edda;
color: #155724;
border-color: #c3e6cb;
}
.custom-node.error .custom-node-header {
background-color: #f8d7da;
color: #721c24;
border-color: #f5c6cb;
}
.node-status {
float: right;
font-size: 10px;
font-weight: bold;
text-transform: uppercase;
padding: 3px 6px;
border-radius: 3px;
background: rgba(0,0,0,0.1);
}
/* New styles for JSON path selector */
.json-path-selector {
min-width: 120px;
margin-right: 12px;
position: relative;
}
.json-path-select {
width: 100%;
font-size: 11px;
padding: 6px;
border: 1px solid #ccc;
border-radius: 4px;
background-color: #fff;
color: #555;
appearance: menulist; /* Show dropdown arrow */
}
/* Style for the JSON output row to make it more distinguishable */
.custom-node-output-row:has(.json-path-selector) {
margin-bottom: 8px;
border-bottom: 1px dashed #e0e0e0;
padding-bottom: 8px;
}
/* Highlight the JSON output row when hovered */
.custom-node-output-row:has(.json-path-selector):hover {
background-color: #f5f9ff;
}
/* Style for the label when using JSON selector */
.custom-node-output-row:has(.json-path-selector) label {
color: #0275d8;
font-size: 11px;
}
/* Make the output row with JSON selector look more organized */
.custom-node-output-row:has(.json-path-selector) {
display: grid;
grid-template-columns: auto minmax(120px, 1fr) 20px;
gap: 8px;
align-items: center;
}