A Pen by Saijo George on CodePen.
Created
May 30, 2021 07:30
-
-
Save CodeMyUI/ed33d6a385937a4596614218b802d0e0 to your computer and use it in GitHub Desktop.
CSS mouse-out transition effect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <h1>Hover Me</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| h1::before { | |
| transform: scaleX(0); | |
| transform-origin: bottom right; | |
| } | |
| h1:hover::before { | |
| transform: scaleX(1); | |
| transform-origin: bottom left; | |
| } | |
| h1::before { | |
| content: " "; | |
| display: block; | |
| position: absolute; | |
| top: 0; right: 0; bottom: 0; left: 0; | |
| inset: 0 0 0 0; | |
| background: hsl(200 100% 80%); | |
| z-index: -1; | |
| transition: transform .3s ease; | |
| } | |
| h1 { | |
| position: relative; | |
| font-size: 5rem; | |
| } | |
| html { | |
| block-size: 100%; | |
| inline-size: 100%; | |
| } | |
| body { | |
| min-block-size: 100%; | |
| min-inline-size: 100%; | |
| margin: 0; | |
| box-sizing: border-box; | |
| display: grid; | |
| place-content: center; | |
| font-family: system-ui, sans-serif; | |
| } | |
| @media (orientation: landscape) { | |
| body { | |
| grid-auto-flow: column; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <link href="https://gitcdn.xyz/repo/octoshrimpy/blokkfont/master/blokkfont.css" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment