استایل زیبا برای Text Input و Label ( نمونه 7)

ساخت وبلاگ

@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700,600,300,800);

* {

  box-sizing: border-box;

}

html,

body {

  overflow-x: hidden;

  font-family: "Open Sans", sans-serif;

  font-weight: 300;

  color: #fff;

  background: #134A46;

  text-align: center;

}

span {

  position: relative;

  display: inline-block;

  margin: 45px 10px;

}

.swing {

  display: inline-block;

  width: 215px;

  padding: 10px 0 10px 15px;

  font-family: "Open Sans", sans;

  font-weight: 400;

  color: #377D6A;

  background: #efefef;

  border: 0;

  border-radius: 3px;

  outline: 0;

  text-indent: 60px;

  transition: all .3s ease-in-out;

}

.swing::-webkit-input-placeholder {

  color: #efefef;

  text-indent: 0;

  font-weight: 300;

}

.swing + label {

  display: inline-block;

  position: absolute;

  top: 0;

  left: 0;

  padding: 10px 15px;

  text-shadow: 0 1px 0 rgba(19, 74, 70, 0.4);

  background: #7AB893;

  border-top-left-radius: 3px;

  border-bottom-left-radius: 3px;

  transform-origin: 2px 2px;

  transform: rotate(0);

  animation: swing-back .4s 1 ease-in-out;

}

@keyframes swing {

  0% {

    transform: rotate(0);

  }

  20% {

    transform: rotate(116deg);

  }

  40% {

    transform: rotate(60deg);

  }

  60% {

    transform: rotate(98deg);

  }

  80% {

    transform: rotate(76deg);

  }

  100% {

    transform: rotate(82deg);

  }

}

@keyframes swing-back {

  0% {

    transform: rotate(82deg);

  }

  100% {

    transform: rotate(0);

  }

}

.swing:focus,

.swing:active {

  color: #377D6A;

  text-indent: 0;

  background: #fff;

  border-top-left-radius: 0;

  border-bottom-left-radius: 0;

}

.swing:focus::-webkit-input-placeholder,

.swing:active::-webkit-input-placeholder {

  color: #aaa;

}

.swing:focus + label,

.swing:active + label {

  animation: swing 1.4s 1 ease-in-out;

  transform: rotate(82deg);

}

- - , .

سون لرن • آموزش...
ما را در سایت سون لرن • آموزش دنبال می کنید

برچسب : نویسنده : استخدام کار 7learn بازدید : 331 تاريخ : سه شنبه 29 دی 1394 ساعت: 18:04

خبرنامه