welcome message

This commit is contained in:
Diego Najar 2018-10-01 17:15:29 +02:00
parent b388af6601
commit 4837ccb94b
2 changed files with 18 additions and 14 deletions

View File

@ -117,10 +117,13 @@ body.login {
} }
#good-message { #good-message {
margin-bottom: 20px; padding: 10px 0;
border: 1px solid #f1f1f1;
padding: 20px;
color: #777; color: #777;
margin-bottom: 20px;
}
#good-message span.oi {
top: 5px;
} }
.ct-series-a .ct-line { .ct-series-a .ct-line {

View File

@ -4,19 +4,20 @@
<!-- Good message --> <!-- Good message -->
<div> <div>
<h2 id="good-message">Hello!</h2> <h2 id="good-message"><span class="oi oi-heart"></span> Hello!</h2>
<script> <script>
$( document ).ready(function() { $( document ).ready(function() {
$("#good-message").fadeOut(1000, function() {
var date = new Date() var date = new Date()
var hours = date.getHours() var hours = date.getHours()
if (hours < 12) { if (hours < 12) {
$("#good-message").html("<?php echo $L->g('good-morning') ?>"); $(this).html('<span class="oi oi-sun"></span> <?php echo $L->g('good-morning') ?>');
} else if (hours < 18) { } else if (hours < 18) {
$("#good-message").html("<?php echo $L->g('good-afternoon') ?>"); $(this).html('<span class="oi oi-sun"></span> <?php echo $L->g('good-afternoon') ?>');
} else { } else {
$("#good-message").html("<?php echo $L->g('good-evening') ?>"); $(this).html('<span class="oi oi-sun"></span> <?php echo $L->g('good-evening') ?>');
} }
}).fadeIn(1000);
}); });
</script> </script>
</div> </div>