Simply add card-depth.js to your code directory and import it to your HTML.
How to use
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>
Add "card" to the class name.
<div class="card">
<p>I am content!</p>
</div>
Add your desired height effects. (consult the reference to learn about these)
<div class="card" z-default='10' z-hover='20'>
<p>I am content!</p>
</div>
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.
Note: You may also use an element named <card>, however it is not officially supported by HTML5 and so it may cause errors.
请发表评论