Skip to content

A wrapper of js-spatial-navigation to Vue components

License

Notifications You must be signed in to change notification settings

Syncronet-APS/zome-vjsn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zome-vjsn (vue-js-spatial-navigation)

Forked from spacerefugee
Original author luke-chang

Updated to be compatible with Vue3

  • Added mouse support
  • Added enter-up trigger click on focused element
  • Added directive 'v-focus-events' for spatial navigation custom events

Vue directive of js-spatial-navigation;

Goal

Our goal is to have a library containing the tools you need to create a tv app with Vue for all tv platforms possible.
At the moment we have only tested on WebOS & Tizen, we will expand to tvOS & AndroidTV later.

Contribution

Feel free to open issues/pull requests.
We are open to new features & changes.
We are willing to answer questions.

Installation

NPM

    no

YARN

    yarn add https://github.com/Syncronet-APS/zome-vjsn

Getting Started

import vjsn from "zome-vjsn";

app.use(vjsn, globalConfig);

Optional global Configuration

Additional configuration scrollOptions:

  • The page will auto scroll to the focus element by using scrollIntoView.

  • You can set this scrollOptions for the scrollIntoViewOptions.

  • The page will not scroll to the focus element when setting scrollOptions to "" or null.

const globalConfig = {
  straightOnly: false,
  straightOverlapThreshold: 0.5,
  rememberSource: false,
  disabled: false,
  defaultElement: "",
  enterTo: "",
  leaveFor: null,
  restrict: "self-first",
  tabIndexIgnoreList:
    "a, input, select, textarea, button, iframe, [contentEditable=true]",
  navigableFilter: null,
  scrollOptions: { behavior: "smooth", block: "center" },
};
Vue.use(vjsn, globalConfig);

Documentation

$SpatialNavigation

A global Vue instance property for SpatialNavigation;

// you can access SpatialNavigation in every instance
this.$SpatialNavigation;

TODO

Go through commits on

About

A wrapper of js-spatial-navigation to Vue components

Resources

License

Stars

Watchers

Forks

Packages

No packages published