awselect.scss 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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. > .value {
  160. opacity: 0;
  161. }
  162. }
  163. }
  164. > .expand_background {
  165. height:100%;
  166. }
  167. }
  168. &.animate2{
  169. > .expand_background {
  170. box-shadow:0px 11px 43px 11px rgba(0, 0, 0, 0.11);
  171. }
  172. .expand_frame {
  173. transform:translateY(0px);
  174. opacity:1;
  175. }
  176. }
  177. &.placeholder_animate {
  178. >.frame {
  179. .value {
  180. opacity:0;
  181. }
  182. }
  183. }
  184. &.placeholder_animate2 {
  185. .frame {
  186. .placeholder {
  187. transform:translateY(0);
  188. opacity:1;
  189. }
  190. }
  191. }
  192. &.transition_paused {
  193. transition:none!important;
  194. }
  195. &.animate > .expand_frame,
  196. &.animating > .expand_frame{
  197. display: block;
  198. }
  199. &.animating > .frame > .content > .value {
  200. opacity: 0;
  201. }
  202. &:not(.animate):not(.animating) {
  203. > .expand_frame{
  204. display: none;
  205. }
  206. > .expand_background {
  207. transform: scaleY(0);
  208. }
  209. }
  210. &:not(.animate) > .frame > .content > .value + .placeholder {
  211. transform:translateY(20px);
  212. opacity:0;
  213. }
  214. }
  215. .aw_cursor_pointer {
  216. float:left;
  217. width:20px;
  218. height:20px;
  219. border-radius:100%;
  220. background:#ddd;
  221. overflow:hidden;
  222. padding:5px;
  223. @include transition();
  224. transform:scale(0.5);
  225. .inner {
  226. float: left;
  227. width: 100%;
  228. height: 0;
  229. background: #fff;
  230. border-radius: 100%;
  231. @include transition();
  232. }
  233. &.animate {
  234. transform: scale(1);
  235. .inner {
  236. height:100%;
  237. }
  238. }
  239. }
  240. .immersive_shadow{
  241. position: relative;
  242. float: left;
  243. }