input.scss 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. $border: #008b8b;
  2. $border-focus: #008b8b;
  3. $brand-color: #1b3d4d;
  4. $booking-green: #02595a;
  5. $asphalt: #506982;
  6. @mixin border-radius($v) {
  7. -moz-border-radius: $v;
  8. -webkit-border-radius: $v;
  9. border-radius: $v;
  10. }
  11. @mixin transition($v...) {
  12. -moz-transition: $v;
  13. -o-transition: $v;
  14. -webkit-transition: $v;
  15. transition: $v;
  16. }
  17. @mixin appearance($v) {
  18. -moz-appearance: $v;
  19. -webkit-appearance: $v;
  20. }
  21. .form-group {
  22. margin-bottom: 20px;
  23. }
  24. .controls {
  25. text-align: left;
  26. position: relative;
  27. width: 100%;
  28. margin-top: 5px;
  29. margin-bottom: 10px;
  30. input[type="text"],
  31. input[type="email"],
  32. input[type="number"],
  33. input[type="date"],
  34. input[type="tel"],
  35. textarea,
  36. button,
  37. select {
  38. padding: 18px 12px 10px;
  39. font-size: 14px;
  40. border: 1px solid $border;
  41. width: 100%;
  42. margin-bottom: 18px;
  43. color: $booking-green;
  44. font-family: 'Lato', 'sans-serif';
  45. font-size: 16px;
  46. font-weight: 300;
  47. @include border-radius(2px);
  48. @include transition(all .3s);
  49. background: #f3fffe;
  50. &:focus, &:hover {
  51. outline: none;
  52. border-color: $border-focus;
  53. + label {
  54. color: $border-focus;
  55. cursor: text;
  56. }
  57. }
  58. }
  59. .fa-sort {
  60. position: absolute;
  61. right: 10px;
  62. top: 17px;
  63. color: #999;
  64. }
  65. select {
  66. @include appearance(none);
  67. cursor: pointer;
  68. }
  69. label {
  70. position: absolute;
  71. left: 8px;
  72. top: 12px;
  73. width: auto;
  74. color: $booking-green;
  75. font-size: 16px;
  76. display: inline-block;
  77. padding: 4px 10px;
  78. font-weight: 400;
  79. background-color: transparent;
  80. @include transition(color .3s, top .3s, background-color .8s);
  81. &.active {
  82. top: -16px;
  83. color: $booking-green;
  84. background-color: #f3fffe;
  85. width: auto;
  86. }
  87. }
  88. textarea {
  89. resize: none;
  90. height: 200px;
  91. }
  92. button {
  93. cursor: pointer;
  94. background-color: $booking-green;
  95. border: none;
  96. color: #fff;
  97. padding: 12px 0;
  98. float: right;
  99. &:hover {
  100. background-color: lighten($brand-color, 5%);
  101. }
  102. }
  103. }
  104. .clear:after {
  105. content: "";
  106. display: table;
  107. clear: both;
  108. }
  109. $clolr: #0077FF;
  110. $inp-Color: #008b8b;
  111. /*<label for="inp" class="inp">
  112. <input type="text" id="inp" placeholder="&nbsp;">
  113. <span class="label">Label</span>
  114. <span class="focus-bg"></span>
  115. </label>*/
  116. .inp {
  117. position: relative;
  118. margin: auto;
  119. width: 100%;
  120. min-width: 280px;
  121. border-radius: 3px;
  122. overflow: hidden;
  123. margin-bottom: 10px;
  124. .inp-label {
  125. position: absolute;
  126. top: 18px;
  127. left: 12px;
  128. font-size: 18px;
  129. color: $inp-Color;
  130. font-weight: 500;
  131. -webkit-transform-origin: 0 0;
  132. transform-origin: 0 0;
  133. -webkit-transform: translate3d(0, 0, 0);
  134. transform: translate3d(0, 0, 0);
  135. -webkit-transition: all 0.2s ease;
  136. transition: all 0.2s ease;
  137. pointer-events: none;
  138. background: transparent;
  139. }
  140. .focus-bg {
  141. position: absolute;
  142. top: 0;
  143. left: 0;
  144. width: 100%;
  145. height: 100%;
  146. background: rgba(0, 0, 0, 0.05);
  147. z-index: -1;
  148. -webkit-transform: scaleX(0);
  149. transform: scaleX(0);
  150. -webkit-transform-origin: left;
  151. transform-origin: left;
  152. }
  153. input, select {
  154. -webkit-appearance: none;
  155. -moz-appearance: none;
  156. appearance: none;
  157. width: 100%;
  158. border: 0;
  159. font-family: inherit;
  160. padding: 16px 12px 0 12px;
  161. height: 56px;
  162. font-size: 16px;
  163. font-weight: 400;
  164. background: rgba(0, 0, 0, 0.05);
  165. //box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.3);
  166. color: $inp-Color;
  167. -webkit-transition: all 0.15s ease;
  168. transition: all 0.15s ease;
  169. box-shadow: inset 0 -2px 0 $inp-Color;
  170. &:hover {
  171. background: rgba(0, 0, 0, 0.08);
  172. box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.5);
  173. }
  174. &:not(:placeholder-shown) + .inp-label {
  175. color: $inp-Color;
  176. -webkit-transform: translate3d(0, -12px, 0) scale(0.9);
  177. transform: translate3d(0, -12px, 0) scale(0.9);
  178. }
  179. &:focus {
  180. background: rgba(0, 0, 0, 0.1);
  181. outline: none;
  182. box-shadow: inset 0 -2px 0 $clolr;
  183. + .inp-label {
  184. color: $clolr;
  185. -webkit-transform: translate3d(0, -12px, 0) scale(0.85);
  186. transform: translate3d(0, -12px, 0) scale(0.85);
  187. }
  188. + .inp-label + .focus-bg {
  189. -webkit-transform: scaleX(1);
  190. transform: scaleX(1);
  191. -webkit-transition: all 0.1s ease;
  192. transition: all 0.1s ease;
  193. }
  194. }
  195. }
  196. }