► Mai Văn Linh ◄
DienDanIT 2018
Đơn giản, nhỏ nhắn xinh xắn, khoản mấy dòng thôi, không nhìu
CODE
CODE
Mã:
<!DOCTYPE html>
<html lang="vi">
<head>
<title>Alertify - AniHay.Tv</title>
<meta name="author" value="RIOTDZ" />
<meta name="url" value="https://anihay.tv" />
</head>
<body>
<style>
.alertify-logs{right: 16px; position: fixed; top: 60px;}
.alertify-logs>* {transition: all .4s cubic-bezier(.25,.8,.25,1);display: block;font-size: 12px;right: -150%;position: relative;padding: 10px 35px 10px 15px;color: #fff;margin-bottom: 15px;letter-spacing: 1px;clear: both;float: right;}
.alertify-logs>.success{background-color: #34a853;}
.alertify-logs>.error{background-color: #ea4335;}
.alertify-logs>.show{right: 0;}
</style>
<input type="submit" onclick="alertify('AniHay.Tv', 'success')" value="AniHay.Tv / Success">
<div class="alertify-logs"></div>
<script>
function alertify(e,i) {
if(i !== 'success' && i !== 'error') return console.log('Vãi đái =)))');
var c = document.createElement('div');
c.className = i, c.innerHTML = e;
document.querySelector('.alertify-logs').appendChild(c),setTimeout(function(){ c.classList.add('show'); }, 200);
setTimeout(function() { c.classList.remove('show'), c.classList.add("hide"), setTimeout(function() { c && c.parentNode && c.parentNode.removeChild(c) }, 400); }, 3000);
}
</script>
</body>
</html>
HDSD: Dán hết code lên một file nào đó rồi truy cập.
Tiếp theo thì CTRL + SHIFT + J copy " alertify('AniHay.Tv','success'); hoặc alertify('AniHay.Tv','error'); " và paste và enter
Hoặc Click vào nút "AniHay.Tv / Success"
Hiện tại mình xài "success" với "error" thôi, bạn nào muốn thêm warning hay gì đó thì tự tùy biến vào nhé có 1 2 dòng thôi =))
DEMO
"Success" || "Error"
Tiếp theo thì CTRL + SHIFT + J copy " alertify('AniHay.Tv','success'); hoặc alertify('AniHay.Tv','error'); " và paste và enter
Hoặc Click vào nút "AniHay.Tv / Success"
Hiện tại mình xài "success" với "error" thôi, bạn nào muốn thêm warning hay gì đó thì tự tùy biến vào nhé có 1 2 dòng thôi =))
DEMO
"Success" || "Error"