npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gamepadzilla

v1.1.0

Published

A plug-and-play gamepad frontend framework for HTML5 mobile games, supporting both virtual and physical joysticks. No scripting required.

Downloads

32

Readme

:t-rex: GamepadZilla la la!

npm cdn

A plug-and-play gamepad frontend framework for HTML5 mobile games, supporting both virtual and physical joysticks. No scripting required.

| :video_game: Preview | :joystick: Features | | :------------------- | :------------------- | virtual gamepad | gpz is fast. (no DOM manpulation)gpz is easy. (no Javascript needed, use only html5 attributes)gpz is pure. (made with only typescript without dependencies)gpz hates the van's old-man! |

showcase

post your open-source game using gamepadzilla!

| game | stack | source | | :--- | :---- | :----: | | Coco Battle Royale 2 | C, Assembly 6502, WebAssembly, Html, gampadzila.js | :octocat:repo |

How to use

  • import library with npm or cdn. :minibus:
  • create html5 canvas elements with class gpz-joy or gpz-btn and configure data attributes.
<!DOCTYPE html>
<html>
    <head>
        <script src='https://cdn.jsdelivr.net/npm/gamepadzilla@1/dist/gamepadzilla.js'></script>
    </head>
    <body style="touch-action: none">
        <canvas
            class="gpz-joy"
            data-gpz-bind="ArrowUp ArrowLeft ArrowDown ArrowRight">
        </canvas>
        <canvas
            class="gpz-btn"
            data-gpz-bind="KeyF">
        </canvas>
    </body>
</html>

How to build

if you intend to contribute, let's rock! :guitar:

bun :rice:

bun run build

nodejs :rage1:

npm install
npm run build

container :whale2:

podman run --rm -v $(pwd):/app -w /app  -it oven/bun bun run build
docker run --rm -v $(pwd):/app -w /app  -it ove/bun bun run build

Cheatsheet

main classes

| html5 class | description | | :---------: | :---------- | | gpz-dpad | virtual digital pad for directional input. | | gpz-joy | virtual stick or gamepad analog for directional input. | | gpz-btn | virtual circle buttons with various console layouts. |

data attributes

| html5 attribute | html5 class | description | | :-------------: | :---------: |:----------- | | data-gpz-bind | * | keyboard to emulate(follows anti-clockwise button pattern like:WASD) | | data-gpz-vibrate | * | vibration animation when pressed for feedback | feedback vibration when interact | | data-gpz-color | gpz-dpadgpz-btn | button colors when is not pressed | | data-gpz-color-action | gpz-dpadgpz-btn | buttons colors when is pressed | | data-gpz-size | gpz-dpad | size of shapes elements | | data-gpz-offset | gpz-dpad | size of gap in elements |


This project is licensed under GNU Affero General Public License 3.0, please read the LICENSE file.