input.css 5.7 KB

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