awselect.scss 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. /**
  2. jQuery Awselect
  3. Developed by: Prev Wong
  4. Documentation: https://prevwong.github.io/awesome-select/
  5. Github: https://github.com/prevwong/awesome-select/
  6. **/
  7. $bg_color: #fff;
  8. $placeholder_color: #000;
  9. $link_color: #000;
  10. @mixin transition() {
  11. -webkit-transition:.4s cubic-bezier(.19,1,.22,1);
  12. -moz-transition:.4s cubic-bezier(.19,1,.22,1);
  13. -o-transition:.4s cubic-bezier(.19,1,.22,1);
  14. transition: .4s cubic-bezier(.19,1,.22,1);
  15. }
  16. .awselect {
  17. float:left;
  18. width:100%;
  19. position:relative;
  20. @include transition();
  21. > .bg {
  22. background:$bg_color;
  23. height:0%;
  24. float:left;
  25. width:100%;
  26. position:absolute;
  27. z-index:1;
  28. @include transition();
  29. }
  30. .front_face{
  31. position:relative;
  32. padding:20px 40px;
  33. color : $placeholder_color;
  34. float:left;
  35. width:100%;
  36. > .bg {
  37. position:absolute;
  38. z-index:0;
  39. float:left;
  40. width:100%;
  41. height:100%;
  42. left:0;
  43. background:#e5e5e5;
  44. top:0;
  45. }
  46. .content {
  47. float:left;
  48. width:100%;
  49. position:relative;
  50. z-index:2;
  51. }
  52. span {
  53. @include transition();
  54. float:left;
  55. width:100%;
  56. color:inherit;
  57. }
  58. .current_value {
  59. position:absolute;
  60. }
  61. .placeholder {
  62. position:relative;
  63. }
  64. .icon {
  65. float: right;
  66. position: absolute;
  67. right: 0px;
  68. top: 50%;
  69. transform: rotate(180deg) translateY(-50%);
  70. transform-origin: center 0;
  71. @include transition();
  72. svg {
  73. width:10px;
  74. height:10px;
  75. }
  76. }
  77. }
  78. .back_face {
  79. z-index:2;
  80. position:absolute;
  81. padding:0px;
  82. @include transition();
  83. transform:translateY(20px);
  84. opacity:0;
  85. float:left;
  86. width:100%;
  87. max-height:200px;
  88. overflow: hidden;
  89. display:none;
  90. &.overflow {
  91. overflow-y:scroll;
  92. }
  93. ul {
  94. margin:0;
  95. float:left;
  96. padding:0;
  97. width:100%;
  98. li {
  99. float:left;
  100. width:100%;
  101. display:block;
  102. a {
  103. color:inherit;
  104. opacity:0.8;
  105. float:left;
  106. width:100%;
  107. @include transition();
  108. &:hover {
  109. background:rgba(0,0,0,0.07);
  110. opacity:1;
  111. }
  112. }
  113. }
  114. }
  115. }
  116. &.dark_scheme {
  117. }
  118. &.animate {
  119. z-index:3;
  120. height:100%!important;
  121. .front_face {
  122. .icon {
  123. transform: rotate(0deg) translateY(-50%);
  124. }
  125. }
  126. > .bg {
  127. height:100%;
  128. }
  129. }
  130. &.animate2{
  131. > .bg {
  132. box-shadow:0px 11px 43px 11px rgba(0, 0, 0, 0.11);
  133. }
  134. .back_face {
  135. transform:translateY(0px);
  136. opacity:1;
  137. }
  138. }
  139. &.hasValue {
  140. .front_face {
  141. .placeholder {
  142. transform:translateY(20px);
  143. opacity:0;
  144. }
  145. }
  146. }
  147. &.placeholder_animate {
  148. .front_face {
  149. .current_value {
  150. opacity:0;
  151. }
  152. }
  153. }
  154. &.placeholder_animate2 {
  155. .front_face {
  156. .placeholder {
  157. transform:translateY(0);
  158. opacity:1;
  159. }
  160. }
  161. }
  162. }