Skip to content

Commit

Permalink
dance
Browse files Browse the repository at this point in the history
  • Loading branch information
metaforpro committed Dec 5, 2023
1 parent 3bc92bb commit bd5c2eb
Show file tree
Hide file tree
Showing 56 changed files with 4,739 additions and 28,950 deletions.
53 changes: 40 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,52 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
.firebaserc
hosting*
.idea
# dependencies
/node_modules
/.pnp
.pnp
.pnp.js

# testing
/coverage

# production
/build
coverage

# svelte
.svelte-kit
build
bun.lockb
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
*.pem
.idea

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
**/.env.dev
**/.env.local
**/.env.development.local
**/.env.test.local
**/.env.production.local

**/node_modules/
**/reports/
# **/build/
**/dist/

**/main.js.map

vite.config.js.timestamp-*
vite.config.ts.timestamp-*
**/src-tauri/target/

*.typegen.d.ts
**/*.typegen.ts
# python
__pycache__/
*.py[cod]
*$py.class

.cache
tmp
/apps/node-express/
.venv
.env
Empty file added .nojekyll
Empty file.
48 changes: 2 additions & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,2 @@
# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `npm start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.\
You will also see any lint errors in the console.

### `npm test`

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).
# metafor
# SuperApp MetaChat
35 changes: 35 additions & 0 deletions app/web/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "web-app",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "vite dev --host 0.0.0.0",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
},
"devDependencies": {
"@sveltejs/adapter-static": "^2.0.3",
"@sveltejs/kit": "^1.27.4",
"@types/three": "^0.157.2",
"svelte": "^4.2.7",
"svelte-check": "^3.6.0",
"three": "^0.157.0",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^4.4.2"
},
"type": "module",
"dependencies": {
"@dimforge/rapier3d-compat": "^0.11.2",
"@theatre/core": "^0.7.0",
"@theatre/studio": "^0.7.0",
"@threlte/core": "^7.0.3",
"@threlte/extras": "^8.0.0",
"@threlte/rapier": "^1.1.3",
"@threlte/theatre": "^2.1.4",
"@xstate/svelte": "^3.0.0",
"xstate": "^5.0.0"
}
}
63 changes: 63 additions & 0 deletions app/web/src/Bots.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!--
Auto-generated by: https://github.com/threlte/threlte/tree/main/packages/gltf
Command: npx @threlte/[email protected] ./static/bots.glb
-->

<script>
import { Group } from "three"
import { T, forwardEventHandlers } from "@threlte/core"
import { useGltf, useGltfAnimations } from "@threlte/extras"
import bots from "$lib/bots.glb?url"
export const ref = new Group()
const gltf = useGltf(bots)
export const { actions, mixer } = useGltfAnimations(gltf, ref)
$: Object.entries($actions).forEach(([key, value]) => {
console.log(key, value)
value?.play()
})
const component = forwardEventHandlers()
</script>
<T is={ref} dispose={false} {...$$restProps} bind:this={$component}>
{#await gltf}
<slot name="fallback" />
{:then gltf}
<T.Group name="Scene">
<T.Group name="Armature001" position={[0, 0, 0.59]} rotation={[Math.PI / 2, 0, 3.11]} scale={0.01}>
<T is={gltf.nodes.mixamorigHips} />
<T.SkinnedMesh
name="Beta_Joints"
geometry={gltf.nodes.Beta_Joints.geometry}
material={gltf.materials.Beta_Joints_MAT1}
skeleton={gltf.nodes.Beta_Joints.skeleton}
/>
<T.SkinnedMesh
name="Beta_Surface"
geometry={gltf.nodes.Beta_Surface.geometry}
material={gltf.materials.Beta_HighLimbsGeoSG3}
skeleton={gltf.nodes.Beta_Surface.skeleton}
/>
</T.Group>
<T.Group name="Armature" position={[0, 0, -0.59]} rotation={[Math.PI / 2, 0, 0]} scale={0.01}>
<T is={gltf.nodes.mixamorigHips_1} />
<T.SkinnedMesh
name="Alpha_Joints"
geometry={gltf.nodes.Alpha_Joints.geometry}
material={gltf.materials["Alpha_Joints_MAT.001"]}
skeleton={gltf.nodes.Alpha_Joints.skeleton}
/>
<T.SkinnedMesh
name="Alpha_Surface"
geometry={gltf.nodes.Alpha_Surface.geometry}
material={gltf.materials["Alpha_Body_MAT.001"]}
skeleton={gltf.nodes.Alpha_Surface.skeleton}
/>
</T.Group>
</T.Group>
{:catch error}
<slot name="error" {error} />
{/await}
<slot {ref} />
</T>
12 changes: 12 additions & 0 deletions app/web/src/app.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface Platform {}
}
}

export {};
12 changes: 12 additions & 0 deletions app/web/src/app.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>
117 changes: 117 additions & 0 deletions app/web/src/lib/TestMachine.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import { createMachine, fromCallback } from "xstate"
type Events = { type: "INC"; value: number } | { type: "ROOT.EVENT" } | { type: "EVENT" } | { type: "NEXT" } | { type: "PREV" } | { type: "SELF" } | { type: "TO_PARALLEL" }

export default createMachine(
{
id: "testMachine",
types: {} as {
events: Events
context: {
count: number
}
},
context: {
count: 0,
},
initial: "simple",
entry: ["rootAction1"],
exit: ["rootAction1"],
on: {
"ROOT.EVENT": {},
},
states: {
simple: {
entry: ["action1", "really long action", "action3"],
exit: ["anotherAction", "action4"],
on: {
NEXT: "compound",
INC: [{ target: "compound", guard: ({ event }) => event.value > 10 }, { target: "final" }],
EVENT: {
target: "final",
guard: function somethingIsTrue() {
return true
},
},
SELF: ".",
},
},
compound: {
invoke: {
id: "fooSrc",
src: "fooSrc",
onDone: "final",
onError: "failure",
},
initial: "one",
states: {
one: {
on: {
NEXT: "two",
},
},
two: {
on: {
PREV: "one",
NEXT: "three",
},
},
three: {
initial: "atomic",
always: {
target: "one",
guard: function gua() {
return true
},
},
states: {
atomic: {},
history: {
type: "history",
},
deepHist: {
type: "history",
history: "deep",
},
},
on: {
TO_PARALLEL: "#parallel",
},
},
},
on: {
SELF: ".",
},
},
parallel: {
id: "parallel",
type: "parallel",
states: {
three: {
on: {
SELF: ".",
},
},
four: {},
five: {},
},
},
final: {
type: "final",
},
failure: {},
},
},
{
actions: {
rootAction1: () => {},
action1: () => {},
"really long action": () => {},
action3: () => {},
anotherAction: () => {},
action4: () => {},
},
actors: {
fooSrc: fromCallback(() => {}),
},
},
)
Binary file added app/web/src/lib/bots.glb
Binary file not shown.
Loading

0 comments on commit bd5c2eb

Please sign in to comment.