Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.
/ sync-status-icon Public archive

A visual metaphor for offline enabled webapps to communicate their state with the user.

Notifications You must be signed in to change notification settings

garden20/sync-status-icon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sync-status-icon

The idea of this project is to create a visual metaphor for offline enabled webapps to communicate their state with the user.

demo

It revolves around the already published offline & storage icon produced by the w3, available here: http://www.w3.org/html/logo/.

It is in the spirit of spin.js in that is uses no images, and should be easy to integrate with your own project.

Getting Started

Using requirejs?

jam install sync-status-icon

define(['sync-status-icon'], SyncIcon) {

}

Using npm?

npm install sync-status-icon

var SyncIcon = require('sync-status-icon');

Browser

<script type="text/javascript" src="sync-status-icon.js"></script>

API

var sync_icon = new SyncIcon('sync');

// respond to the user clicking the icon
sync_icon.click(function(){
    var current_state = sync_icon.getState();
    // maybe if disabled, enable offline support?
})

// visually represent what state your webapp is in
sync_icon.disabled();
sync_icon.online();
sync_icon.offline();
sync_icon.syncing();


About

A visual metaphor for offline enabled webapps to communicate their state with the user.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published