From bb4036234907729f350d5129adb1be6828855bba Mon Sep 17 00:00:00 2001 From: leomcelroy Date: Sat, 14 Oct 2023 00:23:33 -0400 Subject: [PATCH] clean up --- astro/src/components/HelpContents.md | 69 ---------------- astro/src/components/landing/CodeSnippet.tsx | 42 ---------- astro/src/layouts/Workshop.astro | 82 -------------------- astro/src/pages/index.astro | 3 - 4 files changed, 196 deletions(-) delete mode 100644 astro/src/components/HelpContents.md delete mode 100644 astro/src/components/landing/CodeSnippet.tsx delete mode 100644 astro/src/layouts/Workshop.astro diff --git a/astro/src/components/HelpContents.md b/astro/src/components/HelpContents.md deleted file mode 100644 index 1da53c12e..000000000 --- a/astro/src/components/HelpContents.md +++ /dev/null @@ -1,69 +0,0 @@ -# API reference - -### async loop(fn, minInterval = 0) - -Run a function `fn` at least every `minInterval` milliseconds. - -### async sleep(ms) - -Delay for `ms` milliseconds. - -### render(node) - -Render the DOM node `node` to the View tab. - -### viewEl - -A reference to the root node of the View tab. - -### createSynchronizer(actuators) - -Create a "synchronizer" out of an array of `actuator`s (`Thing`s that support various motion commands). Returns an object with the following properties: - -### actuators - -The array of `actuator`s passed to `createSynchronizer`. - -### async target(pos, vels?, accels?) - -Go to the `pos` position without awaiting the end of the movement. - -### async absolute(pos, vel?, accel?) - -Go to the absolute specified actuator position `pos`, and optionally change the velocity and acceleration to `vel` and `accel` respectively. - -### async relative(deltas, vel?, accel?) - -Move relative by the `deltas` specified, and optionally change the velocity and acceleration to `vel` and `accel` respectively. - -### async velocity(vels, accel?) - -Set the velocity vector to `vels`, and optionally change the acceleration to `accel`. - -### async stop() - -Stop all actuators. - -### async awaitMotionEnd() - -Wait for all actuators to stop moving. - -### async setPosition(pos) - -Set the position of all actuators to the respective value in `pos`. - -### setVelocity(vel) - -Set the velocity to `vel`. - -### setAccel(accel) - -Set the acceleration to `accel`. - -### async getPosition() - -Get the current position of all actuators. - -### async getVelocity() - -Get the current velocity of all actuators. diff --git a/astro/src/components/landing/CodeSnippet.tsx b/astro/src/components/landing/CodeSnippet.tsx deleted file mode 100644 index 77fb36cbc..000000000 --- a/astro/src/components/landing/CodeSnippet.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { useCallback, useState, useEffect, useRef } from 'preact/hooks' -import styles from '../CodeMirror.module.css' -import { createCMState } from '../../lib/codemirror/state.js' - -export default function CodeSnippet({ content }) { - const [view, setView] = useState() - - useEffect(() => { - if (view) { - view.dispatch({ - changes: { from: 0, insert: content } - }) - } - }, [view]) - - const editorRef = useCallback((node: HTMLDivElement | null) => { - if (!node) return - - const view = new EditorView({ - state: createCMState(), - parent: node - }) - - node.view = view - - //@ts-expect-error - node.children[0]['view'] = view - - setView(view) - }, []) - - return ( - <> - -
- - ) -} diff --git a/astro/src/layouts/Workshop.astro b/astro/src/layouts/Workshop.astro deleted file mode 100644 index fffa16229..000000000 --- a/astro/src/layouts/Workshop.astro +++ /dev/null @@ -1,82 +0,0 @@ ---- -const { - frontmatter: { title, content } -} = Astro.props ---- - - - -
-
- -
-
diff --git a/astro/src/pages/index.astro b/astro/src/pages/index.astro index b3fd2ddb8..a834691ce 100644 --- a/astro/src/pages/index.astro +++ b/astro/src/pages/index.astro @@ -1,8 +1,6 @@ --- import Layout from '../layouts/Layout.astro' import Background from '../components/landing/Background.astro' -import CodeSnippet from '../components/landing/CodeSnippet.tsx' -import ThreeDModel from '../components/landing/ThreeDModel.astro' import { slug } from '../lib/guide.ts' const workshops = await Astro.glob('/../guides/*.md') @@ -379,7 +377,6 @@ try {
-