phoenix-flow-builder / components /custom-node.js
TrisL's picture
clone n8n and call it tasking
8ca2022 verified
Raw
History Blame Contribute Delete
2.36 kB
class CustomNode extends HTMLElement {
connectedCallback() {
this.attachShadow({ mode: 'open' });
this.shadowRoot.innerHTML = `
<style>
.node-container {
background: rgba(15, 23, 42, 0.9);
border: 1px solid rgba(71, 85, 105, 0.5);
border-radius: 0.5rem;
padding: 1rem;
min-width: 200px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
transition: all 0.2s ease;
}
.node-container:hover {
border-color: #22c55e;
box-shadow: 0 10px 15px -3px rgba(34, 197, 94, 0.1);
}
.node-header {
display: flex;
align-items: center;
margin-bottom: 0.75rem;
}
.node-icon {
width: 2rem;
height: 2rem;
display: flex;
align-items: center;
justify-content: center;
background: rgba(251, 146, 60, 0.1);
border-radius: 0.25rem;
margin-right: 0.75rem;
color: #fb923c;
}
.node-title {
font-weight: 600;
color: #e2e8f0;
}
.node-body {
font-size: 0.875rem;
color: #94a3b8;
}
.node-status {
height: 0.5rem;
width: 0.5rem;
border-radius: 50%;
margin-left: auto;
}
.status-idle {
background-color: #64748b;
}
.status-running {
background-color: #f59e0b;
animation: pulse 1.5s infinite;
}
.status-success {
background-color: #10b981;
}
.status-error {
background-color: #ef4444;
}
@keyframes pulse {
0%, 100% {
opacity: 1;
}
50% {
opacity: 0.5;
}
}
</style>
<div class="node-container">
<div class="node-header">
<div class="node-icon">
<i data-feather="code"></i>
</div>
<div class="node-title">Node</div>
<div class="node-status status-idle"></div>
</div>
<div class="node-body">
Drag handles to connect nodes
</div>
</div>
`;
}
}
customElements.define('custom-node', CustomNode);