gavin19

Search bar animation

Oct 23rd, 2016
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 1.31 KB | None | 0 0
  1. .side #search {
  2.     position: relative;
  3. }
  4. .side #search input[type="text"] {
  5.     border-color: transparent;
  6.     box-shadow: 0 0 1px 1px #808080;
  7. }
  8. #searchexpando {
  9.     position: absolute;
  10.     width: 280px;
  11. }
  12. .side #search:before,
  13. .side #search:after {
  14.     content: '';
  15.     position: absolute;
  16.     left: 0;
  17.     right: 0;
  18.     background: -webkit-linear-gradient(left, #03A9F4, #fff 30%);
  19.     background: linear-gradient(to right, #03A9F4, #fff 30%);
  20.     height: 2px;
  21.     -webkit-animation: srch 5s linear infinite;
  22.     animation: srch 5s linear infinite;
  23. }
  24. .side #search:before {
  25.     top: 0;
  26. }
  27. .side #search:after {
  28.     background: -webkit-linear-gradient(left, #fff 70%, #03A9F4 100%);
  29.     background: linear-gradient(to right, #fff 70%, #03A9F4 100%);
  30.     bottom: 0;
  31.     -webkit-animation: srch2 5s 2.5s linear infinite;
  32.     animation: srch2 5s 2.5s linear infinite;
  33. }
  34. @-webkit-keyframes srch {
  35.     from { background-position: 0 0 ; }
  36.     to { background-position: -300px 0; }
  37. }
  38. @-webkit-keyframes srch2 {
  39.     from { background-position: 0 0 ; }
  40.     to { background-position: 300px 0; }
  41. }
  42. @keyframes srch {
  43.     from { background-position: 0 0 ; }
  44.     to { background-position: -300px 0; }
  45. }
  46. @keyframes srch2 {
  47.     from { background-position: 0 0 ; }
  48.     to { background-position: 300px 0; }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment