项目作者: shipshapecode

项目描述 :
An Ember addon for 3d folding panels
高级语言: JavaScript
项目地址: git://github.com/shipshapecode/ember-3d-folding-panel.git
创建时间: 2016-09-09T01:24:54Z
项目社区:https://github.com/shipshapecode/ember-3d-folding-panel

开源协议:MIT License

下载


ember-3d-folding-panel

ember-3d-folding-panel is built and maintained by Ship Shape. Contact us for Ember.js consulting, development, and training for your project.

npm version
npm
Ember Observer Score
Build Status
Code Climate
Test Coverage

Ember-3d-folding-panel is based on 3D Folding Panel by CodyHouse. It aims to make it easily configurable for use with your Ember apps.

Compatibility

  • Ember.js v2.18 or above
  • Ember CLI v2.13 or above

Installation

ember install ember-3d-folding-panel

Usage

  1. {{folding-panel}}
  2. {{#ember-3d-folding-panel}}
  3. {{#each model as |item|}}
  4. {{#item-square item=item}}
  5. <img class="client-image" src="{{item.imageURL}}">
  6. {{/item-square}}
  7. {{/each}}
  8. {{/ember-3d-folding-panel}}

items are defined as an array of objects, these should contain heading and subheading.
You can also display extra info inside of the item-square.

The route from the dummy app, which contains an array of items, looks like this:

  1. export default Route.extend({
  2. model() {
  3. return [
  4. {
  5. heading: 'Client 1',
  6. subheading: 'Lorem ipsum dolor sit amet, consectetur.',
  7. panelHeading: 'Client 1',
  8. panelSubheading: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse, laboriosam?',
  9. imageURL: 'img/logo1.png',
  10. panelInfo
  11. },
  12. {
  13. heading: 'Client 2',
  14. subheading: 'Lorem ipsum dolor sit amet, consectetur.',
  15. panelHeading: 'Client 2',
  16. panelSubheading: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Esse, laboriosam?',
  17. imageURL: 'img/logo2.png',
  18. panelInfo
  19. },
  20. ...
  21. ];
  22. }
  23. });

Styles

Ember-3d-folding-panel uses Sass for styles. The default styles for the panels are stored in an overridable Sass map. This is accomplished by supplying a $ember-3d-folding-panel map with any or all of the keys found in the defaults map below.

  1. // This is the default map, not what you should use.
  2. // i.e. you want to define $ember-3d-folding-panel, not $ember-3d-folding-panel-defaults
  3. $ember-3d-folding-panel-defaults: (
  4. 'accent-color': #544173, // Mulled Wine
  5. 'color-1': #363558, // Martinique
  6. 'color-2': #544173, // Mulled Wine
  7. 'color-3': #dadcdc, // Iron
  8. 'color-4': #65d29b, // Emerald
  9. 'color-6': #ffffff, // White
  10. 'dark-color': #363558, // Martinique
  11. 'fold-animation': .5s,
  12. 'fold-color': #dadcdc,
  13. 'fold-content-animation': .2s*(3+1)/2, // replace 3 with number of elements that you want to animate
  14. 'light-color': #ffffff, // White
  15. 'overlay-color': #1c1726, // Bastille
  16. );

Under the hood, the addon will merge the default settings and any settings supplied in an $ember-3d-folding-panel map and use those to style the panels. Very little, other than this map, should be required to get the panels looking the way you want them to.

Example styles usages

If you wanted to supply some different colors for the panels, but keep the same animations, your styles.scss might look something like this:

  1. $ember-3d-folding-panel: (
  2. 'color-1': #ffffff,
  3. 'color-2': #000000,
  4. 'color-3': #ffffff,
  5. 'color-4': #000000
  6. );
  7. // After you define your overrides, make sure to import the styles from the addon!
  8. @import 'ember-3d-folding-panel';

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.