<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Работа Promises</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
h1 {
text-align: center;
}
.content {
display: flex;
justify-content: center;
gap: 20px;
}
.explanation {
background-color: rgb(166, 169, 169);
padding: 10px;
border-radius: 4px;
width: 80%;
}
.states {
display: flex;
justify-content: center;
gap: 20px;
text-align: center;
margin-top: 20px;
}
.pending,
.fulfilled,
.rejected {
padding: 10px;
border: 2px solid black;
border-radius: 4px;
flex: 1;
}
.pending {
background-color: lightyellow;
}
.fulfilled {
background-color: lightgreen;
}
.rejected {
background-color: lightcoral;
}
</style>
</head>
<body>
<h1>Promise в JS</h1>
<div class="content">
<div class="explanation">
<h2>Что такое Promise?</h2>
<p>
Promise (с англ. «обещание») в JavaScript — это специальный
объект, который представляет результат асинхронной операции:
он обещает, что рано или поздно операция будет выполнена
успешно или завершится с ошибкой.
</p>
<div class="states">
<div class="pending">
<h3>Pending</h3>
<p>Ожидание</p>
</div>
<div class="fulfilled">
<h3>Fulfilled</h3>
<p>Исполнено</p>
</div>
<div class="rejected">
<h3>Rejected</h3>
<p>Отклонено</p>
</div>
</div>
</div>
</div>
<script>
</script>
</body>
</html>