Created
June 19, 2017 16:26
-
-
Save jordangray/ea08a7abef4bbdcf02aba80abee66e2c to your computer and use it in GitHub Desktop.
Automasking
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
/** | |
* Automasking | |
*/ | |
.mask-content { | |
position: relative; | |
padding: .2em 0; | |
width: 1.2em; | |
text-align: center; | |
} | |
.mask-content:not([data-value=""]) { background: lightgreen; } | |
.mask-content:not([data-value=""]):before, | |
.mask-content:not([data-value=""]):after { | |
transition: opacity 1s step-end; | |
position: absolute; | |
} | |
.mask-content[data-value=""]:before { | |
content: attr(data-value); | |
opacity: 1; | |
} | |
.mask-content[data-value=""]:after { | |
content: '*'; | |
opacity: 0; | |
} | |
.mask-content:not([data-value=""]):before { | |
opacity: 1; | |
} | |
.mask-content:not([data-value=""]):after { | |
opacity: 1; | |
} |
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
<!-- content to be placed inside <body>…</body> --> | |
<div class="mask-content" data-value="2">_</div> |
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
// alert('Hello world!'); |
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
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment