Giter Club home page Giter Club logo

csstelemetry_gball's Introduction

CSSTelemetry | GBall

A G-Force visualizer inspired by MotoGP telemetry, powered by CSS and JS

screenshot

DEMO

https://shelladdicted.github.io/CSSTelemetry_GBall/

Quickstart

HTML:

<link rel="stylesheet" type="text/css" href="dist/csstelemetry-gball.min.css" />
<div id="ball1" class="csstelemetry-gball csstelemetry-gball-left" style="height: 300px; width: 300px;"></div>
<script src="dist/csstelemetry-gball.min.js"></script>

Alignment options

  • csstelemetry-gball-left
  • csstelemetry-gball-center
  • csstelemetry-gball-right

JS:

/*
  GBall(DOMElement, cursorSize = 4, maxGValue = 8, steps = 4, dashed = true)

  DOMElement: DOM Element reserved for GBall
  cursorSize: (int)size of force indicator
  maxGValue: (float)maximum representable value
  steps: (int) number of steps between -maxGValue && +maxGValue (more steps =
  more resolution) dashed: (bool) alternates solid circle and dashed circles
*/
ball = new GBall(document.getElementById("ball1"),4,8);
/*
  showForce(xAxis, yAxis)

  xAxis: (float) force along xAxis (unit: G)
  yAxis: (float) force along yAxis (unit: G)

  Examples:
    ball.showForce(2,1); // 2g (x) ; 1g(y)
    ball.showForce(ms2tog(12), ms2tog(13)) //12m/s² (x) ; 13mm/s² (y)
*/
ball.showForce(2,1); // 2g (x) ; 1g(y)

Unit conversion helpers

  • const: G = 9.80665 (m/s²)
  • function: ms2tog(m/s²) -> g
  • function: gtoms2(g) -> m/s²

csstelemetry_gball's People

Contributors

shelladdicted avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.