juhamust / mozaik-ext-switch

Mozaik extension: Multiple widgets with periodic switching
MIT License
9 stars 1 forks source link

mozaik-ext-switch

Extension for Mozaïk that allows to place multiple widgets into same grid cell and switch periodically between them. Despite the preview shown below, it does the switch with smooth transition.

preview

Setup

Widget: Widgets

Switch between widgets

parameters

key required description
duration no Duration how long to show each widget. Defaults to 8000

usage

Create switch.widgets widget and place widgets within widgets parameter:

dashboards: [
  // First dashboard view
  {
    columns: 1,
    rows: 1,
    widgets: [
      // 1st row
      {
        type: 'switch.widgets',
        columns: 1, rows: 1,
        x: 0, y: 0,
        // Duration how long to show each widget
        duration: 8000,
        // Structure within widgets is same normally
        // with widgets. Naturally the size and placement
        // comes from switch.widgets
        widgets: [
          {
            type: 'time.clock',
            timezone: 'America/Los_Angeles',
            info: 'date',
            title: 'Los Angeles'
          },
          {
            type: 'weather.weather',
            city: 'Helsinki',
            country: 'FI',
            lang: 'en',
          },
          {
            type: 'time.clock',
            info: 'time',
            timezone: 'Asia/Tokyo',
            title: 'Tokyo'
          }
        ]
      }
    ]
  }
]

Changelog

Release 1.0.0

Release 0.4.0

Release 0.3.1

Release 0.3.0

Release 0.2.0

Release 0.1.0

License

Module is MIT -licensed