1.0.2 • Published 1 year ago

jb-weather-widget v1.0.2

Weekly downloads
-
License
GNU
Repository
github
Last release
1 year ago

NPM JavaScript Style Guide

jb-weather-widget

Weather widget for javascript applications

Demo

Installation

npm i jb-weather-widget

or

yarn add jb-weather-widget

Usage

<!-- Import the module inside the document's body -->

<body>
  <div id="app"></div>

  <script type="module">
    import { WeatherWidget } from "jb-weather-widget";

    new WeatherWidget({
      parentContainer: "app",
      units: {
        temperature: "celsius",
        speed: "kmh",
      },
      remember: false,
      refresh: 45,
    });
  </script>
</body>

Options

Styling

const theme = {
  color: {
    font: {
      main: "#fff",
      timer: "#fff",
      bottom: "#fff",
      right: "#fff",
      list: {
        main: "#000",
        hover: "#fff",
      },
    },
    icon: {
      main: "#e040fb",
      right: "#e040fb",
      bottom: "#e040fb",
    },
  },
  bg: {
    main: "#512da8",
    right: "rgba(0,0,0,0.1)",
    bottom: "rgba(0,0,0,0.1)",
    list: {
      main: "#FFF",
      hover: "transparent",
      border: "#ccc",
    },
  },
  spacing: {
    inner: "16px", // The width, height of gaps between inner elements
    outer: "16px", // padding of the container's element
  },
  borderRadius: {
    container: "8px", // you want 0 radius you have to put it explicitly, same below
    element: "8px",
  },
};

See also

React version

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago