This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Hello World</title> | |
| <style> | |
| body { | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SierpinskiTriangle { | |
| static get inputProperties() { | |
| return [ | |
| '--sierpinski-iterations', | |
| '--zoom-factor', | |
| '--fractal-opacity', | |
| '--rotation-angle' | |
| ]; | |
| } | |
| paint(ctx, size, props) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * A custom array class that provides additional query-like methods for filtering, mapping, and manipulating arrays. | |
| * @template T - The type of elements in the array. | |
| */ | |
| export class QueryableArray<T> extends Array<T> { | |
| /** | |
| * Skips the specified number of elements and returns the remaining elements. | |
| * @param count - The number of elements to skip. | |
| * @returns A new QueryableArray containing the remaining elements. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct Uniforms { | |
| resolution: vec3<f32>, | |
| time: f32 | |
| }; | |
| struct VertexOutput { | |
| @builtin(position) pos: vec4<f32>, | |
| @location(0) uv: vec2<f32> | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export class DOMUtils { | |
| static value<T>(selector: string, value?: any) { | |
| const element = DOMUtils.get<HTMLInputElement>(selector); | |
| if (value && element) element!.value = value; | |
| return element ? element.value as T : null; | |
| } | |
| static get<T extends HTMLElement>(selector: string, parent?: Element | DocumentFragment | null): T | null { // Allow null | |
| if (!parent) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { GreenScreenStream, GreenScreenMethod } from "../../src/GreenScreenStream"; | |
| document.addEventListener("DOMContentLoaded", () => { | |
| const bgfile = location.hash.length > 0 ? location.hash.replace("#", "") : "beach.jpg" | |
| navigator.getUserMedia({ video: { width: 640, height: 360 }, audio: false }, (ms: MediaStream) => { | |
| let instance = GreenScreenStream.getInstance(true, `../assets/${bgfile}`, undefined, 640, 360); | |
| instance.onReady = () => { | |
| const fps = 60; | |
| instance.initialize().then(result => { | |
| instance.start(GreenScreenMethod.VirtualBackground); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let pp = | |
| [[0,4],[0,3],[0,2],[0,1],[0,0],[1,0],[2,0],[3,0],[4,0],[4,1],[4,2],[4,3],[4,4],[3,4],[3,3],[3,2],[3,1],[2,1],[1,1],[1,2],[1,3],[1,4],[2,4],[2,3],[2,2]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { ClientFactory, WebRTCFactory, BinaryMessage, TextMessage, Controller } from 'thor-io.client-vnext' | |
| export class TestClient{ | |
| factory: ClientFactory; | |
| controller: Controller; | |
| constructor(){ | |
| this.factory = new ClientFactory("ws://localhost:1337",["example"],{}); | |
| this.factory.onOpen = (controller: Controller) => { | |
| this.controller = controller; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import path from "path"; | |
| import fs from "fs"; | |
| import http from "http"; | |
| import https from "https"; | |
| import express from "express"; | |
| import webSocket from "ws"; | |
| import { ExampleController } from "./controllers/ExampleController"; | |
| import { BrokerController } from "../src/Controllers/BrokerController/Broker"; | |
| import { ThorIO } from ".."; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { CanSet } from '../../src/Decorators/CanSet'; | |
| import { CanInvoke } from '../../src/Decorators/CanInvoke'; | |
| import { ControllerProperties } from '../../src/Decorators/ControllerProperties'; | |
| import { ControllerBase } from "../../src/Controller/ControllerBase"; | |
| import { BinaryMessage } from 'thor-io.client-vnext'; | |
| import { Connection } from '../../src/Connection/Connection'; | |
| interface IMyModel{ | |
| age:number; |
NewerOlder