Skip to content

Commit

Permalink
analytic
Browse files Browse the repository at this point in the history
  • Loading branch information
metaforpro committed Dec 5, 2023
1 parent bd5c2eb commit a137814
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 40 deletions.
3 changes: 0 additions & 3 deletions app/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@
"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"
}
Expand Down
29 changes: 20 additions & 9 deletions app/web/src/app.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
<!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>
<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%
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-VPBER9CJMG"></script>
<script>
window.dataLayer = window.dataLayer || []
function gtag() {
dataLayer.push(arguments)
}
gtag("js", new Date())

gtag("config", "G-VPBER9CJMG")
</script>
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>
3 changes: 1 addition & 2 deletions app/web/src/Bots.svelte → app/web/src/lib/Bots.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ Command: npx @threlte/[email protected] ./static/bots.glb
const gltf = useGltf(bots)
export const { actions, mixer } = useGltfAnimations(gltf, ref)
$: Object.entries($actions).forEach(([key, value]) => {
console.log(key, value)
$: Object.entries($actions).forEach(([_, value]) => {
value?.play()
})
const component = forwardEventHandlers()
Expand Down
6 changes: 4 additions & 2 deletions app/web/src/lib/components/Scene.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@
import type { AnyStateNode } from "xstate"
import Thing from "./thing/Thing.svelte"
import { thingMachine } from "./machine"
import Bots from "../../Bots.svelte"
import Bots from "../Bots.svelte"
export let actor: SimulatorActorType
let edges: { [key: string]: DirectedGraphEdge } = {}
let nodes: { [key: string]: AnyStateNode } = {}
let digraph: any
</script>



<Space {actor} bind:edges bind:nodes bind:digraph>
<T.PerspectiveCamera makeDefault position={[0, 4, 9]} fov={15}>
<OrbitControls autoRotate enableZoom={true} enableDamping autoRotateSpeed={2} target.y={.8} />
<OrbitControls autoRotate enableZoom={true} enableDamping autoRotateSpeed={2} target.y={0.8} />
</T.PerspectiveCamera>
<T.AmbientLight intensity={0.5} />
<T.DirectionalLight args={["#fff", 0.5]} intensity={0.6} />
Expand Down
1 change: 0 additions & 1 deletion app/web/src/lib/components/thing/Thing.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
<Particle
rotationSpeed={0}
rotationIntensity={0}

position={[x, y, z]}
detail={2}
scale={scale * 1.4 * $scaleParent}
Expand Down
4 changes: 4 additions & 0 deletions app/web/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<script lang="ts">
</script>

<slot />
41 changes: 26 additions & 15 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="./favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="modulepreload" href="./internal/immutable/entry/start.63bcea63.js">
<head>
<meta charset="utf-8" />
<link rel="icon" href="./favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="modulepreload" href="./internal/immutable/entry/start.a7bd531a.js">
<link rel="modulepreload" href="./internal/immutable/chunks/scheduler.c03d0109.js">
<link rel="modulepreload" href="./internal/immutable/chunks/singletons.3f4538c9.js">
<link rel="modulepreload" href="./internal/immutable/chunks/singletons.f3045a7f.js">
<link rel="modulepreload" href="./internal/immutable/chunks/index.17ca9755.js">
<link rel="modulepreload" href="./internal/immutable/entry/app.ad889d48.js">
<link rel="modulepreload" href="./internal/immutable/entry/app.8c260a22.js">
<link rel="modulepreload" href="./internal/immutable/chunks/index.bd9bea11.js">
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-VPBER9CJMG"></script>
<script>
window.dataLayer = window.dataLayer || []
function gtag() {
dataLayer.push(arguments)
}
gtag("js", new Date())

gtag("config", "G-VPBER9CJMG")
</script>
</head>
<body data-sveltekit-preload-data="hover">
<div style="display: contents">
<script>
{
__sveltekit_8voxp = {
__sveltekit_15l776l = {
assets: "/littlesun",
base: new URL(".", location).pathname.slice(0, -1),
env: {}
Expand All @@ -25,13 +36,13 @@
const element = document.currentScript.parentElement;

Promise.all([
import("./internal/immutable/entry/start.63bcea63.js"),
import("./internal/immutable/entry/app.ad889d48.js")
import("./internal/immutable/entry/start.a7bd531a.js"),
import("./internal/immutable/entry/app.8c260a22.js")
]).then(([kit, app]) => {
kit.start(app, element);
});
}
</script>
</div>
</body>
</body>
</html>
1 change: 0 additions & 1 deletion internal/immutable/chunks/singletons.3f4538c9.js

This file was deleted.

1 change: 1 addition & 0 deletions internal/immutable/chunks/singletons.f3045a7f.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a137814

Please sign in to comment.