dropdown.scss 2.4 KB

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