Skip to content

Visual control of a Numeric value in your Gun data

Notifications You must be signed in to change notification settings

Stefdv/gunui-slider

Repository files navigation

GunUi elements

GunUi is a set of webcomponents that enables you - the frontend developer - to build complex - Gun - applications without writing any javascript.
Just link an element to a 'data-point' in your Gun data by setting attributes.
<gunui-button soul="lights" prop="hall.ceiling">Light</gunui-button> and you're all set.

GunUi-Slider

gunui-slider is a Gun wrapper around paper-slider

Purpose of gunui-slider

  • Visual control a Numeric value in your Gun data.
  • Syncs the state of the slider with changes in Gun
  • ...and then some...Take a look at the demos

Requirements

  • Gun loaded in your main document
  • gunui-base in your main document

(Bower) Install gunui-slider

( When Polymer 3 arrives we can skip the bower part, but for now...)

bower install gunui-slider --save

Your main document

<!doctype html>
<html lang="en">
  <head>
    <!-- load Gun from somewhere ( required ) -->
    <script src="my_path_to_gun.js"></script>

    <!-- import gunui-base ( required )-->
    <link rel="import" href="/bower_components/gunui-base/gunui-base.html">

    <!-- import gunui-checkbox -->
    <link rel="import" href="/bower_components/gunui-slider/gunui-slider.html">

  </head>
  <body>
    <gunui-base></gunui-base>

    <!-- somewhere in your app, or in a custom element -->
    <gunui-slider soul="lights" prop="lights.1.state.bri"></gunui-slider>

  </body>
</html>

That's it. No javascript!

You now control the property in Gun!

Now what?

Now you are ready to start building great apps with Gun but without having to write javascript :).
Take a look at all the GunUi elements available.

Demos

If you don't fully understand the purpose of gunui take a look at some of the GunUi elements.

Property Elements

Element Demo Type Change Observe Available
gunui-button demo Boolean
gunui-checkbox demo Boolean
gunui-toggle Boolean 🔜
gunui-progress demo Numeric 🔲
gunui-slider demo Numeric
gunui-input Numeric / String 🔜
gunui-textfield String 🔜

Contact

I am not much of an e-mail reader, but please post issues and questions.
It would speed things up if you notify me in the Gun gitter @Stefdv

About

Visual control of a Numeric value in your Gun data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages