Socket
Socket
Sign inDemoInstall

brick-moon

Package Overview
Dependencies
15
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    brick-moon

WebGL component to serve as navigation for front-end website: Brick Moon.


Version published
Maintainers
1
Created

Readme

Source

Brick Moon

WebGL component to serve as navigation for front-end website: Brick Moon.

Quick Start:

Serve the /demo folder and observe one possible way of incorporating the webgl portion of the site, making calls to it's API and listening to it's events.

Usage

include the brickmoon.js script in your <head>, then after pageload you can instantiate it and add it to the DOM:

const brickmoon = new BrickMoon();
document.body.appendChild(brickmoon.element);

or pass it the DOM element you'd like it to be rendered into.

const brickmoon = new BrickMoon(domElement);
Methods:

goto(<string>): call goto('moon') to start the experience
resize(): resizes the canvas to fit it's container, only needs to be called when the container size changes.
reset(): resets the experience to the start state

Events:

listen for events on BrickMoon.element:

const brickmoon = new BrickMoon();
brickmoon.element.addEventListener('location', locationChange);

planet: fired when user goes from the earth to the moon.
location: fired when user goes into and out of locations on the moon, null means the user is in the planetary view.
hotspot: fired when user clicks on a hotspot.

Development

npm install
npm start
goto http://localhost:8080 in a browser

deployment

npm install
npm run build
move the files under /dist wherever you want to include them.

FAQs

Last updated on 26 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc