diff options
-rw-r--r-- | static/website/css/nice-bar.css | 3 | ||||
-rw-r--r-- | static/website/js/nice-bar.js | 30 |
2 files changed, 31 insertions, 2 deletions
diff --git a/static/website/css/nice-bar.css b/static/website/css/nice-bar.css index 6388690..e43fb89 100644 --- a/static/website/css/nice-bar.css +++ b/static/website/css/nice-bar.css @@ -8,7 +8,7 @@ width: 1200px; margin: 0 auto; padding: 12px 0; - color: #ffffff; + color: #000; font-weight: bold; } .nice-bar .nice-button { @@ -26,6 +26,7 @@ float: right; padding: 1px 7px 2px 7px; background: #111111; + color:#fff; -webkit-border-radius: 3px; -moz-border-radius: 3px; -o-border-radius: 3px; diff --git a/static/website/js/nice-bar.js b/static/website/js/nice-bar.js index b27ba2b..b3b6ef8 100644 --- a/static/website/js/nice-bar.js +++ b/static/website/js/nice-bar.js @@ -1,6 +1,34 @@ $(document).ready(function() { - $(".nice-bar").slideDown(); + var pos = 'out'; + var bak = [ '#d7eab0','#27ae60','#34495e']; + var random = Math.floor(Math.random()*1); + var $cur = $('.nice-text').eq(random); + $('.nice-text').hide(); + $cur.show(); + $('.nice-bar').css('background', bak[random]); + $(".nice-bar").slideDown(function() { + var i = random; + setInterval(function() { + if(pos == 'out') { + i = (i == 1) ? 0 : ++i; // [0, 1, 2] since 3 events + $('.nice-text').hide(); + $cur = $('.nice-text').eq(i); + $('.nice-bar').css('background', bak[i]); + $cur.show(); + } + }, 3500); + }); + + $('.nice-bar').mouseenter(function() { + pos = 'in'; + console.log(pos); + }).mouseleave(function() { + pos = 'out'; + console.log(pos); + }); + $(".nice-close").click(function() { $(".nice-bar").slideUp(); }); }); + |