dropdown.scss 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. }
  52. .current_value {
  53. position:absolute;
  54. }
  55. .placeholder {
  56. position:relative;
  57. }
  58. .icon {
  59. float: right;
  60. position: absolute;
  61. right: 40px;
  62. top: 50%;
  63. transform: rotate(180deg) translateY(-50%);
  64. transform-origin: center 0;
  65. @include transition();
  66. svg {
  67. width:10px;
  68. height:10px;
  69. }
  70. }
  71. }
  72. .back_face {
  73. z-index:2;
  74. position:absolute;
  75. padding:0 20px;
  76. @include transition();
  77. transform:translateY(20px);
  78. opacity:0;
  79. float:left;
  80. width:100%;
  81. ul {
  82. float:left;
  83. width:100%;
  84. li {
  85. float:left;
  86. width:100%;
  87. display:block;
  88. a {
  89. color:inherit;
  90. opacity:0.8;
  91. @include transition();
  92. &:hover {
  93. opacity:1;
  94. }
  95. }
  96. }
  97. }
  98. }
  99. &.dark_scheme {
  100. }
  101. &.animate {
  102. z-index:3;
  103. height:100%!important;
  104. .front_face {
  105. .icon {
  106. transform: rotate(0deg) translateY(-50%);
  107. }
  108. }
  109. > .bg {
  110. height:100%;
  111. }
  112. }
  113. &.animate2{
  114. > .bg {
  115. box-shadow:0px 11px 43px 11px rgba(0, 0, 0, 0.11);
  116. }
  117. .back_face {
  118. transform:translateY(0px);
  119. opacity:1;
  120. }
  121. }
  122. &.hasValue {
  123. .front_face {
  124. .placeholder {
  125. transform:translateY(20px);
  126. opacity:0;
  127. }
  128. }
  129. }
  130. &.placeholder_animate {
  131. .front_face {
  132. .current_value {
  133. opacity:0;
  134. }
  135. }
  136. }
  137. &.placeholder_animate2 {
  138. .front_face {
  139. .placeholder {
  140. transform:translateY(0);
  141. opacity:1;
  142. }
  143. }
  144. }
  145. }