Skip to content

Instantly share code, notes, and snippets.

@KoryNunn
Last active May 23, 2019 05:26
Show Gist options
  • Save KoryNunn/5db80f3a6a402f1be9d906aebaebe0ca to your computer and use it in GitHub Desktop.
Save KoryNunn/5db80f3a6a402f1be9d906aebaebe0ca to your computer and use it in GitHub Desktop.
no js toast
<!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