<hyper-card> Web Component
<hyper-card>
is a web component that adds a three-dimensional hover effect to any arbitrary content. Full credit to this 3D card hover effect CodePen from Mark Mironyuk. Used on the registration flow for conf.11ty.dev
.
Features
- Respects
prefers-reduced-motion
. - Customize scale with
--hypercard-scale
CSS custom property.
Installation
You can install via npm
(@zachleat/hypercard
) or download the hypercard.js
JavaScript file manually.
npm install @zachleat/hypercard --save
Add hypercard.js
to your site’s JavaScript assets.
Usage
<hyper-card>Hello.</hyper-card>
Not quite as big on hover
The default value is 1.07
.
<hyper-card style="--hypercard-scale: 1.03">Hello.</hyper-card>
2 Comments
Zach Leatherman :verify:
This is the last entry in my #11yConf web component series! If you’d like to learn more about how the ticketing and registration piece of https://conf.11ty.dev/ was built—tune in later today to the Static Web Development Happy Hour with Mike and Zach: https://www.twitch.tv/cloud… Truncated
Aaron In Iowa
@zachleat fun! got a spot I am tempted to use this on right away.