Код IT Загрузка примера кода…

HTML main.html
<!DOCTYPE html>
<html lang="ru">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Modal fade</title>
  <style>
    body {
      margin: 0;
      min-height: 100dvh;
      font-family: system-ui, sans-serif;
    }
    .modal {
      position: fixed;
      inset: 0;
      display: grid;
      place-items: center;
      padding: 1rem;
    }
    .modal__backdrop {
      position: absolute;
      inset: 0;
      background: rgba(15, 23, 42, 0.55);
      animation: fadeIn 0.25s ease forwards;
    }
    .modal__dialog {
      position: relative;
      width: min(100%, 22rem);
      padding: 1.5rem;
      background: #fff;
      border-radius: 12px;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
      animation: scaleIn 0.3s ease-out 0.05s forwards;
      opacity: 0;
      transform: scale(0.92);
    }
    @keyframes fadeIn {
      from { opacity: 0; }
      to   { opacity: 1; }
    }
    @keyframes scaleIn {
      to {
        opacity: 1;
        transform: scale(1);
      }
    }
  </style>
</head>
<body>
  <div class="modal" role="dialog" aria-modal="true" aria-labelledby="modal-title">
    <div class="modal__backdrop"></div>
    <div class="modal__dialog">
      <h2 id="modal-title" style="margin: 0 0 0.5rem;">Подтверждение</h2>
      <p style="margin: 0; color: #64748b;">Окно появилось с fade и лёгким scale.</p>
    </div>
  </div>
</body>
</html>
<!DOCTYPE html>
<html lang="ru">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Modal fade</title>
  <style>
    body {
      margin: 0;
      min-height: 100dvh;
      font-family: system-ui, sans-serif;
    }
    .modal {
      position: fixed;
      inset: 0;
      display: grid;
      place-items: center;
      padding: 1rem;
    }
    .modal__backdrop {
      position: absolute;
      inset: 0;
      background: rgba(15, 23, 42, 0.55);
      animation: fadeIn 0.25s ease forwards;
    }
    .modal__dialog {
      position: relative;
      width: min(100%, 22rem);
      padding: 1.5rem;
      background: #fff;
      border-radius: 12px;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
      animation: scaleIn 0.3s ease-out 0.05s forwards;
      opacity: 0;
      transform: scale(0.92);
    }
    @keyframes fadeIn {
      from { opacity: 0; }
      to   { opacity: 1; }
    }
    @keyframes scaleIn {
      to {
        opacity: 1;
        transform: scale(1);
      }
    }
  </style>
</head>
<body>
  <div class="modal" role="dialog" aria-modal="true" aria-labelledby="modal-title">
    <div class="modal__backdrop"></div>
    <div class="modal__dialog">
      <h2 id="modal-title" style="margin: 0 0 0.5rem;">Подтверждение</h2>
      <p style="margin: 0; color: #64748b;">Окно появилось с fade и лёгким scale.</p>
    </div>
  </div>
</body>
</html>