mirror of
https://github.com/litruv/lit.ruv.wtf.git
synced 2026-07-24 10:46:03 +10:00
update to node site
This commit is contained in:
38
website/scripts/nodes/PureNode.js
Normal file
38
website/scripts/nodes/PureNode.js
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* @file PureNode.js
|
||||
* @UCLASS(BlueprintType, Blueprintable)
|
||||
*/
|
||||
|
||||
import { NodeBase } from './NodeBase.js';
|
||||
import { NodeRegistry } from './NodeRegistry.js';
|
||||
|
||||
/**
|
||||
* @UCLASS(BlueprintType)
|
||||
* Pure data node — optionally renders an image body. No exec logic.
|
||||
*/
|
||||
export class PureNode extends NodeBase {
|
||||
/** @UCLASS(BlueprintType) */
|
||||
static NodeType = "pure";
|
||||
|
||||
/**
|
||||
* @UFUNCTION(BlueprintNativeEvent)
|
||||
* @param {HTMLElement} article
|
||||
* @param {import('../GraphNode.js').GraphNode} graphNode
|
||||
*/
|
||||
BlueprintNativeEvent_OnRender(article, graphNode) {
|
||||
if (!graphNode.imageSrc) return;
|
||||
|
||||
const body = document.createElement("div");
|
||||
body.className = "node-body node-body--image";
|
||||
|
||||
const img = document.createElement("img");
|
||||
img.src = graphNode.imageSrc;
|
||||
img.alt = "";
|
||||
img.className = "node-image";
|
||||
body.appendChild(img);
|
||||
|
||||
article.appendChild(body);
|
||||
}
|
||||
}
|
||||
|
||||
NodeRegistry.UCLASS_Register(PureNode);
|
||||
Reference in New Issue
Block a user