[Haik]: and so it begins

This commit is contained in:
haikdc
2026-03-13 12:09:25 -07:00
commit 23621306a1
190 changed files with 51641 additions and 0 deletions
@@ -0,0 +1,88 @@
.tree-node {
border: 1px solid #ccc;
margin-top: 10px;
margin-bottom: 10px;
padding: 10px;
border-radius: 4px;
width: 100%;
background-color: #181818;
}
.tree-node-content {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
width: 100%;
}
.tree-node-content-main {
display: flex;
align-items: center;
width: fit-content;
}
.expand-button {
background: none;
border: none;
cursor: pointer;
margin-right: 10px;
padding: 0; /* Ensure no padding around the button */
display: flex;
align-items: center;
justify-content: center;
}
.expand-button img {
width: 16px; /* Adjust the width as needed */
height: 16px; /* Adjust the height as needed */
max-width: 100%; /* Ensure it doesn't exceed button size */
max-height: 100%; /* Ensure it doesn't exceed button size */
}
.tree-node-text {
margin-left: 10px;
font-size: 1.45rem;
font-weight: 600;
font-family: 'Consolas', monospace; /* Specify fallback font */
color: #ffffff; /* Adjust text color to ensure it's visible on the dark background */
}
.tree-node-children {
margin-left: 20px;
margin-right: 20px;
margin-bottom: 10px;
padding-left: 20px;
padding-right: 20px;
gap: 10px;
}
.tree-node-content-secondary {
display: flex;
align-items: center;
}
.color-picker-wrapper {
position: relative;
}
.color-picker-icon {
display: inline-block;
width: 24px;
height: 24px;
cursor: pointer;
border: 1px solid #000;
border-radius: 4px;
overflow: hidden;
background-size: 100% 100%; /* Ensure the background color scales to fit */
background-clip: content-box;
background-color: transparent; /* Ensure the background is transparent */
-webkit-mask: url('../../assets/color-picker.png') center no-repeat;
mask: url('../../assets/color-picker.png') center no-repeat;
-webkit-mask-size: 20px; /* Adjust this value to fit your icon */
mask-size: 20px; /* Adjust this value to fit your icon */
}
.color-picker-icon img {
display: none;
}
@@ -0,0 +1,52 @@
import './TreeNode.css';
import React from 'react';
import plusIcon from '../../assets/collapsed.png';
import minusIcon from '../../assets/expanded.png';
import colorIcon from '../../assets/color-picker.png'; // Import your custom color icon
import EmojiPicker from '../emoji-picker/EmojiPicker';
const TreeNode = ({ node, nodeId, expanded, handleExpandClick, handleCheckboxChange, handleColorChange, handleEmojiChange, renderTree }) => (
<div className="tree-node">
<div className="tree-node-content">
<div className="tree-node-content-main">
{node.children && node.children.length > 0 && (
<button className="expand-button" onClick={() => handleExpandClick(nodeId)}>
<img src={expanded[nodeId] ? minusIcon : plusIcon} alt="Expand/Collapse Icon" />
</button>
)}
<input
type="checkbox"
checked={node.is_toggled}
onChange={(e) => handleCheckboxChange(nodeId, e.target.checked)}
/>
{/* Pass node.emoji along with handleEmojiChange */}
<EmojiPicker
defaultEmoji={node.emoji}
handleEmojiChange={(emoji) => handleEmojiChange(nodeId, emoji)}
/>
<span className="tree-node-text" style={{ color: node.color || '#000000' }}>{node.name}</span>
</div>
<div className="tree-node-content-secondary">
<div className="color-picker-wrapper">
<input
type="color"
value={node.color || '#000000'}
onChange={(e) => handleColorChange(nodeId, e.target.value)}
style={{ display: 'none' }} // Hide the default color input
id={`color-picker-${nodeId}`}
/>
<label htmlFor={`color-picker-${nodeId}`} className="color-picker-icon" style={{ backgroundColor: node.color || '#000000' }}>
<img src={colorIcon} alt="Color Picker Icon" />
</label>
</div>
</div>
</div>
{node.children && expanded[nodeId] && (
<div className="tree-node-children">
{node.children.map((childNode) => renderTree(childNode, nodeId))}
</div>
)}
</div>
);
export default TreeNode;