Last active
January 22, 2022 14:50
-
-
Save csssecrets/6cf33228089efef8a5ac to your computer and use it in GitHub Desktop.
Elastic transitions
This file contains 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
/** | |
* Elastic transitions | |
*/ | |
input:not(:focus) + .callout:not(:hover) { | |
transform: scale(0); | |
transition: .25s transform; | |
} | |
.callout { | |
transition: .5s cubic-bezier(.25,.1,.3,1.5) transform; | |
transform-origin: 1.4em -.4em; | |
} | |
/* Styling */ | |
body { | |
padding: 1.5em; | |
font: 200%/1.6 Baskerville; | |
} | |
input { | |
display: block; | |
padding: 0 .4em; | |
font: inherit; | |
} | |
.callout { | |
position: absolute; | |
max-width: 14em; | |
padding: .6em .8em; | |
border-radius: .3em; | |
margin: .3em 0 0 -.2em; | |
background: #fed; | |
border: 1px solid rgba(0,0,0,.3); | |
box-shadow: .05em .2em .6em rgba(0,0,0,.2); | |
font-size: 75%; | |
} | |
.callout:before { | |
content: ""; | |
position: absolute; | |
top: -.4em; | |
left: 1em; | |
padding: .35em; | |
background: inherit; | |
border: inherit; | |
border-right: 0; | |
border-bottom: 0; | |
transform: rotate(45deg); | |
} |
This file contains 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
<label> | |
Your username: | |
<input value="leaverou"></input> | |
<span class="callout"> | |
Only letters, numbers, underscores (_) and hyphens (-) allowed! | |
</span> | |
</label> |
This file contains 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
// alert('Hello world!'); |
This file contains 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
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment