@benev/tact 0.1.0-3 → 0.1.0-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +111 -103
- package/package.json +7 -7
- package/s/core/bindings/action.ts +14 -4
- package/s/core/bindings/parts/defaults.ts +3 -1
- package/s/core/bindings/parts/lens-algo.ts +17 -13
- package/s/core/bindings/resolver.ts +12 -12
- package/s/core/bindings/sample-map.ts +25 -0
- package/s/core/bindings/types.ts +3 -1
- package/s/core/core.test.ts +46 -34
- package/s/core/devices/auto-gamepads.ts +8 -0
- package/s/core/devices/device.ts +12 -0
- package/s/core/devices/infra/group.ts +24 -0
- package/s/core/devices/infra/sampler.ts +22 -0
- package/s/core/devices/standard/gamepad.ts +83 -0
- package/s/core/{controllers → devices}/standard/index.ts +2 -1
- package/s/core/devices/standard/keyboard.ts +31 -0
- package/s/core/{controllers → devices}/standard/pointer.ts +15 -11
- package/s/core/devices/standard/primary.ts +20 -0
- package/s/core/devices/standard/stick.ts +27 -0
- package/s/core/{controllers/standard/virtual-gamepad.ts → devices/standard/vpad.ts} +9 -9
- package/s/core/{controllers → devices}/types.ts +0 -1
- package/s/core/hub/hub.ts +78 -62
- package/s/core/hub/meta-bindings.ts +23 -0
- package/s/core/hub/parts/connected.ts +15 -0
- package/s/core/hub/port.ts +26 -0
- package/s/core/hub/types.ts +5 -6
- package/s/core/index.ts +12 -14
- package/s/core/testing/testing.ts +19 -14
- package/s/deck/deck.ts +77 -0
- package/s/deck/index.ts +14 -0
- package/s/deck/parts/catalog.ts +58 -0
- package/s/deck/parts/db.ts +66 -0
- package/s/deck/parts/device-skins/device-icons.ts +38 -0
- package/s/deck/parts/device-skins/device-skin.ts +29 -0
- package/s/deck/parts/local-storage-kv.ts +8 -0
- package/s/deck/parts/merge-bindings.ts +21 -0
- package/s/deck/parts/overlay-visibility.ts +49 -0
- package/s/deck/views/deck-overlay/component.ts +48 -0
- package/s/deck/views/deck-overlay/style.css.ts +112 -0
- package/s/deck/views/framework.ts +14 -0
- package/s/demo/game/game.ts +85 -0
- package/s/demo/game/parts/agent.ts +10 -0
- package/s/demo/game/parts/game-bindings.ts +20 -0
- package/s/demo/game/parts/logic.ts +24 -0
- package/s/demo/game/parts/player.ts +32 -0
- package/s/demo/game/parts/renderer.ts +113 -0
- package/s/demo/game/parts/state.ts +24 -0
- package/s/demo/game/parts/virtual-device.ts +13 -0
- package/s/demo/main.bundle.ts +6 -12
- package/s/demo/main.css +30 -2
- package/s/demo/ui/tact-demo/component.ts +13 -0
- package/s/demo/ui/tact-demo/style.css.ts +4 -0
- package/s/demo/ui/theater/styles.css.ts +57 -0
- package/s/demo/ui/theater/view.ts +53 -0
- package/s/demo/ui/theater/virtual/style.css.ts +43 -0
- package/s/demo/ui/theater/virtual/view.ts +31 -0
- package/s/demo/ui/utils/loader.ts +5 -0
- package/s/index.html.ts +16 -6
- package/s/index.ts +3 -1
- package/s/nubs/components.ts +14 -0
- package/s/nubs/index.ts +6 -0
- package/s/nubs/lookpad/component.ts +45 -0
- package/s/nubs/stick/component.ts +115 -0
- package/s/nubs/stick/style.css.ts +70 -0
- package/s/nubs/{virtual-gamepad/view.ts → vpad/component.ts} +21 -11
- package/s/nubs/{virtual-gamepad → vpad}/styles.css.ts +1 -0
- package/s/utils/circular-clamp.ts +15 -0
- package/s/utils/dispensers.ts +20 -0
- package/s/utils/split-axis.ts +10 -2
- package/x/core/bindings/action.d.ts +3 -1
- package/x/core/bindings/action.js +12 -4
- package/x/core/bindings/action.js.map +1 -1
- package/x/core/bindings/parts/defaults.js +3 -1
- package/x/core/bindings/parts/defaults.js.map +1 -1
- package/x/core/bindings/parts/lens-algo.js +14 -7
- package/x/core/bindings/parts/lens-algo.js.map +1 -1
- package/x/core/bindings/resolver.d.ts +5 -4
- package/x/core/bindings/resolver.js +12 -10
- package/x/core/bindings/resolver.js.map +1 -1
- package/x/core/bindings/sample-map.d.ts +7 -0
- package/x/core/bindings/sample-map.js +22 -0
- package/x/core/bindings/sample-map.js.map +1 -0
- package/x/core/bindings/types.d.ts +3 -1
- package/x/core/core.test.d.ts +5 -4
- package/x/core/core.test.js +45 -34
- package/x/core/core.test.js.map +1 -1
- package/x/core/devices/auto-gamepads.d.ts +2 -0
- package/x/core/devices/auto-gamepads.js +6 -0
- package/x/core/devices/auto-gamepads.js.map +1 -0
- package/x/core/devices/device.d.ts +5 -0
- package/x/core/devices/device.js +7 -0
- package/x/core/devices/device.js.map +1 -0
- package/x/core/devices/infra/group.d.ts +8 -0
- package/x/core/devices/infra/group.js +21 -0
- package/x/core/devices/infra/group.js.map +1 -0
- package/x/core/devices/infra/sampler.d.ts +9 -0
- package/x/core/devices/infra/sampler.js +18 -0
- package/x/core/devices/infra/sampler.js.map +1 -0
- package/x/core/devices/standard/gamepad.d.ts +11 -0
- package/x/core/devices/standard/gamepad.js +65 -0
- package/x/core/devices/standard/gamepad.js.map +1 -0
- package/x/core/{controllers → devices}/standard/index.d.ts +2 -1
- package/x/core/{controllers → devices}/standard/index.js +2 -1
- package/x/core/devices/standard/index.js.map +1 -0
- package/x/core/devices/standard/keyboard.d.ts +9 -0
- package/x/core/devices/standard/keyboard.js +28 -0
- package/x/core/devices/standard/keyboard.js.map +1 -0
- package/x/core/devices/standard/pointer.d.ts +15 -0
- package/x/core/{controllers → devices}/standard/pointer.js +14 -11
- package/x/core/devices/standard/pointer.js.map +1 -0
- package/x/core/devices/standard/primary.d.ts +10 -0
- package/x/core/devices/standard/primary.js +17 -0
- package/x/core/devices/standard/primary.js.map +1 -0
- package/x/core/devices/standard/stick.d.ts +15 -0
- package/x/core/devices/standard/stick.js +24 -0
- package/x/core/devices/standard/stick.js.map +1 -0
- package/x/core/devices/standard/vpad.d.ts +7 -0
- package/x/core/{controllers/standard/virtual-gamepad.js → devices/standard/vpad.js} +10 -10
- package/x/core/devices/standard/vpad.js.map +1 -0
- package/x/core/{controllers → devices}/types.d.ts +0 -1
- package/x/core/{controllers → devices}/types.js.map +1 -1
- package/x/core/hub/hub.d.ts +27 -23
- package/x/core/hub/hub.js +71 -61
- package/x/core/hub/hub.js.map +1 -1
- package/x/core/hub/meta-bindings.d.ts +2 -0
- package/x/core/hub/meta-bindings.js +21 -0
- package/x/core/hub/meta-bindings.js.map +1 -0
- package/x/core/hub/parts/connected.d.ts +14 -0
- package/x/core/hub/parts/connected.js +12 -0
- package/x/core/hub/parts/connected.js.map +1 -0
- package/x/core/hub/port.d.ts +10 -0
- package/x/core/hub/port.js +19 -0
- package/x/core/hub/port.js.map +1 -0
- package/x/core/hub/types.d.ts +5 -5
- package/x/core/hub/types.js +1 -1
- package/x/core/hub/types.js.map +1 -1
- package/x/core/index.d.ts +12 -12
- package/x/core/index.js +12 -12
- package/x/core/index.js.map +1 -1
- package/x/core/testing/testing.d.ts +13 -11
- package/x/core/testing/testing.js +14 -13
- package/x/core/testing/testing.js.map +1 -1
- package/x/deck/deck.d.ts +35 -0
- package/x/deck/deck.js +50 -0
- package/x/deck/deck.js.map +1 -0
- package/x/deck/index.d.ts +10 -0
- package/x/deck/index.js +11 -0
- package/x/deck/index.js.map +1 -0
- package/x/deck/parts/catalog.d.ts +23 -0
- package/x/deck/parts/catalog.js +35 -0
- package/x/deck/parts/catalog.js.map +1 -0
- package/x/deck/parts/db.d.ts +20 -0
- package/x/deck/parts/db.js +52 -0
- package/x/deck/parts/db.js.map +1 -0
- package/x/deck/parts/device-skins/device-icons.d.ts +12 -0
- package/x/deck/parts/device-skins/device-icons.js +27 -0
- package/x/deck/parts/device-skins/device-icons.js.map +1 -0
- package/x/deck/parts/device-skins/device-skin.d.ts +14 -0
- package/x/deck/parts/device-skins/device-skin.js +22 -0
- package/x/deck/parts/device-skins/device-skin.js.map +1 -0
- package/x/deck/parts/local-storage-kv.js +6 -0
- package/x/deck/parts/local-storage-kv.js.map +1 -0
- package/x/deck/parts/merge-bindings.d.ts +2 -0
- package/x/deck/parts/merge-bindings.js +15 -0
- package/x/deck/parts/merge-bindings.js.map +1 -0
- package/x/deck/parts/overlay-visibility.d.ts +21 -0
- package/x/deck/parts/overlay-visibility.js +35 -0
- package/x/deck/parts/overlay-visibility.js.map +1 -0
- package/x/deck/views/deck-overlay/component.d.ts +2 -0
- package/x/deck/views/deck-overlay/component.js +40 -0
- package/x/deck/views/deck-overlay/component.js.map +1 -0
- package/x/deck/views/deck-overlay/style.css.js +109 -0
- package/x/deck/views/deck-overlay/style.css.js.map +1 -0
- package/x/deck/views/framework.d.ts +3 -0
- package/x/deck/views/framework.js +8 -0
- package/x/deck/views/framework.js.map +1 -0
- package/x/demo/game/game.d.ts +20 -0
- package/x/demo/game/game.js +63 -0
- package/x/demo/game/game.js.map +1 -0
- package/x/demo/game/parts/agent.d.ts +7 -0
- package/x/demo/game/parts/agent.js +8 -0
- package/x/demo/game/parts/agent.js.map +1 -0
- package/x/demo/game/parts/game-bindings.d.ts +15 -0
- package/x/demo/game/parts/game-bindings.js +10 -0
- package/x/demo/game/parts/game-bindings.js.map +1 -0
- package/x/demo/game/parts/logic.d.ts +8 -0
- package/x/demo/game/parts/logic.js +21 -0
- package/x/demo/game/parts/logic.js.map +1 -0
- package/x/demo/game/parts/player.d.ts +14 -0
- package/x/demo/game/parts/player.js +26 -0
- package/x/demo/game/parts/player.js.map +1 -0
- package/x/demo/game/parts/renderer.d.ts +13 -0
- package/x/demo/game/parts/renderer.js +91 -0
- package/x/demo/game/parts/renderer.js.map +1 -0
- package/x/demo/game/parts/state.d.ts +8 -0
- package/x/demo/game/parts/state.js +20 -0
- package/x/demo/game/parts/state.js.map +1 -0
- package/x/demo/game/parts/virtual-device.d.ts +8 -0
- package/x/demo/game/parts/virtual-device.js +11 -0
- package/x/demo/game/parts/virtual-device.js.map +1 -0
- package/x/demo/main.bundle.js +4 -10
- package/x/demo/main.bundle.js.map +1 -1
- package/x/demo/main.bundle.min.js +315 -54
- package/x/demo/main.bundle.min.js.map +4 -4
- package/x/demo/main.css +30 -2
- package/x/demo/ui/tact-demo/component.d.ts +4 -0
- package/x/demo/ui/tact-demo/component.js +12 -0
- package/x/demo/ui/tact-demo/component.js.map +1 -0
- package/x/demo/ui/tact-demo/style.css.d.ts +2 -0
- package/x/demo/ui/tact-demo/style.css.js +3 -0
- package/x/demo/ui/tact-demo/style.css.js.map +1 -0
- package/x/demo/ui/theater/styles.css.js +56 -0
- package/x/demo/ui/theater/styles.css.js.map +1 -0
- package/x/demo/ui/theater/view.d.ts +2 -0
- package/x/demo/ui/theater/view.js +42 -0
- package/x/demo/ui/theater/view.js.map +1 -0
- package/x/demo/ui/theater/virtual/style.css.d.ts +2 -0
- package/x/demo/ui/theater/virtual/style.css.js +42 -0
- package/x/demo/ui/theater/virtual/style.css.js.map +1 -0
- package/x/demo/ui/theater/virtual/view.d.ts +4 -0
- package/x/demo/ui/theater/virtual/view.js +19 -0
- package/x/demo/ui/theater/virtual/view.js.map +1 -0
- package/x/demo/ui/utils/loader.d.ts +1 -0
- package/x/demo/ui/utils/loader.js +3 -0
- package/x/demo/ui/utils/loader.js.map +1 -0
- package/x/index.d.ts +3 -1
- package/x/index.html +47 -8
- package/x/index.html.js +16 -6
- package/x/index.html.js.map +1 -1
- package/x/index.js +3 -1
- package/x/index.js.map +1 -1
- package/x/nubs/components.d.ts +9 -0
- package/x/nubs/components.js +11 -0
- package/x/nubs/components.js.map +1 -0
- package/x/nubs/index.d.ts +4 -0
- package/x/nubs/index.js +5 -0
- package/x/nubs/index.js.map +1 -0
- package/x/nubs/lookpad/component.d.ts +4 -0
- package/x/nubs/lookpad/component.js +36 -0
- package/x/nubs/lookpad/component.js.map +1 -0
- package/x/nubs/stick/component.d.ts +368 -0
- package/x/nubs/stick/component.js +101 -0
- package/x/nubs/stick/component.js.map +1 -0
- package/x/nubs/stick/style.css.d.ts +2 -0
- package/x/nubs/stick/style.css.js +69 -0
- package/x/nubs/stick/style.css.js.map +1 -0
- package/x/nubs/vpad/component.d.ts +368 -0
- package/x/nubs/{virtual-gamepad/view.js → vpad/component.js} +20 -11
- package/x/nubs/vpad/component.js.map +1 -0
- package/x/nubs/vpad/styles.css.d.ts +2 -0
- package/x/nubs/vpad/styles.css.js.map +1 -0
- package/x/nubs/vpad/utils/gamepad-inputs.js.map +1 -0
- package/x/nubs/vpad/utils/prevent-default-touch-shenanigans.js.map +1 -0
- package/x/nubs/vpad/utils/touch-tracking.js.map +1 -0
- package/x/utils/circular-clamp.d.ts +2 -0
- package/x/utils/circular-clamp.js +8 -0
- package/x/utils/circular-clamp.js.map +1 -0
- package/x/utils/dispensers.d.ts +7 -0
- package/x/utils/dispensers.js +16 -0
- package/x/utils/dispensers.js.map +1 -0
- package/x/utils/split-axis.d.ts +7 -0
- package/x/utils/split-axis.js +7 -2
- package/x/utils/split-axis.js.map +1 -1
- package/s/core/controllers/controller.ts +0 -7
- package/s/core/controllers/infra/group.ts +0 -17
- package/s/core/controllers/infra/sampler.ts +0 -22
- package/s/core/controllers/standard/gamepad.ts +0 -77
- package/s/core/controllers/standard/keyboard.ts +0 -50
- package/s/core/controllers/standard/stick.ts +0 -30
- package/s/core/deck/deck.ts +0 -40
- package/s/core/deck/parts/bindings-depot.ts +0 -24
- package/s/core/deck/parts/local-storage-kv.ts +0 -7
- package/s/core/hub/auto-gamepads.ts +0 -8
- package/s/core/hub/bindings.ts +0 -18
- package/s/core/port/port.ts +0 -34
- package/s/core/port/utils/aggregate_samples_into_map.ts +0 -20
- package/s/core/port/utils/wipe_samples_map.ts +0 -8
- package/s/nubs/lookpad/utils/listeners.ts +0 -53
- package/s/nubs/lookpad/view.ts +0 -32
- package/s/nubs/stick/styles.ts +0 -22
- package/s/nubs/stick/utils/calculate_new_vector_from_pointer_position.ts +0 -27
- package/s/nubs/stick/utils/find_closest_point_on_circle.ts +0 -15
- package/s/nubs/stick/utils/make_pointer_listeners.ts +0 -50
- package/s/nubs/stick/utils/within_radius.ts +0 -6
- package/s/nubs/stick/view.ts +0 -50
- package/s/nubs/stick-graphic/styles.ts +0 -38
- package/s/nubs/stick-graphic/types/basis.ts +0 -5
- package/s/nubs/stick-graphic/utils/calculate_basis.ts +0 -19
- package/s/nubs/stick-graphic/utils/stick_vector_to_pixels.ts +0 -13
- package/s/nubs/stick-graphic/utils/transform.ts +0 -10
- package/s/nubs/stick-graphic/view.ts +0 -43
- package/x/core/controllers/controller.d.ts +0 -4
- package/x/core/controllers/controller.js +0 -3
- package/x/core/controllers/controller.js.map +0 -1
- package/x/core/controllers/infra/group.d.ts +0 -7
- package/x/core/controllers/infra/group.js +0 -13
- package/x/core/controllers/infra/group.js.map +0 -1
- package/x/core/controllers/infra/sampler.d.ts +0 -8
- package/x/core/controllers/infra/sampler.js +0 -17
- package/x/core/controllers/infra/sampler.js.map +0 -1
- package/x/core/controllers/standard/gamepad.d.ts +0 -9
- package/x/core/controllers/standard/gamepad.js +0 -66
- package/x/core/controllers/standard/gamepad.js.map +0 -1
- package/x/core/controllers/standard/index.js.map +0 -1
- package/x/core/controllers/standard/keyboard.d.ts +0 -9
- package/x/core/controllers/standard/keyboard.js +0 -39
- package/x/core/controllers/standard/keyboard.js.map +0 -1
- package/x/core/controllers/standard/pointer.d.ts +0 -11
- package/x/core/controllers/standard/pointer.js.map +0 -1
- package/x/core/controllers/standard/stick.d.ts +0 -15
- package/x/core/controllers/standard/stick.js +0 -27
- package/x/core/controllers/standard/stick.js.map +0 -1
- package/x/core/controllers/standard/virtual-gamepad.d.ts +0 -7
- package/x/core/controllers/standard/virtual-gamepad.js.map +0 -1
- package/x/core/deck/deck.d.ts +0 -16
- package/x/core/deck/deck.js +0 -31
- package/x/core/deck/deck.js.map +0 -1
- package/x/core/deck/parts/bindings-depot.d.ts +0 -9
- package/x/core/deck/parts/bindings-depot.js +0 -19
- package/x/core/deck/parts/bindings-depot.js.map +0 -1
- package/x/core/deck/parts/local-storage-kv.js +0 -5
- package/x/core/deck/parts/local-storage-kv.js.map +0 -1
- package/x/core/hub/auto-gamepads.d.ts +0 -2
- package/x/core/hub/auto-gamepads.js +0 -6
- package/x/core/hub/auto-gamepads.js.map +0 -1
- package/x/core/hub/bindings.d.ts +0 -2
- package/x/core/hub/bindings.js +0 -16
- package/x/core/hub/bindings.js.map +0 -1
- package/x/core/port/port.d.ts +0 -12
- package/x/core/port/port.js +0 -25
- package/x/core/port/port.js.map +0 -1
- package/x/core/port/utils/aggregate_samples_into_map.d.ts +0 -3
- package/x/core/port/utils/aggregate_samples_into_map.js +0 -11
- package/x/core/port/utils/aggregate_samples_into_map.js.map +0 -1
- package/x/core/port/utils/wipe_samples_map.d.ts +0 -2
- package/x/core/port/utils/wipe_samples_map.js +0 -5
- package/x/core/port/utils/wipe_samples_map.js.map +0 -1
- package/x/nubs/lookpad/utils/listeners.d.ts +0 -19
- package/x/nubs/lookpad/utils/listeners.js +0 -37
- package/x/nubs/lookpad/utils/listeners.js.map +0 -1
- package/x/nubs/lookpad/view.d.ts +0 -1
- package/x/nubs/lookpad/view.js +0 -24
- package/x/nubs/lookpad/view.js.map +0 -1
- package/x/nubs/stick/styles.d.ts +0 -1
- package/x/nubs/stick/styles.js +0 -22
- package/x/nubs/stick/styles.js.map +0 -1
- package/x/nubs/stick/utils/calculate_new_vector_from_pointer_position.d.ts +0 -3
- package/x/nubs/stick/utils/calculate_new_vector_from_pointer_position.js +0 -16
- package/x/nubs/stick/utils/calculate_new_vector_from_pointer_position.js.map +0 -1
- package/x/nubs/stick/utils/find_closest_point_on_circle.d.ts +0 -2
- package/x/nubs/stick/utils/find_closest_point_on_circle.js +0 -6
- package/x/nubs/stick/utils/find_closest_point_on_circle.js.map +0 -1
- package/x/nubs/stick/utils/make_pointer_listeners.d.ts +0 -16
- package/x/nubs/stick/utils/make_pointer_listeners.js +0 -34
- package/x/nubs/stick/utils/make_pointer_listeners.js.map +0 -1
- package/x/nubs/stick/utils/within_radius.d.ts +0 -2
- package/x/nubs/stick/utils/within_radius.js +0 -4
- package/x/nubs/stick/utils/within_radius.js.map +0 -1
- package/x/nubs/stick/view.d.ts +0 -2
- package/x/nubs/stick/view.js +0 -38
- package/x/nubs/stick/view.js.map +0 -1
- package/x/nubs/stick-graphic/styles.js +0 -38
- package/x/nubs/stick-graphic/styles.js.map +0 -1
- package/x/nubs/stick-graphic/types/basis.d.ts +0 -4
- package/x/nubs/stick-graphic/types/basis.js +0 -2
- package/x/nubs/stick-graphic/types/basis.js.map +0 -1
- package/x/nubs/stick-graphic/utils/calculate_basis.d.ts +0 -2
- package/x/nubs/stick-graphic/utils/calculate_basis.js +0 -10
- package/x/nubs/stick-graphic/utils/calculate_basis.js.map +0 -1
- package/x/nubs/stick-graphic/utils/stick_vector_to_pixels.d.ts +0 -2
- package/x/nubs/stick-graphic/utils/stick_vector_to_pixels.js +0 -7
- package/x/nubs/stick-graphic/utils/stick_vector_to_pixels.js.map +0 -1
- package/x/nubs/stick-graphic/utils/transform.d.ts +0 -2
- package/x/nubs/stick-graphic/utils/transform.js +0 -7
- package/x/nubs/stick-graphic/utils/transform.js.map +0 -1
- package/x/nubs/stick-graphic/view.d.ts +0 -3
- package/x/nubs/stick-graphic/view.js +0 -30
- package/x/nubs/stick-graphic/view.js.map +0 -1
- package/x/nubs/virtual-gamepad/styles.css.js.map +0 -1
- package/x/nubs/virtual-gamepad/utils/gamepad-inputs.js.map +0 -1
- package/x/nubs/virtual-gamepad/utils/prevent-default-touch-shenanigans.js.map +0 -1
- package/x/nubs/virtual-gamepad/utils/touch-tracking.js.map +0 -1
- package/x/nubs/virtual-gamepad/view.d.ts +0 -2
- package/x/nubs/virtual-gamepad/view.js.map +0 -1
- /package/s/nubs/{virtual-gamepad → vpad}/utils/gamepad-inputs.ts +0 -0
- /package/s/nubs/{virtual-gamepad → vpad}/utils/prevent-default-touch-shenanigans.ts +0 -0
- /package/s/nubs/{virtual-gamepad → vpad}/utils/touch-tracking.ts +0 -0
- /package/x/core/{controllers → devices}/types.js +0 -0
- /package/x/{core/deck → deck}/parts/local-storage-kv.d.ts +0 -0
- /package/x/{nubs/virtual-gamepad/styles.css.d.ts → deck/views/deck-overlay/style.css.d.ts} +0 -0
- /package/x/{nubs/stick-graphic/styles.d.ts → demo/ui/theater/styles.css.d.ts} +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/styles.css.js +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/gamepad-inputs.d.ts +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/gamepad-inputs.js +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/prevent-default-touch-shenanigans.d.ts +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/prevent-default-touch-shenanigans.js +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/touch-tracking.d.ts +0 -0
- /package/x/nubs/{virtual-gamepad → vpad}/utils/touch-tracking.js +0 -0
package/x/demo/main.css
CHANGED
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
:root {
|
|
6
6
|
color-scheme: dark;
|
|
7
7
|
--link: cyan;
|
|
8
|
+
--prime: #ccc;
|
|
8
9
|
--bg: #181818;
|
|
9
|
-
--
|
|
10
|
+
--bg2: #111111;
|
|
10
11
|
}
|
|
11
12
|
}
|
|
12
13
|
|
|
@@ -46,12 +47,39 @@
|
|
|
46
47
|
body { min-height: 100%; }
|
|
47
48
|
|
|
48
49
|
html, body {
|
|
49
|
-
font-
|
|
50
|
+
font-family: sans-serif;
|
|
51
|
+
font-size: 12px;
|
|
50
52
|
color: var(--prime);
|
|
51
53
|
background: var(--bg);
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
@layer page {
|
|
58
|
+
body {
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
align-items: center;
|
|
62
|
+
|
|
63
|
+
gap: 1em;
|
|
64
|
+
padding: 2em;
|
|
65
|
+
|
|
66
|
+
> * {
|
|
67
|
+
width: 100%;
|
|
68
|
+
max-width: 42em;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
> header {
|
|
72
|
+
padding: 0 2em;
|
|
73
|
+
h1 small { font-size: 0.6em; font-weight: normal; }
|
|
74
|
+
* + * { margin-top: 0.5em; }
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
> section {
|
|
78
|
+
padding: 0 2em;
|
|
79
|
+
ul {
|
|
80
|
+
padding-left: 1em;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
56
84
|
}
|
|
57
85
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { cssReset, view } from "@e280/sly";
|
|
2
|
+
import styleCss from "./style.css.js";
|
|
3
|
+
import { Game } from "../../game/game.js";
|
|
4
|
+
import { loader } from "../utils/loader.js";
|
|
5
|
+
import { Theater } from "../theater/view.js";
|
|
6
|
+
export class TactDemo extends view.component(use => {
|
|
7
|
+
use.css(cssReset, styleCss);
|
|
8
|
+
const opGame = use.op.load(async () => Game.load());
|
|
9
|
+
return loader(opGame, game => Theater(game));
|
|
10
|
+
}) {
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../s/demo/ui/tact-demo/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AACxC,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AACrC,OAAO,EAAC,IAAI,EAAC,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAA;AACzC,OAAO,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAA;AAE1C,MAAM,OAAO,QAAS,SAAQ,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;IAClD,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC3B,MAAM,MAAM,GAAG,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,IAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;IAClD,OAAO,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;AAC7C,CAAC,CAAC;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.css.js","sourceRoot":"","sources":["../../../../s/demo/ui/tact-demo/style.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,eAAe,GAAG,CAAA,EAAE,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export const styles = css `
|
|
3
|
+
|
|
4
|
+
:host {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
|
|
9
|
+
gap: 1em;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.surface {
|
|
13
|
+
position: relative;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: auto;
|
|
16
|
+
aspect-ratio: 2 / 1;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
|
|
19
|
+
background: #000;
|
|
20
|
+
border: 0.5em solid #fff4;
|
|
21
|
+
border-radius: 2em;
|
|
22
|
+
|
|
23
|
+
canvas {
|
|
24
|
+
display: block;
|
|
25
|
+
position: absolute;
|
|
26
|
+
inset: 0;
|
|
27
|
+
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: 100%;
|
|
30
|
+
|
|
31
|
+
image-rendering: pixelated;
|
|
32
|
+
outline: 1px solid red;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[deck="overlay"] {
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: 10%;
|
|
38
|
+
left: 0;
|
|
39
|
+
right: 0;
|
|
40
|
+
|
|
41
|
+
display: flex;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
align-items: center;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.dlist {
|
|
48
|
+
display: flex;
|
|
49
|
+
flex-wrap: wrap;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
align-items: center;
|
|
52
|
+
gap: 0.5em;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
`;
|
|
56
|
+
//# sourceMappingURL=styles.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.css.js","sourceRoot":"","sources":["../../../../s/demo/ui/theater/styles.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDxB,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { cssReset, view } from "@e280/sly";
|
|
3
|
+
import { repeat } from "lit/directives/repeat.js";
|
|
4
|
+
import { styles } from "./styles.css.js";
|
|
5
|
+
import { VirtualDeviceView } from "./virtual/view.js";
|
|
6
|
+
import { VirtualDevice } from "../../game/parts/virtual-device.js";
|
|
7
|
+
export const Theater = view(use => (game) => {
|
|
8
|
+
use.css(cssReset, styles);
|
|
9
|
+
use.mount(() => game.loop(60));
|
|
10
|
+
use.mount(() => game.deck.hub.on(use.render));
|
|
11
|
+
const addVirtual = () => game.plug(new VirtualDevice(game.deck.hub));
|
|
12
|
+
const revealOverlay = () => game.deck.overlayVisibility.bump();
|
|
13
|
+
const virtualDevices = game.deck.hub.ports
|
|
14
|
+
.flatMap(port => port.devices.array())
|
|
15
|
+
.filter(device => device instanceof VirtualDevice)
|
|
16
|
+
.map(device => ({ device, skin: game.deck.deviceSkins.get(device) }))
|
|
17
|
+
.sort((a, b) => a.skin.label < b.skin.label ? -1 : 1);
|
|
18
|
+
return html `
|
|
19
|
+
<div class=surface>
|
|
20
|
+
${game.renderer.canvas}
|
|
21
|
+
${game.deck.views.DeckOverlay()}
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class=dlist>
|
|
25
|
+
${repeat(virtualDevices, d => d.skin.label, ({ device, skin }) => {
|
|
26
|
+
return VirtualDeviceView
|
|
27
|
+
.props(game.deck.hub, device, skin)
|
|
28
|
+
.attr("style", `--color: ${skin.color};`)
|
|
29
|
+
.render();
|
|
30
|
+
})}
|
|
31
|
+
|
|
32
|
+
<button @click="${addVirtual}">
|
|
33
|
+
✨
|
|
34
|
+
</button>
|
|
35
|
+
|
|
36
|
+
<button @click="${revealOverlay}">
|
|
37
|
+
👁️
|
|
38
|
+
</button>
|
|
39
|
+
</div>
|
|
40
|
+
`;
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../../s/demo/ui/theater/view.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAC,QAAQ,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AACxC,OAAO,EAAC,MAAM,EAAC,MAAM,0BAA0B,CAAA;AAE/C,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAA;AAEtC,OAAO,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAC,aAAa,EAAC,MAAM,oCAAoC,CAAA;AAEhE,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAU,EAAE,EAAE;IACjD,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;IACzB,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAA;IAC9B,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;IAE7C,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;IACpE,MAAM,aAAa,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAA;IAE9D,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK;SACxC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;SACrC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,YAAY,aAAa,CAAC;SACjD,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,EAAC,CAAC,CAAC;SAClE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEtD,OAAO,IAAI,CAAA;;KAEP,IAAI,CAAC,QAAQ,CAAC,MAAM;KACpB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;;;;KAI7B,MAAM,CACP,cAAc,EACd,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,EACjB,CAAC,EAAC,MAAM,EAAE,IAAI,EAAC,EAAE,EAAE;QAClB,OAAO,iBAAiB;aACtB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC;aAClC,IAAI,CAAC,OAAO,EAAE,YAAY,IAAI,CAAC,KAAK,GAAG,CAAC;aACxC,MAAM,EAAE,CAAA;IACX,CAAC,CACD;;qBAEiB,UAAU;;;;qBAIV,aAAa;;;;EAIhC,CAAA;AACF,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
export default css `
|
|
3
|
+
|
|
4
|
+
:host {
|
|
5
|
+
--color: #aaa;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.box {
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
|
|
13
|
+
gap: 0.2em;
|
|
14
|
+
padding: 0.2em;
|
|
15
|
+
padding-right: 0.5em;
|
|
16
|
+
|
|
17
|
+
border-radius: 2em;
|
|
18
|
+
background: color-mix(in srgb, #fff4, var(--color));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
[view="nub-stick"] {
|
|
22
|
+
width: 2em;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.label {
|
|
26
|
+
font-size: 1.2em;
|
|
27
|
+
font-weight: bold;
|
|
28
|
+
|
|
29
|
+
padding: 0 0.5em;
|
|
30
|
+
text-align: center;
|
|
31
|
+
|
|
32
|
+
color: white;
|
|
33
|
+
text-shadow: 0.1em 0.1em 0.1em #0004;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
button {
|
|
37
|
+
font-size: 0.8em;
|
|
38
|
+
padding: 0.2em;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
`;
|
|
42
|
+
//# sourceMappingURL=style.css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.css.js","sourceRoot":"","sources":["../../../../../s/demo/ui/theater/virtual/style.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCjB,CAAA"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Hub } from "../../../../core/hub/hub.js";
|
|
2
|
+
import { VirtualDevice } from "../../../game/parts/virtual-device.js";
|
|
3
|
+
import { DeviceSkin } from "../../../../deck/parts/device-skins/device-skin.js";
|
|
4
|
+
export declare const VirtualDeviceView: import("@e280/sly").View<[hub: Hub<any, any>, device: VirtualDevice, _deviceSkin: DeviceSkin]>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { html } from "lit";
|
|
2
|
+
import { cssReset, view } from "@e280/sly";
|
|
3
|
+
import styleCss from "./style.css.js";
|
|
4
|
+
import { NubStick } from "../../../../nubs/stick/component.js";
|
|
5
|
+
export const VirtualDeviceView = view(use => (hub, device, _deviceSkin) => {
|
|
6
|
+
use.styles(cssReset, styleCss);
|
|
7
|
+
use.attrs.string.device = "virtual";
|
|
8
|
+
const unplug = () => hub.unplug(device);
|
|
9
|
+
return html `
|
|
10
|
+
<div class=box>
|
|
11
|
+
${NubStick.view(device)}
|
|
12
|
+
|
|
13
|
+
<button @click="${device.shimmyPrevious}">👈</button>
|
|
14
|
+
<button @click="${unplug}">💀</button>
|
|
15
|
+
<button @click="${device.shimmyNext}">👉</button>
|
|
16
|
+
</div>
|
|
17
|
+
`;
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../../../s/demo/ui/theater/virtual/view.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAC,QAAQ,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AACxC,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AAErC,OAAO,EAAC,QAAQ,EAAC,MAAM,qCAAqC,CAAA;AAI5D,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAC3C,GAAa,EACb,MAAqB,EACrB,WAAuB,EACtB,EAAE;IAEJ,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC9B,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,SAAS,CAAA;IAEnC,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAEvC,OAAO,IAAI,CAAA;;KAEP,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;;qBAEL,MAAM,CAAC,cAAc;qBACrB,MAAM;qBACN,MAAM,CAAC,UAAU;;EAEpC,CAAA;AACF,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const loader: import("@e280/sly").Loader;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../../s/demo/ui/utils/loader.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,WAAW,CAAA;AAEpC,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,EAAE,CAAA"}
|
package/x/index.d.ts
CHANGED
package/x/index.html
CHANGED
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
:root {
|
|
13
13
|
color-scheme: dark;
|
|
14
14
|
--link: cyan;
|
|
15
|
+
--prime: #ccc;
|
|
15
16
|
--bg: #181818;
|
|
16
|
-
--
|
|
17
|
+
--bg2: #111111;
|
|
17
18
|
}
|
|
18
19
|
}
|
|
19
20
|
|
|
@@ -53,17 +54,44 @@ html { height: 100%; }
|
|
|
53
54
|
body { min-height: 100%; }
|
|
54
55
|
|
|
55
56
|
html, body {
|
|
56
|
-
font-
|
|
57
|
+
font-family: sans-serif;
|
|
58
|
+
font-size: 12px;
|
|
57
59
|
color: var(--prime);
|
|
58
60
|
background: var(--bg);
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
@layer page {
|
|
65
|
+
body {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
align-items: center;
|
|
69
|
+
|
|
70
|
+
gap: 1em;
|
|
71
|
+
padding: 2em;
|
|
72
|
+
|
|
73
|
+
> * {
|
|
74
|
+
width: 100%;
|
|
75
|
+
max-width: 42em;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
> header {
|
|
79
|
+
padding: 0 2em;
|
|
80
|
+
h1 small { font-size: 0.6em; font-weight: normal; }
|
|
81
|
+
* + * { margin-top: 0.5em; }
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
> section {
|
|
85
|
+
padding: 0 2em;
|
|
86
|
+
ul {
|
|
87
|
+
padding-left: 1em;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
63
91
|
}
|
|
64
92
|
|
|
65
93
|
</style>
|
|
66
|
-
<script type=module src="demo/main.bundle.min.js?v=
|
|
94
|
+
<script type=module src="demo/main.bundle.min.js?v=585090ee8ae9"></script>
|
|
67
95
|
<link rel="icon" href="assets/b.png?v=32b1d0126431"/>
|
|
68
96
|
|
|
69
97
|
<meta name="theme-color" content="#f2ea8e">
|
|
@@ -75,23 +103,34 @@ html, body {
|
|
|
75
103
|
|
|
76
104
|
|
|
77
105
|
|
|
78
|
-
<meta data-version="0.1.0-3" />
|
|
79
|
-
|
|
80
106
|
</head>
|
|
81
107
|
<body>
|
|
82
108
|
|
|
83
109
|
<header>
|
|
84
110
|
<h1>
|
|
85
111
|
<strong>@benev/tact</strong>
|
|
86
|
-
<
|
|
112
|
+
<small>v0.1.0-4</small>
|
|
87
113
|
</h1>
|
|
88
114
|
<div class=deets>
|
|
89
|
-
<
|
|
90
|
-
<
|
|
115
|
+
<p><em>"from keypress to couch co-op"</em></p>
|
|
116
|
+
<p>
|
|
117
|
+
tact is a user input toolkit for the web. it's good at customizable keybindings, and multiple gamepad support.
|
|
118
|
+
see <a href="https://github.com/benevolent-games/tact">github</a>,
|
|
119
|
+
see <a href="https://benevolent.games/">benevolent.games</a>.
|
|
120
|
+
</p>
|
|
91
121
|
</div>
|
|
92
122
|
</header>
|
|
93
123
|
|
|
94
124
|
<tact-demo></tact-demo>
|
|
95
125
|
|
|
126
|
+
<section>
|
|
127
|
+
<h3>controls</h3>
|
|
128
|
+
<ul>
|
|
129
|
+
<li><strong>keyboard</strong> wasd, left-bracket, right-bracket, backslash.</li>
|
|
130
|
+
<li><strong>gamepad</strong> thumbsticks, hold beta/gamma and press bumpers or dpad left/right.</li>
|
|
131
|
+
<li><strong>virtual</strong> use your mouse to press the little buttons.</li>
|
|
132
|
+
</ul>
|
|
133
|
+
</section>
|
|
134
|
+
|
|
96
135
|
</body>
|
|
97
136
|
</html>
|
package/x/index.html.js
CHANGED
|
@@ -9,9 +9,6 @@ export default ssg.page(import.meta.url, async (orb) => ({
|
|
|
9
9
|
css: "demo/main.css",
|
|
10
10
|
dark: true,
|
|
11
11
|
favicon,
|
|
12
|
-
head: html `
|
|
13
|
-
<meta data-version="${orb.packageVersion()}" />
|
|
14
|
-
`,
|
|
15
12
|
socialCard: {
|
|
16
13
|
title,
|
|
17
14
|
description,
|
|
@@ -23,15 +20,28 @@ export default ssg.page(import.meta.url, async (orb) => ({
|
|
|
23
20
|
<header>
|
|
24
21
|
<h1>
|
|
25
22
|
<strong>@benev/tact</strong>
|
|
26
|
-
<
|
|
23
|
+
<small>v${orb.packageVersion()}</small>
|
|
27
24
|
</h1>
|
|
28
25
|
<div class=deets>
|
|
29
|
-
<
|
|
30
|
-
<
|
|
26
|
+
<p><em>"from keypress to couch co-op"</em></p>
|
|
27
|
+
<p>
|
|
28
|
+
tact is a user input toolkit for the web. it's good at customizable keybindings, and multiple gamepad support.
|
|
29
|
+
see <a href="https://github.com/benevolent-games/tact">github</a>,
|
|
30
|
+
see <a href="https://benevolent.games/">benevolent.games</a>.
|
|
31
|
+
</p>
|
|
31
32
|
</div>
|
|
32
33
|
</header>
|
|
33
34
|
|
|
34
35
|
<tact-demo></tact-demo>
|
|
36
|
+
|
|
37
|
+
<section>
|
|
38
|
+
<h3>controls</h3>
|
|
39
|
+
<ul>
|
|
40
|
+
<li><strong>keyboard</strong> wasd, left-bracket, right-bracket, backslash.</li>
|
|
41
|
+
<li><strong>gamepad</strong> thumbsticks, hold beta/gamma and press bumpers or dpad left/right.</li>
|
|
42
|
+
<li><strong>virtual</strong> use your mouse to press the little buttons.</li>
|
|
43
|
+
</ul>
|
|
44
|
+
</section>
|
|
35
45
|
`,
|
|
36
46
|
}));
|
|
37
47
|
//# sourceMappingURL=index.html.js.map
|
package/x/index.html.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.html.js","sourceRoot":"","sources":["../s/index.html.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,aAAa,CAAA;AAErC,MAAM,KAAK,GAAG,aAAa,CAAA;AAC3B,MAAM,MAAM,GAAG,uBAAuB,CAAA;AACtC,MAAM,OAAO,GAAG,eAAe,CAAA;AAC/B,MAAM,WAAW,GAAG,+CAA+C,CAAA;AAEnE,eAAe,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAC,GAAG,EAAC,EAAE,CAAC,CAAC;IACtD,KAAK;IACL,EAAE,EAAE,yBAAyB;IAC7B,GAAG,EAAE,eAAe;IACpB,IAAI,EAAE,IAAI;IACV,OAAO;
|
|
1
|
+
{"version":3,"file":"index.html.js","sourceRoot":"","sources":["../s/index.html.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,aAAa,CAAA;AAErC,MAAM,KAAK,GAAG,aAAa,CAAA;AAC3B,MAAM,MAAM,GAAG,uBAAuB,CAAA;AACtC,MAAM,OAAO,GAAG,eAAe,CAAA;AAC/B,MAAM,WAAW,GAAG,+CAA+C,CAAA;AAEnE,eAAe,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAC,GAAG,EAAC,EAAE,CAAC,CAAC;IACtD,KAAK;IACL,EAAE,EAAE,yBAAyB;IAC7B,GAAG,EAAE,eAAe;IACpB,IAAI,EAAE,IAAI;IACV,OAAO;IAEP,UAAU,EAAE;QACX,KAAK;QACL,WAAW;QACX,UAAU,EAAE,SAAS;QACrB,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,WAAW,MAAM,GAAG,OAAO,EAAE;KACpC;IAED,IAAI,EAAE,IAAI,CAAA;;;;cAIG,GAAG,CAAC,cAAc,EAAE;;;;;;;;;;;;;;;;;;;;;;EAsBhC;CACD,CAAC,CAAC,CAAA"}
|
package/x/index.js
CHANGED
package/x/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../s/index.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../s/index.ts"],"names":[],"mappings":"AACA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAA;AAEvC,cAAc,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NubLookpad } from "./lookpad/component.js";
|
|
2
|
+
import { NubStick } from "./stick/component.js";
|
|
3
|
+
import { NubVpad } from "./vpad/component.js";
|
|
4
|
+
export declare const nubs: () => {
|
|
5
|
+
NubLookpad: typeof NubLookpad;
|
|
6
|
+
NubStick: typeof NubStick;
|
|
7
|
+
NubVpad: typeof NubVpad;
|
|
8
|
+
};
|
|
9
|
+
export declare const registerNubs: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { dom } from "@e280/sly";
|
|
2
|
+
import { NubLookpad } from "./lookpad/component.js";
|
|
3
|
+
import { NubStick } from "./stick/component.js";
|
|
4
|
+
import { NubVpad } from "./vpad/component.js";
|
|
5
|
+
export const nubs = () => ({
|
|
6
|
+
NubLookpad,
|
|
7
|
+
NubStick,
|
|
8
|
+
NubVpad,
|
|
9
|
+
});
|
|
10
|
+
export const registerNubs = () => dom.register(nubs());
|
|
11
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../../s/nubs/components.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,WAAW,CAAA;AAC7B,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAC,OAAO,EAAC,MAAM,qBAAqB,CAAA;AAE3C,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,CAAC;IAC1B,UAAU;IACV,QAAQ;IACR,OAAO;CACP,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAA"}
|
package/x/nubs/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../s/nubs/index.ts"],"names":[],"mappings":"AACA,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,qBAAqB,CAAA;AACnC,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { dom, view } from "@e280/sly";
|
|
2
|
+
import { styles } from "./styles.js";
|
|
3
|
+
const NubLookpadView = view(use => () => {
|
|
4
|
+
use.name("nub-lookpad");
|
|
5
|
+
use.styles(styles);
|
|
6
|
+
const $captured = use.signal(undefined);
|
|
7
|
+
use.mount(() => dom.events(use.element, {
|
|
8
|
+
pointerdown: (event) => {
|
|
9
|
+
event.preventDefault();
|
|
10
|
+
if ($captured.value)
|
|
11
|
+
use.element.releasePointerCapture($captured.value);
|
|
12
|
+
use.element.setPointerCapture(event.pointerId);
|
|
13
|
+
$captured.value = event.pointerId;
|
|
14
|
+
// onPointerDrag(event)
|
|
15
|
+
},
|
|
16
|
+
pointermove: [{ passive: false }, (event) => {
|
|
17
|
+
event.preventDefault();
|
|
18
|
+
if (event.pointerId === $captured.value) {
|
|
19
|
+
// onPointerDrag(event)
|
|
20
|
+
}
|
|
21
|
+
}],
|
|
22
|
+
pointerup: (event) => {
|
|
23
|
+
event.preventDefault();
|
|
24
|
+
if (event.pointerId === $captured.value) {
|
|
25
|
+
use.element.releasePointerCapture($captured.value);
|
|
26
|
+
$captured.value = undefined;
|
|
27
|
+
// onPointerDrag(event)
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
}));
|
|
31
|
+
});
|
|
32
|
+
export class NubLookpad extends (NubLookpadView
|
|
33
|
+
.component()
|
|
34
|
+
.props(() => [])) {
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../s/nubs/lookpad/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAE,IAAI,EAAC,MAAM,WAAW,CAAA;AACnC,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAA;AAElC,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE;IACvC,GAAG,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IACvB,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAElB,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAqB,SAAS,CAAC,CAAA;IAE3D,GAAG,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE;QACvC,WAAW,EAAE,CAAC,KAAmB,EAAE,EAAE;YACpC,KAAK,CAAC,cAAc,EAAE,CAAA;YACtB,IAAI,SAAS,CAAC,KAAK;gBAClB,GAAG,CAAC,OAAO,CAAC,qBAAqB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;YAEnD,GAAG,CAAC,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;YAC9C,SAAS,CAAC,KAAK,GAAG,KAAK,CAAC,SAAS,CAAA;YACjC,uBAAuB;QACxB,CAAC;QAED,WAAW,EAAE,CAAC,EAAC,OAAO,EAAE,KAAK,EAAC,EAAE,CAAC,KAAmB,EAAE,EAAE;gBACvD,KAAK,CAAC,cAAc,EAAE,CAAA;gBACtB,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,KAAK,EAAE,CAAC;oBACzC,uBAAuB;gBACxB,CAAC;YACF,CAAC,CAAC;QAEF,SAAS,EAAE,CAAC,KAAmB,EAAE,EAAE;YAClC,KAAK,CAAC,cAAc,EAAE,CAAA;YACtB,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,KAAK,EAAE,CAAC;gBACzC,GAAG,CAAC,OAAO,CAAC,qBAAqB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;gBAClD,SAAS,CAAC,KAAK,GAAG,SAAS,CAAA;gBAC3B,uBAAuB;YACxB,CAAC;QACF,CAAC;KACD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,MAAM,OAAO,UAAW,SAAQ,CAC/B,cAAc;KACZ,SAAS,EAAE;KACX,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CACjB;CAAG"}
|