supermodal.css 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /**
  2. * SuperModal (https://github.com/GianlucaChiarani/SuperModal)
  3. * @version 0.8 beta1
  4. * @author Gianluca Chiarani
  5. * @license The MIT License (MIT)
  6. */
  7. .supermodal {
  8. display: none;
  9. }
  10. .supermodal-container {
  11. box-sizing: border-box;
  12. display: flex;
  13. justify-content: center;
  14. align-items: center;
  15. position: fixed;
  16. top: 0;
  17. left: 0;
  18. width: 100%;
  19. height: 100vh;
  20. padding: 1rem;
  21. }
  22. .supermodal-container .supermodal-window {
  23. box-sizing: border-box;
  24. display: flex;
  25. flex-direction: column;
  26. position: relative;
  27. width: 100%;
  28. height: 100%;
  29. background: white;
  30. z-index: 1;
  31. }
  32. .supermodal-container .supermodal-title {
  33. height: 45px;
  34. line-height: 45px;
  35. color: white;
  36. font-size: 18px;
  37. padding-left: 1rem;
  38. padding-right: calc(2rem + 30px);
  39. }
  40. .supermodal-container .supermodal-title .supermodal-close {
  41. position: absolute;
  42. right: 1rem;
  43. top: 7.5px;
  44. background-color: #dc3545;
  45. color: white;
  46. line-height: 30px;
  47. text-align: center;
  48. font-size: 18px;
  49. width: 30px;
  50. height: 30px;
  51. border-radius: 100px;
  52. cursor: pointer;
  53. transition: all 0.3s;
  54. -webkit-transition: all 0.3s;
  55. -moz-transition: all 0.3s;
  56. -ms-transition: all 0.3s;
  57. -o-transition: all 0.3s;
  58. }
  59. .supermodal-container .supermodal-title .supermodal-close:hover {
  60. background-color: #bb2d3b;
  61. }
  62. .supermodal-container .supermodal-body {
  63. overflow-y: auto;
  64. }
  65. .supermodal-window.show{
  66. opacity:1;
  67. z-index:2;
  68. transform: scale(1);
  69. animation: show .3s;
  70. -webkit-animation: show .3s;
  71. }
  72. .supermodal-window.hide{
  73. opacity: 0;
  74. transform: scale(1);
  75. animation: hide .3s;
  76. -webkit-animation: hide .3s;
  77. }
  78. .supermodal-container + .supermodal-container .supermodal-window {
  79. top: 1rem;
  80. left: 1rem;
  81. position: relative;
  82. }
  83. .supermodal-container + .supermodal-container {
  84. padding-right: 2rem;
  85. }
  86. @keyframes show {
  87. from {
  88. transform: scale(0);
  89. opacity:0;
  90. z-index:-1;
  91. }
  92. to {
  93. transform: scale(1);
  94. opacity: 1;
  95. z-index:2;
  96. }
  97. }
  98. @keyframes hide {
  99. from {
  100. z-index:2;
  101. transform: scale(1);
  102. opacity:1;
  103. }
  104. to {
  105. z-index:-1;
  106. transform: scale(0);
  107. opacity: 0;
  108. }
  109. }
  110. /* xs */
  111. @media (max-width: 575px){
  112. .supermodal-container {
  113. padding: .5rem;
  114. }
  115. .supermodal-container + .supermodal-container .supermodal-window {
  116. top: .5rem;
  117. left: .5rem;
  118. position: relative;
  119. }
  120. .supermodal-container + .supermodal-container {
  121. padding-right: 1rem;
  122. }
  123. }