Modal.scss 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. @import "../css/_variables";
  2. .Modal {
  3. position: fixed;
  4. top: 0;
  5. left: 0;
  6. right: 0;
  7. bottom: 0;
  8. display: flex;
  9. align-items: center;
  10. justify-content: center;
  11. overflow: auto;
  12. padding: calc(var(--space-factor) * 10);
  13. }
  14. .Modal__background {
  15. position: fixed;
  16. top: 0;
  17. left: 0;
  18. right: 0;
  19. bottom: 0;
  20. z-index: 1;
  21. background-color: transparentize($oc-black, 0.7);
  22. backdrop-filter: blur(2px);
  23. }
  24. .Modal__content {
  25. position: relative;
  26. z-index: 2;
  27. width: 100%;
  28. max-width: var(--max-width);
  29. opacity: 0;
  30. transform: translateY(10px);
  31. animation: Modal__content_fade-in 0.1s ease-out 0.05s forwards;
  32. position: relative;
  33. @media #{$media-query} {
  34. max-width: 100%;
  35. }
  36. }
  37. @keyframes Modal__content_fade-in {
  38. from {
  39. opacity: 0;
  40. transform: translateY(10px);
  41. }
  42. to {
  43. opacity: 1;
  44. transform: translateY(0);
  45. }
  46. }
  47. .Modal__close {
  48. width: calc(var(--space-factor) * 7);
  49. height: calc(var(--space-factor) * 7);
  50. display: flex;
  51. align-items: center;
  52. justify-content: center;
  53. svg {
  54. height: calc(var(--space-factor) * 5);
  55. }
  56. }
  57. .Modal__close--floating {
  58. position: absolute;
  59. right: calc(var(--space-factor) * 5);
  60. top: calc(var(--space-factor) * 5);
  61. }
  62. @media #{$media-query} {
  63. .Modal {
  64. padding: 0;
  65. }
  66. .Modal__content {
  67. position: fixed;
  68. top: 0;
  69. left: 0;
  70. right: 0;
  71. bottom: 0;
  72. }
  73. }