summaryrefslogtreecommitdiff
path: root/static/website/js/nice-bar.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/website/js/nice-bar.js')
-rw-r--r--static/website/js/nice-bar.js30
1 files changed, 29 insertions, 1 deletions
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();
});
});
+