MCPcopy Create free account
hub / github.com/TheOrcDev/github-creature / constructor

Method constructor

components/liquid-ether.tsx:1094–1121  ·  view source on GitHub ↗
(props: any)

Source from the content-addressed store, hash-verified

1092 private _resize = this.resize.bind(this);
1093 private _onVisibility?: () => void;
1094 constructor(props: any) {
1095 this.props = props;
1096 Common.init(props.$wrapper);
1097 Mouse.init(props.$wrapper);
1098 Mouse.autoIntensity = props.autoIntensity;
1099 Mouse.takeoverDuration = props.takeoverDuration;
1100 Mouse.onInteract = () => {
1101 this.lastUserInteraction = performance.now();
1102 if (this.autoDriver) this.autoDriver.forceStop();
1103 };
1104 this.autoDriver = new AutoDriver(Mouse, this as any, {
1105 enabled: props.autoDemo,
1106 speed: props.autoSpeed,
1107 resumeDelay: props.autoResumeDelay,
1108 rampDuration: props.autoRampDuration,
1109 });
1110 this.init();
1111 window.addEventListener("resize", this._resize);
1112 this._onVisibility = () => {
1113 const hidden = document.hidden;
1114 if (hidden) {
1115 this.pause();
1116 } else if (isVisibleRef.current) {
1117 this.start();
1118 }
1119 };
1120 document.addEventListener("visibilitychange", this._onVisibility);
1121 }
1122 init() {
1123 if (!Common.renderer) return;
1124 this.props.$wrapper.prepend(Common.renderer.domElement);

Callers

nothing calls this directly

Calls 5

initMethod · 0.95
pauseMethod · 0.95
startMethod · 0.95
forceStopMethod · 0.80
initMethod · 0.45

Tested by

no test coverage detected