Giter Club home page Giter Club logo

card-depth.js's Introduction

card-depth.js

Add cards with depth. Material design accurate.

How to get started

Simply add card-depth.js to your code directory and import it to your HTML.

How to use

  1. Find the element you want to make into a card. In this example, we'll use a div tag with some content in it.
<div>
  <p>I am content!</p>
</div>
  1. Add "card" to the class name.
<div class="card">
  <p>I am content!</p>
</div>
  1. Add your desired height effects. (consult the reference to learn about these)
<div class="card" z-default='20' z-hover='50'>
  <p>I am content!</p>
</div>

Here's an example: http://codepen.io/anon/pen/xbBNOe

  1. By default, your card should now exist with a height of 100px and a margin of 25px. It will have a transition of .15s for shadows by default. Check the reference to learn how to turn them off.

#Reference Added HTML attributes: z, z-default, z-hover, z-click, no-margin, no-padding, no-transition, no-border-radius, no-height

z: used inside of code, user cannot play with this variable as it constantly changes.

z-default: the z height (in pixels) when user is not hovering or clicking on element.

z-hover: the z height (in pixels) when user is hovering element.

z-click: the z height (in pixels) when user is clicking on element.

no-margin: takes no value. Simply a flag indicating to not apply the default 25px margin to this card.

no-padding: takes no value. Simply a flag indicating to not apply the default 10px padding to this card.

no-transition: takes no value. It is a flag indicating to not apply the default .15s material transition with shadow.

no-height: takes no value. It is a flag indicating to not apply the default height of 100px to this card.

no-border-radius: takes no value. It is a flag indicating to not apply the default border-radius of 2px.

card-depth.js's People

Contributors

jacques-jd avatar

Watchers

James Cloos avatar Bayu Wijaya avatar

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.