_mixin.scss 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. @mixin flex($direction,$wrap,$align,$justify){
  2. display: -webkit-box;
  3. display: -moz-box;
  4. display: -ms-flexbox;
  5. display: -webkit-flex;
  6. display: flex;
  7. // row | row-reverse | column | column-reverse
  8. -webkit-flex-direction: $direction;
  9. -moz-flex-direction: $direction;
  10. -ms-flex-direction: $direction;
  11. flex-direction: $direction;
  12. // nowrap | wrap | wrap-reverse
  13. -webkit-flex-wrap: $wrap;
  14. -moz-flex-wrap: $wrap;
  15. -ms-flex-wrap: $wrap;
  16. flex-wrap: $wrap;
  17. // flex-start | flex-end | center | baseline | stretch
  18. -webkit-align-items: $align;
  19. -moz-align-items: $align;
  20. -ms-align-items: $align;
  21. -ms-flex-align: $align;
  22. align-items: $align;
  23. // flex-start | flex-end | center | space-between | space-around
  24. -webkit-justify-content: $justify;
  25. -moz-justify-content: $justify;
  26. -ms-justify-content: $justify;
  27. justify-content: $justify;
  28. -ms-flex-pack: $justify;
  29. }
  30. @mixin flex-grow($grow) {
  31. -webkit-flex-grow: $grow;
  32. -moz-flex-grow: $grow;
  33. -ms-flex-grow: $grow;
  34. flex-grow: $grow;
  35. }
  36. @mixin align-self($align) {
  37. -webkit-align-self: $align;
  38. -moz-align-self: $align;
  39. -ms-align-self: $align;
  40. align-self: $align;
  41. }
  42. @mixin transition{
  43. -webkit-transition:all .3s,width .3s,opacity .4s,border .1s,margin 0s,background .3s,width .5s,height .5s;
  44. -moz-transition: all .3s,width .3s,opacity .4s,border .1s,margin 0s,background .3s,width .5s,height .5s;
  45. -ms-transition:all .3s,width .3s,opacity .4s,border .1s,margin 0s,background .3s,width .5s,height .5s;
  46. -o-transition: all .3s,width .3s,opacity .4s,border .1s,margin 0s,background .3s,width .5s,height .5s;
  47. transition: all .3s,width .3s,opacity .4s,border .1s,margin 0s,background .3s,width .5s,height .5s;
  48. }
  49. @mixin transition($args...) {
  50. -webkit-transition: $args;
  51. -moz-transition: $args;
  52. -ms-transition: $args;
  53. -o-transition: $args;
  54. transition: $args;
  55. }
  56. /*@mixin transform($degree){
  57. -moz-transform: rotate($degree);
  58. -ms-transform: rotate($degree);
  59. -o-transform: rotate($degree);
  60. -webkit-transform: rotate($degree);
  61. transform: rotate($degree);
  62. }*/
  63. @mixin media-max($break-large){
  64. @media screen and (max-width: $break-large) {
  65. @content
  66. }
  67. }
  68. @mixin media-min($break-large){
  69. @media screen and (min-width: $break-large) {
  70. @content
  71. }
  72. }
  73. @mixin media-height-max($break-large){
  74. @media screen and (max-height: $break-large) {
  75. @content
  76. }
  77. }
  78. @mixin media-height-min($break-large){
  79. @media screen and (min-height: $break-large) {
  80. @content
  81. }
  82. }
  83. @mixin font-source-sans($size: false, $colour: false, $weight: false, $lh: false) {
  84. @if $size { font-size: $size; }
  85. @if $colour { color: $colour; }
  86. @if $weight { font-weight: $weight; }
  87. @if $lh { line-height: $lh; }
  88. }
  89. @mixin input-placeholder {
  90. &.placeholder { @content; }
  91. &:-moz-placeholder { @content; }
  92. &::-moz-placeholder { @content; }
  93. &:-ms-input-placeholder { @content; }
  94. &::-webkit-input-placeholder { @content; }
  95. }
  96. /*
  97. input,
  98. textarea {
  99. @include input-placeholder {
  100. color: $grey;
  101. }
  102. }
  103. */
  104. @mixin opacity($opacity) {
  105. opacity: $opacity;
  106. $opacity-ie: $opacity * 100;
  107. filter: alpha(opacity = $opacity-ie); //IE8
  108. }
  109. @mixin keyframes($name) {
  110. @-webkit-keyframes #{$name} {
  111. @content;
  112. }
  113. @-moz-keyframes #{$name} {
  114. @content;
  115. }
  116. @keyframes #{$name} {
  117. @content;
  118. }
  119. }
  120. @mixin gradient( $orientation,$start-color, $end-color) {
  121. background: $start-color;
  122. @if $orientation == 'vertical' {
  123. background: -webkit-linear-gradient(top, $start-color, $end-color);
  124. background: linear-gradient(to bottom, $start-color, $end-color);
  125. } @else if $orientation == 'horizontal' {
  126. background: -webkit-linear-gradient(left, $start-color, $end-color);
  127. background: linear-gradient(to right, $start-color, $end-color);
  128. } @else {
  129. background: -webkit-radial-gradient(center, ellipse cover, $start-color, $end-color);
  130. background: radial-gradient(ellipse at center, $start-color, $end-color);
  131. }
  132. }
  133. @mixin radius($border-radius){
  134. -webkit-border-radius:$border-radius;
  135. -moz-border-radius: $border-radius;
  136. border-radius: $border-radius;
  137. }
  138. @mixin box-shadow($value) {
  139. -webkit-box-shadow:$value;
  140. -moz-box-shadow: $value;
  141. box-shadow: $value;
  142. }
  143. @mixin animation ($delay, $duration) {
  144. -webkit-animation-delay: $delay;
  145. -webkit-animation-duration: $duration;
  146. /*-webkit-animation-name: $animation;*/
  147. -webkit-animation-fill-mode: both; /* this prevents the animation from restarting! */
  148. -moz-animation-delay: $delay;
  149. -moz-animation-duration: $duration;
  150. /* -moz-animation-name: $animation;*/
  151. -moz-animation-fill-mode: both; /* this prevents the animation from restarting! */
  152. -o-animation-delay: $delay;
  153. -o-animation-duration: $duration;
  154. /* -o-animation-name: $animation;*/
  155. -o-animation-fill-mode:both; /* this prevents the animation from restarting! */
  156. animation-delay: $delay;
  157. animation-duration: $duration;
  158. /* animation-name: $animation;*/
  159. animation-fill-mode: both; /* this prevents the animation from restarting! */
  160. }
  161. @mixin animations($delay, $duration , $animation,$count,$timing) {
  162. -webkit-animation-delay: $delay;
  163. -webkit-animation-duration: $duration;
  164. -webkit-animation-name: $animation;
  165. -webkit-animation-timing-function:$timing;
  166. -webkit-animation-fill-mode: both; /* this prevents the animation from restarting! */
  167. -webkit-animation-iteration-count:$count ;
  168. -moz-animation-delay: $delay;
  169. -moz-animation-duration: $duration;
  170. -moz-animation-name: $animation;
  171. -moz-animation-timing-function:$timing;
  172. -moz-animation-fill-mode: both; /* this prevents the animation from restarting! */
  173. -moz-animation-iteration-count:$count ;
  174. -o-animation-delay: $delay;
  175. -o-animation-duration: $duration;
  176. -o-animation-name: $animation;
  177. -o-animation-timing-function:$timing;
  178. -o-animation-fill-mode:both; /* this prevents the animation from restarting! */
  179. -o-animation-iteration-count:$count ;
  180. animation-delay: $delay;
  181. animation-duration: $duration;
  182. animation-name: $animation;
  183. animation-timing-function:$timing;
  184. animation-fill-mode: both; /* this prevents the animation from restarting! */
  185. animation-iteration-count:$count ;
  186. }
  187. @mixin animation3($delay, $duration ,$count) {
  188. -webkit-animation-delay: $delay;
  189. -webkit-animation-duration: $duration;
  190. -webkit-animation-fill-mode: both; /* this prevents the animation from restarting! */
  191. -webkit-animation-iteration-count:$count ;
  192. -moz-animation-delay: $delay;
  193. -moz-animation-duration: $duration;
  194. -moz-animation-fill-mode: both; /* this prevents the animation from restarting! */
  195. -moz-animation-iteration-count:$count ;
  196. -o-animation-delay: $delay;
  197. -o-animation-duration: $duration;
  198. -o-animation-fill-mode:both; /* this prevents the animation from restarting! */
  199. -o-animation-iteration-count:$count ;
  200. animation-delay: $delay;
  201. animation-duration: $duration;
  202. animation-fill-mode: both; /* this prevents the animation from restarting! */
  203. animation-iteration-count:$count ;
  204. }
  205. @mixin keyframe{
  206. -webkit-animation-name: op;
  207. -moz-animation-name:op;
  208. -o-animation-name: op;
  209. animation-name: op;
  210. @-webkit-keyframes op {
  211. 0% {
  212. opacity: 0;
  213. }
  214. 100% {
  215. opacity: 1;
  216. }
  217. }
  218. @-moz-keyframes op{
  219. 0% {
  220. opacity: 0;
  221. }
  222. 100% {
  223. opacity: 1;
  224. }
  225. }
  226. @-o-keyframes op {
  227. 0% {
  228. opacity: 0;
  229. }
  230. 100% {
  231. opacity: 1;
  232. }
  233. }
  234. @keyframes op {
  235. 0% {
  236. opacity: 0;
  237. }
  238. 100% {
  239. opacity: 1;
  240. }
  241. }
  242. }
  243. @mixin keyframe-rotate{
  244. -webkit-animation-name: l;
  245. -moz-animation-name:l;
  246. -o-animation-name: l;
  247. animation-name: l;
  248. @-webkit-keyframes l {
  249. 0% {
  250. @include transform(0deg);
  251. }
  252. 100% {
  253. @include transform(360deg);
  254. }
  255. }
  256. @-moz-keyframes l{
  257. 0% {
  258. @include transform(0deg);
  259. }
  260. 100% {
  261. @include transform(360deg);
  262. }
  263. }
  264. @-o-keyframes l {
  265. 0% {
  266. @include transform(0deg);
  267. }
  268. 100% {
  269. @include transform(360deg);
  270. }
  271. }
  272. @keyframes l {
  273. 0% {
  274. @include transform(0deg);
  275. }
  276. 100% {
  277. @include transform(360deg);
  278. }
  279. }
  280. }
  281. @mixin ripple{
  282. -webkit-animation-name: l1;
  283. -moz-animation-name:l1;
  284. -o-animation-name: l1;
  285. animation-name: l1;
  286. @-webkit-keyframes l1 {
  287. 0%{
  288. transform: scale(0.8);
  289. }
  290. 50%{
  291. transform: scale(1.07);
  292. }
  293. 100%{
  294. transform: scale(1);
  295. }
  296. }
  297. @-moz-keyframes l1{
  298. 0%{
  299. transform: scale(0.8);
  300. }
  301. 50%{
  302. transform: scale(1.07);
  303. }
  304. 100%{
  305. transform: scale(1);
  306. }
  307. }
  308. @-o-keyframes l1 {
  309. 0%{
  310. transform: scale(0.8);
  311. }
  312. 50%{
  313. transform: scale(1.07);
  314. }
  315. 100%{
  316. transform: scale(1);
  317. }
  318. }
  319. @keyframes l1 {
  320. 0%{
  321. transform: scale(0.8);
  322. }
  323. 50%{
  324. transform: scale(1.07);
  325. }
  326. 100%{
  327. transform: scale(1);
  328. }
  329. }
  330. }
  331. @mixin placeholder{
  332. &::placeholder {
  333. color: #cac6c6;
  334. opacity: 1; /* Firefox */
  335. }
  336. &:-ms-input-placeholder { /* Internet Explorer 10-11 */
  337. color: #cac6c6;
  338. }
  339. &::-ms-input-placeholder { /* Microsoft Edge */
  340. color: #cac6c6;
  341. }
  342. }
  343. @mixin transform($transforms) {
  344. -moz-transform: $transforms;
  345. -o-transform: $transforms;
  346. -ms-transform: $transforms;
  347. -webkit-transform: $transforms;
  348. transform: $transforms;
  349. }
  350. @mixin loading-animation{
  351. -webkit-animation-name: sk-bouncedelay;
  352. -moz-animation-name:sk-bouncedelay;
  353. -o-animation-name: sk-bouncedelay;
  354. animation-name: sk-bouncedelay;
  355. @-webkit-keyframes sk-bouncedelay {
  356. 0%,80%,100%{@include transform(scale(0))}
  357. 40%{@include transform(scale(1))}
  358. }
  359. @-moz-keyframes sk-bouncedelay{
  360. 0%,80%,100%{@include transform(scale(0))}
  361. 40%{@include transform(scale(1))}
  362. }
  363. @-o-keyframes sk-bouncedelay {
  364. 0%,80%,100%{@include transform(scale(0))}
  365. 40%{@include transform(scale(1))}
  366. }
  367. @keyframes sk-bouncedelay {
  368. 0%,80%,100%{@include transform(scale(0));}
  369. 40%{@include transform(scale(1));}
  370. }
  371. }
  372. @mixin bounceIn{
  373. -webkit-animation-name: bounce;
  374. -moz-animation-name:bounce;
  375. -o-animation-name: bounce;
  376. animation-name: bounce;
  377. @-webkit-keyframes bounce {
  378. 0%, 20%, 40%, 60%, 80%, 100% {
  379. -webkit-animation-timing-function: cubic-bezier(0.215,0.61,0.355,1);
  380. animation-timing-function: cubic-bezier(0.215,0.61,0.355,1);
  381. }
  382. 0% {
  383. opacity: 0;
  384. -webkit-transform: scale3d(0.3,0.3,0.3);
  385. @include transform(scale3d(0.3,0.3,0.3))
  386. }
  387. 20% {
  388. -webkit-transform: scale3d(1.1,1.1,1.1);
  389. @include transform(scale3d(1.1,1.1,1.1));
  390. }
  391. 40% {
  392. -webkit-transform: scale3d(0.9,0.9,0.9);
  393. @include transform(scale3d(0.9,0.9,0.9));
  394. }
  395. 60% {
  396. opacity: 1;
  397. -webkit-transform: scale3d(1.03,1.03,1.03);
  398. @include transform(scale3d(1.03,1.03,1.03));
  399. }
  400. 80% {
  401. -webkit-transform: scale3d(0.97,0.97,0.97);
  402. @include transform(scale3d(0.97,0.97,0.97));
  403. }
  404. 100% {
  405. opacity: 1;
  406. -webkit-transform: scale3d(1,1,1);
  407. @include transform(scale3d(1,1,1));
  408. }
  409. }
  410. @-moz-keyframes bounce{
  411. 0%, 20%, 40%, 60%, 80%, 100% {
  412. -webkit-animation-timing-function: cubic-bezier(0.215,0.61,0.355,1);
  413. animation-timing-function: cubic-bezier(0.215,0.61,0.355,1);
  414. }
  415. 0% {
  416. opacity: 0;
  417. -webkit-transform: scale3d(0.3,0.3,0.3);
  418. @include transform(scale3d(0.3,0.3,0.3))
  419. }
  420. 20% {
  421. -webkit-transform: scale3d(1.1,1.1,1.1);
  422. @include transform(scale3d(1.1,1.1,1.1));
  423. }
  424. 40% {
  425. -webkit-transform: scale3d(0.9,0.9,0.9);
  426. @include transform(scale3d(0.9,0.9,0.9));
  427. }
  428. 60% {
  429. opacity: 1;
  430. -webkit-transform: scale3d(1.03,1.03,1.03);
  431. @include transform(scale3d(1.03,1.03,1.03));
  432. }
  433. 80% {
  434. -webkit-transform: scale3d(0.97,0.97,0.97);
  435. @include transform(scale3d(0.97,0.97,0.97));
  436. }
  437. 100% {
  438. opacity: 1;
  439. -webkit-transform: scale3d(1,1,1);
  440. @include transform(scale3d(1,1,1));
  441. }
  442. }
  443. @-o-keyframes bounce {
  444. 0%, 20%, 40%, 60%, 80%, 100% {
  445. -webkit-animation-timing-function: cubic-bezier(0.215,0.61,0.355,1);
  446. animation-timing-function: cubic-bezier(0.215,0.61,0.355,1);
  447. }
  448. 0% {
  449. opacity: 0;
  450. -webkit-transform: scale3d(0.3,0.3,0.3);
  451. @include transform(scale3d(0.3,0.3,0.3))
  452. }
  453. 20% {
  454. -webkit-transform: scale3d(1.1,1.1,1.1);
  455. @include transform(scale3d(1.1,1.1,1.1));
  456. }
  457. 40% {
  458. -webkit-transform: scale3d(0.9,0.9,0.9);
  459. @include transform(scale3d(0.9,0.9,0.9));
  460. }
  461. 60% {
  462. opacity: 1;
  463. -webkit-transform: scale3d(1.03,1.03,1.03);
  464. @include transform(scale3d(1.03,1.03,1.03));
  465. }
  466. 80% {
  467. -webkit-transform: scale3d(0.97,0.97,0.97);
  468. @include transform(scale3d(0.97,0.97,0.97));
  469. }
  470. 100% {
  471. opacity: 1;
  472. -webkit-transform: scale3d(1,1,1);
  473. @include transform(scale3d(1,1,1));
  474. }
  475. }
  476. @keyframes bounce {
  477. 0%, 20%, 40%, 60%, 80%, 100% {
  478. -webkit-animation-timing-function: cubic-bezier(0.215,0.61,0.355,1);
  479. animation-timing-function: cubic-bezier(0.215,0.61,0.355,1);
  480. }
  481. 0% {
  482. opacity: 0;
  483. -webkit-transform: scale3d(0.3,0.3,0.3);
  484. @include transform(scale3d(0.3,0.3,0.3))
  485. }
  486. 20% {
  487. -webkit-transform: scale3d(1.1,1.1,1.1);
  488. @include transform(scale3d(1.1,1.1,1.1));
  489. }
  490. 40% {
  491. -webkit-transform: scale3d(0.9,0.9,0.9);
  492. @include transform(scale3d(0.9,0.9,0.9));
  493. }
  494. 60% {
  495. opacity: 1;
  496. -webkit-transform: scale3d(1.03,1.03,1.03);
  497. @include transform(scale3d(1.03,1.03,1.03));
  498. }
  499. 80% {
  500. -webkit-transform: scale3d(0.97,0.97,0.97);
  501. @include transform(scale3d(0.97,0.97,0.97));
  502. }
  503. 100% {
  504. opacity: 1;
  505. -webkit-transform: scale3d(1,1,1);
  506. @include transform(scale3d(1,1,1));
  507. }
  508. }
  509. }
  510. @-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } }
  511. @-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } }
  512. @keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } }
  513. @-moz-keyframes mspin { 100% { -moz-transform: rotate(-360deg); } }
  514. @-webkit-keyframes mspin { 100% { -webkit-transform: rotate(-360deg); } }
  515. @keyframes mspin { 100% { -webkit-transform: rotate(-360deg); transform:rotate(-360deg); } }
  516. .ltr{
  517. direction: ltr;
  518. }