awselect.scss 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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. $placeholder_color: #000;
  8. $link_color: #000;
  9. @mixin transition() {
  10. -webkit-transition:.4s cubic-bezier(.19,1,.22,1);
  11. -moz-transition:.4s cubic-bezier(.19,1,.22,1);
  12. -o-transition:.4s cubic-bezier(.19,1,.22,1);
  13. transition: .4s cubic-bezier(.19,1,.22,1);
  14. }
  15. @mixin faster_transition() {
  16. -webkit-transition:0.2s ease-in;
  17. -moz-transition:0.2s ease-in;
  18. -o-transition:0.2s ease-in;
  19. transition: 0.2s ease-in;
  20. }
  21. .immersive_awselect {
  22. overflow:hidden!important;
  23. }
  24. .awselect_immersive_background {
  25. position:fixed;
  26. z-index:999;
  27. left:0;
  28. top:0;
  29. width:100%;
  30. height:100%;
  31. opacity:0;
  32. background:rgba(0,0,0,0.8);
  33. @include faster_transition();
  34. &.animate {
  35. opacity:1;
  36. }
  37. }
  38. .awselect {
  39. --awselect_frame_padding_x: 40px;
  40. --awselect_frame_padding_y: 10px;
  41. --awselect_frame_padding_t: unset;
  42. --awselect_frame_padding_r: unset;
  43. --awselect_frame_padding_b: unset;
  44. --awselect_frame_padding_l: unset;
  45. --awselect_option_padding_x: unset;
  46. --awselect_option_padding_y: 5px;
  47. --awselect_options_margin: 10px 0;
  48. --awselect_icon_color: unset;
  49. --awselect_placeholder_color: green;
  50. --awselect_expand_placeholder_color: unset;
  51. float:left;
  52. width:100%;
  53. position:relative;
  54. cursor:pointer;
  55. background: var(--awselect_background, #e5e5e5);
  56. @include transition();
  57. > .expand_background {
  58. background: var(--awselect_active_background, #fff);
  59. height:0;
  60. float:left;
  61. width:100%;
  62. position:absolute;
  63. z-index:1;
  64. transform-origin: top;
  65. @include transition();
  66. }
  67. > .frame {
  68. position:relative;
  69. padding: var(--awselect_frame_padding_y, var(--awselect_frame_padding_t, 10px) var(--awselect_frame_padding_r, 40px)) var(--awselect_frame_padding_x, var(--awselect_frame_padding_b, 10px) var(--awselect_frame_padding_l, 40px));
  70. color : $placeholder_color;
  71. float:left;
  72. width:100%;
  73. .content {
  74. float:left;
  75. width:100%;
  76. position:relative;
  77. z-index:2;
  78. color: var(--awselect_placeholder_color, #000);
  79. }
  80. span {
  81. @include transition();
  82. float:left;
  83. width:100%;
  84. color:inherit;
  85. }
  86. .value {
  87. position:absolute;
  88. left:0;
  89. }
  90. .placeholder {
  91. position:relative;
  92. }
  93. .icon {
  94. float: right;
  95. position: absolute;
  96. right: 0;
  97. top: 50%;
  98. transform: rotate(180deg) translateY(-50%);
  99. transform-origin: center 0;
  100. fill: var(--awselect_icon_color, var(--awselect_placeholder_color, #000));
  101. @include transition();
  102. svg {
  103. width:10px;
  104. height:10px;
  105. }
  106. }
  107. }
  108. .expand_frame {
  109. z-index:2;
  110. position:absolute;
  111. padding:0;
  112. @include transition();
  113. transform:translateY(20px);
  114. opacity:0;
  115. float:left;
  116. width:100%;
  117. max-height:200px;
  118. overflow: hidden;
  119. display:none;
  120. top: 100%;
  121. &.overflow {
  122. overflow-y:scroll;
  123. }
  124. > ul {
  125. float:left;
  126. padding:0;
  127. width:100%;
  128. color: var(--awselect_options_color, #000);
  129. margin: var(--awselect_options_margin);
  130. li {
  131. float:left;
  132. width:100%;
  133. display:block;
  134. a {
  135. padding: var(--awselect_option_padding_y, var(--awselect_frame_padding_y, var(--awselect_frame_padding_t, 10px) var(--awselect_frame_padding_r, 40px)))
  136. var(--awselect_option_padding_x, var(--awselect_frame_padding_x, var(--awselect_frame_padding_b, 10px) var(--awselect_frame_padding_l, 40px)));
  137. color:inherit;
  138. opacity:0.8;
  139. float:left;
  140. width:100%;
  141. @include transition();
  142. &:hover {
  143. background:rgba(0,0,0,0.07);
  144. opacity:1;
  145. }
  146. }
  147. }
  148. }
  149. }
  150. &.animate {
  151. z-index:9999;
  152. > .frame {
  153. .icon {
  154. color: var(--awselect_expand_icon_color, var(--awselect_icon_color, var(--awselect_placeholder_color, #000)));
  155. transform: rotate(0deg) translateY(-50%);
  156. }
  157. > .content {
  158. color: var(--awselect_expand_placeholder_color, var(--awselect_placeholder_color, #000));
  159. }
  160. }
  161. > .expand_background {
  162. height:100%;
  163. }
  164. }
  165. &.animate2{
  166. > .expand_background {
  167. box-shadow:0px 11px 43px 11px rgba(0, 0, 0, 0.11);
  168. }
  169. .expand_frame {
  170. transform:translateY(0px);
  171. opacity:1;
  172. }
  173. }
  174. &.placeholder_animate {
  175. >.frame {
  176. .value {
  177. opacity:0;
  178. }
  179. }
  180. }
  181. &.placeholder_animate2 {
  182. .frame {
  183. .placeholder {
  184. transform:translateY(0);
  185. opacity:1;
  186. }
  187. }
  188. }
  189. &.transition_paused {
  190. transition:none!important;
  191. }
  192. &.animate > .expand_frame,
  193. &.animating > .expand_frame{
  194. display: block;
  195. }
  196. &:not(.expand) > .expand_background {
  197. transform: scaleY(0);
  198. }
  199. &:not(.animate) > .frame > .content > .value + .placeholder {
  200. transform:translateY(20px);
  201. opacity:0;
  202. }
  203. }
  204. .aw_cursor_pointer {
  205. float:left;
  206. width:20px;
  207. height:20px;
  208. border-radius:100%;
  209. background:#ddd;
  210. overflow:hidden;
  211. padding:5px;
  212. @include transition();
  213. transform:scale(0.5);
  214. .inner {
  215. float: left;
  216. width: 100%;
  217. height: 0;
  218. background: #fff;
  219. border-radius: 100%;
  220. @include transition();
  221. }
  222. &.animate {
  223. transform: scale(1);
  224. .inner {
  225. height:100%;
  226. }
  227. }
  228. }
  229. .immersive_shadow{
  230. position: relative;
  231. float: left;
  232. }