popup.scss 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. .cl-popup__wrapper {
  2. z-index: 300;
  3. position: fixed;
  4. top: 0;
  5. bottom: 0;
  6. left: 0;
  7. right: 0;
  8. opacity: 0;
  9. transition: all 0.3s;
  10. pointer-events: none;
  11. &.is-open {
  12. opacity: 1;
  13. pointer-events: auto;
  14. .cl-popup {
  15. transition: all 0.4s;
  16. transform: translate(0, 0);
  17. }
  18. }
  19. &::after {
  20. content: "";
  21. display: inline-block;
  22. height: 100%;
  23. width: 0;
  24. vertical-align: middle;
  25. }
  26. .cl-popup__modal {
  27. height: 100%;
  28. width: 100%;
  29. background-color: rgba(0, 0, 0, 0.4);
  30. position: absolute;
  31. top: 0;
  32. bottom: 0;
  33. left: 0;
  34. right: 0;
  35. }
  36. .cl-popup {
  37. display: flex;
  38. flex-direction: column;
  39. background-color: #fff;
  40. position: absolute;
  41. transition: all 0.3s;
  42. box-sizing: border-box;
  43. &__container {
  44. height: 100%;
  45. }
  46. }
  47. &--left {
  48. .cl-popup {
  49. transform: translateX(-100%);
  50. top: 0;
  51. left: 0;
  52. }
  53. }
  54. &--right {
  55. .cl-popup {
  56. transform: translateX(100%);
  57. right: 0;
  58. top: 0;
  59. }
  60. }
  61. &--top {
  62. .cl-popup {
  63. transform: translateY(-100%);
  64. left: 0;
  65. top: 0;
  66. }
  67. }
  68. &--bottom {
  69. .cl-popup {
  70. transform: translateY(100%);
  71. left: 0;
  72. bottom: 0;
  73. }
  74. }
  75. &--center {
  76. display: flex;
  77. flex-direction: column;
  78. justify-content: center;
  79. align-items: center;
  80. .cl-popup {
  81. transform: scale(1.3);
  82. }
  83. }
  84. &--top,
  85. &--left,
  86. &--right {
  87. .cl-popup {
  88. /* #ifdef H5 */
  89. padding-top: 44px;
  90. /* #endif */
  91. /* #ifndef H5 */
  92. padding-top: env(safe-area-inset-top);
  93. /* #endif */
  94. }
  95. }
  96. &--left,
  97. &--right,
  98. &--bottom {
  99. .cl-popup {
  100. padding-bottom: env(safe-area-inset-bottom);
  101. }
  102. }
  103. }