Giter Club home page Giter Club logo

ee-tile's Introduction

ee-tile

Build Status Dependency Status devDependency Status

A UI component for angular apps to display media and text content in tiles. Inspired by material design.

Visual examples

Height of the component is dependening on the width, as the main area will always be a square.

ee-media-tile-abp

Usage

Using a script tag:

<script src="ee-tile.js"></script>
<script>
// Add eeTile as dependency to your module definition
var app = angular.module('YourApp', ['eeTile']);
</script>

Using browserify:

You need to browserify your source code with the brfs transform, if you require ee-tile from index.js source.

var app = angular.module('myApp', [])
require('ee-tile')(app)

API

The API of the component can be used via attributes on the directive, which has an isolated scope. The tile is devided in four areas:

ee-media-tile

We call the area with 1 and 2 "main" and the area of 3 and 4 "bottom bar".

You can provide options to the directive to change the default behavior regarding these areas:

<ee-tile options="{...}"></ee-tile>

background (color)

You can set the background color of the main area using the background option. This will be used as the value for the css background property.

<ee-tile options="{background: 'red'}"></ee-tile>
<ee-tile options="{background: 'rgba(0,0,0,0.5)'}"></ee-tile>

cover image

To fill the main area with an image, use the image option to reference a URL. This will be used to set a css background-image url.

<ee-tile options="{image: '../cover.jpg'}"></ee-tile>

cover icon

If you want an icon displayed on top of the main area, use the icon option. This must be a css class name or space delimited set of names which will be applied as classes to the icon element.

<ee-tile options="{icon: 'ion-information-circled'}"></ee-tile>

main text content, fitText, ellipsis

To set text to be displayed in the main area, use the text option.

<ee-tile options="{text: 'Lorem ipsum'}"></ee-tile>

The font-size is automatically set to fit and fill the main area; use fitText option to disable this behavior.

<ee-tile options="{text: 'Lorem ipsum', fitText: false}"></ee-tile>

If the text exceeds the length of 140 characters, it will automatically be cut off with an ellipsis. You can change the number of characters or disable this behavior with the ellipsis option.

<ee-tile options="{text: 'Lorem ipsum', ellipsis: 5}"></ee-tile>
<ee-tile options="{text: 'Lorem ipsum', ellipsis: false}"></ee-tile>

bottom bar: background, text, disable

To set the background (color) of the bottom bar, use bar.

<ee-tile options="{bar: 'green'}"></ee-tile>

You can also disable the rendering of the bottom bar by passing false to the bar option.

<ee-tile options="{bar: false}"></ee-tile>

You can provide the text for the bottom bar in the barText option. Text will be fixed font-size and automatically cut off by an ellipsis.

<ee-tile options="{barText: 'Foo Bar'}"></ee-tile>

Build process

This is build using npm scripts.

npm run serve opens browser for development with livereload.

npm run dist creates browserify bundles in dist/ folder.

npm test runs the tests.

npm run watch executes npm test when index.es6 changes.

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.