Travis build: 126 [FORCED]
This commit is contained in:
@ -5,13 +5,13 @@ Creates a shadow box around the text whern it is hovered.
|
||||
#### HTML
|
||||
|
||||
```html
|
||||
<p class = "hover-shadow-box-animation"> Box it! </p>
|
||||
<p class="hover-shadow-box-animation">Box it!</p>
|
||||
```
|
||||
|
||||
#### CSS
|
||||
|
||||
```css
|
||||
.hover-shadow-box-animation{
|
||||
.hover-shadow-box-animation {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
transform: perspective(1px) translateZ(0);
|
||||
@ -20,11 +20,14 @@ Creates a shadow box around the text whern it is hovered.
|
||||
transition-duration: 0.3s;
|
||||
transition-property: box-shadow, transform;
|
||||
}
|
||||
.hover-shadow-box-animation:hover, .hover-shadow-box-animation:focus, .hover-shadow-box-animation:active{
|
||||
box-shadow: 1px 10px 10px -10px rgba(0,0,24,0.5);
|
||||
transform: scale(1.2);
|
||||
.hover-shadow-box-animation:hover,
|
||||
.hover-shadow-box-animation:focus,
|
||||
.hover-shadow-box-animation:active {
|
||||
box-shadow: 1px 10px 10px -10px rgba(0, 0, 24, 0.5);
|
||||
transform: scale(1.2);
|
||||
}
|
||||
```
|
||||
|
||||
#### Demo
|
||||
|
||||
<div class = "snippet-demo">
|
||||
@ -47,9 +50,9 @@ Creates a shadow box around the text whern it is hovered.
|
||||
box-shadow: 1px 10px 10px -10px rgba(0,0,24,0.1);
|
||||
transform: scale(1.2);
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
#### Explanation
|
||||
#### Explanation
|
||||
|
||||
1. `display: inline-block` to set width and length for `p` element thus making it an `inline-block`.
|
||||
2. Set `transform: perspective(1px)` to give element a 3D space by affecting the distance between the Z plane and the user and `translate(0)` to reposition the `p` element along z-axis in 3D space.
|
||||
@ -59,13 +62,11 @@ Creates a shadow box around the text whern it is hovered.
|
||||
6. `:hover` to activate whole css when hovering is done until `active`.
|
||||
7. `transform: scale(1.2)` to change the scale, magnifying the text.
|
||||
|
||||
|
||||
#### Browser Support
|
||||
|
||||
<span class="snippet__support-note">✅ No caveats.</span>
|
||||
|
||||
* https://caniuse.com/#feat=transforms3d
|
||||
* https://caniuse.com/#feat=css-transitions
|
||||
|
||||
- https://caniuse.com/#feat=transforms3d
|
||||
- https://caniuse.com/#feat=css-transitions
|
||||
|
||||
<!-- tags: animation -->
|
||||
|
||||
Reference in New Issue
Block a user