Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 46 additions & 28 deletions src/components/nodes/AmplifierNode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,38 @@ export function AmplifierNode({ data }) {
<div
style={{
width: 90,
height: 80,
height: 60,
background: data.nodeColor || '#DDE6ED',
color: 'black',
borderRadius: 8,
padding: 8,
fontWeight: 'bold',
position: 'relative',
cursor: 'pointer',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
}}
>

<svg width="100%" height="100%" viewBox="0 0 100 100" preserveAspectRatio="none">
<polygon points="0,0 100,50 0,100" fill={data.nodeColor || "#DDE6ED"} />
</svg>
{/* Amplifier symbol */}
<div style={{
fontSize: '12px',
textAlign: 'center',
background: 'transparent',
transform: 'translate(-80%, -50%)',
top: '50%',
left: '50%',
position: 'absolute',
fontSize: '16px',
fontWeight: 'bold',
marginBottom: '2px',
}}>
{data.label}
×{data.gain || 'K'}
</div>


{/* Optional label */}
{data.label && (
<div style={{
fontSize: '10px',
textAlign: 'center',
}}>
{data.label}
</div>
)}

<Handle type="target" position="left" style={{ background: '#555' }} />
<Handle type="source" position="right" style={{ background: '#555' }} />
Expand All @@ -41,29 +50,38 @@ export function AmplifierNodeReverse({ data }) {
<div
style={{
width: 90,
height: 80,
height: 60,
background: data.nodeColor || '#DDE6ED',
color: 'black',
borderRadius: 8,
padding: 8,
fontWeight: 'bold',
position: 'relative',
cursor: 'pointer',
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
}}
>

<svg width="100%" height="100%" viewBox="0 0 100 100" preserveAspectRatio="none">
<polygon points="0,50 100,100 100,0" fill={data.nodeColor || "#DDE6ED"} />
</svg>
{/* Amplifier symbol with reverse indicator */}
<div style={{
fontSize: '12px',
textAlign: 'center',
background: 'transparent',
transform: 'translate(-50%, -50%)',
top: '50%',
left: '50%',
position: 'absolute',
fontSize: '16px',
fontWeight: 'bold',
marginBottom: '2px',
}}>
{data.label}
×{data.gain || 'K'}
</div>


{/* Optional label */}
{data.label && (
<div style={{
fontSize: '10px',
textAlign: 'center',
}}>
{data.label}
</div>
)}

<Handle type="target" position="right" style={{ background: '#555' }} />
<Handle type="source" position="left" style={{ background: '#555' }} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/nodes/DefaultNode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default function DefaultNode({ data }) {
width: 180,
background: data.nodeColor || '#DDE6ED',
color: 'black',
borderRadius: 0,
borderRadius: 8,
padding: 10,
fontWeight: 'bold',
position: 'relative',
Expand Down
2 changes: 1 addition & 1 deletion src/components/nodes/IntegratorNode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function IntegratorNode({ data }) {
width: 180,
background: data.nodeColor || '#DDE6ED',
color: 'black',
borderRadius: 0,
borderRadius: 8,
padding: 10,
fontWeight: 'bold',
position: 'relative',
Expand Down
12 changes: 12 additions & 0 deletions src/styles/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@
background-color: #0056b3 !important;
}

/* Node hover effects */
.react-flow__node:hover > div {
border: 2px solid #78A083 !important;
box-shadow: 0 0 8px #78a08366;
}

/* Default border for divs */
.react-flow__node > div {
border: 2px solid #ccc !important;
}


/* App container */
.app {
width: 100vw;
Expand Down
Loading