From: Max Value Date: Sun, 29 Mar 2026 11:41:58 +0000 (+0100) Subject: Initial X-Git-Url: https://git.ozva.co.uk/?a=commitdiff_plain;h=f39c221f5e37e7bb8433c7815bd499dca42f00c8;p=delta-velorum Initial --- f39c221f5e37e7bb8433c7815bd499dca42f00c8 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3d43339 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build/ +__pycache__/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0709a5c --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +main : .venv/touchfile + npx tsc + .venv/bin/flask --app director run --debug + +.venv/touchfile : requirements.txt + python3 -m venv .venv + .venv/bin/python -m pip install -r requirements.txt + touch .venv/touchfile diff --git a/director/__init__.py b/director/__init__.py new file mode 100644 index 0000000..dd366a6 --- /dev/null +++ b/director/__init__.py @@ -0,0 +1,15 @@ +from flask import Flask, render_template, send_from_directory +import os + +app = Flask(__name__, instance_relative_config=False) +app.config.from_mapping( + DATABASE=os.path.join(app.root_path, 'flaskr.sqlite') +) + +@app.route("/", methods=['get']) +def index(): + return render_template("index.html") + +@app.route("/script/", methods=["get"]) +def script(filename): + return send_from_directory(os.path.join(app.root_path, "build"), filename) diff --git a/director/src/title.ts b/director/src/title.ts new file mode 100644 index 0000000..123811b --- /dev/null +++ b/director/src/title.ts @@ -0,0 +1,7 @@ +export default function renderTitle(): void { + const el: HTMLCollectionOf = document.getElementsByClassName("title"); + + for (let e of el) { + console.log(e); + } +} diff --git a/director/src/update.ts b/director/src/update.ts new file mode 100644 index 0000000..fa3dfc5 --- /dev/null +++ b/director/src/update.ts @@ -0,0 +1,8 @@ +import renderTitle from "./title.js"; +export {}; + +function update(): void { + renderTitle(); +} + +update(); diff --git a/director/templates/index.html b/director/templates/index.html new file mode 100644 index 0000000..f1e0771 --- /dev/null +++ b/director/templates/index.html @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/docs.html b/docs.html new file mode 100644 index 0000000..c0a5e59 --- /dev/null +++ b/docs.html @@ -0,0 +1,35 @@ + + + Documentation + + +

Docs

+ +

Classes

+ +

update

+

+ generates the javascript to update the blocks data-raw attribute with the latest data from the websocket +

+ +

root__[key]

+

+ e.g. root__product__price
+ generates the javascript to update the blocks data-raw attribute with the latest data from the websocket. when a block updates, all keys in that block (incl. other blocks) are all updated +

+ +

timer

+

+ when postprocessing data-raw, it is interpreted as a unix timecode and is displayed as time till that unix timecode +

+ +

title

+

+ when postprocessing data-raw, it is interpreted as text and put in title case +

+ +

+

+

+ + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..7e10602 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +flask diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..e0bf5b8 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,45 @@ +{ + // Visit https://aka.ms/tsconfig to read more about this file + "include": ["./director/src"], + "compilerOptions": { + // File Layout + "rootDir": "./director/src", + "outDir": "./director/build", + + // Environment Settings + // See also https://aka.ms/tsconfig/module + "module": "nodenext", + "target": "esnext", + "types": [], + // For nodejs: + // "lib": ["esnext"], + // "types": ["node"], + // and npm install -D @types/node + + // Other Outputs + "sourceMap": true, + "declaration": true, + "declarationMap": true, + + // Stricter Typechecking Options + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + + // Style Options + // "noImplicitReturns": true, + // "noImplicitOverride": true, + // "noUnusedLocals": true, + // "noUnusedParameters": true, + // "noFallthroughCasesInSwitch": true, + // "noPropertyAccessFromIndexSignature": true, + + // Recommended Options + "strict": true, + "jsx": "react-jsx", + "verbatimModuleSyntax": false, + "isolatedModules": true, + "noUncheckedSideEffectImports": true, + "moduleDetection": "force", + "skipLibCheck": true, + } +}