项目作者: framework7io

项目描述 :
Framework7 plugin to add 3d effect for side panels
高级语言: JavaScript
项目地址: git://github.com/framework7io/framework7-plugin-3d-panels.git
创建时间: 2014-07-20T15:48:59Z
项目社区:https://github.com/framework7io/framework7-plugin-3d-panels

开源协议:MIT License

下载


Framework7 3D Panels Plugin

Framework7 plugin to add 3d effect for side panels

Installation

Just grab plugin files from dist/ folder or using npm:

  1. npm install framework7-plugin-3d-panels

And link them to your app’s right AFTER Framework7’s scripts and styles:

  1. <link rel="stylesheet" href="path/to/framework7.min.css">
  2. <link rel="stylesheet" href="path/to/framework7.3dpanels.css">
  3. ...
  4. <script src="path/to/framework7.min.js"></script>
  5. <script src="path/to/framework7.3dpanels.js"></script>

Usage

This plugin doesn’t add new effect, it just converts “reveal”-effect panels to 3d panels. So make sure that you have “reveal” panel in your layout:

  1. <div class="panel panel-left panel-reveal">...</div>

Install & Enable Plugin

After you included plugin script file, you need to install plugin:

  1. // install plugin to Framework7
  2. Framework7.use(Framework73dPanels);
  3. // init app and enable plugin
  4. var app = new Framework7({
  5. // enable plugin
  6. panels3d: {
  7. enabled: true,
  8. }
  9. })

ES Module

This plugin comes with ready to use ES module:

  1. import Framework7 from 'framework7';
  2. import Framework73dPanels from 'framework7-plugin-3d-panels';
  3. // install plugin
  4. Framework7.use(Framework73dPanels);
  5. // init app and enable plugin
  6. var app = new Framework7({
  7. // enable plugin
  8. panels3d: {
  9. enabled: true,
  10. }
  11. })

API

When plugin installed to Framework7 with Framework7.use(Framework73dPanels), it will extend app instance with two additional methods:

  • app.panels3d.enable() - enables 3d panels
  • app.panels3d.disable() - disables 3d panels

Demo

Plugin comes with demo example to see how it works and looks. To make demo works you need to run in terminal:

  1. $ npm run prod

Contribute

All changes should be done only in src/ folder. This project uses gulp and rollup to build a distributable version.

First you need to install all dependencies:

  1. $ npm install

Then to build plugin’s files for testing run:

  1. $ npm run build:dev

If you need a local server while you developing you can run:

  1. $ gulp server

or

  1. $ npm run dev

And working demo will be available on http://localhost:3000/demo/

Live Preview

https://framework7io.github.io/framework7-plugin-3d-panels/