Git Product home page Git Product logo

zumly's Introduction

Zumly is a Javascript library for building zooming user interfaces. Create zooming experiences using web standards.

Overview

Zumly is a frontend library for creating zoomable user interfaces (ZUI). Instead of hyperlinks and windows, Zumly uses zooming as a metaphor for browsing through information. This way it offers an infinite virtual canvas in which elements can be zoomed themselves to reveal further details.

To be more flexible Zumly is primarily focused on zooming transitions without caring about visual design. Most CSS frameworks or custom designs work with Zumly.

Installation

NPM

npm install zumly

# or

yarn add zumly

Content delivery networks (CDN)

Include https://unpkg.com/zumly in your project in a <script> tag.

Direct download

Download Zumly files from unpkg.com. Files are in dist folder.

Setup

ES6 modules

  1. Add CSS inside <head> tag:
<link rel="stylesheet" href="zumly/dist/zumly.css">

<!-- Or "https://unpkg.com/[email protected]/dist/zumly.css" -->
  1. Add Zumly as ES6 module:
<script type="module">
  import Zumly from "zumly/dist/zumly.mjs"

  // Or "https://unpkg.com/[email protected]/dist/zumly.mjs"
</script>

UMD modules

  1. Add Zumly CSS Styles inside <head> tag:
<link rel="stylesheet" href="zumly/dist/zumly.css">

<!-- Or "https://unpkg.com/[email protected]/dist/zumly.css" -->
  1. Add Zumly as UMD module:
<script src="zumly/dist/zumly.umd.js"></script>

// Or "https://unpkg.com/zumly"

Hello World

  1. Create a container for your Zumly app with .zumly-canvas:
<div class="example zumly-canvas"></div>
  1. Inside script tag write this code:
// Some views
const hello = `
<div class="z-view">
H E L L O <br>
W <span class="zoom-me" data-to="world">O</span> R L D!
</div>
`;

const world = `
<div class="z-view">
<img src="https://raw.githubusercontent.com/zumly/website/gh-pages/images/world.png"/>
</div>
`;

// Zumly instance
const app = new Zumly({
  mount: '.example',
  initialView: 'hello',
  views: {
    hello,
    world
  }
})

app.init()

Zumly options

  1. The Zumly instance:
const app = new Zumly({
  // Mount DOM Element. String. Required
  mount: '.className',
  // First rendered view name. String. Required
  initialView: 'viewName',
  // Store all views. Object. Required
  views: {
    view1,
    view2,
    . . .
  }, 
  // Customize transitions. Object. Optional
  transitions: {
    // Effects for background views. Array. ['blur', 'sepia', 'saturate']
    effects: ['sepia'],
    // How new injected view is adapted. String. Default 'width'
    cover: 'height',
    // Transition duration. String. Default '1s'
    duration: '1300ms' ,
    // Transition ease. String. Default 'ease-in-out'
    ease: 'cubic-bezier(0.25,0.1,0.25,1)'
  },
  // Activate debug notifications. Boolean. Default false
  debug: true
})
// Initialize instance
app.init()
  1. Options for each zoomable element:
  • Add z-view class in you view container:
<div class="z-view"></div>
  • Add zoom-me class to an HTML element to make it zoomable and add data-to attribute with the name of the target view
<div class="zoom-me" data-to="anotherView">Zoom me!</div>
  • Each zooming transition can be customized by adding some data- attributes:
<div class="zoom-me" data-to="anotherView" data-with-duration="2s" data-with-ease="ease-in">
  Zoom me!
</div>

Development

Developer environment requirements

To run this project, you will need:

  • Node.js >= v10.5.0

Dev mode

When developing you can run:

npm run dev

# or

yarn dev

This will regenerate the build files each time a source file is changed and serve on http://localhost:9090

Running tests

npm run test

# or

yarn test

Building

npm run build

# or

yarn build

Changelog

Please see CHANGELOG for more information what has changed recently.

Status: beta

Zumly is on early stages of development.

Roadmap

  • Allow different template engines. Currently Zumly only accepts string literal templates.
  • Add lateral navigation for same zoom level elements.
  • Add a navegation widget.
  • Add programmatic navigation.
  • Add preseted navigation.
  • Add router. #3
  • Allow recalculate zoom position on resize events.

Stay in touch

Original idea

Zumly is a new approach based on another library I made, Zircle UI

License

The MIT License (MIT). Please see License File for more information.

zumly's People

Contributors

andriytyurnikov avatar lucksus avatar sabiqovsky avatar tinchox5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

zumly's Issues

Zumly with SSGs

Hello!
I have been trying, unsuccessfully, to get Zircle, then Zumly, to work with any react-based SSG. I have focused my efforts around Zumly and Gatsby, mostly. Predictably, the error I receive is around Zumly's access to the canvas:

Cannot read property 'setAttribute' of null
./node_modules/zumly/dist/zumly.mjs:282
// Prepare the instance:
this.canvas = document.querySelector(this.mount);
this.canvas.setAttribute('tabindex', 0);
this.canvas.addEventListener('mouseup', this._onZoom, false);

Can you point me in a general research direction? I'm not asking you to fix it for me, I just want to try to make this work in whatever way I can.

Thanks so much!

Introduce ZoomPath for full zoom state representation.

Is your feature request related to a problem? Please describe.
For integration with SPA routers it would be required to have full zoom-path (if single view may be represented in different locations of ZoomSpace)

Describe the solution you'd like
Simplest implementation would be a string representation like /initial/zoomLevelOne/zoomLevelTwo

Describe alternatives you've considered
Having same view with different names, is an acceptable work-around

Additional context
We could use an examples of nested zoom

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.