awselect.scss 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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:0 20px;
  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. @include transition();
  106. &:hover {
  107. opacity:1;
  108. }
  109. }
  110. }
  111. }
  112. }
  113. &.dark_scheme {
  114. }
  115. &.animate {
  116. z-index:3;
  117. height:100%!important;
  118. .front_face {
  119. .icon {
  120. transform: rotate(0deg) translateY(-50%);
  121. }
  122. }
  123. > .bg {
  124. height:100%;
  125. }
  126. }
  127. &.animate2{
  128. > .bg {
  129. box-shadow:0px 11px 43px 11px rgba(0, 0, 0, 0.11);
  130. }
  131. .back_face {
  132. transform:translateY(0px);
  133. opacity:1;
  134. }
  135. }
  136. &.hasValue {
  137. .front_face {
  138. .placeholder {
  139. transform:translateY(20px);
  140. opacity:0;
  141. }
  142. }
  143. }
  144. &.placeholder_animate {
  145. .front_face {
  146. .current_value {
  147. opacity:0;
  148. }
  149. }
  150. }
  151. &.placeholder_animate2 {
  152. .front_face {
  153. .placeholder {
  154. transform:translateY(0);
  155. opacity:1;
  156. }
  157. }
  158. }
  159. }