LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code

Inspired by @Sergey over on dribbble. <3

note: this will only work on http://

CSS
@import url(https://fonts.googleapis.com/css?family=Ubuntu:300,500);
body {
  background: #423852;
  overflow: hidden;
}

.container {
  position: absolute;
  width: 348px;
  margin-left: -174px;
  top: 41px;
  left: 50%;
  border-radius: 0 0 4px 4px;
  overflow: hidden;
  z-index: 1;
}
.container .nav * {
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}
.container .nav,
.container .nav__item {
  padding: 0;
  margin: 0;
  list-style: none;
  text-align: center;
}
.container .nav {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  background: #5C4D6F;
  z-index: 1;
}
.container .nav__item {
  -webkit-box-flex: 1;
      -ms-flex-positive: 1;
          flex-grow: 1;
  width: 60px;
  padding: 0.8em 0;
  color: rgba(255, 255, 255, 0.5);
  z-index: 3;
  cursor: pointer;
  -webkit-transition: color 0.4s ease 0.4s;
  transition: color 0.4s ease 0.4s;
}
.container .nav__item i {
  font-size: 1.4em;
  font-weight: 100;
  height: 51px;
}
.container .nav__item.selected, .container .nav__item:hover {
  color: white;
}
.container .nav__item:hover {
  -webkit-transition: color 0.2s ease;
  transition: color 0.2s ease;
}

.jelly {
  background-image: -webkit-linear-gradient(left, #3498db 0%, #3498db 20%, #1abc9c 20%, #1abc9c 40%, #e75c56 40%, #e75c56 60%, #fabb74 60%, #fabb74 80%, #de6596 80%, #de6596 100%);
  background-image: linear-gradient(to right, #3498db 0%, #3498db 20%, #1abc9c 20%, #1abc9c 40%, #e75c56 40%, #e75c56 60%, #fabb74 60%, #fabb74 80%, #de6596 80%, #de6596 100%);
  background-attachment: fixed;
  background-position: 50%;
  background-size: 348px;
  height: 51px;
  top: 0;
  position: absolute;
  -webkit-transform: translate3d(0px, 0px, 1px);
          transform: translate3d(0px, 0px, 1px);
  -webkit-transition: background 0.1s cubic-bezier(0.94, 0.12, 0.29, 0.92), left 0.1s cubic-bezier(0.24, 0.84, 0.53, 1), right 0.1s cubic-bezier(0.24, 0.84, 0.53, 1);
  transition: background 0.1s cubic-bezier(0.94, 0.12, 0.29, 0.92), left 0.1s cubic-bezier(0.24, 0.84, 0.53, 1), right 0.1s cubic-bezier(0.24, 0.84, 0.53, 1);
}
.jelly.left {
  -webkit-transition: background 0.6s cubic-bezier(0.94, 0.12, 0.29, 0.92), left 0.6s cubic-bezier(0.94, 0.12, 0.29, 0.92), right 0.3s cubic-bezier(0.24, 0.84, 0.53, 1) 0.35s;
  transition: background 0.6s cubic-bezier(0.94, 0.12, 0.29, 0.92), left 0.6s cubic-bezier(0.94, 0.12, 0.29, 0.92), right 0.3s cubic-bezier(0.24, 0.84, 0.53, 1) 0.35s;
}
.jelly.right {
  -webkit-transition: background 0.6s cubic-bezier(0.94, 0.12, 0.29, 0.92), right 0.6s cubic-bezier(0.94, 0.12, 0.29, 0.92), left 0.3s cubic-bezier(0.24, 0.84, 0.53, 1) 0.35s;
  transition: background 0.6s cubic-bezier(0.94, 0.12, 0.29, 0.92), right 0.6s cubic-bezier(0.94, 0.12, 0.29, 0.92), left 0.3s cubic-bezier(0.24, 0.84, 0.53, 1) 0.35s;
}

.iphone {
  background: url(https://2.bp.blogspot.com/-6hlrTw0hxdQ/VA9aSOz9Y1I/AAAAAAAAkXE/BekM0IzyPrU/s1600/Imagenes%2Biphone%2B6%2Bpng%2B3.png);
  background-position: 1px bottom;
  background-size: cover;
  width: 801px;
  height: 200px;
  position: absolute;
  left: 50%;
  margin-left: -400px;
}

label {
  color: white;
  font-family: ubuntu;
  font-weight: 100;
  position: absolute;
  left: 50%;
  top: 20px;
  margin-left: 100px;
  width: 400px;
  text-align: center;
  line-height: 40px;
  vertical-align: middle;
}
label input {
  position: relative;
  top: 2px;
  margin: 5px;
}

p {
  font-family: ubuntu;
  font-weight: 100;
  position: absolute;
  width: 100%;
  text-align: center;
  top: 200px;
  color: #e8dbff;
}
p a {
  color: #6be1ff;
  font-weight: bold;
}
p:last-of-type {
  top: 230px;
  font-style: italic;
}
JS
var w = $(".container li").first().width();
//var h = $(".container li").first().outerHeight();

var move = function(x) {
	
    if( $.type(x) === "number" ) {
        var l = x;
    } else if( x instanceof $ ) {
        var l = x.position().left;
    } else {
        l = 0;
    }

    var r = $(".container").width() - (w + l);
    var original = $(".jelly").position().left;
    var dir = "right";

    $(".jelly").removeClass("left right");

    if( l < original ) {
        dir = "left";
    }
    
    $(".jelly")
        .addClass( dir )
        .css("left", l )
        .css("right", r );
        
	$(x)
        .addClass("selected")
        .siblings()
        .removeClass("selected");

}

var p = 1;
move($(".nav__item").eq(0));
var ii = setInterval(function() {
   if(p>=5){p=0;}
	move($(".nav__item").eq(p));
    p++;
},2000);

$("ul > li").on("click", function() {
    
    clearInterval(ii);
	move($(this));
	
});

//$(".jelly").css("height", h );


$("input[type=checkbox]").on("change", function() {
   
    if($(this).is(":checked")) {
        $(".jelly").css("background", "#1abc9c");
    } else {
        $(".jelly").css("background", "");
    }
    
}).trigger("change");
Host Instantly Drag and Drop Website Builder

 

Description

Based on this sexy UI concept: https://dribbble.com/shots/2071319-GIF-of-the-Tapbar-Interactions
Term
Mon, 11/27/2017 - 21:55

Related Codes

Pen ID
Pen ID
Pen ID