Last active
May 23, 2019 05:26
-
-
Save KoryNunn/5db80f3a6a402f1be9d906aebaebe0ca to your computer and use it in GitHub Desktop.
no js toast
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style> | |
@keyframes toast { | |
0% { | |
opacity: 1 | |
} | |
80% { | |
opacity: 1; | |
} | |
100% { | |
opacity: 0; | |
} | |
} | |
@keyframes toastout { | |
0% { | |
opacity: 1 | |
} | |
100% { | |
opacity: 0; | |
} | |
} | |
input[type="checkbox"]{ | |
opacity: 0; | |
-webkit-appearance: none; | |
animation-iteration-count: 1; | |
animation-duration: 5s; | |
animation-name: toast; | |
} | |
input[type="checkbox"]:after{ | |
content:attr(text) | |
} | |
input[type="checkbox"]:checked{ | |
animation-duration: 1s; | |
animation-name: toastout; | |
pointer-events: none; | |
} | |
</style> | |
</head> | |
<body> | |
<input type="checkbox" text="This toast will dissapear in 5s, unless you click it." /> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment